OSDN Git Service

「wikiメイン」ウィジェット更新。
authornaoki hirata <naoki@magic3.org>
Fri, 10 Jul 2015 12:54:44 +0000 (21:54 +0900)
committernaoki hirata <naoki@magic3.org>
Fri, 10 Jul 2015 12:54:44 +0000 (21:54 +0900)
include/sql/update_widgets.sql
widgets/wiki_main/css/default.css
widgets/wiki_main/include/conf/default.ini.php
widgets/wiki_main/include/data/50756B6957696B692F312E342F4D616E75616C2F506C7567696E2F4C2D4E.txt
widgets/wiki_main/include/plugin/ls2.inc.php

index 036d8b7..32cc124 100644 (file)
@@ -278,7 +278,7 @@ INSERT INTO _widgets
 DELETE FROM _widgets WHERE wd_id = 'wiki_main';\r
 INSERT INTO _widgets\r
 (wd_id,       wd_name,       wd_category_id,    wd_type, wd_content_type, wd_edit_content, wd_template_type, wd_version, wd_author,      wd_copyright, wd_license, wd_official_level, wd_description,     wd_add_script_lib, wd_add_script_lib_a, wd_has_admin, wd_initialized, wd_release_dt, wd_install_dt, wd_create_dt) VALUES\r
-('wiki_main', 'Wiki-メイン', 'wiki',            'wiki',  'wiki',          true,           'bootstrap',      '3.1.0',    'Naoki Hirata', 'Magic3.org', 'GPL',      10,                'Wikiを表示する。', 'md5',             'md5',               true,                       true,               '2015-07-06', now(),    now());\r
+('wiki_main', 'Wiki-メイン', 'wiki',            'wiki',  'wiki',          true,           'bootstrap',      '3.1.1',    'Naoki Hirata', 'Magic3.org', 'GPL',      10,                'Wikiを表示する。', 'md5',             'md5',               true,                       true,               '2015-07-10', now(),    now());\r
 DELETE FROM _widgets WHERE wd_id = 'wiki_update';\r
 INSERT INTO _widgets\r
 (wd_id,                wd_name,                       wd_category_id, wd_template_type, wd_version, wd_author,      wd_copyright, wd_license, wd_official_level, wd_description,  wd_add_script_lib, wd_add_script_lib_a,                         wd_has_admin, wd_use_instance_def, wd_initialized, wd_has_rss, wd_release_dt, wd_install_dt, wd_create_dt) VALUES\r
index 7d2ea4f..1369127 100644 (file)
@@ -70,10 +70,10 @@ hr.note_hr {
        text-align:center;
        margin:1em auto 0em auto;
 }
