OSDN Git Service

DB更新スクリプト更新。
[magic3/magic3.git] / widgets / m / sample_input / include / container / m_sample_inputWidgetContainer.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-2009 Magic3 Project.
12  * @license    http://www.gnu.org/copyleft/gpl.html  GPL License
13  * @version    SVN: $Id: m_sample_inputWidgetContainer.php 1857 2009-05-06 09:23:04Z fishbone $
14  * @link       http://www.magic3.org
15  */
16 require_once($gEnvManager->getContainerPath()           . '/baseMobileWidgetContainer.php');
17
18 class m_sample_inputWidgetContainer extends BaseMobileWidgetContainer
19 {
20         /**
21          * コンストラクタ
22          */
23         function __construct()
24         {
25                 // 親クラスを呼び出す
26                 parent::__construct();
27         }
28         /**
29          * テンプレートファイルを設定
30          *
31          * _assign()でデータを埋め込むテンプレートファイルのファイル名を返す。
32          * 読み込むディレクトリは、「自ウィジェットディレクトリ/include/template」に固定。
33          *
34          * @param RequestManager $request               HTTPリクエスト処理クラス
35          * @param object         $param                 任意使用パラメータ。そのまま_assign()に渡る
36          * @return string                                               テンプレートファイル名。テンプレートライブラリを使用しない場合は空文字列「''」を返す。
37          */
38         function _setTemplate($request, &$param)
39         {       
40                 return 'index.tmpl.html';
41         }
42         /**
43          * テンプレートにデータ埋め込む
44          *
45          * _setTemplate()で指定したテンプレートファイルにデータを埋め込む。
46          *
47          * @param RequestManager $request               HTTPリクエスト処理クラス
48          * @param object         $param                 任意使用パラメータ。_setTemplate()と共有。
49          * @param                                                               なし
50          */
51         function _assign($request, &$param)
52         {
53                 $msg = '';
54                 $input = $request->mobileTrimValueOf('msg');
55                 if (!empty($input)){
56                         $msg = '送信文字は[' . $input . ']です<br /><br />';
57                 }
58                 
59                 // 入力値を戻す
60                 $this->tmpl->addVar("_widget", "msg", $msg);
61                 $this->tmpl->addVar("_widget", "home_url", $this->gEnv->getDefaultMobileUrl(true));
62                 $url = $this->gEnv->createCurrentPageUrlForMobile();
63                 $this->tmpl->addVar("_widget", "url", $url);
64                 
65                 // 携帯キャリア、機種
66                 $this->tmpl->addVar("_widget", "carrier", $this->agent->getCarrierLongName());
67                 $this->tmpl->addVar("_widget", "type", $this->agent->getModel());
68                 $this->tmpl->addVar("_widget", "serial", $this->gEnv->getMobileId());
69         }
70 }
71 ?>