当前位置: 首页>>代码示例>>PHP>>正文


PHP XenForo_Template_Abstract::create方法代码示例

本文整理汇总了PHP中XenForo_Template_Abstract::create方法的典型用法代码示例。如果您正苦于以下问题:PHP XenForo_Template_Abstract::create方法的具体用法?PHP XenForo_Template_Abstract::create怎么用?PHP XenForo_Template_Abstract::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XenForo_Template_Abstract的用法示例。


在下文中一共展示了XenForo_Template_Abstract::create方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: templatePostRender

 public static function templatePostRender($templateName, &$content, array &$containerData, XenForo_Template_Abstract $template)
 {
     switch ($templateName) {
         case 'template_list':
             $params = $template->getParams();
             $params['type'] = 'public';
             $replace = $template->create('template_list_addon_filter', $params);
             $content = preg_replace('/<div class="Popup">(.*?<\\/div>){3}/is', "\\0 {$replace}", $content);
             break;
         case 'template_search':
             $params = $template->getParams();
             $replace = $template->create('template_search_addon_filter', $params);
             $content = preg_replace('/<dl class="ctrlUnit">(.*?<\\/dl>){1}/is', "\\0 {$replace}", $content, 1);
             break;
         case 'template_search_results':
             $params = $template->getParams();
             if (!empty($params['addOn'])) {
                 $containerData['title'] .= '<br />' . new XenForo_Phrase('add_on') . ': ' . $params['addOn']['title'];
             }
             break;
         case 'admin_template_list':
             $params = $template->getParams();
             $params['type'] = 'admin';
             $replace = $template->create('template_list_addon_filter', $params);
             $content = preg_replace('/<form action="[^\\>]*>(.*?)<\\/form>/is', "{$replace} \\0", $content);
             break;
     }
 }
开发者ID:Sywooch,项目名称:forums,代码行数:28,代码来源:Listener.php

示例2: template_hook

 public static function template_hook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
 {
     //Swiiitch!
     switch ($hookName) {
         //first template hook
         case 'member_view_tabs_heading':
             //Get our template!
             $ourTemplate = $template->create('autocraft_GameProfilesTab', $template->getParams());
             //Render
             $rendered = $ourTemplate->render();
             //Put the rendered template in the contents.
             $contents .= $rendered;
             break;
             //second template hook
         //second template hook
         case 'member_view_tabs_content':
             //Get our template!
             $ourTemplate = $template->create('autocraft_GameProfiles', $template->getParams());
             //Render
             $rendered = $ourTemplate->render();
             //Put the rendered template in the contents.
             $contents .= $rendered;
             break;
     }
 }
开发者ID:ravenboilinux,项目名称:xenforo,代码行数:25,代码来源:Listener.php

