/** * Renders the guest time zone 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) { $value = $preparedOption['option_value']; $editLink = $view->createTemplateObject('option_list_option_editlink', array('preparedOption' => $preparedOption, 'canEditOptionDefinition' => $canEdit)); $forumOptions = XenForo_Option_NodeChooser::getNodeOptions($value['node_id'], sprintf('(%s)', new XenForo_Phrase('unspecified')), 'Forum'); return $view->createTemplateObject('option_template_spamThreadAction', array('fieldPrefix' => $fieldPrefix, 'listedFieldName' => $fieldPrefix . '_listed[]', 'preparedOption' => $preparedOption, 'formatParams' => $forumOptions, 'editLink' => $editLink)); }
/** * Renders the CAPTCHA template. * * @see XenForo_Captcha_Abstract::renderInternal() */ public function renderInternal(XenForo_View $view) { if (!$this->_config['publicKey']) { return ''; } return $view->createTemplateObject('captcha_recaptcha', array('publicKey' => $this->_config['publicKey'])); }
public function getTabs() { $allContentKeys = array('resource' => array('resource_id', 'resource'), 'thread' => array('thread_id', 'thread'), 'conversation' => array('conversation_id', 'conversation'), 'project' => array('project_id', 'freeagent_project'), 'media' => array('media_id', 'xengallery_media'), 'product' => array('product_id', 'xenproduct_product')); $contentKeys = array(); $params = $this->_view->getParams(); foreach ($allContentKeys as $contentKeyId => $contentTypeInfo) { if (isset($params[$contentKeyId])) { $contentTypes[] = $contentTypeInfo[1]; $contentIdKeys[] = $contentTypeInfo[0]; $contentKeys[] = $contentKeyId; } } /* @var $tabModel Waindigo_Tabs_Model_Tab */ $tabModel = XenForo_Model::create('Waindigo_Tabs_Model_Tab'); $canAddExistingContentToTab = false; for ($i = 0; $i < isset($contentKeys) ? count($contentKeys) : 0; $i++) { $content = $params[$contentKeys[$i]]; if (!isset($content['tab_id']) || !$content['tab_id']) { continue; } if (!$canAddExistingContentToTab) { $canAddExistingContentToTab = $tabModel->canAddExistingContentToTab(array('tab_id' => $content['tab_id'])); } $tabContents = $tabModel->getTabContentsByTabId($content['tab_id']); $tabContents = $tabModel->prepareTabContents($tabContents, $contentTypes[$i], $content[$contentIdKeys[$i]], $content); $this->_view->setParams(array('tabContents' => $tabContents)); break; } if (!$canAddExistingContentToTab) { $canAddExistingContentToTab = $tabModel->canAddExistingContentToTab(array()); } $this->_view->setParams(array('canAddExistingContentToTab' => $canAddExistingContentToTab)); }
public function renderVerification(XenForo_View $view, $context, array $user, array $providerData, array $triggerData) { $issuer = XenForo_Helper_String::wholeWordTrim(str_replace(':', '', XenForo_Application::getOptions()->boardTitle), 50); $user = str_replace(':', '', $user['username']); $params = array('secret' => $providerData['secret'], 'otpUrl' => $this->_getAuthHandler()->getOtpAuthUrl("{$issuer}: {$user}", $providerData['secret'], $issuer), 'data' => $providerData, 'context' => $context); return $view->createTemplateObject('two_step_totp', $params)->render(); }
/** * Creates a template object in which to display the search results. * * @param array $results * @param XenForo_View $view * * @return XenForo_Template_Admin */ public function renderResults($results, XenForo_View $view) { /* @var $styleModel XenForo_Model_Style */ $styleModel = $this->getModelFromCache('XenForo_Model_Style'); $styleId = $styleModel->getStyleIdFromCookie(); return $view->createTemplateObject($this->_getTemplateName(), array('results' => $this->_limitResults($results), 'styleId' => $styleId ? $styleId : false)); }
public static function renderOption(XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit) { $editLink = $view->createTemplateObject('option_list_option_editlink', array('preparedOption' => $preparedOption, 'canEditOptionDefinition' => $canEdit)); $nodeModel = XenForo_Model::create('XenForo_Model_Node'); $forumOptions = $nodeModel->getNodeOptionsArray($nodeModel->getAllNodes(), false, '(unspecified)'); return $view->createTemplateObject('option_list_option_multi_EWRmedio', array('fieldPrefix' => $fieldPrefix, 'listedFieldName' => $fieldPrefix . '_listed[]', 'preparedOption' => $preparedOption, 'formatParams' => $forumOptions, 'editLink' => $editLink)); }
/** * Renders the exif options. * * @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) { $value = $preparedOption['option_value']; $choices = array(); if (isset($value['FILE'])) { foreach ($value['FILE'] as $option) { $choices[] = array('group' => $option['group'], 'name' => is_string($option['name']) ? $option['name'] : '', 'format' => $option['format']); } } if (isset($value['COMPUTED'])) { foreach ($value['COMPUTED'] as $option) { $choices[] = array('group' => $option['group'], 'name' => is_string($option['name']) ? $option['name'] : '', 'format' => $option['format']); } } if (isset($value['IFD0'])) { foreach ($value['IFD0'] as $option) { $choices[] = array('group' => $option['group'], 'name' => is_string($option['name']) ? $option['name'] : '', 'format' => $option['format']); } } if (isset($value['EXIF'])) { foreach ($value['EXIF'] as $option) { $choices[] = array('group' => $option['group'], 'name' => is_string($option['name']) ? $option['name'] : '', 'format' => $option['format']); } } $editLink = $view->createTemplateObject('option_list_option_editlink', array('preparedOption' => $preparedOption, 'canEditOptionDefinition' => $canEdit)); return $view->createTemplateObject('option_template_xengallery_exif_options', array('fieldPrefix' => $fieldPrefix, 'listedFieldName' => $fieldPrefix . '_listed[]', 'preparedOption' => $preparedOption, 'formatParams' => $preparedOption['formatParams'], 'editLink' => $editLink, 'choices' => $choices, 'nextCounter' => count($choices))); }
/** * Renders the CAPTCHA template. * * @see XenForo_Captcha_Abstract::renderInternal() */ public function renderInternal(XenForo_View $view) { if (!$this->_cKey) { return ''; } return $view->createTemplateObject('captcha_solve_media', array('cKey' => $this->_cKey)); }
public static function renderMultiple(XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit) { $editLink = $view->createTemplateObject('option_list_option_editlink', array('preparedOption' => $preparedOption, 'canEditOptionDefinition' => $canEdit)); /* @var $nodeModel XenForo_Model_Node */ $nodeModel = XenForo_Model::create('XenForo_Model_Node'); $forumOptions = $nodeModel->getNodeOptionsArray($nodeModel->getAllNodes(), $preparedOption['option_value'], '(unspecified)'); return $view->createTemplateObject('el_portal_nodeoptions', array('fieldPrefix' => $fieldPrefix, 'listedFieldName' => $fieldPrefix . '_listed[]', 'preparedOption' => $preparedOption, 'formatParams' => $forumOptions, 'editLink' => $editLink)); }
public function renderHtml(array $photo, XenForo_View $view) { $album = null; if (isset($photo['album'])) { $album = $photo['album']; } return $view->createTemplateObject('sonnb_xengallery_photo_list_item', array('photo' => $photo, 'album' => $album)); }
public static function renderMultiple(XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit) { $editLink = $view->createTemplateObject('option_list_option_editlink', array('preparedOption' => $preparedOption, 'canEditOptionDefinition' => $canEdit)); /* @var $nodeModel XenForo_Model_Node */ $nodeModel = XenForo_Model::create('XenForo_Model_Node'); $forumOptions = $nodeModel->getNodeOptionsArray($nodeModel->getAllNodes()); return $view->createTemplateObject('option_list_option_multi_MODM_AJAXChat', array('fieldPrefix' => $fieldPrefix, 'listedFieldName' => $fieldPrefix . '_listed[]', 'preparedOption' => $preparedOption, 'formatParams' => $forumOptions, 'editLink' => $editLink, 'multiple' => true)); }
/** * A callback that is called when viewing the full report. * * @see XenForo_ReportHandler_Abstract::viewCallback() */ public function viewCallback(XenForo_View $view, array &$report, array &$contentInfo) { $bbCodeParser = new XenForo_BbCode_Parser(XenForo_BbCode_Formatter_Base::create('Base', array('view' => $view))); $contentInfo['comment']['messageHtml'] = new XenForo_BbCode_TextWrapper($contentInfo['comment']['message'], $bbCodeParser); $contentInfo['comment']['message'] = $contentInfo['comment']['messageHtml']; // sanity check in case template not update return $view->createTemplateObject('xengallery_report_comment_content', array('report' => $report, 'content' => $contentInfo)); }
public static function renderOption(XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit) { $value = $preparedOption['option_value']; $editLink = $view->createTemplateObject('option_list_option_editlink', array('preparedOption' => $preparedOption, 'canEditOptionDefinition' => $canEdit)); $styleModel = self::_getStyleModel(); $styleOptions = $styleModel->getStylesForOptionsTag($value['style']); return $view->createTemplateObject('option_template_styleChooser_EWRporta', array('fieldPrefix' => $fieldPrefix, 'listedFieldName' => $fieldPrefix . '_listed[]', 'preparedOption' => $preparedOption, 'formatParams' => $styleOptions, 'editLink' => $editLink)); }
/** * Renders the CAPTCHA template. * * @see XenForo_Captcha_Abstract::renderInternal() */ public function renderInternal(XenForo_View $view) { if (!$this->_siteKey) { return ''; } $template = $view->createTemplateObject('captcha_nocaptcha', array('siteKey' => $this->_siteKey)); return $template; }
public static function renderOption(XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit) { $value = $preparedOption['option_value']; $editLink = $view->createTemplateObject('option_list_option_editlink', array('preparedOption' => $preparedOption, 'canEditOptionDefinition' => $canEdit)); $nodeModel = XenForo_Model::create('XenForo_Model_Node'); $forumOptions = $nodeModel->getNodeOptionsArray($nodeModel->getAllNodes(), $preparedOption['option_value'], '(None)'); return $view->createTemplateObject('borbole_helper_rating_forums', array('fieldPrefix' => $fieldPrefix, 'listedFieldName' => $fieldPrefix . '_listed[]', 'preparedOption' => $preparedOption, 'formatParams' => $forumOptions, 'editLink' => $editLink)); }
/** * @param array $content * @param XenForo_View $view * @return XenForo_Template_Abstract */ public function renderHtml(array $content, XenForo_View $view) { $album = null; if (isset($content['album'])) { $album = $content['album']; } return $view->createTemplateObject('sonnb_xengallery_' . $content['content_type'] . '_list_item', array('content' => $content, 'album' => $album)); }
public static function render_AdminCP_CustomFieldsAdder(XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit) { $choices = $preparedOption['option_value']; //self::debug($choices); $stylesWithOption = self::getBackgroundReplaceRules($choices); //self::debug($stylesWithOption); $editLink = $view->createTemplateObject('option_list_option_editlink', array('preparedOption' => $preparedOption, 'canEditOptionDefinition' => $canEdit)); return $view->createTemplateObject('kiror_customBackground_options_places', array('fieldPrefix' => $fieldPrefix, 'listedFieldName' => $fieldPrefix . '_listed[]', 'preparedOption' => $preparedOption, 'formatParams' => $preparedOption['formatParams'], 'editLink' => $editLink, 'choices' => $stylesWithOption, 'nextCounter' => count($stylesWithOption))); }
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); }
public static function renderAuto(XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit) { list($addOns, $missingAddOns) = self::_getMissingAddOns($preparedOption['option_id']); if (empty($missingAddOns)) { $preparedOption['title'] = new XenForo_Phrase('bdsocialshare_auto_for_x', array('action' => $preparedOption['title'])); $editLink = $view->createTemplateObject('option_list_option_editlink', array('preparedOption' => $preparedOption, 'canEditOptionDefinition' => $canEdit)); return $view->createTemplateObject('bdsocialshare_option_auto', array('fieldPrefix' => $fieldPrefix, 'listedFieldName' => $fieldPrefix . '_listed[]', 'preparedOption' => $preparedOption, 'value' => isset($preparedOption['option_value']) ? $preparedOption['option_value'] : '', 'formatParams' => $preparedOption['formatParams'], 'editLink' => $editLink)); } }
public static function renderOption(XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit) { $editLink = $view->createTemplateObject('option_list_option_editlink', array('preparedOption' => $preparedOption, 'canEditOptionDefinition' => $canEdit)); $options = array(); foreach (self::$navbarPositions as $pos) { $options[$pos] = $pos; } return $view->createTemplateObject('option_list_option_select', array('fieldPrefix' => $fieldPrefix, 'listedFieldName' => $fieldPrefix . '_listed[]', 'preparedOption' => $preparedOption, 'formatParams' => $options, 'editLink' => $editLink)); }
/** * Renders the censor words option row. * * @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) { $value = $preparedOption['option_value']; $choices = array(); foreach ($value as $word) { $choices[] = array('word' => $word['word'], 'replace' => is_string($word['replace']) ? $word['replace'] : ''); } $editLink = $view->createTemplateObject('option_list_option_editlink', array('preparedOption' => $preparedOption, 'canEditOptionDefinition' => $canEdit)); return $view->createTemplateObject('option_template_censorWords', array('fieldPrefix' => $fieldPrefix, 'listedFieldName' => $fieldPrefix . '_listed[]', 'preparedOption' => $preparedOption, 'formatParams' => $preparedOption['formatParams'], 'editLink' => $editLink, 'choices' => $choices, 'nextCounter' => count($choices))); }
/** * Renders the media site thumbs options. * * @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) { $value = $preparedOption['option_value']; $choices = array(); foreach ($value as $site => $url) { $choices[] = array('id' => $site, 'url' => is_string($url) ? $url : ''); } $editLink = $view->createTemplateObject('option_list_option_editlink', array('preparedOption' => $preparedOption, 'canEditOptionDefinition' => $canEdit)); return $view->createTemplateObject('option_template_xengallery_media_thumbnails', array('fieldPrefix' => $fieldPrefix, 'listedFieldName' => $fieldPrefix . '_listed[]', 'preparedOption' => $preparedOption, 'formatParams' => $preparedOption['formatParams'], 'editLink' => $editLink, 'mediaSites' => self::getBbCodeMediaSites(), 'choices' => $choices, 'nextCounter' => count($choices))); }
public static function renderSocialForumsListFromDisplayArray(XenForo_View $view, array $socialForums) { $renderedSocialForums = array(); foreach ($socialForums as $socialForum) { $template = $view->createTemplateObject('th_social_forum_list_item_socialgroups'); $template->setParam('forum', $socialForum); $renderedSocialForums[] = $template->render(); } return $renderedSocialForums; }
public static function renderWidgetPages(XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit) { $widgetPages = XenForo_Model::create('WidgetFramework_Model_WidgetPage')->getList(); $choices = array(0 => ''); foreach ($widgetPages as $widgetPageId => $widgetPageTitle) { $choices[$widgetPageId] = $widgetPageTitle; } $editLink = $view->createTemplateObject('option_list_option_editlink', array('preparedOption' => $preparedOption, 'canEditOptionDefinition' => $canEdit)); return $view->createTemplateObject('option_list_option_select', array('fieldPrefix' => $fieldPrefix, 'listedFieldName' => $fieldPrefix . '_listed[]', 'preparedOption' => $preparedOption, 'formatParams' => $choices, 'editLink' => $editLink)); }
public static function renderOption(XenForo_View $view, array $option) { $threadPrefixModel = self::_getThreadPrefixModel(); $threadPrefixes = $threadPrefixModel->preparePrefixes($threadPrefixModel->getAllPrefixes()); $options = array(); foreach ($threadPrefixes as $threadPrefixId => $threadPrefix) { $options[$threadPrefixId] = $threadPrefix['title']; } $option['field_choices'] = $options; return $view->createTemplateObject('lpsf_destination_option_thread_prefix', array('option' => $option)); }
/** * Renders the CAPTCHA template. * * @see XenForo_Captcha_Abstract::renderInternal() */ public function renderInternal(XenForo_View $view) { if (!$this->_keyUserId) { return ''; } $ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : ''; $sessionId = md5(uniqid('xfkeycaptcha')); $sign = md5($sessionId . $ip . $this->_privateKey); $sign2 = md5($sessionId . $this->_privateKey); return $view->createTemplateObject('captcha_keycaptcha', array('keyUserId' => $this->_keyUserId, 'sessionId' => $sessionId, 'sign' => $sign, 'sign2' => $sign2)); }
public static function renderOptionNumbers(XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit) { $value = $preparedOption['option_value']; $numbers = array(); foreach ($value as $number) { if ($number > 0) { $numbers[] = $number; } } $editLink = $view->createTemplateObject('option_list_option_editlink', array('preparedOption' => $preparedOption, 'canEditOptionDefinition' => $canEdit)); return $view->createTemplateObject('VietXfAdvStats_option_numbers', array('fieldPrefix' => $fieldPrefix, 'listedFieldName' => $fieldPrefix . '_listed[]', 'preparedOption' => $preparedOption, 'formatParams' => $preparedOption['formatParams'], 'editLink' => $editLink, 'numbers' => $numbers, 'nextCounter' => count($numbers))); }
public static function renderOption(XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit) { $values = $preparedOption['option_value']; $entries = array(); if (!empty($values)) { foreach ($values as $value) { $entries[] = $value; } } $editLink = $view->createTemplateObject('option_list_option_editlink', array('preparedOption' => $preparedOption, 'canEditOptionDefinition' => $canEdit)); return $view->createTemplateObject('option_template_multiEntries_EWRporta', array('fieldPrefix' => $fieldPrefix, 'listedFieldName' => $fieldPrefix . '_listed[]', 'preparedOption' => $preparedOption, 'formatParams' => $preparedOption['formatParams'], 'editLink' => $editLink, 'entries' => $entries, 'nextCounter' => count($entries))); }
public static function renderOption(XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit) { $value = $preparedOption['option_value']; $threads = array(); foreach ($value as $thread) { if (!empty($thread['thread_id'])) { $threads[] = $thread; } } $editLink = $view->createTemplateObject('option_list_option_editlink', array('preparedOption' => $preparedOption, 'canEditOptionDefinition' => $canEdit)); return $view->createTemplateObject('th_option_template_threadinoverlay', array('fieldPrefix' => $fieldPrefix, 'listedFieldName' => $fieldPrefix . '_listed[]', 'preparedOption' => $preparedOption, 'formatParams' => $preparedOption['formatParams'], 'editLink' => $editLink, 'threads' => $threads, 'nextCounter' => count($threads))); }
public static function renderOption(XenForo_View $view, array $option) { $maxResponses = XenForo_Application::get('options')->pollMaximumResponses; if ($maxResponses == 0) { $maxResponses = 10; // number to create for non-JS users } if ($maxResponses > 2) { $pollExtraArray = array_fill(0, $maxResponses - 2, true); } else { $pollExtraArray = array(); } return $view->createTemplateObject('lpsf_destination_option_thread_poll', array('option' => $option, 'pollExtraArray' => $pollExtraArray, 'xfVersion' => XenForo_Application::$versionId)); }