Ignore:
Timestamp:
2009/11/07 01:38:52 (17 years ago)
Author:
Seasoft
Message:
  • プラグインを管理機能[プラグイン] - [プラグイン管理]画面からインストール・アンインストールするように改訂。現状では、XMLへの登録・削除とSQLの実行に対応。今後拡張していく予定。
  • 管理機能のメニュー表示をサーバサイドで処理するように変更。
  • インストール中はプラグインの影響が無いように改修。
Location:
branches/comu-ver2/html/user_data/plugins
Files:
3 added
1 deleted
5 edited
4 moved

Legend:

Unmodified
Added
Removed
  • branches/comu-ver2/html/user_data/plugins/google_analytics/admin/index.php

    r18345 r18370  
    2222 */ 
    2323// {{{ requires 
    24 require_once("../../../admin/require.php"); 
    25 require_once(USER_PATH . 'plugins/google_analytics/classes/pages/LC_Page_Admin_GoogleAnalytics.php'); 
     24require_once '../../../../admin/require.php'; 
     25$arrPluginInfo = SC_Utils_Ex::sfLoadPluginInfo('../plugin_info.php'); 
     26require_once $arrPluginInfo['fullpath'] . 'classes/pages/LC_Page_Admin_GoogleAnalytics.php'; 
    2627 
    2728// }}} 
     
    2930 
    3031$objPage = new LC_Page_Admin_GoogleAnalytics(); 
     32$objPage->arrPluginInfo = $arrPluginInfo; 
    3133register_shutdown_function(array($objPage, 'destroy')); 
    3234$objPage->init(); 
  • branches/comu-ver2/html/user_data/plugins/google_analytics/classes/pages/LC_Page_Admin_GoogleAnalytics.php

    r18345 r18370  
    3434class LC_Page_Admin_GoogleAnalytics extends LC_Page { 
    3535 
     36    /** プラグイン情報配列 (呼び出し元でセットする) */ 
     37    var $arrPluginInfo; 
     38 
    3639    // }}} 
    3740    // {{{ functions 
     
    4447    function init() { 
    4548        parent::init(); 
    46         $this->tpl_mainpage = PLUGIN_PATH . 'google_analytics/tpl/index.tpl'; 
    47         $this->tpl_subtitle = "Google Analytics Plugin"; 
     49        $this->tpl_mainpage = $this->arrPluginInfo['fullpath'] . 'tpl/admin/index.tpl'; 
     50        $this->tpl_mainno   = 'plugin'; 
     51        $this->tpl_subno    = $this->arrPluginInfo['path']; 
     52        $this->tpl_subtitle = "プラグイン「{$this->arrPluginInfo['name']}」の設定"; 
    4853 
    4954        if (empty($_POST["mode"])) { 
     
    102107        $objView = new SC_AdminView(); 
    103108        $objView->assignobj($this); 
    104         $objView->display($this->tpl_mainpage); 
     109        $objView->display(MAIN_FRAME); 
    105110    } 
    106111 
     
    118123            . htmlspecialchars($ua, ENT_QUOTES) . "');\n?>\n"; 
    119124 
    120         $configFile = PLUGIN_PATH . "google_analytics/classes/pages/ga_config.php"; 
     125        $configFile = $this->arrPluginInfo['fullpath'] . "classes/pages/ga_config.php"; 
    121126        $handle = fopen($configFile, "w"); 
    122127        if (!$handle) { 
  • branches/comu-ver2/html/user_data/plugins/google_analytics/classes/pages/LC_Page_FrontParts_Bloc_GoogleAnalytics.php

    r18345 r18370  
    3434class LC_Page_FrontParts_Bloc_GoogleAnalytics extends LC_Page { 
    3535 
     36    /** プラグイン情報配列 (呼び出し元でセットする) */ 
     37    var $arrPluginInfo; 
     38 
    3639    // }}} 
    3740    // {{{ functions 
     
    4447    function init() { 
    4548        parent::init(); 
    46         $this->tpl_mainpage = USER_PATH . 'plugins/google_analytics/tpl/ga.tpl'; 
    47         $this->tpl_subtitle = "Google Analytics Plugin"; 
     49        $this->tpl_mainpage = $this->arrPluginInfo['fullpath'] . 'tpl/ga.tpl'; 
    4850    } 
    4951 
  • branches/comu-ver2/html/user_data/plugins/google_analytics/ga.php

    r18345 r18370  
    11<?php 
     2/* 
     3 * This file is part of EC-CUBE 
     4 * 
     5 * Copyright(c) 2000-2009 LOCKON CO.,LTD. All Rights Reserved. 
     6 * 
     7 * http://www.lockon.co.jp/ 
     8 * 
     9 * This program is free software; you can redistribute it and/or 
     10 * modify it under the terms of the GNU General Public License 
     11 * as published by the Free Software Foundation; either version 2 
     12 * of the License, or (at your option) any later version. 
     13 * 
     14 * This program is distributed in the hope that it will be useful, 
     15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
     16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     17 * GNU General Public License for more details. 
     18 * 
     19 * You should have received a copy of the GNU General Public License 
     20 * along with this program; if not, write to the Free Software 
     21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. 
     22 */ 
     23 
    224// {{{ requires 
    3 require_once(PLUGIN_PATH . "google_analytics/classes/pages/LC_Page_FrontParts_Bloc_GoogleAnalytics.php"); 
     25$arrPluginInfo = SC_Utils_Ex::sfLoadPluginInfo(dirname(__FILE__) . '/plugin_info.php'); 
     26require_once $arrPluginInfo['fullpath'] . 'classes/pages/LC_Page_FrontParts_Bloc_GoogleAnalytics.php'; 
    427 
    528// }}} 
     
    730 
    831$objPage = new LC_Page_FrontParts_Bloc_GoogleAnalytics(); 
    9 register_shutdown_function(array($objPage, "destroy")); 
     32$objPage->arrPluginInfo = $arrPluginInfo; 
     33register_shutdown_function(array($objPage, 'destroy')); 
    1034$objPage->init(); 
    1135$objPage->process(); 
  • branches/comu-ver2/html/user_data/plugins/google_analytics/require.php

    r18345 r18370  
    33 * EC-CUBE 本体で, このプラグインの関数を使用したい場合は, ここで require する 
    44 */ 
    5 require_once(PLUGIN_PATH . "google_analytics/classes/pages/ga_config.php"); 
     5require_once(dirname(__FILE__) . '/classes/pages/ga_config.php'); 
    66?> 
  • branches/comu-ver2/html/user_data/plugins/google_analytics/tpl/admin/index.tpl

    r18345 r18370  
    1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja"> 
    3  
    4 <head> 
    5 <meta http-equiv="content-type" content="application/xhtml+xml; charset=<!--{$smarty.const.CHAR_CODE}-->" /> 
    6 <meta http-equiv="content-script-type" content="text/javascript" /> 
    7 <meta http-equiv="content-style-type" content="text/css" /> 
    8 <link rel="stylesheet" href="<!--{$TPL_DIR}-->css/admin_contents.css" type="text/css" media="all" /> 
    9 <script type="text/javascript" src="<!--{$TPL_DIR}-->js/css.js"></script> 
    10 <script type="text/javascript" src="<!--{$TPL_DIR}-->js/navi.js"></script> 
    11 <script type="text/javascript" src="<!--{$TPL_DIR}-->js/win_op.js"></script> 
    12 <script type="text/javascript" src="<!--{$TPL_DIR}-->js/site.js"></script> 
    13 <script type="text/javascript" src="<!--{$TPL_DIR}-->js/jquery.js"></script> 
    14 <script type="text/javascript" src="<!--{$TPL_DIR}-->js/admin.js"></script> 
    15 <title><!--{$tpl_subtitle}--></title> 
    16 <script type="text/javascript"> 
    17  
    18 </script> 
    19 <style type="text/css"> 
    20 @charset "UTF-8"; 
    21 </style> 
    22 </head> 
    23  
    24 <body onload="<!--{$tpl_onload}-->" class="authority_0" style="min_width: 400px"> 
    25 <noscript> 
    26   <p>JavaScript を有効にしてご利用下さい.</p> 
    27 </noscript> 
    28  
    29 <div id="container"> 
    30 <a name="top"></a> 
    31 <!--▼CONTENTS--> 
    32 <h1>Google Analytics Plugin</h1> 
    33 <div id="contents" class="clear-block"> 
    34   <form method="post" action="index.php"> 
     1<form method="post" action="index.php"> 
    352    <div id="system" class="contents-main"> 
    36       <table class="list"> 
    37     <tr> 
    38       <th>ウェブ プロパティ ID</th> 
    39       <td>UA-<input type="text" name="ga_ua" value="<!--{$smarty.const.GA_UA}-->" /></td> 
    40     </tr> 
    41       </table> 
    42       <div class="btn addnew"> 
    43     <input type="hidden" name="mode" value="register" /> 
    44     <button type="submit"><span>この内容で登録する</span></button> 
    45       </div> 
     3        <table class="list"> 
     4            <tr> 
     5                <th>ウェブ プロパティ ID</th> 
     6                <td>UA-<input type="text" name="ga_ua" value="<!--{$smarty.const.GA_UA}-->" /></td> 
     7            </tr> 
     8        </table> 
     9        <div class="btn addnew"> 
     10            <input type="hidden" name="mode" value="register" /> 
     11            <button type="submit"><span>この内容で登録する</span></button> 
     12        </div> 
    4613    </div> 
    47   </form> 
    48 </div> 
    49 <!--▲CONTENTS--> 
    50 </div> 
    51 </body> 
    52 </html> 
     14</form> 
  • branches/comu-ver2/html/user_data/plugins/plugins.xml

    r18345 r18370  
    11<?xml version="1.0" encoding="utf-8"?> 
    22<plugins> 
    3   <plugin> 
    4     <name>Google Analytics</name> 
    5     <path>google_analytics</path> 
    6   </plugin> 
    73</plugins> 
Note: See TracChangeset for help on using the changeset viewer.