OSDN Git Service

初回コミット(v2.6.17.1)
[magic3/magic3.git] / widgets / s / googlemaps / include / container / admin_s_googlemapsWidgetContainer.php
1 <?php
2 /**
3  * コンテナクラス
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: admin_s_googlemapsWidgetContainer.php 4767 2012-03-19 08:59:10Z fishbone $
14  * @link       http://www.magic3.org
15  */
16 require_once($gEnvManager->getContainerPath() . '/baseAdminWidgetContainer.php');
17
18 class admin_s_googlemapsWidgetContainer extends BaseAdminWidgetContainer
19 {
20         private $serialNo;              // 選択中の項目のシリアル番号
21         private $serialArray = array();                 // 表示中のシリアル番号
22         private $langId;
23         private $configId;              // 定義ID
24         private $paramObj;              // パラメータ保存用オブジェクト
25         const DEFAULT_NAME_HEAD = '名称未設定';                    // デフォルトの設定名
26         const DEFAULT_WIDTH = 320;              // デフォルトの幅
27         const DEFAULT_HEIGHT = 480;             // デフォルトの高さ
28         const CODING_URL = 'http://www.geocoding.jp/';                  // 緯度経度取得用URL
29         const DEFAULT_POS_LAT = '35.594757';                            // デフォルト緯度
30         const DEFAULT_POS_LNG = '139.620739';                   // デフォルト経度
31         const DEFAULT_ZOOM = 13;                        // デフォルトのズームレベル
32         
33         /**
34          * コンストラクタ
35          */
36         function __construct()
37         {
38                 // 親クラスを呼び出す
39                 parent::__construct();
40         }
41         /**
42          * テンプレートファイルを設定
43          *
44          * _assign()でデータを埋め込むテンプレートファイルのファイル名を返す。
45          * 読み込むディレクトリは、「自ウィジェットディレクトリ/include/template」に固定。
46          *
47          * @param RequestManager $request               HTTPリクエスト処理クラス
48          * @param object         $param                 任意使用パラメータ。そのまま_assign()に渡る
49          * @return string                                               テンプレートファイル名。テンプレートライブラリを使用しない場合は空文字列「''」を返す。
50          */
51         function _setTemplate($request, &$param)
52         {
53                 $task = $request->trimValueOf('task');
54                 if ($task == 'list'){           // 一覧画面
55                         return 'admin_list.tmpl.html';
56                 } else {                        // 一覧画面
57                         return 'admin.tmpl.html';
58                 }
59         }
60         /**
61          * テンプレートにデータ埋め込む
62          *
63          * _setTemplate()で指定したテンプレートファイルにデータを埋め込む。
64          *
65          * @param RequestManager $request               HTTPリクエスト処理クラス
66          * @param object         $param                 任意使用パラメータ。_setTemplate()と共有。
67          * @return                                                              なし
68          */
69         function _assign($request, &$param)
70         {
71                 $task = $request->trimValueOf('task');
72                 if ($task == 'list'){           // 一覧画面
73                         return $this->createList($request);
74                 } else {                        // 詳細設定画面
75                         return $this->createDetail($request);
76                 }
77         }
78         /**
79          * 詳細画面作成
80          *
81          * @param RequestManager $request               HTTPリクエスト処理クラス
82          * @return                                                              なし
83          */
84         function createDetail($request)
85         {
86                 // ページ定義IDとページ定義のレコードシリアル番号を取得
87                 $this->startPageDefParam($defSerial, $defConfigId, $this->paramObj);
88                 
89                 $userId         = $this->gEnv->getCurrentUserId();
90                 $this->langId   = $this->gEnv->getCurrentLanguage();            // 表示言語を取得
91                 $act = $request->trimValueOf('act');
92                 $this->serialNo = $request->trimValueOf('serial');              // 選択項目のシリアル番号
93
94                 // 入力値を取得
95                 $name   = $request->trimValueOf('item_name');                   // ヘッダタイトル
96                 $width  = $request->trimValueOf('item_width');          // ヘッダの幅
97                 $height = $request->trimValueOf('item_height');         // ヘッダの高さ
98                 $lat    = $request->trimValueOf('item_lat');            // 緯度
99                 $lng    = $request->trimValueOf('item_lng');            // 経度
100                 $markerLat      = $request->trimValueOf('item_marker_lat');             // マーカー緯度
101                 $markerLng      = $request->trimValueOf('item_marker_lng');             // マーカー経度
102                 $infoLat        = $request->trimValueOf('item_info_lat');               // 吹き出し緯度
103                 $infoLng        = $request->trimValueOf('item_info_lng');               // 吹き出し経度
104                 $zoom   = $request->trimValueOf('item_zoom');           // ズームレベル
105                 $infoContent    = $request->valueOf('item_info_content');               // 吹き出し内容
106                 $infoContent = str_replace(array("\r", "\n", "\t"), '', $infoContent);          // 改行、タブ削除
107                 $showMarker = ($request->trimValueOf('item_show_marker') == 'on') ? 1 : 0;              // マーカーを表示するかどうか
108                 $showPosControl = ($request->trimValueOf('item_pos_control') == 'on') ? 1 : 0;          // 位置コントローラを表示するかどうか
109                 $showTypeControl = ($request->trimValueOf('item_type_control') == 'on') ? 1 : 0;                // 地図タイプコントローラを表示するかどうか
110                 $showInfo = ($request->trimValueOf('item_show_info') == 'on') ? 1 : 0;          // 吹き出しを表示するかどうか
111                 
112                 $this->configId = $request->trimValueOf('item_id');             // 定義ID
113                 if (empty($this->configId)) $this->configId = $defConfigId;             // 呼び出しウィンドウから引き継いだ定義ID
114                 
115                 $replaceNew = false;            // データを再取得するかどうか
116                 if (empty($act)){// 初期起動時
117                         // デフォルト値設定
118                         $this->configId = $defConfigId;         // 呼び出しウィンドウから引き継いだ定義ID
119                         $replaceNew = true;                     // データ再取得
120                 } else if ($act == 'add'){// 新規追加
121                         // 入力チェック
122                         $this->checkInput($name, '名前');
123                         $this->checkNumeric($width, '幅');
124                         $this->checkNumeric($height, '高さ');
125                         $this->checkNumber($lat, '緯度');
126                         $this->checkNumber($lng, '経度');
127                         $this->checkNumber($zoom, 'ズームレベル');
128                         if ($showMarker){                       // マーカーを表示するかどうか
129                                 $this->checkNumber($markerLat, 'マーカー緯度');
130                                 $this->checkNumber($markerLng, 'マーカー経度');
131                         } else {
132                                 $this->checkNumber($markerLat, 'マーカー緯度', true);
133                                 $this->checkNumber($markerLng, 'マーカー経度', true);
134                         }
135                         if ($showInfo){         // 吹き出しを表示するかどうか
136                                 $this->checkNumber($infoLat, '吹き出し緯度');
137                                 $this->checkNumber($infoLng, '吹き出し経度');
138                         } else {
139                                 $this->checkNumber($infoLat, '吹き出し緯度', true);
140                                 $this->checkNumber($infoLng, '吹き出し経度', true);
141                         }
142                         
143                         // 設定名の重複チェック
144                         for ($i = 0; $i < count($this->paramObj); $i++){
145                                 $targetObj = $this->paramObj[$i]->object;
146                                 if ($name == $targetObj->name){         // 定義名
147                                         $this->setUserErrorMsg('名前が重複しています');
148                                         break;
149                                 }
150                         }
151                         
152                         // エラーなしの場合は、データを登録
153                         if ($this->getMsgCount() == 0){
154                                 // 追加オブジェクト作成
155                                 $newObj = new stdClass;
156                                 $newObj->name   = $name;        // 表示名
157                                 $newObj->width  = $width;               // 幅
158                                 $newObj->height = $height;              // 高さ
159                                 $newObj->lat    = $lat;         // 緯度
160                                 $newObj->lng    = $lng;         // 経度
161                                 $newObj->markerLat      = $markerLat;           // マーカー緯度
162                                 $newObj->markerLng      = $markerLng;           // マーカー経度
163                                 $newObj->infoLat        = $infoLat;             // 吹き出し緯度
164                                 $newObj->infoLng        = $infoLng;             // 吹き出し経度
165                                 
166                                 $newObj->zoom   = $zoom;                // ズームレベル
167                                 $newObj->infoContent    = $infoContent;         // 吹き出し内容
168                                 $newObj->showMarker = $showMarker;              // マーカーを表示するかどうか
169                                 $newObj->showPosControl = $showPosControl;              // 位置コントローラを表示するかどうか
170                                 $newObj->showTypeControl = $showTypeControl;            // 地図タイプコントローラを表示するかどうか
171                                 $newObj->showInfo = $showInfo;                  // 吹き出しを表示するかどうか
172                                 
173                                 $ret = $this->addPageDefParam($defSerial, $defConfigId, $this->paramObj, $newObj);
174                                 
175                                 if ($ret){
176                                         $this->setGuidanceMsg('データを追加しました');
177                                         
178                                         $this->configId = $defConfigId;         // 定義定義IDを更新
179                                         $replaceNew = true;                     // データ再取得
180                                 } else {
181                                         $this->setAppErrorMsg('データ追加に失敗しました');
182                                 }
183                         }
184                 } else if ($act == 'update'){           // 設定更新のとき
185                         // 入力値のエラーチェック
186                         $this->checkNumeric($width, '幅');
187                         $this->checkNumeric($height, '高さ');
188                         $this->checkNumber($lat, '緯度');
189                         $this->checkNumber($lng, '経度');
190                         $this->checkNumber($zoom, 'ズームレベル');
191                         if ($showMarker){                       // マーカーを表示するかどうか
192                                 $this->checkNumber($markerLat, 'マーカー緯度');
193                                 $this->checkNumber($markerLng, 'マーカー経度');
194                         } else {
195                                 $this->checkNumber($markerLat, 'マーカー緯度', true);
196                                 $this->checkNumber($markerLng, 'マーカー経度', true);
197                         }
198                         if ($showInfo){         // 吹き出しを表示するかどうか
199                                 $this->checkNumber($infoLat, '吹き出し緯度');
200                                 $this->checkNumber($infoLng, '吹き出し経度');
201                         } else {
202                                 $this->checkNumber($infoLat, '吹き出し緯度', true);
203                                 $this->checkNumber($infoLng, '吹き出し経度', true);
204                         }
205                         
206                         if ($this->getMsgCount() == 0){                 // エラーのないとき
207                                 // 現在の設定値を取得
208                                 $ret = $this->getPageDefParam($defSerial, $defConfigId, $this->paramObj, $this->configId, $targetObj);
209                                 if ($ret){
210                                         // ウィジェットオブジェクト更新
211                                         $targetObj->width       = $width;               // ヘッダの幅
212                                         $targetObj->height      = $height;              // ヘッダの高さ
213                                         $targetObj->lat         = $lat;         // 緯度
214                                         $targetObj->lng         = $lng;         // 経度
215                                         $targetObj->markerLat           = $markerLat;           // マーカー緯度
216                                         $targetObj->markerLng           = $markerLng;           // マーカー経度
217                                         $targetObj->infoLat     = $infoLat;             // 吹き出し緯度
218                                         $targetObj->infoLng     = $infoLng;             // 吹き出し経度
219                                         $targetObj->zoom        = $zoom;                // ズームレベル
220                                         $targetObj->infoContent = $infoContent;         // 吹き出し内容
221                                         $targetObj->showMarker = $showMarker;           // マーカーを表示するかどうか
222                                         $targetObj->showPosControl = $showPosControl;           // 位置コントローラを表示するかどうか
223                                         $targetObj->showTypeControl = $showTypeControl;         // 地図タイプコントローラを表示するかどうか
224                                         $targetObj->showInfo = $showInfo;                       // 吹き出しを表示するかどうか
225                                 }
226                                 
227                                 // 設定値を更新
228                                 if ($ret) $ret = $this->updatePageDefParam($defSerial, $defConfigId, $this->paramObj, $this->configId, $targetObj);
229                                 
230                                 if ($ret){
231                                         $this->setMsg(self::MSG_GUIDANCE, 'データを更新しました');
232                                         
233                                         $replaceNew = true;                     // データ再取得
234                                 } else {
235                                         $this->setMsg(self::MSG_APP_ERR, 'データ更新に失敗しました');
236                                 }
237                         }
238                 } else if ($act == 'select'){   // 定義IDを変更
239                         $replaceNew = true;                     // データ再取得
240                 }
241                 
242                 // 設定項目選択メニュー作成
243                 $this->createItemMenu();
244                 
245                 // 表示用データを取得
246                 if (empty($this->configId)){            // 新規登録の場合
247                         $this->tmpl->setAttribute('item_name_visible', 'visibility', 'visible');// 名前入力フィールド表示
248                         if ($replaceNew){               // データ再取得時
249                                 $name = $this->createDefaultName();                     // デフォルト登録項目名
250                                 $width  = self::DEFAULT_WIDTH;          // 幅
251                                 $height = self::DEFAULT_HEIGHT;         // 高さ
252                                 $lat    = self::DEFAULT_POS_LAT;                // 緯度
253                                 $lng    = self::DEFAULT_POS_LNG;                // 経度
254                                 $markerLat      = self::DEFAULT_POS_LAT;                // マーカー緯度
255                                 $markerLng      = self::DEFAULT_POS_LNG;                // マーカー経度
256                                 $infoLat        = self::DEFAULT_POS_LAT;                // 吹き出し緯度
257                                 $infoLng        = self::DEFAULT_POS_LNG;                // 吹き出し経度
258                                 $zoom   = self::DEFAULT_ZOOM;           // ズームレベル
259                                 $infoContent = '';              // 吹き出し内容
260                                 $showMarker = 0;                // マーカーを表示するかどうか
261                                 $showPosControl = 1;            // 位置コントローラを表示するかどうか
262                                 $showTypeControl = 1;           // 地図タイプコントローラを表示するかどうか
263                                 $showInfo = 0;                  // 吹き出しを表示するかどうか
264                         }
265                         $this->serialNo = 0;
266                 } else {
267                         if ($replaceNew){
268                                 $ret = $this->getPageDefParam($defSerial, $defConfigId, $this->paramObj, $this->configId, $targetObj);
269                                 if ($ret){
270                                         $name = $targetObj->name;// 名前
271                                         $width  = $targetObj->width;            // 幅
272                                         $height = $targetObj->height;           // 高さ
273                                         $lat    = $targetObj->lat;              // 緯度
274                                         $lng    = $targetObj->lng;              // 経度
275                                         $markerLat      = $targetObj->markerLat;                // マーカー緯度
276                                         $markerLng      = $targetObj->markerLng;                // マーカー経度
277                                         $infoLat        = $targetObj->infoLat;          // 吹き出し緯度
278                                         $infoLng        = $targetObj->infoLng;          // 吹き出し経度
279                                         $zoom   = $targetObj->zoom;             // ズームレベル
280                                         $infoContent    = $targetObj->infoContent;              // 吹き出し内容
281                                         $showMarker = $targetObj->showMarker;           // マーカーを表示するかどうか
282                                         $showPosControl = $targetObj->showPosControl;           // 位置コントローラを表示するかどうか
283                                         $showTypeControl = $targetObj->showTypeControl;         // 地図タイプコントローラを表示するかどうか
284                                         $showInfo               = $targetObj->showInfo;                 // 吹き出しを表示するかどうか
285                                 }
286                         }
287                         $this->serialNo = $this->configId;
288                                 
289                         // 新規作成でないときは、メニューを変更不可にする(画面作成から呼ばれている場合のみ)
290                         if (!empty($defConfigId) && !empty($defSerial)) $this->tmpl->addVar("_widget", "id_disabled", 'disabled');
291                 }
292                 
293                 // プレビュー表示
294                 if (is_numeric($lat) && is_numeric($lng) && is_numeric($zoom)) $this->tmpl->setAttribute('show_script', 'visibility', 'visible');// 緯度経度が入力されている場合
295                 
296                 // 画面にデータを埋め込む
297                 $this->tmpl->addVar("item_name_visible", "name", $name);                // 名前
298                 $this->tmpl->addVar("_widget", "width", $width);
299                 $this->tmpl->addVar("_widget", "height",        $height);
300                 $this->tmpl->addVar("_widget", "lat",   $lat);          // 緯度
301                 $this->tmpl->addVar("_widget", "lng",   $lng);          // 経度
302                 $this->tmpl->addVar("_widget", "zoom",  $zoom);         // ズームレベル
303                 $this->tmpl->addVar("_widget", "info_content",  $this->convertToDispString($infoContent));              // 吹き出し内容
304                 $this->tmpl->addVar("_widget", "marker_lat",    $markerLat);            // マーカー緯度
305                 $this->tmpl->addVar("_widget", "marker_lng",    $markerLng);            // マーカー経度
306                 $this->tmpl->addVar("_widget", "info_lat",      $infoLat);              // 吹き出し緯度
307                 $this->tmpl->addVar("_widget", "info_lng",      $infoLng);              // 吹き出し経度
308                 $this->tmpl->addVar("show_script", "lat",       $lat);          // 緯度
309                 $this->tmpl->addVar("show_script", "lng",       $lng);          // 経度
310                 $this->tmpl->addVar("show_script", "zoom",      $zoom);         // ズームレベル
311                 $this->tmpl->addVar("show_marker", "marker_lat",        $markerLat);            // マーカー緯度
312                 $this->tmpl->addVar("show_marker", "marker_lng",        $markerLng);            // マーカー経度
313                 $this->tmpl->addVar("show_info", "info_lat",    $infoLat);              // 吹き出し緯度
314                 $this->tmpl->addVar("show_info", "info_lng",    $infoLng);              // 吹き出し経度
315                 $this->tmpl->addVar("show_info", "info_content",        addslashes($infoContent));              // 吹き出し内容
316                 
317                 $checked = '';
318                 if ($showMarker){                       // マーカーを表示するかどうか
319                         $checked = 'checked';
320                         
321                         // 緯度経度が入力されている場合はスクリプトを表示
322                         if (is_numeric($markerLat) && is_numeric($markerLng)) $this->tmpl->setAttribute('show_marker', 'visibility', 'visible');// マーカーを表示
323                 }
324                 $this->tmpl->addVar("_widget", "show_marker_checked", $checked);        // マーカーを表示するかどうか
325                 $checked = '';
326                 if ($showPosControl){           // 位置コントローラを表示するかどうか
327                         $checked = 'checked';
328                         $this->tmpl->setAttribute('show_pos_control', 'visibility', 'hidden');// 位置コントローラを表示
329                 }
330                 $this->tmpl->addVar("_widget", "pos_checked", $checked);        // 位置コントローラを表示するかどうか
331                 $checked = '';
332                 if ($showTypeControl){          // 地図タイプコントローラを表示するかどうか
333                         $checked = 'checked';
334                         $this->tmpl->setAttribute('show_type_control', 'visibility', 'hidden');// 地図タイプコントローラを表示
335                 }
336                 $this->tmpl->addVar("_widget", "type_checked", $checked);       // 地図タイプコントローラを表示するかどうか
337                 $checked = '';
338                 if ($showInfo){         // 吹き出しを表示するかどうか
339                         $checked = 'checked';
340                         
341                         // 緯度経度が入力されている場合はスクリプトを表示
342                         if (is_numeric($infoLat) && is_numeric($infoLng)) $this->tmpl->setAttribute('show_info', 'visibility', 'visible');// 吹き出しを表示
343                 }
344                 $this->tmpl->addVar("_widget", "show_info_checked", $checked);  // 吹き出しを表示するかどうか
345                 $this->tmpl->addVar("_widget", "coding_url",    self::CODING_URL);              // 緯度経度取得用URL
346                                 
347                 $this->tmpl->addVar("_widget", "serial", $this->serialNo);// 選択中のシリアル番号、IDを設定
348                 
349                 // ボタンの表示制御
350                 if (empty($this->serialNo)){            // 新規追加項目を選択しているとき
351                         $this->tmpl->setAttribute('add_button', 'visibility', 'visible');// 「新規追加」ボタン
352                 } else {
353                         $this->tmpl->setAttribute('update_button', 'visibility', 'visible');// 「更新」ボタン
354                 }
355                 // ページ定義IDとページ定義のレコードシリアル番号を更新
356                 $this->endPageDefParam($defSerial, $defConfigId, $this->paramObj);
357         }
358         /**
359          * 選択用メニューを作成
360          *
361          * @return なし                                               
362          */
363         function createItemMenu()
364         {
365                 for ($i = 0; $i < count($this->paramObj); $i++){
366                         $id = $this->paramObj[$i]->id;// 定義ID
367                         $targetObj = $this->paramObj[$i]->object;
368                         $name = $targetObj->name;// 定義名
369                         $selected = '';
370
371                         if (empty($id)) continue;// 定義ID=0は一覧表示しない
372                         
373                         if ($this->configId == $id) $selected = 'selected';
374                         $row = array(
375                                 'name' => $name,                // 名前
376                                 'value' => $id,         // 定義ID
377                                 'selected' => $selected // 選択中の項目かどうか
378                         );
379                         $this->tmpl->addVars('title_list', $row);
380                         $this->tmpl->parseTemplate('title_list', 'a');
381                 }
382         }
383         /**
384          * デフォルトの名前を取得
385          *
386          * @return string       デフォルト名                                              
387          */
388         function createDefaultName()
389         {
390                 $name = self::DEFAULT_NAME_HEAD;
391                 for ($j = 1; $j < 100; $j++){
392                         $name = self::DEFAULT_NAME_HEAD . $j;
393                         // 設定名の重複チェック
394                         for ($i = 0; $i < count($this->paramObj); $i++){
395                                 $targetObj = $this->paramObj[$i]->object;
396                                 if ($name == $targetObj->name){         // 定義名
397                                         break;
398                                 }
399                         }
400                         // 重複なしのときは終了
401                         if ($i == count($this->paramObj)) break;
402                 }
403                 return $name;
404         }
405         /**
406          * 一覧画面作成
407          *
408          * @param RequestManager $request               HTTPリクエスト処理クラス
409          * @return                                                              なし
410          */
411         function createList($request)
412         {
413                 // ページ定義IDとページ定義のレコードシリアル番号を取得
414                 $this->startPageDefParam($defSerial, $defConfigId, $this->paramObj);
415                 
416                 $userId         = $this->gEnv->getCurrentUserId();
417                 $langId = $this->gEnv->getCurrentLanguage();            // 表示言語を取得
418                 $act = $request->trimValueOf('act');
419                 
420                 if ($act == 'delete'){          // メニュー項目の削除
421                         $listedItem = explode(',', $request->trimValueOf('seriallist'));
422                         $delItems = array();
423                         for ($i = 0; $i < count($listedItem); $i++){
424                                 // 項目がチェックされているかを取得
425                                 $itemName = 'item' . $i . '_selected';
426                                 $itemValue = ($request->trimValueOf($itemName) == 'on') ? 1 : 0;
427                                 
428                                 if ($itemValue){                // チェック項目
429                                         $delItems[] = $listedItem[$i];
430                                 }
431                         }
432                         if (count($delItems) > 0){
433                                 $ret = $this->delPageDefParam($defSerial, $defConfigId, $this->paramObj, $delItems);
434                                 if ($ret){              // データ削除成功のとき
435                                         $this->setGuidanceMsg('データを削除しました');
436                                 } else {
437                                         $this->setAppErrorMsg('データ削除に失敗しました');
438                                 }
439                         }
440                 }
441                                         
442                 // 定義一覧作成
443                 $this->createItemList();
444                 
445                 $this->tmpl->addVar("_widget", "serial_list", implode($this->serialArray, ','));// 表示項目のシリアル番号を設定
446                 
447                 // ページ定義IDとページ定義のレコードシリアル番号を更新
448                 $this->endPageDefParam($defSerial, $defConfigId, $this->paramObj);
449         }
450         /**
451          * 定義一覧作成
452          *
453          * @return なし                                               
454          */
455         function createItemList()
456         {
457                 $index = 0;
458                 for ($i = 0; $i < count($this->paramObj); $i++){
459                         $id = $this->paramObj[$i]->id;// 定義ID
460                         $targetObj = $this->paramObj[$i]->object;
461                         $name = $targetObj->name;// 定義名
462                         
463                         if (empty($id)) continue;// 定義ID=0は一覧表示しない
464                         
465                         $defCount = 0;
466                         if (!empty($id)){
467                                 $defCount = $this->_db->getPageDefCount($this->gEnv->getCurrentWidgetId(), $id);
468                         }
469                         $operationDisagled = '';
470                         if ($defCount > 0) $operationDisagled = 'disabled';
471                         
472                         // 値が設定されていないときはデフォルト値を設定
473                         $markerLat = $targetObj->markerLat;
474                         if ($markerLat == '')   $markerLat      = 0;            // マーカー緯度
475                         $markerLng = $targetObj->markerLng;
476                         if ($markerLng == '')   $markerLng      = 0;            // マーカー経度
477                         $infoLat = $targetObj->infoLat;
478                         if ($infoLat == '')             $infoLat        = 0;            // 吹き出し緯度
479                         $infoLng = $targetObj->infoLng;
480                         if ($infoLng == '')             $infoLng        = 0;            // 吹き出し経度
481
482                         $row = array(
483                                 'index' => $index,
484                                 'ope_disabled' => $operationDisagled,                   // 選択可能かどうか
485                                 'name' => $this->convertToDispString($name),            // 名前
486                                 'width' => $targetObj->width,                                   // 動画幅
487                                 'height' => $targetObj->height,                                 // 動画高さ
488                                 'lat' => $targetObj->lat,               // 緯度
489                                 'lng' => $targetObj->lng,               // 経度
490                                 'marker_lat' => $markerLat,             // マーカー緯度
491                                 'marker_lng' => $markerLng,             // マーカー経度
492                                 'info_lat' => $infoLat,         // 吹き出し緯度
493                                 'info_lng' => $infoLng,         // 吹き出し経度
494                                 'zoom' => $targetObj->zoom,             // ズームレベル
495                                 'info_content' => $this->convertToDispString($targetObj->infoContent),          // 吹き出し内容
496                                 'marker' => $targetObj->showMarker,             // マーカーを表示するかどうか
497                                 'info' => $targetObj->showInfo,                 // 吹き出しを表示するかどうか
498                                 'pos_control' => $targetObj->showPosControl,            // 位置コントローラを表示するかどうか
499                                 'type_control' => $targetObj->showTypeControl,          // 地図タイプコントローラを表示するかどうか
500                                 'def_count' => $defCount                                                        // 使用数
501                         );
502                         $this->tmpl->addVars('itemlist', $row);
503                         $this->tmpl->parseTemplate('itemlist', 'a');
504                         
505                         // シリアル番号を保存
506                         $this->serialArray[] = $id;
507                         $index++;               // 項目番号更新
508                 }
509         }
510         /**
511          * JavascriptファイルをHTMLヘッダ部に設定
512          *
513          * JavascriptファイルをHTMLのheadタグ内に追加出力する。
514          * _assign()よりも後に実行される。
515          *
516          * @param RequestManager $request               HTTPリクエスト処理クラス
517          * @param object         $param                 任意使用パラメータ。
518          * @return string                                               Javascriptファイル。出力しない場合は空文字列を設定。
519          */
520         function _addScriptFileToHead($request, &$param)
521         {
522                 $scriptUrl = $this->getUrl('http://maps.google.com/maps/api/js?sensor=false');
523                 return $scriptUrl;
524         }
525 }
526 ?>