OSDN Git Service

初回コミット(v2.6.17.1)
[magic3/magic3.git] / widgets / admin_main / include / container / admin_mainSearchwordlogWidgetContainer.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     株式会社 毎日メディアサービス
11  * @copyright  Copyright 2010 株式会社 毎日メディアサービス.
12  * @license    http://www.gnu.org/copyleft/gpl.html  GPL License
13  * @version    SVN: $Id: admin_mainSearchwordlogWidgetContainer.php 5802 2013-03-07 06:14:29Z fishbone $
14  * @link       http://www.m-media.co.jp
15  */
16 require_once($gEnvManager->getCurrentWidgetContainerPath() .    '/admin_mainConditionBaseWidgetContainer.php');
17 require_once($gEnvManager->getCurrentWidgetDbPath() . '/admin_mainDb.php');
18 require_once($gEnvManager->getCurrentWidgetDbPath() . '/admin_serverDb.php');
19
20 class admin_mainSearchwordlogWidgetContainer extends admin_mainConditionBaseWidgetContainer
21 {
22         private $db;    // DB接続オブジェクト
23         private $serverDb;              // DB接続オブジェクト
24         private $sysDb;         // システムDBオブジェクト
25         private $serialNo;      // シリアルNo
26         private $serialArray = array();         // 表示されているコンテンツシリアル番号
27         private $clientIp;                      // クライアントのIPアドレス
28         private $path;                          // アクセスパス
29         private $logOrder;                      // 検索語の表示順
30         private $logOrderArray;         // 検索語の表示順タイプ
31         private $browserIconFile;       // ブラウザアイコンファイル名
32         private $showMessage;           // メッセージ画面かどうか
33         private $message;                       // 表示メッセージ
34         private $server;                        // 指定サーバ
35         private $startNo;                       // 先頭の項目番号
36         const DEFAULT_LIST_COUNT = 30;                  // 最大リスト表示数
37         const MAX_PAGE_COUNT = 20;                              // 最大ページ数
38         const FLAG_ICON_DIR = '/images/system/flag/';           // 国旗アイコンディレクトリ
39         const BROWSER_ICON_DIR = '/images/system/browser/';             // ブラウザアイコンディレクトリ
40         const ICON_SIZE = 16;           // アイコンのサイズ
41 //      const DEFAULT_LOG_LEVEL = '0';          // デフォルトのログレベル
42 //      const DEFAULT_LOG_STATUS = '1';         // デフォルトのログステータス
43         const DEFAULT_LOG_ORDER = '0';          // デフォルトの検索語表示順
44         const DEFAULT_ACCESS_PATH = 'index';            // デフォルトのアクセスパス(PC用アクセスポイント)
45         const ACCESS_PATH_ALL = '_all';                         // アクセスパスすべて選択
46         const ACCESS_PATH_OTHER = '_other';                             // アクセスパスその他
47
48         /**
49          * コンストラクタ
50          */
51         function __construct()
52         {
53                 // 親クラスを呼び出す
54                 parent::__construct();
55                 
56                 // DB接続オブジェクト作成
57                 $this->db = new admin_mainDb();
58                 $this->serverDb = new admin_serverDb();
59                 
60                 // 検索語の表示順タイプ
61                 $this->logOrderArray = array(   array(  'name' => '最新',     'value' => '0'),
62                                                                                 array(  'name' => '頻度高',  'value' => '1'));
63                                                                                 
64                 // ブラウザアイコンファイル名
65                 $this->browserIconFile = array(
66                         'OP' => 'opera.png',    // opera
67                         'IE' => 'ie.png',       // microsoft internet explorer
68                         'NS' => 'netscape.png', // netscape
69                         'GA' => 'galeon.png',   // galeon
70                         'PX' => 'phoenix.png',  // phoenix
71                         'FF' => 'firefox.png',  // firefox
72                         'FB' => 'firebird.png', // mozilla firebird
73                         'SM' => 'seamonkey.png',        // seamonkey
74                         'CA' => 'camino.png',   // camino
75                         'SF' => 'safari.png',   // safari
76                         'CH' => 'chrome.gif',   // chrome
77                         'KM' => 'k-meleon.png', // k-meleon
78                         'MO' => 'mozilla.gif',  // mozilla
79                         'KO' => 'konqueror.png',        // konqueror
80                         'BB' => '',     // blackberry
81                         'IC' => 'icab.png',     // icab
82                         'LX' => '',     // lynx
83                         'LI' => '',     // links
84                         'MC' => '',     // ncsa mosaic
85                         'AM' => '',     // amaya
86                         'OW' => 'omniweb.png',  // omniweb
87                         'HJ' => '',     // hotjava
88                         'BX' => '',     // browsex
89                         'AV' => '',     // amigavoyager
90                         'AW' => '',     // amiga-aweb
91                         'IB' => '',     // ibrowse
92                         'AR' => '',     // arora
93                         'EP' => 'epiphany.png', // epiphany
94                         'FL' => 'flock.png',    // flock
95                         'SL' => 'sleipnir.gif'          ,// sleipnir
96                         'LU' => 'lunascape.gif',        // lunascape
97                         'SH' => 'shiira.gif',           // shiira
98                         'SW' => 'swift.png',    // swift
99                         'PS' => 'playstation.gif',      // playstation portable
100                         'PP' => 'playstation.gif',      // ワイプアウトピュア
101                         'NC' => 'netcaptor.gif',        // netcaptor
102                         'WT' => 'webtv.gif',    // webtv
103                         
104                         // クローラ
105                         'GB' => 'google.gif',   // Google
106                         'MS' => 'msn.gif',      // MSN
107                         'YA' => 'yahoo.gif',    // YahooSeeker
108                         'GO' => 'goo.gif',      // goo
109                         'HT' => 'hatena.gif',   // はてなアンテナ
110                         'NV' => 'naver.gif',    // Naver(韓国)
111                         
112                         // 携帯
113                         'DC' => 'docomo.gif',           // ドコモ
114                         'AU' => 'au.gif',               // au
115                         'SB' => 'softbank.gif',         // ソフトバンク
116                 );
117         }
118         /**
119          * テンプレートファイルを設定
120          *
121          * _assign()でデータを埋め込むテンプレートファイルのファイル名を返す。
122          * 読み込むディレクトリは、「自ウィジェットディレクトリ/include/template」に固定。
123          *
124          * @param RequestManager $request               HTTPリクエスト処理クラス
125          * @param object         $param                 任意使用パラメータ。そのまま_assign()に渡る
126          * @return string                                               テンプレートファイル名。テンプレートライブラリを使用しない場合は空文字列「''」を返す。
127          */
128         function _setTemplate($request, &$param)
129         {
130                 // サーバ指定されている場合は接続先DBを変更
131                 $this->server = $request->trimValueOf(M3_REQUEST_PARAM_SERVER);
132                 if (!empty($this->server)){
133                         // 設定データを取得
134                         $ret = $this->serverDb->getServerById($this->server, $row);
135                         if ($ret){
136                                 $dbDsn = $row['ts_db_connect_dsn'];             // DB接続情報
137                                 $dbAccount = $row['ts_db_account'];     // DB接続アカウント
138                                 $dbPassword = $row['ts_db_password'];// DB接続パスワード
139
140                                 // テスト用DBオブジェクト作成
141                                 $ret = $this->db->openLocalDb($dbDsn, $dbAccount, $dbPassword);// 接続先を変更
142                         }
143                         if (!$ret){             // サーバに接続できない場合
144                                 $this->showMessage = true;              // メッセージ画面かどうか
145                                 $this->message = 'サーバに接続できません';
146                                 return 'message.tmpl.html';
147                         }
148                 }
149                 
150                 $task = $request->trimValueOf('task');
151                 if ($task == 'searchwordlog_detail'){           // 詳細画面
152                         return 'searchwordlog_detail.tmpl.html';
153                 } else {                        // 一覧画面
154                         return 'searchwordlog.tmpl.html';
155                 }
156         }
157         /**
158          * テンプレートにデータ埋め込む
159          *
160          * _setTemplate()で指定したテンプレートファイルにデータを埋め込む。
161          *
162          * @param RequestManager $request               HTTPリクエスト処理クラス
163          * @param object         $param                 任意使用パラメータ。_setTemplate()と共有。
164          * @param                                                               なし
165          */
166         function _assign($request, &$param)
167         {
168                 if ($this->showMessage){                // メッセージ画面かどうか
169                         $this->setMsg(self::MSG_APP_ERR, $this->message);
170                         return;
171                 }
172                 $task = $request->trimValueOf('task');
173                 if ($task == 'searchwordlog_detail'){   // 詳細画面
174                         return $this->createDetail($request);
175                 } else {                        // 一覧画面
176                         return $this->createList($request);
177                 }
178         }
179         /**
180          * 一覧画面作成
181          *
182          * @param RequestManager $request               HTTPリクエスト処理クラス
183          * @param                                                               なし
184          */
185         function createList($request)
186         {
187                 $this->clientIp = $this->gRequest->trimServerValueOf('REMOTE_ADDR');            // クライアントのIPアドレス
188                 $act = $request->trimValueOf('act');
189                 $this->path = $request->trimValueOf('path');            // アクセスパス
190                 if (empty($this->path)) $this->path = self::DEFAULT_ACCESS_PATH;
191                 $this->logOrder = $request->trimValueOf('logorder');// 検索語の表示順
192                 if ($this->logOrder == '') $this->logOrder = self::DEFAULT_LOG_ORDER;
193                 
194                 // 表示条件
195                 $viewCount = $request->trimValueOf('viewcount');// 表示項目数
196                 if ($viewCount == '') $viewCount = self::DEFAULT_LIST_COUNT;                            // 表示項目数
197                 $pageNo = $request->trimValueOf('page');                                // ページ番号
198                 if (empty($pageNo)) $pageNo = 1;
199
200                 // 表示するログのタイプを設定
201                 $pathParam = $this->path;
202                 if ($pathParam == self::ACCESS_PATH_ALL){
203                         $pathParam = NULL;
204                 } else if ($pathParam == self::ACCESS_PATH_OTHER){              // その他のパス
205                         $pathParam = '';
206                 }
207                 switch ($this->logOrder){
208                         case 0:
209                         default:
210                                 $this->tmpl->setAttribute('show_last_log', 'visibility', 'visible');// 最新から検索語を表示
211                                 
212                                 // 総数を取得
213                                 $totalCount = $this->db->getSearchWordLogCount($pathParam);
214                                 break;
215                         case 1:                 // 頻度高
216                                 $this->tmpl->setAttribute('show_sum_log', 'visibility', 'visible');// 検索頻度順に検索語を表示
217                                 
218                                 // 総数を取得
219                                 $totalCount = $this->db->getSearchWordSumCount($pathParam);
220                                 break;
221                 }
222
223                 // 表示するページ番号の修正
224                 $pageCount = (int)(($totalCount -1) / $viewCount) + 1;          // 総ページ数
225                 if ($pageNo < 1) $pageNo = 1;
226                 if ($pageNo > $pageCount) $pageNo = $pageCount;
227                 $startNo = ($pageNo -1) * $viewCount +1;                // 先頭の行番号
228                 $endNo = $pageNo * $viewCount > $totalCount ? $totalCount : $pageNo * $viewCount;// 最後の行番号
229                 $this->startNo = $startNo;                      // 先頭の項目番号
230                 
231                 // ページング用リンク作成
232                 $pageLink = '';
233                 if ($pageCount > 1){    // ページが2ページ以上のときリンクを作成
234                         for ($i = 1; $i <= $pageCount; $i++){
235                                 if ($i > self::MAX_PAGE_COUNT) break;                   // 最大ページ数以上のときは終了
236                                 if ($i == $pageNo){
237                                         $link = '&nbsp;' . $i;
238                                 } else {
239                                         $link = '&nbsp;<a href="#" onclick="selpage(\'' . $i . '\');return false;">' . $i . '</a>';
240                                 }
241                                 $pageLink .= $link;
242                         }
243                 }
244                 
245                 // アクセスパスメニュー、表示順選択メニュー作成
246                 $this->createPathMenu();
247                 $this->createLogOrderMenu();
248                         
249                 $this->tmpl->addVar("_widget", "page_link", $pageLink);
250                 $this->tmpl->addVar("_widget", "total_count", $totalCount);
251                 $this->tmpl->addVar("_widget", "page", $pageNo);        // ページ番号
252                 $this->tmpl->addVar("_widget", "view_count", $viewCount);       // 最大表示項目数
253                 $this->tmpl->addVar("search_range", "start_no", $startNo);
254                 $this->tmpl->addVar("search_range", "end_no", $endNo);
255                 if ($totalCount > 0) $this->tmpl->setAttribute('search_range', 'visibility', 'visible');// 検出範囲を表示
256                 
257                 // アクセスログURL
258                 $accessLogUrl = '?task=accesslog_detail&openby=simple';
259                 if (!empty($this->server)) $accessLogUrl .= '&_server=' . $this->server;
260                 $this->tmpl->addVar("_widget", "access_log_url", $accessLogUrl);
261                 
262                 // 運用ログを取得
263                 switch ($this->logOrder){
264                         case 0:
265                         default:
266                                 $this->db->getSearchWordLogList($viewCount, $pageNo, $pathParam, array($this, 'logListLoop'));
267                                 if (count($this->serialArray) == 0) $this->tmpl->setAttribute('loglist', 'visibility', 'hidden');               // ログがないときは非表示
268                                 
269                                 $this->tmpl->addVar("_widget", "detail_disabled", 'disabled');          // 詳細画面遷移なし
270                                 break;
271                         case 1:                 // 頻度高
272                                 $this->db->getSearchWordSumList($viewCount, $pageNo, $pathParam, array($this, 'logListSumLoop'));
273                                 if (count($this->serialArray) == 0) $this->tmpl->setAttribute('loglist_sum', 'visibility', 'hidden');           // ログがないときは非表示
274                                 break;
275                 }
276                 $this->tmpl->addVar("_widget", "serial_list", implode($this->serialArray, ','));// 表示項目のシリアル番号を設定
277         }
278         /**
279          * 詳細画面作成
280          *
281          * @param RequestManager $request               HTTPリクエスト処理クラス
282          * @return                                                              なし
283          */
284         function createDetail($request)
285         {
286                 $act = $request->trimValueOf('act');
287                 $word = $request->trimValueOf('word');          // 比較語
288                 $this->path = $request->trimValueOf('path');            // アクセスパス
289                 if (empty($this->path)) $this->path = self::DEFAULT_ACCESS_PATH;
290                 $this->logOrder = $request->trimValueOf('logorder');// 検索語の表示順
291                 if ($this->logOrder == '') $this->logOrder = self::DEFAULT_LOG_ORDER;
292                 $savedPageNo = $request->trimValueOf('page');                           // ページ番号
293                 
294                 // 表示条件
295                 $viewCount = $request->trimValueOf('viewcount');// 表示項目数
296                 if ($viewCount == '') $viewCount = self::DEFAULT_LIST_COUNT;                            // 表示項目数
297                 $pageNo = $request->trimValueOf('page_');                               // ページ番号
298                 if (empty($pageNo)) $pageNo = 1;
299                 
300                 // 総数を取得
301                 $pathParam = $this->path;
302                 if ($pathParam == self::ACCESS_PATH_ALL){
303                         $pathParam = NULL;
304                 } else if ($pathParam == self::ACCESS_PATH_OTHER){              // その他のパス
305                         $pathParam = '';
306                 }
307                 $totalCount = $this->db->getSearchWordLogCountByWord($word, $pathParam);
308                                 
309                 // 表示するページ番号の修正
310                 $pageCount = (int)(($totalCount -1) / $viewCount) + 1;          // 総ページ数
311                 if ($pageNo < 1) $pageNo = 1;
312                 if ($pageNo > $pageCount) $pageNo = $pageCount;
313                 $startNo = ($pageNo -1) * $viewCount +1;                // 先頭の行番号
314                 $endNo = $pageNo * $viewCount > $totalCount ? $totalCount : $pageNo * $viewCount;// 最後の行番号
315                 $this->startNo = $startNo;                      // 先頭の項目番号
316                 
317                 // ページング用リンク作成
318                 $pageLink = '';
319                 if ($pageCount > 1){    // ページが2ページ以上のときリンクを作成
320                         for ($i = 1; $i <= $pageCount; $i++){
321                                 if ($i > self::MAX_PAGE_COUNT) break;                   // 最大ページ数以上のときは終了
322                                 if ($i == $pageNo){
323                                         $link = '&nbsp;' . $i;
324                                 } else {
325                                         $link = '&nbsp;<a href="#" onclick="selpage(\'' . $i . '\');return false;">' . $i . '</a>';
326                                 }
327                                 $pageLink .= $link;
328                         }
329                 }
330                         
331                 $this->tmpl->addVar("_widget", "page_link", $pageLink);
332                 $this->tmpl->addVar("_widget", "total_count", $totalCount);
333                 $this->tmpl->addVar("_widget", "page_", $pageNo);       // ページ番号
334                 $this->tmpl->addVar("_widget", "view_count", $viewCount);       // 最大表示項目数
335                 $this->tmpl->addVar("search_range", "start_no", $startNo);
336                 $this->tmpl->addVar("search_range", "end_no", $endNo);
337                 if ($totalCount > 0) $this->tmpl->setAttribute('search_range', 'visibility', 'visible');// 検出範囲を表示
338
339                 // 前ウィンドウから引き継いだパラメータ
340                 $this->tmpl->addVar("_widget", "log_order", $this->logOrder);
341                 $this->tmpl->addVar("_widget", "path", $this->path);
342                 $this->tmpl->addVar("_widget", "compare_word", $word);
343                 $this->tmpl->addVar("_widget", "page", $savedPageNo);
344                 
345                 // アクセスログURL
346                 $accessLogUrl = '?task=accesslog_detail&openby=simple';
347                 if (!empty($this->server)) $accessLogUrl .= '&_server=' . $this->server;
348                 $this->tmpl->addVar("_widget", "access_log_url", $accessLogUrl);
349                 
350                 // 運用ログを取得
351                 $this->db->getSearchWordLogListByWord($word, $viewCount, $pageNo, $pathParam, array($this, 'logListLoop'));
352                 if (count($this->serialArray) == 0) $this->tmpl->setAttribute('loglist', 'visibility', 'hidden');               // ログがないときは非表示
353         }
354         /**
355          * 検索語一覧取得したデータをテンプレートに設定する
356          *
357          * @param int $index                    行番号(0~)
358          * @param array $fetchedRow             フェッチ取得した行
359          * @param object $param                 未使用
360          * @return bool                                 true=処理続行の場合、false=処理終了の場合
361          */
362         function logListLoop($index, $fetchedRow, $param)
363         {
364                 // 先頭の項目番号
365                 $no = $this->startNo + $index;
366                 
367                 // ブラウザ、プラットフォームの情報を取得
368                 $isMobile = false;              // 携帯かどうか
369                 $browserCode = $this->gInstance->getAnalyzeManager()->getBrowserType($fetchedRow['al_user_agent'], $version);
370                 $browserImg = '';
371                 if (!empty($browserCode)){
372                 }
373                 if ($browserCode == 'DC' ||             // ドコモ
374                         $browserCode == 'AU' ||         // au
375                         $browserCode == 'SB'){          // ソフトバンク
376                         $isMobile = true;
377                 }
378                 
379                 // アクセスユーザの国を取得
380                 $countryCode = '';
381                 if (!empty($fetchedRow['al_accept_language'])) $countryCode = $this->gInstance->getAnalyzeManager()->getBrowserCountryCode($fetchedRow['al_accept_language']);
382                 if ($isMobile) $countryCode = 'jp';             // 携帯の場合は日本に設定
383                 
384                 $countryImg = '';
385                 if (!empty($countryCode)){
386                         $iconTitle = $countryCode;
387                         $iconUrl = $this->gEnv->getRootUrl() . self::FLAG_ICON_DIR . $countryCode . '.png';
388                         $countryImg = '<img src="' . $this->getUrl($iconUrl) . '" border="0" alt="' . $iconTitle . '" title="' . $iconTitle . '" />';
389                 }
390                 
391                 // ブラウザ、プラットフォームの情報を取得
392                 $browserCode = $this->gInstance->getAnalyzeManager()->getBrowserType($fetchedRow['al_user_agent'], $version);
393                 $browserImg = '';
394                 if (!empty($browserCode)){
395                         $iconFile = $this->browserIconFile[$browserCode];
396                         if (!empty($iconFile)){
397                                 $iconTitle = $browserCode;
398                                 $iconUrl = $this->gEnv->getRootUrl() . self::BROWSER_ICON_DIR . $iconFile;
399                                 $browserImg = '<img src="' . $this->getUrl($iconUrl) . '" border="0" alt="' . $iconTitle . '" title="' . $iconTitle . '" />';
400                         }
401                 }
402                 // アクセスログ番号
403                 $accessLog = '';
404                 if (!empty($fetchedRow['sw_access_log_serial'])) $accessLog = $this->convertToDispString($fetchedRow['sw_access_log_serial']);
405
406                 $row = array(
407                         'index' => $index,                                                                                                      // 行番号
408                         'no' => $no,                    // シリアル番号
409                         'word' => $this->convertToDispString($fetchedRow['sw_word']),           // 語句
410                         'browser' => $browserImg,               // ブラウザ
411                         'country' => $countryImg,               // 国画像
412                         'access_log' => $accessLog,             // アクセスログ番号
413                         'user' => $this->convertToDispString($fetchedRow['lu_name']),                                                                           // ユーザ
414                         'dt' => $this->convertToDispDateTime($fetchedRow['al_dt']),     // 出力日時
415                         'selected' => $selected                                                                                         // 項目選択用ラジオボタン
416                 );
417                 $this->tmpl->addVars('loglist', $row);
418                 $this->tmpl->parseTemplate('loglist', 'a');
419                 
420                 // 表示中のコンテンツIDを保存
421                 $this->serialArray[] = $fetchedRow['sw_serial'];
422                 return true;
423         }
424         /**
425          * 検索語一覧取得したデータをテンプレートに設定する
426          *
427          * @param int $index                    行番号(0~)
428          * @param array $fetchedRow             フェッチ取得した行
429          * @param object $param                 未使用
430          * @return bool                                 true=処理続行の場合、false=処理終了の場合
431          */
432         function logListSumLoop($index, $fetchedRow, $param)
433         {
434                 // 先頭の項目番号
435                 $no = $this->startNo + $index;
436
437                 // 最新の検索語ログを取得
438                 $word = $fetchedRow['sw_basic_word'];
439                 $ret = $this->db->getSearchWordLogByCompareWord($word, $row);
440                 
441                 $row = array(
442                         'index' => $index,                                                                                                      // 行番号
443                         'no' => $no,                    // シリアル番号
444                         'word' => $this->convertToDispString($row['sw_word']),          // 語句
445                         'compare_word' => $this->convertToDispString($word),            // 比較語
446                         'count' => $this->convertToDispString($fetchedRow['ct']),               // 検索回数
447                         'country' => $countryImg,               // 国画像
448                         'access_log' => $accessLog,             // アクセスログ番号
449                         'user' => $this->convertToDispString($row['lu_name']),                                                                          // ユーザ
450                         'dt' => $this->convertToDispDateTime($row['al_dt']),    // 出力日時
451                         'selected' => $selected                                                                                         // 項目選択用ラジオボタン
452                 );
453                 $this->tmpl->addVars('loglist_sum', $row);
454                 $this->tmpl->parseTemplate('loglist_sum', 'a');
455                 
456                 // 表示中のコンテンツIDを保存
457                 $this->serialArray[] = $no;
458                 return true;
459         }
460         /**
461          * アクセスパスメニュー作成
462          *
463          * @return                                                              なし
464          */
465         function createPathMenu()
466         {
467                 $selected = '';
468                 if ($this->path == self::ACCESS_PATH_ALL){// アクセスパスすべて選択
469                         $selected = 'selected';
470                 }
471                 $row = array(
472                         'value'    => self::ACCESS_PATH_ALL,                    // アクセスパス
473                         'name'     => 'すべて表示',                        // 表示文字列
474                         'selected' => $selected                                                                                                         // 選択中かどうか
475                 );
476                 $this->tmpl->addVars('path_list', $row);
477                 $this->tmpl->parseTemplate('path_list', 'a');
478                 
479                 $this->db->getPageIdList(array($this, 'pageIdLoop'), 0/*ページID*/);
480                 
481                 $selected = '';
482                 if ($this->path == self::ACCESS_PATH_OTHER){// アクセスパスその他
483                         $selected = 'selected';
484                 }
485                 $row = array(
486                         'value'    => self::ACCESS_PATH_OTHER,                  // アクセスパス
487                         'name'     => 'その他',                      // 表示文字列
488                         'selected' => $selected                                                                                                         // 選択中かどうか
489                 );
490                 $this->tmpl->addVars('path_list', $row);
491                 $this->tmpl->parseTemplate('path_list', 'a');
492         }
493         /**
494          * 表示順選択メニュー作成
495          *
496          * @return なし
497          */
498         function createLogOrderMenu()
499         {
500                 for ($i = 0; $i < count($this->logOrderArray); $i++){
501                         $value = $this->logOrderArray[$i]['value'];
502                         $name = $this->logOrderArray[$i]['name'];
503                         
504                         $selected = '';
505                         if ($value == $this->logOrder) $selected = 'selected';
506                         
507                         $row = array(
508                                 'value'    => $value,                   // 表示順
509                                 'name'     => $name,                    // 表示順名
510                                 'selected' => $selected                 // 選択中かどうか
511                         );
512                         $this->tmpl->addVars('logorder_list', $row);
513                         $this->tmpl->parseTemplate('logorder_list', 'a');
514                 }
515         }
516         /**
517          * ページID、取得したデータをテンプレートに設定する
518          *
519          * @param int $index                    行番号(0~)
520          * @param array $fetchedRow             フェッチ取得した行
521          * @param object $param                 未使用
522          * @return bool                                 true=処理続行の場合、false=処理終了の場合
523          */
524         function pageIdLoop($index, $fetchedRow, $param)
525         {
526                 $selected = '';
527                 if ($fetchedRow['pg_path'] == $this->path){
528                         $selected = 'selected';
529                 }
530                 $name = $this->convertToDispString($fetchedRow['pg_path']) . ' - ' . $this->convertToDispString($fetchedRow['pg_name']);                        // ページ名
531                 $row = array(
532                         'value'    => $this->convertToDispString($fetchedRow['pg_path']),                       // アクセスパス
533                         'name'     => $name,                    // ページ名
534                         'selected' => $selected                                                                                                         // 選択中かどうか
535                 );
536                 $this->tmpl->addVars('path_list', $row);
537                 $this->tmpl->parseTemplate('path_list', 'a');
538                 return true;
539         }
540 }
541 ?>