當前位置: 首頁>>代碼示例>>PHP>>正文


PHP XenForo_View::createOwnTemplateObject方法代碼示例

本文整理匯總了PHP中XenForo_View::createOwnTemplateObject方法的典型用法代碼示例。如果您正苦於以下問題:PHP XenForo_View::createOwnTemplateObject方法的具體用法?PHP XenForo_View::createOwnTemplateObject怎麽用?PHP XenForo_View::createOwnTemplateObject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在XenForo_View的用法示例。


在下文中一共展示了XenForo_View::createOwnTemplateObject方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: addRedactorButtons

 public static function addRedactorButtons(XenForo_View $view, $formCtrlName, &$message, array &$editorOptions, &$showWysiwyg)
 {
     if (!$showWysiwyg) {
         return false;
     }
     $xenOptions = XenForo_Application::get('options');
     if ($xenOptions->bbm_debug_tinymcehookdisable) {
         return false;
     }
     $template = $view->createOwnTemplateObject();
     $controllerName = $template->getParam('controllerName');
     $controllerAction = $template->getParam('controllerAction');
     $viewName = $template->getParam('viewName');
     $bbmParams = BBM_Helper_Buttons::getConfig($controllerName, $controllerAction, $viewName);
     if (empty($bbmParams['bbmButtonsJsGridArray'])) {
         //We must be here with Quattro
         return false;
     }
     $bbmButtonsJsGrid = $bbmParams['bbmButtonsJsGridArray'];
     $bbmCustomButtons = $bbmParams['bbmCustomButtons'];
     if (!isset($editorOptions['json']['buttons'])) {
         //Make this as an array to avoid any errors below
         $editorOptions['json']['buttons'] = array();
     }
     $jsonButtons =& $editorOptions['json']['buttons'];
     $extendedButtonsBackup = array();
     /**
      * Filter buttons grid
      */
     $allGridButtons = array();
     if (!empty($bbmButtonsJsGrid)) {
         foreach ($bbmButtonsJsGrid as &$buttonGroup) {
             foreach ($buttonGroup as $key => $button) {
                 if (!self::filterButton($button, $editorOptions, $editorOptions, $showWysiwyg)) {
                     unset($buttonGroup[$key]);
                     continue;
                 }
                 array_push($allGridButtons, $button);
             }
         }
     }
     /**
      * XenForo Custom BbCodes Manager Buttons
      */
     if (!empty($editorOptions['json']['bbCodes'])) {
         $customBbCodesButtons = array();
         foreach ($editorOptions['json']['bbCodes'] as $k => $v) {
             $customTag = "custom_{$k}";
             if (!in_array($customTag, $allGridButtons) && self::filterButton($customTag, $editorOptions, $editorOptions, $showWysiwyg)) {
                 $customBbCodesButtons[] = $customTag;
             }
         }
         if (!empty($customBbCodesButtons)) {
             $bbmButtonsJsGrid[] = $customBbCodesButtons;
         }
     }
     /**
      * Other addons Buttons Backup
      */
     if (!empty($jsonButtons)) {
         $extendedButtonsBackup = $jsonButtons;
     }
     /**
      * Get BBM Custom Buttons
      */
     if (is_array($bbmCustomButtons)) {
         foreach ($bbmCustomButtons as $button) {
             $tag = preg_replace('#^at_#', '', $button['tag']);
             $code = $button['code'];
             $desc = XenForo_Template_Helper_Core::jsEscape($button['description']);
             $opts = XenForo_Template_Helper_Core::jsEscape($button['tagOptions']);
             $content = XenForo_Template_Helper_Core::jsEscape($button['tagContent']);
             $separator = XenForo_Template_Helper_Core::jsEscape($button['separator']);
             $textButton = XenForo_Template_Helper_Core::jsEscape($button['textButton']);
             $faButton = XenForo_Template_Helper_Core::jsEscape($button['faButton']);
             $jsonButtons[$code] = array('title' => $desc, 'tag' => $tag, 'bbCodeOptions' => $opts, 'bbCodeOptionsSeparator' => $separator, 'bbCodeContent' => $content, 'textButton' => $textButton, 'faButton' => $faButton);
         }
     }
     /**
      * Let's put back the buttons from other addons at the end of the editor with the backup
      * Also check if some of these buttons have a bbm configuration to delete them from the backup
      */
     if (!empty($extendedButtonsBackup) && is_array($extendedButtonsBackup)) {
         foreach ($jsonButtons as $buttonCode => $jsonButton) {
             if (isset($extendedButtonsBackup[$buttonCode])) {
                 $jsonButtons[$buttonCode] = array_merge($jsonButtons[$buttonCode], $extendedButtonsBackup[$buttonCode]);
                 unset($extendedButtonsBackup[$buttonCode]);
             }
         }
         if (!empty($extendedButtonsBackup)) {
             //Extend custom buttons
             $jsonButtons += $extendedButtonsBackup;
             //Extend buttons grid
             $extendedgrid = array();
             foreach ($extendedButtonsBackup as $buttonCode => $extendedButton) {
                 $extendedgrid[] = $buttonCode;
             }
             array_push($bbmButtonsJsGrid, $extendedgrid);
         }
     }
//.........這裏部分代碼省略.........
開發者ID:Sywooch,項目名稱:forums,代碼行數:101,代碼來源:AllInOne.php

示例2: editor_setup

 /**
  * @param XenForo_View $view
  * @param $formCtrlName
  * @param $message
  * @param array $editorOptions
  * @param $showWysiwyg
  */
 public static function editor_setup(XenForo_View $view, $formCtrlName, &$message, array &$editorOptions, &$showWysiwyg)
 {
     if ($showWysiwyg && XenForo_Application::getOptions()->sonnbXG_editorButtons) {
         $view->createOwnTemplateObject()->addRequiredExternal('css', 'sonnb_xengallery_editor');
         $time = XenForo_Application::$time;
         $visitor = XenForo_Visitor::getInstance();
         if ($formCtrlName !== 'signature' || $formCtrlName === 'signature' && $visitor->hasPermission('signature', 'sonnbXG_album')) {
             $editorOptions['json']['buttons']['insertAlbum'] = array('title' => new XenForo_Phrase('sonnb_xengallery_insert_album'), 'dialogUrl' => XenForo_Link::buildPublicLink('gallery/editor', null, array('type' => 'album', 'time' => $time)));
         }
         if ($formCtrlName !== 'signature' || $formCtrlName === 'signature' && ($visitor->hasPermission('signature', 'sonnbXG_photo') || $visitor->hasPermission('signature', 'sonnbXG_video'))) {
             $editorOptions['json']['buttons']['insertContent'] = array('title' => new XenForo_Phrase('sonnb_xengallery_insert_content'), 'dialogUrl' => XenForo_Link::buildPublicLink('gallery/editor', null, array('type' => 'content', 'time' => $time)));
         }
     }
 }
開發者ID:Sywooch,項目名稱:forums,代碼行數:21,代碼來源:Listener.php


注:本文中的XenForo_View::createOwnTemplateObject方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。