7 * LICENSE: This source file is licensed under the terms of the GNU General Public License.
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: youtube2WidgetContainer.php 1825 2009-05-02 12:52:51Z fishbone $
14 * @link http://www.magic3.org
16 require_once($gEnvManager->getContainerPath() . '/baseWidgetContainer.php');
18 class youtube2WidgetContainer extends BaseWidgetContainer
20 private $langId; // 現在の言語
21 const DEFAULT_CONFIG_ID = 0;
22 const DEFAULT_TITLE = 'YouTube'; // デフォルトのウィジェットタイトル
27 function __construct()
30 parent::__construct();
35 * _assign()でデータを埋め込むテンプレートファイルのファイル名を返す。
36 * 読み込むディレクトリは、「自ウィジェットディレクトリ/include/template」に固定。
38 * @param RequestManager $request HTTPリクエスト処理クラス
39 * @param object $param 任意使用パラメータ。そのまま_assign()に渡る
40 * @return string テンプレートファイル名。テンプレートライブラリを使用しない場合は空文字列「''」を返す。
42 function _setTemplate($request, &$param)
44 return 'index.tmpl.html';
49 * _setTemplate()で指定したテンプレートファイルにデータを埋め込む。
51 * @param RequestManager $request HTTPリクエスト処理クラス
52 * @param object $param 任意使用パラメータ。_setTemplate()と共有。
55 function _assign($request, &$param)
57 $this->langId = $this->gEnv->getCurrentLanguage();
60 $configId = $this->gEnv->getCurrentWidgetConfigId();
61 if (empty($configId)) $configId = self::DEFAULT_CONFIG_ID;
64 $targetObj = $this->getWidgetParamObjByConfigId($configId);
65 if (!empty($targetObj)){ // 定義データが取得できたとき
66 $name = $targetObj->name;// 定義名
67 $width = $targetObj->width; // 幅
68 $height = $targetObj->height; // 高さ
69 $movieId = $targetObj->movieId; // YouTubeの動画ID
72 $this->tmpl->setAttribute('show_html', 'visibility', 'visible');// 画像を表示
73 $this->tmpl->addVar("show_html", "width", $width);
74 $this->tmpl->addVar("show_html", "height", $height);
75 $this->tmpl->addVar("show_html", "movie_id", $movieId);
81 * @param RequestManager $request HTTPリクエスト処理クラス
82 * @param object $param 任意使用パラメータ。そのまま_assign()に渡る
83 * @return string ウィジェットのタイトル名
85 function _setTitle($request, &$param)
87 return self::DEFAULT_TITLE;