OSDN Git Service

「wikiメイン」ウィジェット修正。
authornaoki hirata <naoki@magic3.org>
Fri, 11 Jul 2014 09:49:46 +0000 (18:49 +0900)
committernaoki hirata <naoki@magic3.org>
Fri, 11 Jul 2014 09:49:46 +0000 (18:49 +0900)
widgets/wiki_main/include/container/admin_wiki_mainWidgetContainer.php
widgets/wiki_main/include/plugin/tb.inc.php
widgets/wiki_main/include/template/admin.tmpl.html
widgets/wiki_main/include/template/admin_list.tmpl.html [deleted file]

index 540fe35..4234c7e 100644 (file)
@@ -8,9 +8,9 @@
  *
  * @package    Magic3 Framework
  * @author     平田直毅(Naoki Hirata) <naoki@aplo.co.jp>
- * @copyright  Copyright 2006-2009 Magic3 Project.
+ * @copyright  Copyright 2006-2014 Magic3 Project.
  * @license    http://www.gnu.org/copyleft/gpl.html  GPL License
- * @version    SVN: $Id: admin_wiki_mainWidgetContainer.php 3478 2010-08-14 08:33:30Z fishbone $
+ * @version    SVN: $Id$
  * @link       http://www.magic3.org
  */
 require_once($gEnvManager->getContainerPath() . '/baseAdminWidgetContainer.php');
@@ -18,7 +18,6 @@ require_once($gEnvManager->getCurrentWidgetDbPath() . '/wiki_mainDb.php');
 
 class admin_wiki_mainWidgetContainer extends BaseAdminWidgetContainer
 {
-       private $sysDb; // DB接続オブジェクト
        private $langId;
        private $authType;              // 認証方法
        const DEFAULT_PASSWORD = '********';    // 設定済みを示すパスワード
@@ -58,11 +57,7 @@ class admin_wiki_mainWidgetContainer extends BaseAdminWidgetContainer
        function _setTemplate($request, &$param)
        {
                $task = $request->trimValueOf('task');
-               if ($task == 'list'){           // 一覧画面
-                       return 'admin_list.tmpl.html';
-               } else {                        // 一覧画面
-                       return 'admin.tmpl.html';
-               }
+               return 'admin.tmpl.html';
        }
        /**
         * テンプレートにデータ埋め込む
@@ -75,12 +70,8 @@ class admin_wiki_mainWidgetContainer extends BaseAdminWidgetContainer
         */
        function _assign($request, &$param)
        {
-               $task = $request->trimValueOf('task');
-               if ($task == 'list'){           // 一覧画面
-                       return $this->createList($request);
-               } else {                        // 詳細設定画面
-                       return $this->createDetail($request);
-               }
+               // 詳細設定画面
+               return $this->createDetail($request);
        }
        /**
         * 詳細画面作成
@@ -238,94 +229,5 @@ class admin_wiki_mainWidgetContainer extends BaseAdminWidgetContainer
                        $this->tmpl->parseTemplate('auth_list', 'a');
                }
        }
-       /**
-        * 一覧画面作成
-        *
-        * @param RequestManager $request               HTTPリクエスト処理クラス
-        * @param                                                               なし
-        */
-       function createList($request)
-       {
-               $userId = $this->gEnv->getCurrentUserId();
-               $langId = $this->gEnv->getCurrentLanguage();            // 表示言語を取得
-               $act    = $request->trimValueOf('act');
-               
-               if ($act == 'delete'){          // メニュー項目の削除
-                       $listedItem = explode(',', $request->trimValueOf('seriallist'));
-                       $delItems = array();
-                       for ($i = 0; $i < count($listedItem); $i++){
-                               // 項目がチェックされているかを取得
-                               $itemName = 'item' . $i . '_selected';
-                               $itemValue = ($request->trimValueOf($itemName) == 'on') ? 1 : 0;
-                               
-                               if ($itemValue){                // チェック項目
-                                       $delItems[] = $listedItem[$i];
-                               }
-                       }
-                       if (count($delItems) > 0){
-                               // 更新オブジェクト作成
-                               $newParamObj = array();
-
-                               for ($i = 0; $i < count($this->paramObj); $i++){
-                                       $targetObj = $this->paramObj[$i];
-                                       $id = $targetObj->id;// 定義ID
-                                       if (!in_array($id, $delItems)){         // 削除対象でないときは追加
-                                               $newParamObj[] = $targetObj;
-                                       }
-                               }
-                               
-                               // ウィジェットパラメータオブジェクト更新
-                               $ret = $this->updateWidgetParamObj($newParamObj);
-                               if ($ret){              // データ削除成功のとき
-                                       $this->setGuidanceMsg('データを削除しました');
-                                       $this->paramObj = $newParamObj;
-                               } else {
-                                       $this->setAppErrorMsg('データ削除に失敗しました');
-                               }
-                       }
-               }
-               // 定義一覧作成
-               $this->createItemList();
-               
-               $this->tmpl->addVar("_widget", "serial_list", implode($this->serialArray, ','));// 表示項目のシリアル番号を設定
-               
-               // 画面定義用の情報を戻す
-               $this->tmpl->addVar("_widget", "def_serial", $defSerial);       // ページ定義のレコードシリアル番号
-               $this->tmpl->addVar("_widget", "def_config", $defConfigId);     // ページ定義の定義ID
-       }
-       /**
-        * 定義一覧作成
-        *
-        * @return なし                                               
-        */
-       function createItemList()
-       {
-               for ($i = 0; $i < count($this->paramObj); $i++){
-                       $targetObj = $this->paramObj[$i];
-                       $id = $targetObj->id;// 定義ID
-                       $name = $targetObj->name;// 定義名
-                       
-                       $defCount = 0;
-                       if (!empty($id)){
-                               $defCount = $this->sysDb->getPageDefCount($this->gEnv->getCurrentWidgetId(), $id);
-                       }
-                       $operationDisagled = '';
-                       if ($defCount > 0) $operationDisagled = 'disabled';
-                       $row = array(
-                               'index' => $i,
-                               'ope_disabled' => $operationDisagled,                   // 選択可能かどうか
-                               'name' => $this->convertToDispString($name),            // 名前
-                               'movie_id' => $this->convertToDispString($targetObj->movieId),  // 動画ID
-                               'width' => $targetObj->width,                                   // 動画幅
-                               'height' => $targetObj->height,                                 // 動画高さ
-                               'def_count' => $defCount                                                        // 使用数
-                       );
-                       $this->tmpl->addVars('itemlist', $row);
-                       $this->tmpl->parseTemplate('itemlist', 'a');
-                       
-                       // シリアル番号を保存
-                       $this->serialArray[] = $id;
-               }
-       }
 }
 ?>
