OSDN Git Service

Bootstrap型テンプレートにツールチップ付加。
authornaoki hirata <naoki@magic3.org>
Sun, 13 Jul 2014 09:38:47 +0000 (18:38 +0900)
committernaoki hirata <naoki@magic3.org>
Sun, 13 Jul 2014 09:38:47 +0000 (18:38 +0900)
include/global.php
templates/bootstrap_cerulean/index.php
templates/bootstrap_yeti/index.php
widgets/wiki_main/include/container/wiki_mainWidgetContainer.php
widgets/wiki_main/include/plugin/unfreeze.inc.php

index 14376c2..a05e89e 100644 (file)
@@ -154,6 +154,13 @@ define('M3_EVENT_HOOK_PARAM_UPDATE_DT',            'update_dt');                                   // 更新日時
 define('M3_WIDGET_ID_SEPARATOR',       ',');                                                                   // ウィジェットIDと付加情報を連結
 define('M3_LANG_SEPARATOR',                    '|');                                                                   // 言語IDと内容を連結
 
+// テンプレートタイプ
+define('M3_TEMPLATE_JOOMLA_10',                        0);             // Joomla!v1.0テンプレート
+define('M3_TEMPLATE_JOOMLA_15',                        1);             // Joomla!v1.5テンプレート
+define('M3_TEMPLATE_JOOMLA_25',                        2);             // Joomla!v2.5テンプレート
+define('M3_TEMPLATE_BOOTSTRAP_30',             10);            // Bootstrap v3.0テンプレート
+define('M3_TEMPLATE_JQUERY_MOBILE_10', 20);            // jQuery Mobile v1.0テンプレート
+
 // 描画出力タイプ
 define('M3_RENDER_JOOMLA_OLD',         'joomla_old');          // Joomla! 1.0テンプレート
 define('M3_RENDER_JOOMLA_NEW',         'joomla_new');          // Joomla! 1.5以上のテンプレート
index a413189..25e0a5a 100644 (file)
@@ -41,6 +41,9 @@ $(function(){
        // 画像リサイズ
        resizeImage();
        $(window).resize(function(){ resizeImage(); });
+       
+       // ツールチップ作成
+       $('[rel=tooltip]').tooltip();
 });
 
 function resizeImage(){
index 947e6d2..75ead07 100644 (file)
@@ -41,6 +41,9 @@ $(function(){
        // 画像リサイズ
        resizeImage();
        $(window).resize(function(){ resizeImage(); });
+       
+       // ツールチップ作成
+       $('[rel=tooltip]').tooltip();
 });
 
 function resizeImage(){
index ecffdea..b2dde2c 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-2014 Magic3 Project.
  * @license    http://www.gnu.org/copyleft/gpl.html  GPL License
- * @version    SVN: $Id: wiki_mainWidgetContainer.php 3477 2010-08-14 06:57:31Z fishbone $
+ * @version    SVN: $Id$
  * @link       http://www.magic3.org
  */
 require_once($gEnvManager->getContainerPath() . '/baseWidgetContainer.php');
@@ -462,6 +462,7 @@ class wiki_mainWidgetContainer extends BaseWidgetContainer
        function createToolbarButton($key, $width = 20, $height = 20)
        {
                global $_LANG;
+               global $gEnvManager;
                
                $lang   = $_LANG['skin'];
                $link   = $this->resLink;
@@ -470,10 +471,19 @@ class wiki_mainWidgetContainer extends BaseWidgetContainer
                if (! isset($link[$key]) ) { $button = 'LINK NOT FOUND';  return $button; }
                if (! isset($image[$key])) { $button = 'IMAGE NOT FOUND'; return $button; }
 
-               $button = '<a href="' . $link[$key] . '">' .
-                       '<img src="' . IMAGE_DIR . $image[$key] . '" width="' . $width . '" height="' . $height . '" ' .
-                               'alt="' . $lang[$key] . '" title="' . $lang[$key] . '" />' .
-                       '</a>';
+               // テンプレートタイプに合わせて出力を変更
+               $templateType = $gEnvManager->getCurrentTemplateType();
+               if ($templateType == M3_TEMPLATE_BOOTSTRAP_30){         // Bootstrap型テンプレートの場合
+                       $button = '<a href="' . $link[$key] . '">' .
+                               '<img src="' . IMAGE_DIR . $image[$key] . '" width="' . $width . '" height="' . $height . '" ' .
+                                       'alt="' . $lang[$key] . '" title="' . $lang[$key] . '" rel="tooltip" data-toggle="tooltip" />' .
+                               '</a>';
+               } else {
+                       $button = '<a href="' . $link[$key] . '">' .
+                               '<img src="' . IMAGE_DIR . $image[$key] . '" width="' . $width . '" height="' . $height . '" ' .
+                                       'alt="' . $lang[$key] . '" title="' . $lang[$key] . '" />' .
+                               '</a>';
+               }
                return $button;
        }
 }
index 9f11020..14521b9 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: unfreeze.inc.php 1601 2009-03-21 05:51:06Z fishbone $
+ * @version    SVN: $Id$
  * @link       http://www.magic3.org
  */
 
@@ -24,6 +24,7 @@ function plugin_unfreeze_action()
        global $script, $function_freeze;
        global $_title_isunfreezed, $_title_unfreezed, $_title_unfreeze;
        global $_msg_invalidpass, $_msg_unfreezing, $_btn_unfreeze;
+       global $gEnvManager;
 
        //$page = isset($vars['page']) ? $vars['page'] : '';
        $page = WikiParam::getPage();
@@ -72,7 +73,22 @@ function plugin_unfreeze_action()
                
                // modified for Magic3 by naoki on 2008/10/10
                $postScript = $script . WikiParam::convQuery("?");
-               $body  .= <<<EOD
+               
+               // テンプレートタイプに合わせて出力を変更
+               $templateType = $gEnvManager->getCurrentTemplateType();
+               if ($templateType == M3_TEMPLATE_BOOTSTRAP_30){         // Bootstrap型テンプレートの場合
+                       $body  .= <<<EOD
+<p>$_msg_unfreezing</p>
+<form action="$postScript" method="post" class="form form-inline" role="form">
+  <input type="hidden"   name="wcmd"  value="unfreeze" />
+  <input type="hidden"   name="page" value="$s_page" />
+  <input type="hidden"   name="pass" />
+  <div class="form-group"><div class="input-group"><input type="password" class="form-control" name="password" size="12" /></div></div>
+  <input type="submit"   name="ok"   class="button btn btn-default" value="$_btn_unfreeze" onclick="this.form.pass.value = hex_md5(this.form.password.value);" />
+</form>
+EOD;
+               } else {
+                       $body  .= <<<EOD
 <p>$_msg_unfreezing</p>
 <form action="$postScript" method="post" class="form">
  <div>
@@ -84,6 +100,7 @@ function plugin_unfreeze_action()
  </div>
 </form>
 EOD;
+               }
        }
 
        return array('msg'=>$msg, 'body'=>$body);