-ul.wiki_list li {
+/*ul.wiki_list li {
        margin-left: .5em;
        margin-right: 0;
-}
+}*/
 /*
 ul.wiki_list1 { list-style-type:disc; }
 ul.wiki_list2 { list-style-type:circle; }
@@ -82,26 +82,23 @@ ol.wiki_list1 { list-style-type:decimal; }
 ol.wiki_list2 { list-style-type:lower-roman; }
 ol.wiki_list3 { list-style-type:lower-alpha; }
 */
+/*
 dl.wiki_list dt {
        font-weight:bold;
        margin-top:1em;
-/*     margin-left:1em;*/
 }
 dl.wiki_list1 dt {
        font-weight:bold;
        margin-top:1em;
-/*     margin-left:1em;*/
 }
 dl.wiki_list2 dt {
        font-weight:bold;
        margin-top:1em;
-/*     margin-left:1em;*/
 }
 dl.wiki_list3 dt {
        font-weight:bold;
        margin-top:1em;
-/*     margin-left:1em;*/
-}
+}*/
 span.noexists {
        color:inherit;
        background-color:#FFFACC;
index a3e9cc6..59fcecb 100644 (file)
@@ -62,9 +62,8 @@ $_ol_left_margin = 0;   // リストと画面左端との間隔(px)
 $_ol_margin = 16;       // リストの階層間の間隔(px)
 $_dl_left_margin = 0;   // リストと画面左端との間隔(px)
 $_dl_margin = 16;        // リストの階層間の間隔(px)
-//$_list_pad_str = ' class="list%d" style="padding-left:%dpx;margin-left:%dpx"';
-//$_list_pad_str = ' class="list%d"';
-$_list_pad_str = ' class="wiki_list%d"';                       // リストクラス名
+//$_list_pad_str = ' class="wiki_list%d"';                     // リストクラス名
+$_list_pad_str = '';                   // リストクラス名
 
 /////////////////////////////////////////////////
 // テキストエリアのカラム数
index f8216a4..11f2c93 100644 (file)
 --title - ページに含まれる見出し(*,**,***)の一覧を併記します。
 --include - 下位層のページが#includeを使用していた場合、includeしているページの一覧を表示します。
 --reverse - ページの並び順を反転し、名前の降順に表示します。省略すると名前の昇順に表示されます。
---compact - 見出しレベルを調整します。
+--compact(Magic3版廃止) - 見出しレベルを調整します。
 --link - #ls2を書いた位置に一覧を表示する代わりにリンクを表示します。このリンクを選択すると別画面にページの一覧を表示するようにします。
 :|~linkの別名表示には、パラメータlinkを指定した際に表示される文字列の代わりの文字列を指定します。省略時は'' '...'で始まるページの一覧''となります。
 :プラグイン内設定|~
 --PLUGIN_LS2_ANCHOR_PREFIX 見出しアンカーの書式
 --PLUGIN_LS2_ANCHOR_ORIGIN 見出しアンカーの開始番号
---PLUGIN_LS2_LIST_COMPACT compactオプション省略時、見出しレベルを調整するか
+--PLUGIN_LS2_LIST_COMPACT(Magic3版廃止) compactオプション省略時、見出しレベルを調整するか
 :備考|
 ~ls プラグインとの違いについて。
 --階層化されたページの起点となるページが、lsでは記述したページ固定だが、ls2ではパラメータで指定できます。
index e3b9827..cb5c158 100644 (file)
@@ -8,9 +8,9 @@
  *
  * @package    Magic3 Framework
  * @author     平田直毅(Naoki Hirata) <naoki@aplo.co.jp>
- * @copyright  Copyright 2006-2010 Magic3 Project.
+ * @copyright  Copyright 2006-2015 Magic3 Project.
  * @license    http://www.gnu.org/copyleft/gpl.html  GPL License
- * @version    SVN: $Id: ls2.inc.php 3474 2010-08-13 10:36:48Z fishbone $
+ * @version    SVN: $Id$
  * @link       http://www.magic3.org
  */
 /*
@@ -35,33 +35,37 @@ define('PLUGIN_LS2_ANCHOR_PREFIX', '#content_1_');
 define('PLUGIN_LS2_ANCHOR_ORIGIN', 0);
 
 // 見出しレベルを調整する(デフォルト値)
-define('PLUGIN_LS2_LIST_COMPACT', FALSE);
+//define('PLUGIN_LS2_LIST_COMPACT', FALSE);
 
 function plugin_ls2_action()
 {
-       global $vars, $_ls2_msg_title;
+//     global $vars, $_ls2_msg_title;
+       global $_ls2_msg_title;
 
        $params = array();
-       foreach (array('title', 'include', 'reverse') as $key)
-               $params[$key] = isset($vars[$key]);
+       foreach (array('title', 'include', 'reverse') as $key){
+               //$params[$key] = isset($vars[$key]);
+               $params[$key] = (WikiParam::getVar($key) != '');
+       }
 
-       $prefix = isset($vars['prefix']) ? $vars['prefix'] : '';
+//     $prefix = isset($vars['prefix']) ? $vars['prefix'] : '';
+       $prefix = WikiParam::getVar('prefix');
        $body = plugin_ls2_show_lists($prefix, $params);
 
-       return array('body'=>$body,
-               'msg'=>str_replace('$1', htmlspecialchars($prefix), $_ls2_msg_title));
+       return array('body'=>$body, 'msg'=>str_replace('$1', htmlspecialchars($prefix), $_ls2_msg_title));
 }
 
 function plugin_ls2_convert()
 {
-       global $script, $vars, $_ls2_msg_title;
+       //global $script, $vars, $_ls2_msg_title;
+       global $script, $_ls2_msg_title;
 
        $params = array(
                'link'    => FALSE,
                'title'   => FALSE,
                'include' => FALSE,
                'reverse' => FALSE,
-               'compact' => PLUGIN_LS2_LIST_COMPACT,
+//             'compact' => PLUGIN_LS2_LIST_COMPACT,
                '_args'   => array(),
                '_done'   => FALSE
        );
@@ -72,24 +76,22 @@ function plugin_ls2_convert()
                $args   = func_get_args();
                $prefix = array_shift($args);
        }
-       if ($prefix == '') $prefix = strip_bracket($vars['page']) . '/';
 
-       // fixed by naoki on 2008/9/30
-       array_walk($args, 'plugin_ls2_check_arg', $params);
+       if ($prefix == '') $prefix = strip_bracket(WikiParam::getPage()) . '/';
+
+       foreach ($args as $arg) plugin_ls2_check_arg($arg, $params);
 
        $title = (! empty($params['_args'])) ? join(',', $params['_args']) :   // Manual
                str_replace('$1', htmlspecialchars($prefix), $_ls2_msg_title); // Auto
 
-       if (! $params['link'])
-               return plugin_ls2_show_lists($prefix, $params);
+       if (! $params['link']) return plugin_ls2_show_lists($prefix, $params);
 
        $tmp = array();
        $tmp[] = 'plugin=ls2&amp;prefix=' . rawurlencode($prefix);
        if (isset($params['title']))   $tmp[] = 'title=1';
        if (isset($params['include'])) $tmp[] = 'include=1';
 
-       return '<p><a href="' . $script . '?' . join('&amp;', $tmp) . '">' .
-               $title . '</a></p>' . "\n";
+       return '<p><a href="' . $script . '?' . join('&amp;', $tmp) . '">' . $title . '</a></p>' . "\n";
 }
 
 function plugin_ls2_show_lists($prefix, & $params)
@@ -157,13 +159,10 @@ function plugin_ls2_get_headings($page, & $params, $level, $include = FALSE)
                        $id    = make_heading($line);
                        $level = strlen($matches[1]);
                        $id    = PLUGIN_LS2_ANCHOR_PREFIX . $anchor++;
+
                        plugin_ls2_list_push($params, $level + strlen($level));
-                       array_push($params['result'],
-                               '<li><a href="' . $href . $id . '">' . $line . '</a>');
-               } else if ($params['include'] &&
-                       preg_match('/^#include\((.+)\)/', $line, $matches) &&
-                       is_page($matches[1]))
-               {
+                       array_push($params['result'], '<li><a href="' . $href . $id . '">' . $line . '</a>');
+               } else if ($params['include'] && preg_match('/^#include\((.+)\)/', $line, $matches) && is_page($matches[1])){
                        plugin_ls2_get_headings($matches[1], $params, $level + 1, TRUE);
                }
        }
@@ -174,8 +173,8 @@ function plugin_ls2_list_push(& $params, $level)
 {
        global $_ul_left_margin, $_ul_margin, $_list_pad_str;
 
-       $result = $params['result'];
-       $saved  = $params['saved'];
+       $result = &$params['result'];           // 変換値を戻す
+       $saved  = &$params['saved'];            // 変換値を戻す
        $cont   = TRUE;
        $open   = '<ul%s>';
        $close  = '</li></ul>';
@@ -192,6 +191,7 @@ function plugin_ls2_list_push(& $params, $level)
                $cont = FALSE;
                array_unshift($saved, $close);
 
+/*
                $left = ($level == $margin) ? $_ul_left_margin : 0;
                if ($params['compact']) {
                        $left  += $_ul_margin;   // マージンを固定
@@ -199,7 +199,8 @@ function plugin_ls2_list_push(& $params, $level)
                } else {
                        $left += $margin * $_ul_margin;
                }
-               $str = sprintf($_list_pad_str, $level, $left, $left);
+               $str = sprintf($_list_pad_str, $level, $left, $left);*/
+               $str = sprintf($_list_pad_str, $level);
                array_push($result, sprintf($open, $str));
        }
 
@@ -207,7 +208,7 @@ function plugin_ls2_list_push(& $params, $level)
 }
 
 // オプションを解析する
-function plugin_ls2_check_arg($value, $key, & $params)
+function plugin_ls2_check_arg($value, & $params)
 {
        if ($value == '') {
                $params['_done'] = TRUE;
@@ -225,6 +226,7 @@ function plugin_ls2_check_arg($value, $key, & $params)
                $params['_done'] = TRUE;
        }
 
+//     $params['_args'][] = htmlsc($value); // Link title
        $params['_args'][] = htmlspecialchars($value); // Link title
 }
 ?>