index 77c7d26..c63108c 100644 (file)
@@ -8,9 +8,9 @@
  *
  * @package    Magic3 Framework
  * @author     平田直毅(Naoki Hirata) <naoki@aplo.co.jp>
- * @copyright  Copyright 2006-2008 Magic3 Project.
+ * @copyright  Copyright 2006-2014 Magic3 Project.
  * @license    http://www.gnu.org/copyleft/gpl.html  GPL License
- * @version    SVN: $Id: tb.inc.php 1156 2008-10-29 10:13:32Z fishbone $
+ * @version    SVN: $Id$
  * @link       http://www.magic3.org
  */
 /*
@@ -23,7 +23,6 @@
  * plugin_tb_save($url, $tb_id)          Save or update TrackBack Ping data
  * plugin_tb_output_response($rc, $msg)  Show a response code of the ping via HTTP/XML (then exit)
  * plugin_tb_output_rsslist($tb_id)      Show pings for the page via RSS
- * plugin_tb_output_htmllist($tb_id)     Show pings for the page via XHTML
  */
 
 switch(LANG){
@@ -56,17 +55,10 @@ function plugin_tb_action()
                $mode = WikiParam::getVar('__mode');
                //if ($trackback && isset($vars['__mode']) && isset($vars['tb_id'])) {
                if ($trackback && ($mode != '') && ($tb_id != '')) {
-                       // Show TrackBacks received (and exit)
-                       /*switch ($vars['__mode']) {
-                       case 'rss' : plugin_tb_output_rsslist($vars['tb_id']);  break;
-                       case 'view': plugin_tb_output_htmllist($vars['tb_id']); break;
-                       }*/
                        switch ($mode) {
                                case 'rss' : plugin_tb_output_rsslist($tb_id);  break;
-                               case 'view': plugin_tb_output_htmllist($tb_id); break;
                        }
                        exit;
-
                } else {
                        // Show List of pages that TrackBacks reached
                        //$pages = get_existpages(TRACKBACK_DIR, '.txt');
@@ -205,61 +197,4 @@ EOD;
        echo mb_convert_encoding($rc, 'UTF-8', SOURCE_ENCODING);
        exit;
 }
-
-// Show pings for the page via XHTML
-function plugin_tb_output_htmllist($tb_id)
-{
-       pkwk_common_headers();
-       echo 'This function had been removed now. It will be created soon.<br />' . "\n";
-       echo 'Sorry for your inconvenience.';
-       exit;
-
-       // ----
-       // Skeleton Logic
-
-       global $script;
-       global $_tb_date;
-
-       $page = tb_id2page($tb_id);
-       if ($page === FALSE) return FALSE;
-
-       $data = tb_get(tb_get_filename($page));
-
-       // Sort: The first is the latest
-       usort($data, create_function('$a,$b', 'return $b[0] - $a[0];'));
-
-       $tb_body = '';
-       foreach ($data as $x) {
-               if (count($x) != 5) continue; // Ignore incorrect record
-
-               list ($time, $url, $title, $excerpt, $blog_name) = $x;
-               if ($title == '') $title = 'no title';
-
-               $time = date($_tb_date, $time + LOCALZONE); // May 2, 2003 11:25 AM
-               $tb_body .= <<<EOD
-EOD;
-       }
-
-       // Output start
-       pkwk_common_headers();
-
-       // BugTrack/466 Care for MSIE trouble
-       // Logically correct, but MSIE will treat the data like 'file downloading'
-       //header('Content-type: application/xhtml+xml; charset=UTF-8');
-       header('Content-type: text/html; charset=UTF-8'); // Works well
-
-       $meta_content_type = pkwk_output_dtd(PKWK_DTD_XHTML_1_0_TRANSITIONAL, 'UTF-8');
-       $msg = <<<EOD
-<head>
- $meta_content_type
-</head>
-<body>
- $script?tb_id=$tb_id<br /><br />
- $tb_body
-</body>
-</html>
-EOD;
-       echo mb_convert_encoding($msg, 'UTF-8', SOURCE_ENCODING);
-       exit;
-}
 ?>
index b34a7b9..c1104c0 100644 (file)
@@ -1,6 +1,18 @@
+/**\r
+ * 表示データ作成用テンプレート(patTemplate)\r
+ *\r
+ * LICENSE: This source file is licensed under the terms of the GNU General Public License.\r
+ *\r
+ * @package    Magic3 Framework\r
+ * @author     平田直毅(Naoki Hirata) <naoki@aplo.co.jp>\r
+ * @copyright  Copyright 2006-2014 Magic3 Project.\r
+ * @license    http://www.gnu.org/copyleft/gpl.html  GPL License\r
+ * @version    SVN: $Id$\r
+ * @link       http://www.magic3.org\r
+ */\r
 <patTemplate:tmpl name="_widget">\r
 <script type="text/javascript">\r
-<!--\r
+//<![CDATA[\r
 function updateItem(){\r
        if (document.main.item_pwd.value == ''){\r
                window.alert('パスワードが入力されていません');\r
@@ -21,22 +33,21 @@ function selAuth(value){
                $('#item_pwd_label').css('display', 'none');\r
        }\r
 }\r
-// -->\r
+//]]>\r
 </script>\r
-<div align="center">\r
-<br />\r
+<div class="m3config_container">\r
 <!-- m3:ErrorMessage -->\r
 <form method="post" name="main" class="form">\r
 <input type="hidden" name="task" />\r
 <input type="hidden" name="act" />\r
 <input type="hidden" name="password" />\r
-<table width="90%">\r
+<table>\r
 <tr><td><label>Wiki設定</label></td>\r
 <td align="right">\r
 </td></tr>\r
 <tr><td colspan="2">\r
 \r
-<table id="config" class="simple-table" width="100%">\r
+<table class="simple-table" style="width:950px;">\r
     <tbody>\r
         <tr>\r
            <td class="table-headside" width="200"><span {_HELP_AUTH_LABEL}>認証方法</span></td>\r
diff --git a/widgets/wiki_main/include/template/admin_list.tmpl.html b/widgets/wiki_main/include/template/admin_list.tmpl.html
deleted file mode 100644 (file)
index 7f42062..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-<patTemplate:tmpl name="_widget">\r
-<script type="text/javascript">\r
-<!--\r
-function delItem(){\r
-    if (document.main.seriallist.value){\r
-        var items = document.main.seriallist.value.split(",");\r
-       for (var i = 0; i < items.length; i++){\r
-           var name = "document.main.item" + i + "_selected";\r
-           var itemObj = eval(name);\r
-           // チェックありのときは終了\r
-           if (itemObj && itemObj.checked) break;\r
-       }\r
-       if (i == items.length){                 \r
-           window.alert('削除する項目を選択してください');\r
-       } else {\r
-            if (!window.confirm('選択項目を削除しますか?')) return false;\r
-            document.main.act.value = 'delete';\r
-            document.main.submit();\r
-       }\r
-    }\r
-    return true;\r
-}\r
-function cancelItem(){\r
-    document.main.task.value = '';\r
-    document.main.submit();\r
-    return true;\r
-}\r
-function showPreview(movieid, width, height){\r
-       // プレビュー動画の更新\r
-//     var width = document.main.item_width.value;\r
-//     var height = document.main.item_height.value;\r
-       var preOuter = $('#preview_outer');\r
-       var innerText = '<embed src="http://www.youtube.com/v/' + movieid + '" width="' + width + '" height="' + height + '" type="application/x-shockwave-flash" wmode="transparent"></embed>';\r
-       //var innerText = '<object id="preview_obj" data="' + url + '" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '">' +\r
-       //              '<param id="preview_param" name="movie" value="' + url + '" /><param name="wmode" value="transparent" /></object>';\r
-       preOuter.html(innerText);\r
-}\r
-$(function(){\r
-       // スクロールバー付きのテーブルを作成\r
-       m3_tableWithScrollbar('itemlist', -1, 0);\r
-});\r
-// -->\r
-</script>\r
-<div align="center">\r
-<br />\r
-<!-- m3:ErrorMessage -->\r
-<form method="post" name="main" class="form">\r
-<input type="hidden" name="task" value="list" />\r
-<input type="hidden" name="act" />\r
-<input type="hidden" name="serial" />\r
-<input type="hidden" name="seriallist" value="{SERIAL_LIST}" />\r
-<input type="hidden" name="defserial" value="{DEF_SERIAL}" />\r
-<input type="hidden" name="defconfig" value="{DEF_CONFIG}" />\r
-<table width="90%">\r
-<tr><td>\r
-<label>YouTube定義一覧</label>\r
-</td><td align="right"><input type="button" class="button" onclick="delItem();" value="削除" /><input type="button" class="button" onclick="cancelItem();" value="戻る" />\r
-</td></tr>\r
-<tr><td colspan="2">\r
-<table id="itemlist" class="simple-table" width="100%">\r
-    <thead>\r
-        <tr>\r
-           <th width="35" align="center">選択</th>\r
-           <th width="40%" align="center">名前</th>\r
-           <th width="40%" align="center">動画ID</th>\r
-           <th align="center">使用</th>\r
-       </tr>\r
-    </thead>\r
-    <tbody>\r
-        <patTemplate:tmpl name="itemlist">\r
-        <tr onclick="showPreview('{MOVIE_ID}', '{WIDTH}', '{HEIGHT}');">\r
-            <td align="center"><input type="checkbox" name="item{INDEX}_selected" {OPE_DISABLED} /></td>\r
-           <td>{NAME}</td>\r
-           <td>{MOVIE_ID}</td>\r
-           <td align="center">{DEF_COUNT}</td>\r
-       </tr>\r
-       </patTemplate:tmpl>\r
-    </tbody>\r
-</table>\r
-<tr><td colspan="2">\r
-<br />\r
-<div>\r
-<label>YouTubeプレビュー</label></div>\r
-<div id="preview_outer"></div>\r
-</td></tr>\r
-</table>\r
-\r
-</form>\r
-</div>\r
-</patTemplate:tmpl>\r