示例3: hooks

 public static function hooks($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
 {
     if (self::$class_check === null) {
         self::$class_check = class_exists('KingK_BbCodeManager_BbCodeManager');
     }
     if (self::$class_check === false) {
         switch ($hookName) {
             case 'editor':
                 $options = XenForo_Application::get('options');
                 $visitor = XenForo_Visitor::getInstance();
                 if ($options->Bbm_Bm_ShowControllerInfo && $visitor['is_admin']) {
                     $contents .= $template->create('bbm_editor_extra_info', $template->getParams());
                 }
                 break;
             case 'help_bb_codes':
                 $contents .= $template->create('help_bbm_bbcodes', $template->getParams());
                 break;
             case 'page_container_head':
                 if ($template instanceof XenForo_Template_Admin && !$options->Bbm_Bm_SetInAdmin) {
                     break;
                 }
                 //Extra css
                 $contents .= $template->create('bbm_js', $template->getParams());
                 break;
         }
     }
 }
开发者ID:Sywooch,项目名称:forums,代码行数:27,代码来源:Public.php

示例4: listenhooks

 public static function listenhooks($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
 {
     switch ($hookName) {
         case 'account_privacy_top':
             $options = XenForo_Application::get('options');
             if (!$options->sedo_at_preventracing) {
                 break;
             }
             $mergedParams = array_merge($template->getParams(), $hookParams);
             $contents = $template->create('sedo_agent_account', $mergedParams) . $contents;
             break;
         case 'message_content':
             $options = XenForo_Application::get('options');
             $src = $template->getTemplateName();
             //Check which kind of integration is activated
             if ($src == 'conversation_view' && (!$options->sedo_at_auto_conversation || $options->sedo_at_auto_conversation_style != 'graphic') or $src == 'thread_view' && (!$options->sedo_at_auto_thread || $options->sedo_at_auto_thread_style != 'graphic')) {
                 break;
             }
             if ($options->sedo_at_auto_thread_style == 'graphic' || $options->sedo_at_auto_thread_style == 'graphic') {
                 $mergedParams = array_merge($template->getParams(), $hookParams);
                 $contents .= $template->create('sedo_agent', $mergedParams);
             }
             break;
     }
 }
开发者ID:Sywooch,项目名称:forums,代码行数:25,代码来源:Templates.php

示例5: template_hook

 public static function template_hook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
 {
     $options = XenForo_Application::get('options');
     $enableadvxenforo = $options->enableadvxenforo;
     $thread_id = $hookParams['thread']['thread_id'];
     if ($enableadvxenforo) {
         $PermissionEnable = XenForo_Visitor::getInstance()->hasPermission('adv_xenforo', 'adv_xenforo_enable_adv') ? TRUE : FALSE;
         if ($hookName == 'account_preferences_options' && $PermissionEnable) {
             $ourTemplate = $template->create('adv_xenforo_account_options', $template->getparams());
             $rendered = $ourTemplate->render();
             $contents = $contents . $rendered;
         }
         $hasPermission = XenForo_Visitor::getInstance()->hasPermission('adv_xenforo', 'adv_xenforo_show') ? TRUE : FALSE;
         $advs = XenForo_Application::getSimpleCacheData('adv_xenforo');
         $user = XenForo_Visitor::getInstance()->toArray();
         $enable_adv = $PermissionEnable === TRUE ? $user['enable_adv'] : TRUE;
         $containerData = self::$containerData;
         if (empty(self::$containerData)) {
             $containerData = XenForo_Template_Public::getExtraContainerData();
         }
         if ($enable_adv) {
             if ($hasPermission === TRUE && $advs["AdvsHook"]) {
                 $isMobile = XenForo_Visitor::isBrowsingWith('mobile');
                 switch (TRUE) {
                     case $isMobile == TRUE:
                         $adv_adv = 'adv_small';
                         break;
                     default:
                         $adv_adv = 'adv_large';
                         break;
                 }
                 foreach ($advs["AdvsHook"] as $_asv) {
                     if ($_asv['active'] && XenForo_Helper_Criteria::userMatchesCriteria($_asv['user_criteria'], TRUE, $user) && XenForo_Helper_Criteria::pageMatchesCriteria($_asv['page_criteria'], TRUE, $template->getParams(), $containerData)) {
                         $ourTemplate = $template->create('ads_xf_ar_xenforo', array('advanced' => $_asv[$adv_adv]));
                         $rendered = $ourTemplate->render();
                         if ($hookName == 'message_content' && Turki_Adv_Helper_Criteria::postCriteria($_asv['post_criteria'], TRUE) === FALSE) {
                             if ($hookParams['message']['thread_id']) {
                                 $decode = XenForo_Helper_Criteria::prepareCriteriaForSelection($_asv['post_criteria']);
                                 $position = $decode['active']['page'] ? $hookParams['message']['position'] % $options->messagesPerPage : $hookParams['message']['position'];
                                 if ($position == $decode['active']['post_id'] - 1) {
                                     $contents = $decode['active']['position'] ? Turki_Adv_Helper_Helpers::advhtml($contents, $rendered) : $contents . $rendered;
                                 }
                             }
                         } else {
                             if ($hookName == $_asv['adv_hook_name'] && Turki_Adv_Helper_Criteria::postCriteria($_asv['post_criteria'], TRUE)) {
                                 $contents = $_asv['display'] == 'top' ? $rendered . $contents : $contents . $rendered;
                             }
                         }
                     }
                 }
             }
         }
         self::_templateHook($hookName, $contents, $hookParams, $template);
     }
 }
开发者ID:Sywooch,项目名称:forums,代码行数:55,代码来源:Listener.php

示例6: template_hook

 public static function template_hook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
 {
     switch ($hookName) {
         case 'admin_forum_edit_tabs':
             $contents .= $template->create('XenStop_AdvArchiver_forum_edit_tab')->render();
             break;
         case 'admin_forum_edit_panes':
             $params['rule'] = XenForo_Application::get('XenStop_AdvArchiver_Params');
             $contents .= $template->create('XenStop_AdvArchiver_forum_edit_fields', $params)->render();
             break;
     }
 }
开发者ID:Mirovinger,项目名称:AdvArchiver,代码行数:12,代码来源:CodeEvents.php

示例7: templateHook

 public static function templateHook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
 {
     $modernStatisticModel = XenForo_Model::create('Brivium_ModernStatistic_Model_ModernStatistic');
     if (is_null(self::$_dismissed)) {
         self::$_dismissed = true;
         if (!$modernStatisticModel->checkExclude()) {
             self::$_dismissed = false;
         }
     }
     if (!self::$_dismissed) {
         $options = XenForo_Application::get('options');
         $position = $options->BRMS_position;
         if ($position != 'other') {
             if ($hookName == $position) {
                 $ourTemplate = $template->create('BRMS_ModernStatistic', $template->getParams());
                 $contents .= $ourTemplate->render();
             }
         }
         if ($options->BRMS_loadFirstTab) {
             switch ($hookName) {
                 case 'brms_modern_statistic_first_tabs':
                     if (!empty($options->BRMS_tabsSelector)) {
                         $tabId = -1;
                         $xenAddons = XenForo_Application::get('addOns');
                         $userId = XenForo_Visitor::getUserId();
                         foreach ($options->BRMS_tabsSelector as $key => $tab) {
                             if (!empty($tab['active']) && ($tab['kind'] != 'resource' || $modernStatisticModel->checkXenForoResourceAddon()) && ($tab['type'] != 'my_threads' || !empty($userId))) {
                                 $tabId = $key;
                                 break;
                             }
                         }
                         if ($tabId != -1) {
                             $limit = 0;
                             $limitOptions = $options->BRMS_itemLimit;
                             if (!empty($limitOptions['enabled'])) {
                                 $request = new Zend_Controller_Request_Http();
                                 $limit = $request->getCookie('brmsNumberEntry');
                             }
                             $viewParams = $modernStatisticModel->getStatistics($tabId, $limit ? $limit : 0);
                             $newTemplate = $template->create($viewParams['template'], $template->getParams());
                             $newTemplate->setParams($viewParams);
                             $contents = $newTemplate->render();
                         }
                     }
                     break;
             }
         }
     }
     // NO!
     self::_templateHook($hookName, $contents, $hookParams, $template);
 }
开发者ID:darkearl,项目名称:projectT122015,代码行数:51,代码来源:Listener.php

示例8: templateHookListener

 public static function templateHookListener($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
 {
     switch ($hookName) {
         case 'account_wrapper_sidebar_settings':
             $contents .= $template->create('discordauth_account_wrapper_sidebar', $template->getParams())->render();
             break;
         case 'member_view_tabs_content':
             $contents .= $template->create('discordauth_profile_tab_content', $template->getParams())->render();
             break;
         case 'navigation_visitor_tab_links1':
             $contents .= $template->create('discordauth_navigation_tab_link', $template->getParams())->render();
             break;
     }
 }
开发者ID:Hornwitser,项目名称:DiscordAuthorizer,代码行数:14,代码来源:Addon.php

示例9: template_post_render

 public static function template_post_render($templateName, &$contents, array &$containerData, XenForo_Template_Abstract $template)
 {
     $options = XenForo_Application::get('options');
     $viewingUser = XenForo_Visitor::getInstance()->toArray();
     $hookParams['forum']['node_id'] = !empty($containerData['quickNavSelected']) ? substr($containerData['quickNavSelected'], 5) : '';
     if ($templateName == 'forum_view' && !empty($containerData['topctrl']) && XenForo_Permission::hasPermission($viewingUser['permissions'], 'EWRatendo', 'canPost') && in_array($hookParams['forum']['node_id'], $options->EWRatendo_eventforums)) {
         $topctrl = !empty(XenForo_Application::get('options')->EWRatendo_eventforums2[$hookParams['forum']['node_id']]['topctrl']) ? true : false;
         if ($topctrl) {
             $containerData['topctrl'] = $template->create('EWRatendo_ForumView_TopCtrl', $hookParams);
         } else {
             $containerData['topctrl'] .= $template->create('EWRatendo_ForumView_TopCtrl', $hookParams);
         }
     }
 }
开发者ID:Sywooch,项目名称:forums,代码行数:14,代码来源:Template.php

示例10: template_hook

 public static function template_hook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
 {
     switch ($hookName) {
         case 'account_wrapper_sidebar_settings':
             $ourTemplate = $template->create('bdapi_account_wrapper_sidebar', $template->getParams());
             $ourHtml = $ourTemplate->render();
             $contents .= $ourHtml;
             break;
         case 'navigation_visitor_tab_links1':
             $ourTemplate = $template->create('bdapi_navigation_visitor_tab', $template->getParams());
             $ourHtml = $ourTemplate->render();
             $contents .= $ourHtml;
             break;
     }
 }
开发者ID:burtay,项目名称:bdApi,代码行数:15,代码来源:Listener.php

示例11: TemplateHook

 public static function TemplateHook($hookName, &$content, array $hookParams, XenForo_Template_Abstract $template)
 {
     switch ($hookName) {
         case 'dark_taigachat':
         case 'dark_taigachat_alt':
             $params = $template->getParams();
             if ($hookName == 'dark_taigachat_alt') {
                 $params['taigachat']['alt'] = true;
             }
             $params['taigachat']['room'] = 1;
             if (isset($hookParams['room'])) {
                 $params['taigachat']['room'] = $hookParams['room'];
             }
             $content .= $template->create('dark_taigachat', $params)->render();
             break;
         case 'dark_taigachat_online_users':
             $params = $template->getParams();
             $content .= $template->create('dark_taigachat_widget_online', $params)->render();
             break;
         case 'dark_taigachat_fake':
             $params = $template->getParams();
             $content .= $template->create('dark_taigachat_fake', $params)->render();
             break;
         case 'dark_taigachat_full':
             $params = $template->getParams();
             $params['taigachat']['room'] = 1;
             if (isset($hookParams['room'])) {
                 $params['taigachat']['room'] = $hookParams['room'];
             }
             $visitor = XenForo_Visitor::getInstance();
             $sessionModel = XenForo_Model::create('Dark_TaigaChat_Model_Session');
             $taigamodel = XenForo_Model::create("Dark_TaigaChat_Model_TaigaChat");
             $taigamodel->updateActivity($visitor['user_id'], false);
             $onlineUsers = $sessionModel->getSessionActivityQuickList($visitor->toArray(), array('cutOff' => array('>', $sessionModel->getOnlineStatusTimeout())), $visitor['user_id'] ? $visitor->toArray() : null);
             $onlineUsersTaiga = array();
             if ($options->dark_taigachat_sidebar) {
                 $onlineUsersTaiga = $taigamodel->getActivityUserList($visitor->toArray());
             }
             $params += array('taigachat' => array('onlineUsers' => $onlineUsers, 'sidebar_enabled' => true, 'online' => $onlineUsersTaiga));
             $response = new stdClass();
             $response->viewName = "Dark_TaigaChat_ViewPublic_TaigaChat_Index";
             $response->params = array();
             Dark_TaigaChat_Helper_Global::getTaigaChatStuff($response, "");
             $params = array_merge_recursive($params, $response->params);
             $content .= $template->create('dark_taigachat_full', $params)->render();
             break;
     }
 }
开发者ID:VoDongMy,项目名称:xenforo-laravel5.1,代码行数:48,代码来源:Listener.php

示例12: templatePostRender

 public static function templatePostRender($templateName, &$content, array &$containerData, XenForo_Template_Abstract $template)
 {
     $param = array();
     switch ($templateName) {
         case 'node_list.css':
             $cacheDataForum = XenForo_Application::isRegistered('brcnsCacheDataForum') ? XenForo_Application::get('brcnsCacheDataForum') : XenForo_Model::create('XenForo_Model_DataRegistry')->get('brcnsCacheDataForum');
             $cacheDataPage = XenForo_Application::isRegistered('brcnsCacheDataPage') ? XenForo_Application::get('brcnsCacheDataPage') : XenForo_Model::create('XenForo_Model_DataRegistry')->get('brcnsCacheDataPage');
             $cacheDataLink = XenForo_Application::isRegistered('brcnsCacheDataLink') ? XenForo_Application::get('brcnsCacheDataLink') : XenForo_Model::create('XenForo_Model_DataRegistry')->get('brcnsCacheDataLink');
             $cacheDataCategory = XenForo_Application::isRegistered('brcnsCacheDataCategory') ? XenForo_Application::get('brcnsCacheDataCategory') : XenForo_Model::create('XenForo_Model_DataRegistry')->get('brcnsCacheDataCategory');
             $cacheDataCategoryRoot = XenForo_Application::isRegistered('brcnsCacheDataCateRoot') ? XenForo_Application::get('brcnsCacheDataCateRoot') : XenForo_Model::create('XenForo_Model_DataRegistry')->get('brcnsCacheDataCateRoot');
             XenForo_Application::set('brcnsCustomNodeStylesForum', $cacheDataForum);
             XenForo_Application::set('brcnsCustomNodeStylesPage', $cacheDataPage);
             XenForo_Application::set('brcnsCustomNodeStylesLink', $cacheDataLink);
             XenForo_Application::set('brcnsCustomNodeStylesCategory', $cacheDataCategory);
             XenForo_Application::set('brcnsCustomNodeStylesCategoryRoot', $cacheDataCategoryRoot);
             $param['CustomNodeStylesForums'] = XenForo_Application::get('brcnsCustomNodeStylesForum');
             $param['CustomNodeStylesPages'] = XenForo_Application::get('brcnsCustomNodeStylesPage');
             $param['CustomNodeStylesLinks'] = XenForo_Application::get('brcnsCustomNodeStylesLink');
             $param['CustomNodeStylescategories'] = XenForo_Application::get('brcnsCustomNodeStylesCategory');
             $param['CustomNodeStylesCategoriesRoot'] = XenForo_Application::get('brcnsCustomNodeStylesCategoryRoot');
             $options = XenForo_Application::get('options');
             $param['size'] = $options->BRCNS_size_icon;
             $newTemplate = $template->create('BRCNS_custom_node_style.css', $template->getParams());
             $newTemplate->setParams($param);
             $content = $content . $newTemplate->render();
             break;
     }
 }
开发者ID:darkearl,项目名称:projectT122015,代码行数:28,代码来源:Listener.php

示例13: listen

 public static function listen($hookName, &$content, array $hookParams, XenForo_Template_Abstract $template)
 {
     if ($hookName == 'ad_below_content') {
         $params = $template->getParams();
         $content .= $template->create('dark_azucloud', $params);
     }
 }
开发者ID:Sywooch,项目名称:forums,代码行数:7,代码来源:TemplateHook.php

示例14: listen

 public static function listen($hookName, &$content, array $hookParams, XenForo_Template_Abstract $template)
 {
     if ($hookName == 'editor') {
         $params = $template->getParams();
         $options = XenForo_Application::get('options');
         if ($options->dark_minorin_enabled) {
             $smilies = array();
             $toolbar_bbcode = array();
             $toolbar_bbcode_temp = explode("\n", str_replace("\r", "", trim($options->dark_minorin_bbcode)));
             foreach ($toolbar_bbcode_temp as $bbcode) {
                 $bbcode = explode(":", trim($bbcode));
                 $toolbar_bbcode[$bbcode[0]] = $bbcode[1];
             }
             if (XenForo_Application::isRegistered('smilies')) {
                 $smilies = XenForo_Application::get('smilies');
             } else {
                 $smilies = XenForo_Model::create('XenForo_Model_Smilie')->getAllSmiliesForCache();
                 XenForo_Application::set('smilies', $smilies);
             }
             foreach ($smilies as &$smilie) {
                 $smilie['text'] = $smilie['smilieText'][0];
                 $smilie['sprite_mode'] = array_key_exists('sprite_params', $smilie);
             }
             $params += array('minorin' => array("toolbar_bbcode" => $toolbar_bbcode, "toolbar_smilies" => $smilies, "enabled" => $options->dark_minorin_enabled, "js_modification" => filemtime("js/dark/minorin.js")));
         }
         $content .= $template->create('dark_minorin_toolbar', $params);
     }
 }
开发者ID:Sywooch,项目名称:forums,代码行数:28,代码来源:TemplateHook.php

示例15: template_hook

 public static function template_hook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
 {
     if ($hookName == 'message_content') {
         $ourTemplate = $template->create('MoreThread_main', $template->getParams());
         $ourTemplate->setParam('message', $hookParams['message']);
         $contents .= $ourTemplate->render();
     }
 }
开发者ID:Sywooch,项目名称:forums,代码行数:8,代码来源:Listener.php


注:本文中的XenForo_Template_Abstract::create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。