OSDN Git Service

初回コミット(v2.6.17.1)
[magic3/magic3.git] / widgets / s / jquery_footer / include / container / s_jquery_footerWidgetContainer.php
1 <?php
2 /**
3  * index.php用コンテナクラス
4  *
5  * PHP versions 5
6  *
7  * LICENSE: This source file is licensed under the terms of the GNU General Public License.
8  *
9  * @package    Magic3 Framework
10  * @author     平田直毅(Naoki Hirata) <naoki@aplo.co.jp>
11  * @copyright  Copyright 2006-2012 Magic3 Project.
12  * @license    http://www.gnu.org/copyleft/gpl.html  GPL License
13  * @version    SVN: $Id: s_jquery_footerWidgetContainer.php 4633 2012-01-30 13:01:53Z fishbone $
14  * @link       http://www.magic3.org
15  */
16 require_once($gEnvManager->getContainerPath() . '/baseWidgetContainer.php');
17
18 class s_jquery_footerWidgetContainer extends BaseWidgetContainer
19 {
20         const DEFAULT_CONFIG_ID = 0;
21         const DEFAULT_TITLE = 'jQueryページ専用フッタ';                 // デフォルトのウィジェットタイトル
22         
23         /**
24          * コンストラクタ
25          */
26         function __construct()
27         {
28                 // 親クラスを呼び出す
29                 parent::__construct();
30         }
31         /**
32          * テンプレートファイルを設定
33          *
34          * _assign()でデータを埋め込むテンプレートファイルのファイル名を返す。
35          * 読み込むディレクトリは、「自ウィジェットディレクトリ/include/template」に固定。
36          *
37          * @param RequestManager $request               HTTPリクエスト処理クラス
38          * @param object         $param                 任意使用パラメータ。そのまま_assign()に渡る
39          * @return string                                               テンプレートファイル名。テンプレートライブラリを使用しない場合は空文字列「''」を返す。
40          */
41         function _setTemplate($request, &$param)
42         {
43                 return 'index.tmpl.html';
44         }
45         /**
46          * テンプレートにデータ埋め込む
47          *
48          * _setTemplate()で指定したテンプレートファイルにデータを埋め込む。
49          *
50          * @param RequestManager $request               HTTPリクエスト処理クラス
51          * @param object         $param                 任意使用パラメータ。_setTemplate()と共有。
52          * @param                                                               なし
53          */
54         function _assign($request, &$param)
55         {
56                 // 定義ID取得
57                 $configId = $this->gEnv->getCurrentWidgetConfigId();
58                 if (empty($configId)) $configId = self::DEFAULT_CONFIG_ID;
59                 
60                 // パラメータオブジェクトを取得
61                 $targetObj = $this->getWidgetParamObjByConfigId($configId);
62                 if (!empty($targetObj)){                // 定義データが取得できたとき
63                         $name           = $targetObj->name;// 定義名
64                         $content        = $targetObj->content;          // タグ内容
65
66                         // 表示データ埋め込み
67                         $this->tmpl->addVar("_widget", "content",       $content);
68                 }
69         }
70         /**
71          * ウィジェットのタイトルを設定
72          *
73          * @param RequestManager $request               HTTPリクエスト処理クラス
74          * @param object         $param                 任意使用パラメータ。そのまま_assign()に渡る
75          * @return string                                               ウィジェットのタイトル名
76          */
77         function _setTitle($request, &$param)
78         {
79                 return self::DEFAULT_TITLE;
80         }
81 }
82 ?>