本文整理汇总了PHP中XenForo_ViewAdmin_Helper_Option类的典型用法代码示例。如果您正苦于以下问题:PHP XenForo_ViewAdmin_Helper_Option类的具体用法?PHP XenForo_ViewAdmin_Helper_Option怎么用?PHP XenForo_ViewAdmin_Helper_Option使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了XenForo_ViewAdmin_Helper_Option类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _render
/**
* Renders the style chooser option.
*
* @param string Name of template to render
* @param XenForo_View $view View object
* @param string $fieldPrefix Prefix for the HTML form field name
* @param array $preparedOption Prepared option info
* @param boolean $canEdit True if an "edit" link should appear
*
* @return XenForo_Template_Abstract Template object
*/
protected static function _render($templateName, XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit)
{
$styleModel = XenForo_Model::create('XenForo_Model_Style');
$styleModel->setAdminStyles(true);
$preparedOption['formatParams'] = $styleModel->getStylesForOptionsTag($preparedOption['option_value']);
return XenForo_ViewAdmin_Helper_Option::renderOptionTemplateInternal($templateName, $view, $fieldPrefix, $preparedOption, $canEdit);
}
示例2: renderTextbox
/**
*
* @param XenForo_View $view View object
* @param string $fieldPrefix Prefix for the HTML form field name
* @param array $preparedOption Prepared option info
* @param boolean $canEdit True if an "edit" link should appear
*
* @return XenForo_Template_Abstract Template object
*/
public static function renderTextbox(XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit)
{
$addOns = XenForo_Application::get('addOns');
if (!empty($addOns['XenResource'])) {
return XenForo_ViewAdmin_Helper_Option::renderOptionTemplateInternal('option_list_option_textbox', $view, $fieldPrefix, $preparedOption, $canEdit);
}
}
示例3: renderSpinBoxes
public static function renderSpinBoxes(XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit)
{
/* @var $codeEventModel XenForo_Model_CodeEvent */
$codeEventModel = XenForo_Model::create('XenForo_Model_CodeEvent');
$codeEventListeners = $codeEventModel->getAllEventListeners();
/* @var $addOnModel XenForo_Model_AddOn */
$addOnModel = XenForo_Model::create('XenForo_Model_AddOn');
$addOns = $addOnModel->getAllAddOns();
foreach ($codeEventListeners as $codeEventListener) {
if ($codeEventListener['event_id'] == 'navigation_tabs') {
$callback = $codeEventListener['callback_class'] . '::' . $codeEventListener['callback_method'];
$addOns[$codeEventListener['addon_id']]['callbacks'][] = $callback;
if (!isset($preparedOption['option_value'][$callback])) {
$preparedOption['option_value'][$callback] = 10;
}
}
}
unset($addOns['NodesAsTabs']);
unset($addOns['ThemeHouse_NavigationTabs']);
foreach ($addOns as $addOnId => $addOn) {
if (empty($addOn['callbacks'])) {
unset($addOns[$addOnId]);
}
}
$preparedOption['formatParams']['addOns'] = $addOns;
return XenForo_ViewAdmin_Helper_Option::renderOptionTemplateInternal('th_option_list_priorities_navigationtabs', $view, $fieldPrefix, $preparedOption, $canEdit);
}
示例4: renderPreparedOptionsHtml
/**
* Renders a collection of options in the standard way. See {@link renderPreparedOptionHtml()}
* for more specifics on the arguments.
*
* @param XenForo_View $view
* @param array $preparedOptions
* @param boolean $canEdit
* @param string $fieldPrefix
*
* @return array Array of XenForo_Template_Abstract objects
*/
public static function renderPreparedOptionsHtml(XenForo_View $view, array $preparedOptions, $canEdit, $fieldPrefix = 'options')
{
$renderedOptions = array();
foreach ($preparedOptions as $optionId => $preparedOption) {
$renderedOptions[$optionId] = XenForo_ViewAdmin_Helper_Option::renderPreparedOptionHtml($view, $preparedOption, $canEdit, $fieldPrefix);
}
return $renderedOptions;
}
示例5: renderOption
/**
* Renders the tracked events list.
*
* @param XenForo_View $view View object
* @param string $fieldPrefix Prefix for the HTML form field name
* @param array $preparedOption Prepared option info
* @param boolean $canEdit True if an "edit" link should appear
*
* @return XenForo_Template_Abstract Template object
*/
public static function renderOption(XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit)
{
$preparedOption['extraChoices'] = array();
$selectable = DigitalPointBetterAnalytics_Helper_Api::check();
$preparedOption['formatParams'] = array(array('name' => 'options[dpAnalyticsEvents][user_engagement]', 'label' => new XenForo_Phrase('user_engagement'), 'selected' => @$preparedOption['option_value']['user_engagement']), array('name' => 'options[dpAnalyticsEvents][content]', 'label' => new XenForo_Phrase('content_being_created'), 'selected' => @$preparedOption['option_value']['content']), array('name' => 'options[dpAnalyticsEvents][emails]', 'label' => new XenForo_Phrase('emails_sent_opened'), 'selected' => @$preparedOption['option_value']['emails'], 'unselectable' => !$selectable), array('name' => 'options[dpAnalyticsEvents][attachment]', 'label' => new XenForo_Phrase('attachment_views'), 'selected' => @$preparedOption['option_value']['attachment'], 'unselectable' => !$selectable), array('name' => 'options[dpAnalyticsEvents][links]', 'label' => new XenForo_Phrase('clicks_on_external_links'), 'selected' => @$preparedOption['option_value']['links'], 'unselectable' => !$selectable), array('name' => 'options[dpAnalyticsEvents][registration]', 'label' => new XenForo_Phrase('user_registrations'), 'selected' => @$preparedOption['option_value']['registration'], 'unselectable' => !$selectable), array('name' => 'options[dpAnalyticsEvents][moderator]', 'label' => new XenForo_Phrase('moderator_actions'), 'selected' => @$preparedOption['option_value']['moderator'], 'unselectable' => !$selectable), array('name' => 'options[dpAnalyticsEvents][report]', 'label' => new XenForo_Phrase('reports'), 'selected' => @$preparedOption['option_value']['report'], 'unselectable' => !$selectable), array('name' => 'options[dpAnalyticsEvents][warning]', 'label' => new XenForo_Phrase('warnings'), 'selected' => @$preparedOption['option_value']['warning'], 'unselectable' => !$selectable), array('name' => 'options[dpAnalyticsEvents][ajax_requests]', 'label' => new XenForo_Phrase('ajax_requests'), 'selected' => @$preparedOption['option_value']['ajax_requests']), array('name' => 'options[dpAnalyticsEvents][ajax_error]', 'label' => new XenForo_Phrase('js_errors'), 'selected' => @$preparedOption['option_value']['ajax_error'], 'unselectable' => !$selectable), array('name' => 'options[dpAnalyticsEvents][js_error]', 'label' => new XenForo_Phrase('ajax_errors'), 'selected' => @$preparedOption['option_value']['js_error'], 'unselectable' => !$selectable));
$preparedOption['explain'] = !$selectable ? '<style> .unselectable{opacity:0.5} </style>' . new XenForo_Phrase('some_options_not_available_for_unlicensed') : '';
return XenForo_ViewAdmin_Helper_Option::renderOptionTemplateInternal('option_list_option_checkbox', $view, $fieldPrefix, $preparedOption, $canEdit);
}
示例6: renderOption
/**
* Renders the radio buttons for the track users with blocking enabled.
*
* @param XenForo_View $view View object
* @param string $fieldPrefix Prefix for the HTML form field name
* @param array $preparedOption Prepared option info
* @param boolean $canEdit True if an "edit" link should appear
*
* @return XenForo_Template_Abstract Template object
*/
public static function renderOption(XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit)
{
$preparedOption['extraChoices'] = array();
$selectable = DigitalPointBetterAnalytics_Helper_Api::check();
$preparedOption['formatParams'] = array(array('name' => 'options[dpAnalyticsTrackBlocked]', 'value' => 'never', 'label' => new XenForo_Phrase('never'), 'selected' => $preparedOption['option_value'] == 'never', 'unselectable' => false), array('name' => 'options[dpAnalyticsTrackBlocked]', 'value' => 'logged_in', 'label' => new XenForo_Phrase('only_users_logged_in'), 'selected' => $preparedOption['option_value'] == 'logged_in', 'unselectable' => !$selectable), array('name' => 'options[dpAnalyticsTrackBlocked]', 'value' => 'guests', 'label' => new XenForo_Phrase('guests'), 'selected' => $preparedOption['option_value'] == 'guests', 'unselectable' => !$selectable), array('name' => 'options[dpAnalyticsTrackBlocked]', 'value' => 'everyone', 'label' => new XenForo_Phrase('everyone'), 'selected' => $preparedOption['option_value'] == 'everyone', 'unselectable' => !$selectable));
$preparedOption['explain'] = (!$selectable ? '<style> .unselectable{opacity:0.5} </style>' . new XenForo_Phrase('some_options_not_available_for_unlicensed') . '<br /><br />' : '') . $preparedOption['explain'];
return XenForo_ViewAdmin_Helper_Option::renderOptionTemplateInternal('option_list_option_radio', $view, $fieldPrefix, $preparedOption, $canEdit);
}
示例7: _render
protected static function _render($templateName, XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit)
{
$preparedOption['formatParams'] = XenForo_Model::create('XenGallery_Model_Media')->getUserGroupOptions($preparedOption['option_value']);
foreach ($preparedOption['formatParams'] as &$param) {
$param['label'] .= " ({$param['value']})";
}
return XenForo_ViewAdmin_Helper_Option::renderOptionTemplateInternal($templateName, $view, $fieldPrefix, $preparedOption, $canEdit);
}
示例8: renderOption
public static function renderOption(XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit)
{
$preparedOption['formatParams'] = array('' => '(' . new XenForo_Phrase('none') . ')') + XenForo_Model::create('DigitalPointSocialBar_Model_SocialBar')->getSlugsFromList();
$return = XenForo_ViewAdmin_Helper_Option::renderOptionTemplateInternal('option_list_option_select', $view, $fieldPrefix, $preparedOption, $canEdit);
if (!XenForo_Application::getOptions()->dpTwitterAccessTokenSecret) {
$return = str_replace('<select', '<select disabled=disabled', $return);
}
return $return;
}
示例9: renderUserGroups
public static function renderUserGroups(XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit)
{
$userGroups = XenForo_Model::create('XenForo_Model_UserGroup')->getAllUserGroups();
foreach ($userGroups as $userGroupId => $userGroup) {
$formatParams[$userGroupId] = array('label' => $userGroup['title'], 'value' => $userGroup['user_group_id'], 'selected' => in_array($userGroup['user_group_id'], $preparedOption['option_value']));
}
$preparedOption['formatParams'] = $formatParams;
return XenForo_ViewAdmin_Helper_Option::renderOptionTemplateInternal('option_list_option_checkbox', $view, $fieldPrefix, $preparedOption, $canEdit);
}
示例10: renderOption
/**
* Renders the usergroup chooser option.
*
* @param XenForo_View $view View object
* @param string $fieldPrefix Prefix for the HTML form field name
* @param array $preparedOption Prepared option info
* @param boolean $canEdit True if an "edit" link should appear
*
* @return XenForo_Template_Abstract Template object
*/
public static function renderOption(XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit)
{
$preparedOption['formatParams'] = array();
$usergroups = XenForo_Model::create('XenForo_Model_UserGroup')->getAllUserGroups();
foreach ($usergroups as $key => $usergroup) {
$preparedOption['options'][$usergroup['user_group_id']] = array('name' => $usergroup['title'], 'checked' => in_array($usergroup['user_group_id'], (array) $preparedOption['option_value']));
}
return XenForo_ViewAdmin_Helper_Option::renderOptionTemplateInternal('option_template_AdPositioning_MultiCheckbox', $view, $fieldPrefix, $preparedOption, $canEdit);
}
示例11: renderList
public static function renderList(XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit)
{
/** @var XenForo_Model_Node $nodeModel */
$nodeModel = XenForo_Model::create('XenForo_Model_Node');
$nodes = $nodeModel->getAllNodes();
$html = $view->createTemplateObject('nixfifty_xentrader_option_list_select_forum', array('selNodeIds' => $preparedOption['option_value'], 'nodes' => $nodes, 'fieldPrefix' => $fieldPrefix, 'preparedOption' => $preparedOption));
$preparedOption['formatParams'] = $html;
return XenForo_ViewAdmin_Helper_Option::renderOptionTemplateInternal('nixfifty_xentrader_option_list_html', $view, $fieldPrefix, $preparedOption, $canEdit);
}
示例12: renderOption
/**
* Renders checkboxes allowing the selection of nodes.
*
* @param XenForo_View $view View object
* @param string $fieldPrefix Prefix for the HTML form field name
* @param array $preparedOption Prepared option info
* @param boolean $canEdit True if an "edit" link should appear
*
* @return XenForo_Template_Abstract Template object
*/
public static function renderOption(XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit)
{
if (XenForo_Application::$versionId > 1020000) {
$addOns = XenForo_Application::get('addOns');
if (!empty($addOns['widget_framework'])) {
return XenForo_ViewAdmin_Helper_Option::renderOptionTemplateInternal('option_list_option_onoff', $view, $fieldPrefix, $preparedOption, $canEdit);
}
}
}
示例13: render_xen_tags
public static function render_xen_tags(XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit)
{
$tags = array('b', 'i', 'u', 's', 'color', 'font', 'size', 'left', 'center', 'right', 'indent', 'url', 'email', 'img', 'quote', 'code', 'php', 'html', 'plain', 'media', 'attach');
foreach ($tags as $tag) {
$xenTags[] = array('label' => $tag, 'value' => $tag, 'selected' => in_array($tag, $preparedOption['option_value']));
}
$preparedOption['formatParams'] = $xenTags;
return XenForo_ViewAdmin_Helper_Option::renderOptionTemplateInternal('option_list_option_bbm_multiselect', $view, $fieldPrefix, $preparedOption, $canEdit);
}
示例14: renderOption
/**
* Forum chooser. Displays a list of nodes. Rendered in a multiple choice select element
*/
public static function renderOption(XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit)
{
$nodes = XenForo_Model::create('XenForo_Model_Node')->getAllNodes();
foreach ($nodes as $key => $node) {
if ($node['node_type_id'] == 'Category' || $node['node_type_id'] == 'Forum') {
$preparedOption['options'][$node['node_id']] = array('node_id' => $node['node_id'], 'title' => $node['title'], 'type' => $node['node_type_id'], 'depth' => str_repeat(' ', $node['depth']), 'selected' => in_array($nodes[$key]['node_id'], $preparedOption['option_value']));
}
}
return XenForo_ViewAdmin_Helper_Option::renderOptionTemplateInternal('unread_posts_forum_chooser', $view, $fieldPrefix, $preparedOption, $canEdit);
}
示例15: renderOption
/**
* Gallery Category chooser. Displays a list of nodes. Rendered in a multiple choice select element
*/
public static function renderOption(XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit)
{
$preparedOption['options'] = array();
$categories = XenForo_Model::create('XenGallery_Model_Category')->getCategoryStructure();
$preparedOption['options'][0] = array('category_id' => 0, 'title' => sprintf('(%s)', new XenForo_Phrase('xengallery_no_categories')), 'depth' => '', 'selected' => in_array('0', $preparedOption['option_value']));
foreach ($categories as $key => $category) {
$preparedOption['options'][$category['category_id']] = array('category_id' => $category['category_id'], 'title' => $category['category_title'], 'depth' => str_repeat(' ', $category['depth']), 'selected' => in_array($categories[$key]['category_id'], $preparedOption['option_value']));
}
return XenForo_ViewAdmin_Helper_Option::renderOptionTemplateInternal('xengallery_category_chooser', $view, $fieldPrefix, $preparedOption, $canEdit);
}