OSDN Git Service

初回コミット(v2.6.17.1)
[magic3/magic3.git] / include / container / baseRssContainer.php
1 <?php
2 /**
3  * RSSベースクラス
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-2009 Magic3 Project.
12  * @license    http://www.gnu.org/copyleft/gpl.html  GPL License
13  * @version    SVN: $Id: baseRssContainer.php 2631 2009-12-06 11:04:06Z fishbone $
14  * @link       http://www.magic3.org
15  */
16 require_once($gEnvManager->getContainerPath() . '/baseWidgetContainer.php');
17
18 class BaseRssContainer extends BaseWidgetContainer
19 {
20         /**
21          * コンストラクタ
22          */
23         function __construct()
24         {
25                 // 親クラスを呼び出す
26                 parent::__construct();
27         }
28         /**
29          * 起動マネージャから呼ばれる唯一のメソッド
30          *
31          * @param RequestManager $request               HTTPリクエスト処理クラス
32          * @return                                                              なし
33          */
34         function process($request)
35         {
36                 // ウィジェット単位のアクセス制御
37                 if (method_exists($this, '_checkAccess')){
38                         // アクセス不可のときはここで終了
39                         if (!$this->_checkAccess($request)) return;
40                 }
41                                         
42                 // ディスパッチ処理
43                 if (method_exists($this, '_dispatch')){
44                         // 処理を継続しない場合は終了
45                         if (!$this->_dispatch($request, $param)) return;
46                 }
47                 if (method_exists($this, '_setTemplate')){
48                         // テンプレートファイル名を取得
49                         // $paramは、任意使用パラメータ
50                         $templateFile = $this->_setTemplate($request, $param);
51                         
52                         // テンプレートファイル名が空文字列のときは、テンプレートライブラリを使用しない
53                         if ($templateFile != ''){
54                                 // テンプレートオブジェクト作成
55                                 $this->__setTemplate();
56                                 
57                                 // テンプレートファイルを設定
58                                 $this->tmpl->readTemplatesFromFile($templateFile);
59
60                                 // エラーメッセージ組み込み
61                                 $this->__assign();
62                         }
63                         // 各ウィジェットごとのテンプレート処理、テンプレートを使用しないときは出力処理(Ajax等)
64                         if (method_exists($this, '_preAssign')) $this->_preAssign($request, $param);
65                         
66                         // 各ウィジェットごとのテンプレート処理、テンプレートを使用しないときは出力処理(Ajax等)
67                         if (method_exists($this, '_assign')){
68                                 $this->_assign($request, $param);
69                         }
70                                 
71                         // 各ウィジェットごとのテンプレート処理、テンプレートを使用しないときは出力処理(Ajax等)
72                         if (method_exists($this, '_postAssign')) $this->_postAssign($request, $param);
73                         
74                         // RSSチャンネルデータ設定
75                         if (method_exists($this, '_setRssChannel')){
76                                 $rssData = $this->_setRssChannel($request, $param);
77                                 
78                                 // ヘッダにRSSチャンネルデータを設定
79                                 if (!empty($rssData)) $this->gPage->setRssChannel($rssData);
80                         }
81
82                         if ($templateFile != ''){
83                                 // エラーメッセージ出力
84                                 if ($this->displayMessage) $this->displayMsg();
85         
86                                 // HTML生成
87                                 if (!$this->parseCancel) $this->__parse();
88                         }
89                 } else {        // メソッドが存在しないときはエラーメッセージを出力
90                         echo 'method not found: BaseWidgetContainer::_setTemplate()';
91                 }
92         }
93 }
94 ?>