OSDN Git Service

Themlerテンプレート対応でカテゴリーの説明部分を修正。
authornaoki hirata <naoki@magic3.org>
Wed, 21 Oct 2015 01:35:06 +0000 (10:35 +0900)
committernaoki hirata <naoki@magic3.org>
Wed, 21 Oct 2015 01:35:06 +0000 (10:35 +0900)
include/container/baseWidgetContainer.php
include/mos/JRender.php

index 242877f..b1126d0 100644 (file)
@@ -3597,9 +3597,10 @@ class BaseWidgetContainer extends Core
         * @param int $columnCount                      カラム部(intro部)のカラム数
         * @param string $categoryDesc          カテゴリーの説明
         * @param string $readMoreTitle         「もっと読む」ボタンのタイトル(ウィジェットでのデフォルト値)
+        * @param bool $withDefaultOutput       ウィジェットデフォルト描画出力をカテゴリー説明部に出力するかどうか
         * @return                                      なし
         */
-       function setJoomlaViewData($viewItemsData, $leadContentCount, $columnContentCount, $columnCount, $categoryDesc = '', $readMoreTitle = '')
+       function setJoomlaViewData($viewItemsData, $leadContentCount, $columnContentCount, $columnCount, $categoryDesc = '', $readMoreTitle = '', $withDefaultOutput = false)
        {
                // Joomla!新型テンプレートでない場合は終了
                if ($this->_renderType != M3_RENDER_JOOMLA_NEW) return;
@@ -3613,6 +3614,7 @@ class BaseWidgetContainer extends Core
                $viewData['columnCount']                = $columnCount;                                 // カラム部(intro部)のカラム数
                $viewData['categoryDesc']               = $categoryDesc;                                // カテゴリーの説明
                $viewData['readMoreTitle']              = $readMoreTitle;                               // 「もっと読む」ボタンタイトル
+               if ($withDefaultOutput) $viewData['withDefaultOutput']  = true;                         // ウィジェット出力をカテゴリー説明部に出力するかどうか
                $this->gEnv->setJoomlaViewData($viewData);
        }
        /**
index 8a081f3..189cc20 100644 (file)
@@ -75,7 +75,7 @@ class JRender extends JParameter
        public function getModuleContents($style, $content, $title = '', $attribs = array(), $paramsOther = array(), $pageDefParam = array(), $templateVer = 0)
        {
                global $gEnvManager;
-               
+
                // 必要なスクリプトを読み込む
                $templateId = empty($this->templateId) ? $gEnvManager->getCurrentTemplateId() : $this->templateId;
                $path = $gEnvManager->getTemplatesPath() . '/' . $templateId . '/html/modules.php';             // テンプレート独自の変換処理
@@ -316,12 +316,18 @@ $this->item->title = '****';*/
                                $this->_addHook('loadtemplate.start', array($this, '_loadtemplateStartHook'));
        
                                // ### カテゴリーの情報 ###
+                               // カテゴリー説明を優先
                                $categoryDesc = $viewData['categoryDesc'];
-                               if (!empty(Description)){
+                               if (!empty($categoryDesc)){
                                        // カテゴリーの説明
                                        $this->category = new stdClass;
                                        $this->category->description = $categoryDesc;
                                        $this->params->set('show_description', 1);
+                               } else if ($viewData['withDefaultOutput']){                             // ウィジェット出力をカテゴリー説明部に出力する場合
+                                       // カテゴリーの説明
+                                       $this->category = new stdClass;
+                                       $this->category->description = $content;
+                                       $this->params->set('show_description', 1);
                                }
                                // カテゴリータイトル(サブタイトル)
                                //$this->params->set('show_category_title', 1);