OSDN Git Service

初回コミット(v2.6.17.1)
[magic3/magic3.git] / widgets / image2 / include / container / admin_image2WidgetContainer.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-2009 Magic3 Project.
12  * @license    http://www.gnu.org/copyleft/gpl.html  GPL License
13  * @version    SVN: $Id: admin_image2WidgetContainer.php 2268 2009-08-31 03:29:18Z fishbone $
14  * @link       http://www.magic3.org
15  */
16 require_once($gEnvManager->getContainerPath() . '/baseAdminWidgetContainer.php');
17 require_once($gEnvManager->getCurrentWidgetDbPath() . '/image2Db.php');
18
19 class admin_image2WidgetContainer extends BaseAdminWidgetContainer
20 {
21         private $db;    // DB接続オブジェクト
22         private $sysDb; // DB接続オブジェクト
23         private $serialNo;              // 選択中の項目のシリアル番号
24         private $serialArray = array();                 // 表示中のシリアル番号
25         private $langId;
26         private $configId;              // 定義ID
27         private $paramObj;              // パラメータ保存用オブジェクト
28         const DEFAULT_NAME_HEAD = '名称未設定';                    // デフォルトの設定名
29         
30         /**
31          * コンストラクタ
32          */
33         function __construct()
34         {
35                 // 親クラスを呼び出す
36                 parent::__construct();
37                 
38                 // DBオブジェクト作成
39                 $this->db = new image2Db();
40                 $this->sysDb = $this->gInstance->getSytemDbObject();
41         }
42         /**
43          * テンプレートファイルを設定
44          *
45          * _assign()でデータを埋め込むテンプレートファイルのファイル名を返す。
46          * 読み込むディレクトリは、「自ウィジェットディレクトリ/include/template」に固定。
47          *
48          * @param RequestManager $request               HTTPリクエスト処理クラス
49          * @param object         $param                 任意使用パラメータ。そのまま_assign()に渡る
50          * @return string                                               テンプレートファイル名。テンプレートライブラリを使用しない場合は空文字列「''」を返す。
51          */
52         function _setTemplate($request, &$param)
53         {
54                 $task = $request->trimValueOf('task');
55                 if ($task == 'list'){           // 一覧画面
56                         return 'admin_list.tmpl.html';
57                 } else {                        // 一覧画面
58                         return 'admin.tmpl.html';
59                 }
60         }
61         /**
62          * テンプレートにデータ埋め込む
63          *
64          * _setTemplate()で指定したテンプレートファイルにデータを埋め込む。
65          *
66          * @param RequestManager $request               HTTPリクエスト処理クラス
67          * @param object         $param                 任意使用パラメータ。_setTemplate()と共有。
68          * @param                                                               なし
69          */
70         function _assign($request, &$param)
71         {
72                 $task = $request->trimValueOf('task');
73                 if ($task == 'list'){           // 一覧画面
74                         return $this->createList($request);
75                 } else {                        // 詳細設定画面
76                         return $this->createDetail($request);
77                 }
78         }
79         /**
80          * 詳細画面作成
81          *
82          * @param RequestManager $request               HTTPリクエスト処理クラス
83          * @param                                                               なし
84          */
85         function createDetail($request)
86         {
87                 // ページ定義IDとページ定義のレコードシリアル番号を取得
88                 $this->startPageDefParam($defSerial, $defConfigId, $this->paramObj);
89                 
90                 $userId         = $this->gEnv->getCurrentUserId();
91                 $this->langId   = $this->gEnv->getCurrentLanguage();            // 表示言語を取得
92                 $act = $request->trimValueOf('act');
93                 $this->serialNo = $request->trimValueOf('serial');              // 選択項目のシリアル番号
94                 $this->configId = $request->trimValueOf('item_id');             // 定義ID
95                 if (empty($this->configId)) $this->configId = $defConfigId;             // 呼び出しウィンドウから引き継いだ定義ID
96                 
97                 // 入力値を取得
98                 $name   = $request->trimValueOf('item_name');                   // 定義名
99                 $imageUrl       = $request->trimValueOf('item_image_url');                                                      // 画像へのパス
100                 $linkUrl        = $request->trimValueOf('item_link_url');                       // リンク先
101                 $align          = $request->trimValueOf('item_align');                  // 表示位置
102                 $bgcolor = $request->trimValueOf('item_bgcolor');               // 画像バックグランドカラー
103                 $width  = $request->trimValueOf('item_width');          // 画像の幅
104                 $height = $request->trimValueOf('item_height');         // 画像の高さ
105                 $margin = $request->trimValueOf('item_margin');         // 画像マージン
106                 $widthType      = $request->trimValueOf('item_widthtype');              // 画像の幅単位
107                 $heightType     = $request->trimValueOf('item_heighttype');             // 画像の高さ単位
108                 $posx   = $request->trimValueOf('item_posx');           // x座標
109                 $posy   = $request->trimValueOf('item_posy');           // y座標
110                 $posxType       = $request->trimValueOf('item_posxtype');               // x座標単位
111                 $posyType       = $request->trimValueOf('item_posytype');               // y座標単位
112                 $posType        = $request->trimValueOf('item_postype');                // 座標指定方法
113                 $usePos = ($request->trimValueOf('item_use_pos') == 'on') ? 1 : 0;                      // 座標指定を可能とするかどうか
114                 $useLink        = ($request->trimValueOf('item_use_link') == 'on') ? 1 : 0;                     // 画像にリンクを付けるかどうか
115                 
116                 $replaceNew = false;            // データを再取得するかどうか
117                 if ($act == 'add'){// 新規追加
118                         // 入力チェック
119                         $this->checkInput($name, '名前');
120                         $this->checkNumeric($width, '画像の幅', true);
121                         $this->checkNumeric($height, '画像の高さ', true);
122                         $this->checkNumeric($margin, '画像マージン', true);
123                         
124                         // 設定名の重複チェック
125                         for ($i = 0; $i < count($this->paramObj); $i++){
126                                 $targetObj = $this->paramObj[$i]->object;
127                                 if ($name == $targetObj->name){         // 定義名
128                                         $this->setUserErrorMsg('名前が重複しています');
129                                         break;
130                                 }
131                         }
132                         
133                         // エラーなしの場合は、データを登録
134                         if ($this->getMsgCount() == 0){
135                                 // パスをマクロ形式に変換
136                                 if (!empty($imageUrl)) $imageUrl = $this->gEnv->getMacroPath($imageUrl);
137                                 
138                                 // 追加オブジェクト作成
139                                 $newObj = new stdClass;
140                                 $newObj->name   = $name;// 表示名
141                                 $newObj->imageUrl       = $imageUrl;                                                    // 画像へのパス
142                                 $newObj->linkUrl        = $linkUrl;                     // リンク先
143                                 $newObj->align          = $align;                       // 表示位置
144                                 $newObj->bgcolor        = $bgcolor;             // 画像バックグランドカラー
145                                 $newObj->width          = $width;               // 画像の幅
146                                 $newObj->height         = $height;              // 画像の高さ
147                                 $newObj->margin         = $margin;              // 画像マージン
148                                 $newObj->widthType      = $widthType;           // 画像の幅単位
149                                 $newObj->heightType     = $heightType;          // 画像の高さ単位
150                                 $newObj->posx           = $posx;                // x座標
151                                 $newObj->posy           = $posy;                // y座標
152                                 $newObj->posxType       = $posxType;            // x座標単位
153                                 $newObj->posyType       = $posyType;            // y座標単位
154                                 $newObj->posType        = $posType;             // 座標指定方法(相対座標)
155                                 $newObj->usePos         = $usePos;                      // 座標指定を可能とするかどうか
156                                 $newObj->useLink        = $useLink;                     // 画像にリンクを付けるかどうか
157                                 
158                                 $ret = $this->addPageDefParam($defSerial, $defConfigId, $this->paramObj, $newObj);
159                                 if ($ret){
160                                         $this->setGuidanceMsg('データを追加しました');
161                                         
162                                         $this->configId = $defConfigId;         // 定義定義IDを更新
163                                         $replaceNew = true;                     // データ再取得
164                                 } else {
165                                         $this->setAppErrorMsg('データ追加に失敗しました');
166                                 }
167                         }
168                 } else if ($act == 'update'){           // 設定更新のとき
169                         // 入力値のエラーチェック
170                         $this->checkNumeric($width, '画像の幅', true);
171                         $this->checkNumeric($height, '画像の高さ', true);
172                         $this->checkNumeric($margin, '画像マージン', true);
173                         
174                         if ($this->getMsgCount() == 0){                 // エラーのないとき
175                                 // パスをマクロ形式に変換
176                                 if (!empty($imageUrl)) $imageUrl = $this->gEnv->getMacroPath($imageUrl);
177                                 
178                                 // 現在の設定値を取得
179                                 $ret = $this->getPageDefParam($defSerial, $defConfigId, $this->paramObj, $this->configId, $targetObj);
180                                 if ($ret){
181                                         // ウィジェットオブジェクト更新
182                                         $targetObj->imageUrl = $imageUrl;                                                       // 画像へのパス
183                                         $targetObj->linkUrl = $linkUrl;                 // リンク先
184                                         $targetObj->align       = $align;                       // 表示位置
185                                         $targetObj->bgcolor = $bgcolor;         // 画像バックグランドカラー
186                                         $targetObj->width = $width;             // 画像の幅
187                                         $targetObj->height = $height;           // 画像の高さ
188                                         $targetObj->margin      = $margin;              // 画像マージン
189                                         $targetObj->widthType = $widthType;             // 画像の幅単位
190                                         $targetObj->heightType = $heightType;           // 画像の高さ単位
191                                         $targetObj->posx = $posx;               // x座標
192                                         $targetObj->posy = $posy;               // y座標
193                                         $targetObj->posxType = $posxType;               // x座標単位
194                                         $targetObj->posyType = $posyType;               // y座標単位
195                                         $targetObj->posType = $posType;         // 座標指定方法(相対座標)
196                                         $targetObj->imageType = $imageType;             // 画像のタイプ(0=メニューから選択、1=直接指定)
197                                         $targetObj->usePos = $usePos;                   // 座標指定を可能とするかどうか
198                                         $targetObj->useLink = $useLink;                 // 画像にリンクを付けるかどうか
199                                 }
200                                 
201                                 // 設定値を更新
202                                 if ($ret) $ret = $this->updatePageDefParam($defSerial, $defConfigId, $this->paramObj, $this->configId, $targetObj);
203                                 if ($ret){
204                                         $this->setMsg(self::MSG_GUIDANCE, 'データを更新しました');
205                                         $replaceNew = true;                     // データ再取得
206                                 } else {
207                                         $this->setMsg(self::MSG_APP_ERR, 'データ更新に失敗しました');
208                                 }
209                         }
210                 } else if ($act == 'select'){   // 定義IDを変更
211                         $replaceNew = true;                     // データ再取得
212                 } else {        // 初期起動時、または上記以外の場合
213                         // デフォルト値設定
214                         $this->configId = $defConfigId;         // 呼び出しウィンドウから引き継いだ定義ID
215                         $replaceNew = true;                     // データ再取得
216                 }
217                 // 設定項目選択メニュー作成
218                 $this->createItemMenu();
219                                 
220                 // 表示用データを取得
221                 if (empty($this->configId)){            // 新規登録の場合
222                         $this->tmpl->setAttribute('item_name_visible', 'visibility', 'visible');// 名前入力フィールド表示
223                         if ($replaceNew){               // データ再取得時
224                                 $name = $this->createDefaultName();                     // デフォルト登録項目名
225                                 $imageUrl       = '';                                                   // 画像へのパス
226                                 $linkUrl        = '';                   // リンク先
227                                 $align          = '';                   // 表示位置
228                                 $bgcolor        = '';           // 画像バックグランドカラー
229                                 $width          = 0;            // 画像の幅
230                                 $height         = 0;            // 画像の高さ
231                                 $margin         = 0;            // 画像マージン
232                                 $widthType      = 0;            // 画像の幅単位
233                                 $heightType     = 0;            // 画像の高さ単位
234                                 $posx           = 0;            // x座標
235                                 $posy           = 0;            // y座標
236                                 $posxType       = 0;            // x座標単位
237                                 $posyType       = 0;            // y座標単位
238                                 $posType        = 'relative';           // 座標指定方法(相対座標)
239                                 $usePos         = 0;                    // 座標指定を可能とするかどうか
240                                 $useLink        = 0;                    // 画像にリンクを付けるかどうか
241                         }
242                         $this->serialNo = 0;
243                 } else {
244                         if ($replaceNew){// データ再取得時
245                                 $ret = $this->getPageDefParam($defSerial, $defConfigId, $this->paramObj, $this->configId, $targetObj);
246                                 if ($ret){
247                                         $name           = $targetObj->name;// 名前
248                                         $imageUrl       = $targetObj->imageUrl;                                                 // 画像へのパス
249                                         $linkUrl        = $targetObj->linkUrl;                  // リンク先
250                                         $align          = $targetObj->align;                    // 表示位置
251                                         $bgcolor        = $targetObj->bgcolor;          // 画像バックグランドカラー
252                                         $width          = $targetObj->width;            // 画像の幅
253                                         $height         = $targetObj->height;           // 画像の高さ
254                                         $margin         = $targetObj->margin;           // 画像マージン
255                                         $widthType      = $targetObj->widthType;                // 画像の幅単位
256                                         $heightType     = $targetObj->heightType;               // 画像の高さ単位
257                                         $posx           = $targetObj->posx;             // x座標
258                                         $posy           = $targetObj->posy;             // y座標
259                                         $posxType       = $targetObj->posxType;         // x座標単位
260                                         $posyType       = $targetObj->posyType;         // y座標単位
261                                         $posType        = $targetObj->posType;          // 座標指定方法(相対座標)
262                                         $usePos         = $targetObj->usePos;                   // 座標指定を可能とするかどうか
263                                         $useLink        = $targetObj->useLink;                  // 画像にリンクを付けるかどうか
264                                 }
265                         }
266                         $this->serialNo = $this->configId;
267                                 
268                         // 新規作成でないときは、メニューを変更不可にする(画面作成から呼ばれている場合のみ)
269                         if (!empty($defConfigId) && !empty($defSerial)) $this->tmpl->addVar("_widget", "id_disabled", 'disabled');
270                 }
271
272                 // 画像のパスを修正
273                 if (!empty($imageUrl)){
274                         $imageUrl = str_replace(M3_TAG_START . M3_TAG_MACRO_ROOT_URL . M3_TAG_END, $this->gEnv->getRootUrl(), $imageUrl);
275                 }
276                 
277                 // 画面にデータを埋め込む
278                 if (!empty($this->configId)) $this->tmpl->addVar("_widget", "id", $this->configId);             // 定義ID
279                 $this->tmpl->addVar("item_name_visible", "name",        $name);
280                 $this->tmpl->addVar("_widget", "link_url",      $this->getUrl($linkUrl));// リンク先
281                 $this->tmpl->addVar("_widget", "bgcolor", $bgcolor);
282                 $this->tmpl->addVar("_widget", "width", $width);
283                 $this->tmpl->addVar("_widget", "height",        $height);
284                 $this->tmpl->addVar("_widget", "margin",        $margin);
285                 $this->tmpl->addVar("_widget", "posx",  $posx);// x座標
286                 $this->tmpl->addVar("_widget", "posy",  $posy);// y座標
287                 
288                 // 高さ、幅の単位
289                 if (empty($widthType)){         // ヘッダの幅単位
290                         $this->tmpl->addVar("_widget", "width0_selected",       'selected');
291                 } else {
292                         $this->tmpl->addVar("_widget", "width1_selected",       'selected');
293                 }
294                 if (empty($heightType)){                // ヘッダの高さ単位
295                         $this->tmpl->addVar("_widget", "height0_selected",      'selected');
296                 } else {
297                         $this->tmpl->addVar("_widget", "height1_selected",      'selected');
298                 }
299                 if (empty($posxType)){          // x座標単位
300                         $this->tmpl->addVar("_widget", "posx0_selected",        'selected');
301                 } else {
302                         $this->tmpl->addVar("_widget", "posx1_selected",        'selected');
303                 }
304                 if (empty($posyType)){          // y座標単位
305                         $this->tmpl->addVar("_widget", "posy0_selected",        'selected');
306                 } else {
307                         $this->tmpl->addVar("_widget", "posy1_selected",        'selected');
308                 }
309                 if ($posType == 'relative'){            // 座標の指定方法
310                         $this->tmpl->addVar("_widget", "postype0_selected",     'selected');
311                 } else if ($posType == 'absolute'){
312                         $this->tmpl->addVar("_widget", "postype1_selected",     'selected');
313                 }
314                 if ($align == ''){              // 表示位置
315                         $this->tmpl->addVar("_widget", "align0_selected",       'selected');
316                 } else if ($align == 'left'){
317                         $this->tmpl->addVar("_widget", "align1_selected",       'selected');
318                 } else if ($align == 'center'){
319                         $this->tmpl->addVar("_widget", "align2_selected",       'selected');
320                 } else if ($align == 'right'){
321                         $this->tmpl->addVar("_widget", "align3_selected",       'selected');
322                 }
323                 $this->tmpl->addVar("_widget", "image_url",     $imageUrl);
324                 if ($usePos) $this->tmpl->addVar('_widget', 'use_pos',  'checked');     // 座標指定を可能とするかどうか
325                 if ($useLink) $this->tmpl->addVar('_widget', 'use_link',        'checked');                     // 画像にリンクを付けるかどうか
326                 
327                 // プレビュー作成
328                 $destImg = '';
329                 if (!empty($imageUrl)){
330                         $destImg = '<img id="preview_img" src="' . $this->getUrl($imageUrl) . '"';
331                         if (!empty($width) && $width > 0){
332                                 $destImg .= ' width="' . $width;
333                                 if (!empty($widthType)) $destImg .= '%';
334                                 $destImg .= '"';
335                         }
336                         if (!empty($height) && $height > 0){
337                                 $destImg .= ' height="' . $height;
338                                 if (!empty($heightType)) $destImg .= '%';
339                                 $destImg .= '"';
340                         }
341                         $destImg .= ' />';
342                 }
343                 $this->tmpl->addVar("_widget", "image", $destImg);
344                 
345                 $this->tmpl->addVar("_widget", "serial", $this->serialNo);// 選択中のシリアル番号、IDを設定
346                 
347                 // ボタンの表示制御
348                 if (empty($this->serialNo)){            // 新規追加項目を選択しているとき
349                         $this->tmpl->setAttribute('add_button', 'visibility', 'visible');// 「新規追加」ボタン
350                 } else {
351                         $this->tmpl->setAttribute('update_button', 'visibility', 'visible');// 「更新」ボタン
352                         
353                         // ヘルプの追加
354                         $this->convertHelp('update_button');
355                 }
356                 
357                 // ページ定義IDとページ定義のレコードシリアル番号を更新
358                 $this->endPageDefParam($defSerial, $defConfigId, $this->paramObj);
359         }
360         /**
361          * 選択用メニューを作成
362          *
363          * @return なし                                               
364          */
365         function createItemMenu()
366         {
367                 for ($i = 0; $i < count($this->paramObj); $i++){
368                         $id = $this->paramObj[$i]->id;// 定義ID
369                         $targetObj = $this->paramObj[$i]->object;
370                         $name = $targetObj->name;// 定義名
371                         $selected = '';
372                         if ($this->configId == $id) $selected = 'selected';
373
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          * @param                                                               なし
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                 $this->createItemList();
443                 
444                 $this->tmpl->addVar("_widget", "serial_list", implode($this->serialArray, ','));// 表示項目のシリアル番号を設定
445                 $this->tmpl->addVar('_widget', 'admin_url', $this->gEnv->getDefaultAdminUrl());// 管理者URL
446                 
447                 // ページ定義IDとページ定義のレコードシリアル番号を更新
448                 $this->endPageDefParam($defSerial, $defConfigId, $this->paramObj);
449         }
450         /**
451          * 定義一覧作成
452          *
453          * @return なし                                               
454          */
455         function createItemList()
456         {
457                 for ($i = 0; $i < count($this->paramObj); $i++){
458                         $id                     = $this->paramObj[$i]->id;// 定義ID
459                         $targetObj      = $this->paramObj[$i]->object;
460                         $name = $targetObj->name;// 定義名
461                         $width          = $targetObj->width;            // 画像の幅
462                         $height         = $targetObj->height;           // 画像の高さ
463                         $widthType      = $targetObj->widthType;                // 画像の幅単位
464                         $heightType     = $targetObj->heightType;               // 画像の高さ単位
465                 
466                         // ファイル名取得
467                         $filename = '';
468                         $partArray = explode('/', $targetObj->imageUrl);
469                         if (count($partArray) > 0) $filename = $partArray[count($partArray)-1];
470                 
471                         // 使用数
472                         $defCount = 0;
473                         if (!empty($id)){
474                                 $defCount = $this->sysDb->getPageDefCount($this->gEnv->getCurrentWidgetId(), $id);
475                         }
476                         $operationDisagled = '';
477                         if ($defCount > 0) $operationDisagled = 'disabled';
478                         
479                         // 画像サイズ
480                         $imgWidth = '';
481                         $imgHeight = '';
482                         if (!empty($width) && $width > 0){
483                                 $imgWidth = $width;
484                                 if (!empty($widthType)) $imgWidth .= '%';
485                         }
486                         if (!empty($height) && $height > 0){
487                                 $imgHeight = $height;
488                                 if (!empty($heightType)) $imgHeight .= '%';
489                         }
490                         
491                         // 画像URL
492                         $url = $targetObj->imageUrl;
493                         if (!empty($url)) $url = str_replace(M3_TAG_START . M3_TAG_MACRO_ROOT_URL . M3_TAG_END, $this->gEnv->getRootUrl(), $url);
494                         
495                         $row = array(
496                                 'index' => $i,
497                                 'id' => $id,
498                                 'ope_disabled' => $operationDisagled,                   // 選択可能かどうか
499                                 'name' => $this->convertToDispString($name),            // 名前
500                                 'filename' => $this->convertToDispString($filename),    // ファイル名
501                                 'def_count' => $defCount,                                                       // 使用数
502                                 'width' => $imgWidth,                                   // 画像幅
503                                 'height' => $imgHeight,                                 // 画像高さ
504                                 'url' => $this->getUrl($url)                                    // URL
505                         );
506                         $this->tmpl->addVars('itemlist', $row);
507                         $this->tmpl->parseTemplate('itemlist', 'a');
508                         
509                         // シリアル番号を保存
510                         $this->serialArray[] = $id;
511                 }
512         }
513 }
514 ?>