[18223] | 1 | Index: html/user_data/plugins/plugin_menu.tpl |
---|
| 2 | =================================================================== |
---|
| 3 | --- html/user_data/plugins/plugin_menu.tpl (リビジョン 0) |
---|
| 4 | +++ html/user_data/plugins/plugin_menu.tpl (リビジョン 0) |
---|
[18230] | 5 | @@ -0,0 +1,35 @@ |
---|
[18223] | 6 | +<ul id="navi-plugin-menu" class="level1"> |
---|
| 7 | +</ul> |
---|
| 8 | +<script type="text/javascript"> |
---|
[18225] | 9 | +//<![CDATA[ |
---|
[18230] | 10 | +var host = (("https:" == document.location.protocol) ? "<!--{$smarty.const.SSL_URL}-->" : "<!--{$smarty.const.SITE_URL}-->"); |
---|
| 11 | +var pluginURL = host + '<!--{$smarty.const.USER_DIR}--><!--{$smarty.const.PLUGIN_DIR}-->'; |
---|
[18223] | 12 | +$(function(){ |
---|
[18230] | 13 | + $.ajax({ |
---|
| 14 | + url: pluginURL + 'plugins.xml', |
---|
[18223] | 15 | + type: 'GET', |
---|
| 16 | + dataType: 'xml', |
---|
| 17 | + timeout: 2000, |
---|
| 18 | + error: function(){ |
---|
| 19 | + alert("xmlファイルの読み込みに失敗しました"); |
---|
| 20 | + }, |
---|
| 21 | + success: function(xml){ |
---|
| 22 | + $(xml).find("plugin").each(function(){ |
---|
| 23 | + var item_text = $(this).find("name").text(); |
---|
| 24 | + var item_path = $(this).find("path").text(); |
---|
| 25 | + |
---|
| 26 | + $("<li id='navi-plugin-index'></li>") |
---|
[18225] | 27 | + .html("<a href='javascript:;'><span>" + item_text + "</span></a>") |
---|
[18223] | 28 | + .appendTo('ul#navi-plugin-menu') |
---|
| 29 | + .click(function() { |
---|
[18230] | 30 | + win03(pluginURL + item_path |
---|
[18223] | 31 | + + '/index.php', 'plugins', '800','600'); |
---|
| 32 | + return false; |
---|
| 33 | + }); |
---|
| 34 | + }); |
---|
| 35 | + $("li.plugin_menu").html(""); |
---|
| 36 | + } |
---|
| 37 | + }); |
---|
| 38 | +}); |
---|
[18225] | 39 | +//]]> |
---|
[18223] | 40 | +</script> |
---|
| 41 | Index: html/user_data/plugins/plugins.xml |
---|
| 42 | =================================================================== |
---|
| 43 | --- html/user_data/plugins/plugins.xml (リビジョン 0) |
---|
| 44 | +++ html/user_data/plugins/plugins.xml (リビジョン 0) |
---|
| 45 | @@ -0,0 +1,7 @@ |
---|
| 46 | +<?xml version="1.0" encoding="utf-8"?> |
---|
| 47 | +<plugins> |
---|
| 48 | + <plugin> |
---|
| 49 | + <name>Google Analytics</name> |
---|
| 50 | + <path>google_analytics</path> |
---|
| 51 | + </plugin> |
---|
| 52 | +</plugins> |
---|
| 53 | Index: html/user_data/plugins/google_analytics/sql/delete.sql |
---|
| 54 | =================================================================== |
---|
| 55 | --- html/user_data/plugins/google_analytics/sql/delete.sql (リビジョン 0) |
---|
| 56 | +++ html/user_data/plugins/google_analytics/sql/delete.sql (リビジョン 0) |
---|
| 57 | @@ -0,0 +1,2 @@ |
---|
[18230] | 58 | +DELETE FROM dtb_bloc WHERE bloc_name = 'Google Analytics'; |
---|
| 59 | +DELETE FROM dtb_blocposition WHERE bloc_id = (SELECT bloc_id FROM dtb_bloc WHERE bloc_name = 'Google Analytics'); |
---|
[18223] | 60 | Index: html/user_data/plugins/google_analytics/sql/insert.sql |
---|
| 61 | =================================================================== |
---|
| 62 | --- html/user_data/plugins/google_analytics/sql/insert.sql (リビジョン 0) |
---|
| 63 | +++ html/user_data/plugins/google_analytics/sql/insert.sql (リビジョン 0) |
---|
[18230] | 64 | @@ -0,0 +1 @@ |
---|
[18223] | 65 | +INSERT INTO dtb_bloc (bloc_name, tpl_path, filename, php_path, del_flg) VALUES ('Google Analytics', 'user_data/plugins/google_analytics/tpl/ga.tpl', 'google_analytics', 'user_data/plugins/google_analytics/ga.php', 1); |
---|
| 66 | \ No newline at end of file |
---|
| 67 | Index: html/user_data/plugins/google_analytics/tpl/ga.tpl |
---|
| 68 | =================================================================== |
---|
| 69 | --- html/user_data/plugins/google_analytics/tpl/ga.tpl (リビジョン 0) |
---|
| 70 | +++ html/user_data/plugins/google_analytics/tpl/ga.tpl (リビジョン 0) |
---|
| 71 | @@ -0,0 +1,9 @@ |
---|
| 72 | +<script type="text/javascript"> |
---|
| 73 | +var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); |
---|
| 74 | +document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); |
---|
| 75 | +</script> |
---|
| 76 | +<script type="text/javascript"> |
---|
| 77 | +try { |
---|
| 78 | +var pageTracker = _gat._getTracker("UA-<!--{$smarty.const.GA_UA}-->"); |
---|
| 79 | +pageTracker._trackPageview(); |
---|
| 80 | +} catch(err) {}</script> |
---|
| 81 | Index: html/user_data/plugins/google_analytics/tpl/index.tpl |
---|
| 82 | =================================================================== |
---|
| 83 | --- html/user_data/plugins/google_analytics/tpl/index.tpl (リビジョン 0) |
---|
| 84 | +++ html/user_data/plugins/google_analytics/tpl/index.tpl (リビジョン 0) |
---|
| 85 | @@ -0,0 +1,52 @@ |
---|
| 86 | +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
---|
| 87 | +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja"> |
---|
| 88 | + |
---|
| 89 | +<head> |
---|
| 90 | +<meta http-equiv="content-type" content="application/xhtml+xml; charset=<!--{$smarty.const.CHAR_CODE}-->" /> |
---|
| 91 | +<meta http-equiv="content-script-type" content="text/javascript" /> |
---|
| 92 | +<meta http-equiv="content-style-type" content="text/css" /> |
---|
| 93 | +<link rel="stylesheet" href="<!--{$TPL_DIR}-->css/admin_contents.css" type="text/css" media="all" /> |
---|
| 94 | +<script type="text/javascript" src="<!--{$TPL_DIR}-->js/css.js"></script> |
---|
| 95 | +<script type="text/javascript" src="<!--{$TPL_DIR}-->js/navi.js"></script> |
---|
| 96 | +<script type="text/javascript" src="<!--{$TPL_DIR}-->js/win_op.js"></script> |
---|
| 97 | +<script type="text/javascript" src="<!--{$TPL_DIR}-->js/site.js"></script> |
---|
| 98 | +<script type="text/javascript" src="<!--{$TPL_DIR}-->js/jquery.js"></script> |
---|
| 99 | +<script type="text/javascript" src="<!--{$TPL_DIR}-->js/admin.js"></script> |
---|
| 100 | +<title><!--{$tpl_subtitle}--></title> |
---|
| 101 | +<script type="text/javascript"> |
---|
| 102 | + |
---|
| 103 | +</script> |
---|
| 104 | +<style type="text/css"> |
---|
| 105 | +@charset "UTF-8"; |
---|
| 106 | +</style> |
---|
| 107 | +</head> |
---|
| 108 | + |
---|
| 109 | +<body onload="<!--{$tpl_onload}-->" class="authority_0" style="min_width: 400px"> |
---|
| 110 | +<noscript> |
---|
| 111 | + <p>JavaScript を有効にしてご利用下さい.</p> |
---|
| 112 | +</noscript> |
---|
| 113 | + |
---|
| 114 | +<div id="container"> |
---|
| 115 | +<a name="top"></a> |
---|
| 116 | +<!--▼CONTENTS--> |
---|
| 117 | +<h1>Google Analytics Plugin</h1> |
---|
| 118 | +<div id="contents" class="clear-block"> |
---|
| 119 | + <form method="post" action="index.php"> |
---|
| 120 | + <div id="system" class="contents-main"> |
---|
| 121 | + <table class="list"> |
---|
| 122 | + <tr> |
---|
| 123 | + <th>ウェブ プロパティ ID</th> |
---|
| 124 | + <td>UA-<input type="text" name="ga_ua" value="<!--{$smarty.const.GA_UA}-->" /></td> |
---|
| 125 | + </tr> |
---|
| 126 | + </table> |
---|
| 127 | + <div class="btn addnew"> |
---|
| 128 | + <input type="hidden" name="mode" value="register" /> |
---|
| 129 | + <button type="submit"><span>この内容で登録する</span></button> |
---|
| 130 | + </div> |
---|
| 131 | + </div> |
---|
| 132 | + </form> |
---|
| 133 | +</div> |
---|
| 134 | +<!--▲CONTENTS--> |
---|
| 135 | +</div> |
---|
| 136 | +</body> |
---|
| 137 | +</html> |
---|
| 138 | Index: html/user_data/plugins/google_analytics/require.php |
---|
| 139 | =================================================================== |
---|
| 140 | --- html/user_data/plugins/google_analytics/require.php (リビジョン 0) |
---|
| 141 | +++ html/user_data/plugins/google_analytics/require.php (リビジョン 0) |
---|
| 142 | @@ -0,0 +1,6 @@ |
---|
| 143 | +<?php |
---|
| 144 | +/* |
---|
| 145 | + * EC-CUBE 本体で, このプラグインの関数を使用したい場合は, ここで require する |
---|
| 146 | + */ |
---|
| 147 | +require_once(PLUGIN_PATH . "google_analytics/classes/pages/ga_config.php"); |
---|
| 148 | +?> |
---|
| 149 | \ No newline at end of file |
---|
| 150 | Index: html/user_data/plugins/google_analytics/classes/pages/ga_config.php |
---|
| 151 | =================================================================== |
---|
| 152 | --- html/user_data/plugins/google_analytics/classes/pages/ga_config.php (リビジョン 0) |
---|
| 153 | +++ html/user_data/plugins/google_analytics/classes/pages/ga_config.php (リビジョン 0) |
---|
| 154 | @@ -0,0 +1,3 @@ |
---|
| 155 | +<?php |
---|
| 156 | +define('GA_UA', ''); |
---|
| 157 | +?> |
---|
| 158 | Index: html/user_data/plugins/google_analytics/classes/pages/LC_Page_FrontParts_Bloc_GoogleAnalytics.php |
---|
| 159 | =================================================================== |
---|
| 160 | --- html/user_data/plugins/google_analytics/classes/pages/LC_Page_FrontParts_Bloc_GoogleAnalytics.php (リビジョン 0) |
---|
| 161 | +++ html/user_data/plugins/google_analytics/classes/pages/LC_Page_FrontParts_Bloc_GoogleAnalytics.php (リビジョン 0) |
---|
| 162 | @@ -0,0 +1,70 @@ |
---|
| 163 | +<?php |
---|
| 164 | +/* |
---|
| 165 | + * This file is part of EC-CUBE |
---|
| 166 | + * |
---|
| 167 | + * Copyright(c) 2000-2009 LOCKON CO.,LTD. All Rights Reserved. |
---|
| 168 | + * |
---|
| 169 | + * http://www.lockon.co.jp/ |
---|
| 170 | + * |
---|
| 171 | + * This program is free software; you can redistribute it and/or |
---|
| 172 | + * modify it under the terms of the GNU General Public License |
---|
| 173 | + * as published by the Free Software Foundation; either version 2 |
---|
| 174 | + * of the License, or (at your option) any later version. |
---|
| 175 | + * |
---|
| 176 | + * This program is distributed in the hope that it will be useful, |
---|
| 177 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 178 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 179 | + * GNU General Public License for more details. |
---|
| 180 | + * |
---|
| 181 | + * You should have received a copy of the GNU General Public License |
---|
| 182 | + * along with this program; if not, write to the Free Software |
---|
| 183 | + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
| 184 | + */ |
---|
| 185 | + |
---|
| 186 | +// {{{ requires |
---|
| 187 | +require_once CLASS_PATH . "pages/LC_Page.php"; |
---|
| 188 | + |
---|
| 189 | +/** |
---|
| 190 | + * Google Analytics プラグインを制御するクラス. |
---|
| 191 | + * |
---|
| 192 | + * @package Page |
---|
| 193 | + * @author Kentaro Ohkouchi |
---|
| 194 | + * @version $Id$ |
---|
| 195 | + */ |
---|
| 196 | +class LC_Page_FrontParts_Bloc_GoogleAnalytics extends LC_Page { |
---|
| 197 | + |
---|
| 198 | + // }}} |
---|
| 199 | + // {{{ functions |
---|
| 200 | + |
---|
| 201 | + /** |
---|
| 202 | + * Page を初期化する. |
---|
| 203 | + * |
---|
| 204 | + * @return void |
---|
| 205 | + */ |
---|
| 206 | + function init() { |
---|
| 207 | + parent::init(); |
---|
| 208 | + $this->tpl_mainpage = USER_PATH . 'plugins/google_analytics/tpl/ga.tpl'; |
---|
| 209 | + $this->tpl_subtitle = "Google Analytics Plugin"; |
---|
| 210 | + } |
---|
| 211 | + |
---|
| 212 | + /** |
---|
| 213 | + * Page のプロセス. |
---|
| 214 | + * |
---|
| 215 | + * @return void |
---|
| 216 | + */ |
---|
| 217 | + function process() { |
---|
| 218 | + $objView = new SC_SiteView(); |
---|
| 219 | + $objView->assignobj($this); |
---|
| 220 | + $objView->display($this->tpl_mainpage); |
---|
| 221 | + } |
---|
| 222 | + |
---|
| 223 | + /** |
---|
| 224 | + * デストラクタ. |
---|
| 225 | + * |
---|
| 226 | + * @return void |
---|
| 227 | + */ |
---|
| 228 | + function destroy() { |
---|
| 229 | + parent::destroy(); |
---|
| 230 | + } |
---|
| 231 | +} |
---|
| 232 | +?> |
---|
| 233 | \ No newline at end of file |
---|
| 234 | Index: html/user_data/plugins/google_analytics/classes/pages/LC_Page_Admin_GoogleAnalytics.php |
---|
| 235 | =================================================================== |
---|
| 236 | --- html/user_data/plugins/google_analytics/classes/pages/LC_Page_Admin_GoogleAnalytics.php (リビジョン 0) |
---|
| 237 | +++ html/user_data/plugins/google_analytics/classes/pages/LC_Page_Admin_GoogleAnalytics.php (リビジョン 0) |
---|
[18230] | 238 | @@ -0,0 +1,141 @@ |
---|
[18223] | 239 | +<?php |
---|
| 240 | +/* |
---|
| 241 | + * This file is part of EC-CUBE |
---|
| 242 | + * |
---|
| 243 | + * Copyright(c) 2000-2009 LOCKON CO.,LTD. All Rights Reserved. |
---|
| 244 | + * |
---|
| 245 | + * http://www.lockon.co.jp/ |
---|
| 246 | + * |
---|
| 247 | + * This program is free software; you can redistribute it and/or |
---|
| 248 | + * modify it under the terms of the GNU General Public License |
---|
| 249 | + * as published by the Free Software Foundation; either version 2 |
---|
| 250 | + * of the License, or (at your option) any later version. |
---|
| 251 | + * |
---|
| 252 | + * This program is distributed in the hope that it will be useful, |
---|
| 253 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 254 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 255 | + * GNU General Public License for more details. |
---|
| 256 | + * |
---|
| 257 | + * You should have received a copy of the GNU General Public License |
---|
| 258 | + * along with this program; if not, write to the Free Software |
---|
| 259 | + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
| 260 | + */ |
---|
| 261 | + |
---|
| 262 | +// {{{ requires |
---|
| 263 | +require_once CLASS_PATH . "pages/LC_Page.php"; |
---|
| 264 | + |
---|
| 265 | +/** |
---|
| 266 | + * Google Analytics プラグインの管理画面を制御するクラス. |
---|
| 267 | + * |
---|
| 268 | + * @package Page |
---|
| 269 | + * @author Kentaro Ohkouchi |
---|
| 270 | + * @version $Id$ |
---|
| 271 | + */ |
---|
| 272 | +class LC_Page_Admin_GoogleAnalytics extends LC_Page { |
---|
| 273 | + |
---|
| 274 | + // }}} |
---|
| 275 | + // {{{ functions |
---|
| 276 | + |
---|
| 277 | + /** |
---|
| 278 | + * Page を初期化する. |
---|
| 279 | + * |
---|
| 280 | + * @return void |
---|
| 281 | + */ |
---|
| 282 | + function init() { |
---|
| 283 | + parent::init(); |
---|
| 284 | + $this->tpl_mainpage = PLUGIN_PATH . 'google_analytics/tpl/index.tpl'; |
---|
| 285 | + $this->tpl_subtitle = "Google Analytics Plugin"; |
---|
| 286 | + |
---|
| 287 | + if (empty($_POST["mode"])) { |
---|
| 288 | + $_POST["mode"] = ""; |
---|
| 289 | + } |
---|
| 290 | + |
---|
| 291 | + if (empty($_GET["mode"])) { |
---|
| 292 | + $_GET["mode"] = ""; |
---|
| 293 | + } |
---|
| 294 | + } |
---|
| 295 | + |
---|
| 296 | + /** |
---|
| 297 | + * Page のプロセス. |
---|
| 298 | + * |
---|
| 299 | + * POST パラメータ "mode" が register の場合は登録処理を行う. |
---|
| 300 | + * 登録処理の後, 自ページをリロードし, GET パラメータ "mode" を付与する. |
---|
| 301 | + * 登録に成功し, GET パラメータ "mode" の値が success の場合は |
---|
| 302 | + * 「登録に成功しました」というメッセージをポップアップで表示する. |
---|
| 303 | + * 登録に失敗し, GET パラメータ "mode" の値が failure の場合は |
---|
| 304 | + * 「登録に失敗しました」というメッセージをポップアップで表示する. |
---|
| 305 | + * |
---|
[18230] | 306 | + * TODO Transaction Token を使用する |
---|
| 307 | + * |
---|
[18223] | 308 | + * @return void |
---|
| 309 | + */ |
---|
| 310 | + function process() { |
---|
| 311 | + // 認証可否の判定 |
---|
| 312 | + SC_Utils_Ex::sfIsSuccess(new SC_Session()); |
---|
| 313 | + |
---|
| 314 | + switch ($_POST["mode"]) { |
---|
| 315 | + case "register": |
---|
| 316 | + if ($this->register($_POST['ga_ua'])) { |
---|
| 317 | + $this->reload(array("mode" => "success")); |
---|
| 318 | + exit; |
---|
| 319 | + } else { |
---|
| 320 | + $this->reload(array("mode" => "failure")); |
---|
| 321 | + exit; |
---|
| 322 | + } |
---|
| 323 | + break; |
---|
| 324 | + |
---|
| 325 | + default: |
---|
| 326 | + } |
---|
| 327 | + |
---|
| 328 | + switch ($_GET["mode"]) { |
---|
| 329 | + case "success": |
---|
| 330 | + $this->tpl_onload .= "window.alert('登録に成功しました。');"; |
---|
| 331 | + break; |
---|
| 332 | + |
---|
| 333 | + case "failure": |
---|
| 334 | + $this->tpl_onload .= "window.alert('登録に失敗しました。');"; |
---|
| 335 | + break; |
---|
| 336 | + |
---|
| 337 | + default: |
---|
| 338 | + } |
---|
| 339 | + |
---|
| 340 | + $objView = new SC_AdminView(); |
---|
| 341 | + $objView->assignobj($this); |
---|
| 342 | + $objView->display($this->tpl_mainpage); |
---|
| 343 | + } |
---|
| 344 | + |
---|
| 345 | + /** |
---|
| 346 | + * UA の登録を行う. |
---|
| 347 | + * |
---|
| 348 | + * classes/pages/ga_config.php を読み込み, ウェブプロパティID の文字列 |
---|
| 349 | + * を定数として書き出す. |
---|
| 350 | + * |
---|
| 351 | + * @param string ウェブプロパティID の文字列 |
---|
| 352 | + * @return boolean 登録に成功した場合 true; 失敗した場合 false; |
---|
| 353 | + */ |
---|
| 354 | + function register($ua) { |
---|
| 355 | + $data = "<?php\ndefine('GA_UA', '" |
---|
| 356 | + . htmlspecialchars($ua, ENT_QUOTES) . "');\n?>\n"; |
---|
| 357 | + |
---|
| 358 | + $configFile = PLUGIN_PATH . "google_analytics/classes/pages/ga_config.php"; |
---|
| 359 | + $handle = fopen($configFile, "w"); |
---|
| 360 | + if (!$handle) { |
---|
| 361 | + return false; |
---|
| 362 | + } |
---|
| 363 | + // ファイルの内容を書き出す. |
---|
| 364 | + if (fwrite($handle, $data) === false) { |
---|
| 365 | + return false; |
---|
| 366 | + } |
---|
| 367 | + return true; |
---|
| 368 | + } |
---|
| 369 | + |
---|
| 370 | + /** |
---|
| 371 | + * デストラクタ. |
---|
| 372 | + * |
---|
| 373 | + * @return void |
---|
| 374 | + */ |
---|
| 375 | + function destroy() { |
---|
| 376 | + parent::destroy(); |
---|
| 377 | + } |
---|
| 378 | +} |
---|
| 379 | +?> |
---|
| 380 | \ No newline at end of file |
---|
| 381 | Index: html/user_data/plugins/google_analytics/ga.php |
---|
| 382 | =================================================================== |
---|
| 383 | --- html/user_data/plugins/google_analytics/ga.php (リビジョン 0) |
---|
| 384 | +++ html/user_data/plugins/google_analytics/ga.php (リビジョン 0) |
---|
| 385 | @@ -0,0 +1,12 @@ |
---|
| 386 | +<?php |
---|
| 387 | +// {{{ requires |
---|
| 388 | +require_once(PLUGIN_PATH . "google_analytics/classes/pages/LC_Page_FrontParts_Bloc_GoogleAnalytics.php"); |
---|
| 389 | + |
---|
| 390 | +// }}} |
---|
| 391 | +// {{{ generate page |
---|
| 392 | + |
---|
| 393 | +$objPage = new LC_Page_FrontParts_Bloc_GoogleAnalytics(); |
---|
| 394 | +register_shutdown_function(array($objPage, "destroy")); |
---|
| 395 | +$objPage->init(); |
---|
| 396 | +$objPage->process(); |
---|
| 397 | +?> |
---|
| 398 | \ No newline at end of file |
---|
| 399 | Index: html/user_data/plugins/google_analytics/index.php |
---|
| 400 | =================================================================== |
---|
| 401 | --- html/user_data/plugins/google_analytics/index.php (リビジョン 0) |
---|
| 402 | +++ html/user_data/plugins/google_analytics/index.php (リビジョン 0) |
---|
| 403 | @@ -0,0 +1,34 @@ |
---|
| 404 | +<?php |
---|
| 405 | +/* |
---|
| 406 | + * This file is part of EC-CUBE |
---|
| 407 | + * |
---|
| 408 | + * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved. |
---|
| 409 | + * |
---|
| 410 | + * http://www.lockon.co.jp/ |
---|
| 411 | + * |
---|
| 412 | + * This program is free software; you can redistribute it and/or |
---|
| 413 | + * modify it under the terms of the GNU General Public License |
---|
| 414 | + * as published by the Free Software Foundation; either version 2 |
---|
| 415 | + * of the License, or (at your option) any later version. |
---|
| 416 | + * |
---|
| 417 | + * This program is distributed in the hope that it will be useful, |
---|
| 418 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 419 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 420 | + * GNU General Public License for more details. |
---|
| 421 | + * |
---|
| 422 | + * You should have received a copy of the GNU General Public License |
---|
| 423 | + * along with this program; if not, write to the Free Software |
---|
| 424 | + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
| 425 | + */ |
---|
| 426 | +// {{{ requires |
---|
| 427 | +require_once("../../../admin/require.php"); |
---|
| 428 | +require_once(USER_PATH . 'plugins/google_analytics/classes/pages/LC_Page_Admin_GoogleAnalytics.php'); |
---|
| 429 | + |
---|
| 430 | +// }}} |
---|
| 431 | +// {{{ generate page |
---|
| 432 | + |
---|
| 433 | +$objPage = new LC_Page_Admin_GoogleAnalytics(); |
---|
| 434 | +register_shutdown_function(array($objPage, 'destroy')); |
---|
| 435 | +$objPage->init(); |
---|
| 436 | +$objPage->process(); |
---|
| 437 | +?> |
---|
| 438 | \ No newline at end of file |
---|
| 439 | Index: html/install/sql/insert_data.sql |
---|
| 440 | =================================================================== |
---|
[18230] | 441 | --- html/install/sql/insert_data.sql (リビジョン 18229) |
---|
[18223] | 442 | +++ html/install/sql/insert_data.sql (作業コピー) |
---|
| 443 | @@ -1114,5 +1114,8 @@ |
---|
| 444 | INSERT INTO mtb_constants VALUES ('OSTORE_E_C_BATCH_ERR', '"2010"', 522, 'オーナーズストア通信エラーコード'); |
---|
| 445 | INSERT INTO mtb_constants VALUES ('OPTION_FAVOFITE_PRODUCT', '1', 523, 'お気に入り商品登録(有効:1 無効:0)'); |
---|
| 446 | INSERT INTO mtb_constants VALUES ('IMAGE_RENAME', 'true', 525, '画像リネーム設定(商品画像のみ)(true:リネームする、false:リネームしない)'); |
---|
| 447 | +INSERT INTO mtb_constants VALUES ('PLUGIN_DIR', '"plugins/"', 600, 'プラグインディレクトリ'); |
---|
| 448 | +INSERT INTO mtb_constants VALUES ('PLUGIN_PATH', 'USER_PATH . PLUGIN_DIR', 601, 'プラグイン保存先'); |
---|
| 449 | +INSERT INTO mtb_constants VALUES ('PLUGIN_URL', 'USER_URL . PLUGIN_DIR', 602, 'プラグイン URL'); |
---|
| 450 | |
---|
| 451 | INSERT INTO dtb_module (module_id,module_code,module_name,update_date,create_date) VALUES (0,0,'patch',now(),now()); |
---|
| 452 | Index: data/Smarty/templates/default/admin/main_frame.tpl |
---|
| 453 | =================================================================== |
---|
[18230] | 454 | --- data/Smarty/templates/default/admin/main_frame.tpl (リビジョン 18229) |
---|
[18223] | 455 | +++ data/Smarty/templates/default/admin/main_frame.tpl (作業コピー) |
---|
[18230] | 456 | @@ -113,6 +113,10 @@ |
---|
[18223] | 457 | <a><span>OWNERS STORE</span></a> |
---|
| 458 | <!--{include file="`$smarty.const.TEMPLATE_ADMIN_DIR`ownersstore/subnavi.tpl"}--> |
---|
[18230] | 459 | </li> |
---|
[18223] | 460 | + <li id="navi-plugin" class="<!--{if $tpl_mainno eq "plugin"}-->on<!--{/if}-->"> |
---|
| 461 | + <a><span>プラグイン設定</span></a> |
---|
| 462 | + <!--{include file="`$smarty.const.PLUGIN_PATH`plugin_menu.tpl"}--> |
---|
[18230] | 463 | + </li> |
---|
[18223] | 464 | </ul> |
---|
| 465 | <div style="clear: both;"></div> |
---|
[18230] | 466 | <!--{* ▲NAVI *}--> |
---|
[18223] | 467 | Index: data/require_plugin.php |
---|
| 468 | =================================================================== |
---|
[18230] | 469 | --- data/require_plugin.php (リビジョン 18229) |
---|
[18223] | 470 | +++ data/require_plugin.php (作業コピー) |
---|
| 471 | @@ -1,5 +1,39 @@ |
---|
| 472 | <?php |
---|
| 473 | - /* |
---|
| 474 | - * プラグインを require するためのファイル |
---|
| 475 | - */ |
---|
| 476 | +/* |
---|
| 477 | + * This file is part of EC-CUBE |
---|
| 478 | + * |
---|
| 479 | + * Copyright(c) 2000-2009 LOCKON CO.,LTD. All Rights Reserved. |
---|
| 480 | + * |
---|
| 481 | + * http://www.lockon.co.jp/ |
---|
| 482 | + * |
---|
| 483 | + * This program is free software; you can redistribute it and/or |
---|
| 484 | + * modify it under the terms of the GNU General Public License |
---|
| 485 | + * as published by the Free Software Foundation; either version 2 |
---|
| 486 | + * of the License, or (at your option) any later version. |
---|
| 487 | + * |
---|
| 488 | + * This program is distributed in the hope that it will be useful, |
---|
| 489 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 490 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 491 | + * GNU General Public License for more details. |
---|
| 492 | + * |
---|
| 493 | + * You should have received a copy of the GNU General Public License |
---|
| 494 | + * along with this program; if not, write to the Free Software |
---|
| 495 | + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
| 496 | + */ |
---|
| 497 | + |
---|
| 498 | +// load plugins |
---|
| 499 | +/* ----------------------------------------------------------------------------- |
---|
| 500 | + * TODO PHP4 でも使えるように, XML パーサーをファクトリークラスで実装する |
---|
| 501 | + * ----------------------------------------------------------------------------*/ |
---|
| 502 | +if (version_compare("5", PHP_VERSION, "<")) { |
---|
| 503 | + $plugins = file_get_contents(USER_PATH . "plugins/plugins.xml"); |
---|
| 504 | + $xml = new SimpleXMLElement($plugins); |
---|
| 505 | + foreach ($xml->plugin as $plugin) { |
---|
| 506 | + |
---|
| 507 | + $requireFile = USER_PATH . "plugins/" . $plugin->path . "/require.php"; |
---|
| 508 | + if (file_exists($requireFile)) { |
---|
| 509 | + require_once($requireFile); |
---|
| 510 | + } |
---|
| 511 | + } |
---|
| 512 | +} |
---|
| 513 | ?> |
---|
| 514 | Index: data/mtb_constants_init.php |
---|
| 515 | =================================================================== |
---|
[18230] | 516 | --- data/mtb_constants_init.php (リビジョン 18229) |
---|
[18223] | 517 | +++ data/mtb_constants_init.php (作業コピー) |
---|
[18224] | 518 | @@ -670,4 +670,10 @@ |
---|
[18223] | 519 | define('OPTION_FAVOFITE_PRODUCT','1'); |
---|
| 520 | /** 画像リネーム設定(商品画像のみ) */ |
---|
| 521 | define('IMAGE_RENAME', true); |
---|
| 522 | +/** プラグインディレクトリ */ |
---|
| 523 | +define("PLUGIN_DIR", "plugins/"); |
---|
| 524 | +/** プラグイン保存先 */ |
---|
| 525 | +define("PLUGIN_PATH", USER_PATH . PLUGIN_DIR); |
---|
| 526 | +/** プラグイン URL */ |
---|
| 527 | +define("PLUGIN_URL", USER_URL . PLUGIN_DIR); |
---|
| 528 | ?> |
---|
[18230] | 529 | Index: data/require_base.php |
---|
| 530 | =================================================================== |
---|
| 531 | --- data/require_base.php (リビジョン 18229) |
---|
| 532 | +++ data/require_base.php (作業コピー) |
---|
| 533 | @@ -78,7 +78,6 @@ |
---|
| 534 | require_once(CLASS_EX_PATH . "helper_extends/SC_Helper_Session_Ex.php");
|
---|
| 535 | require_once(CLASS_EX_PATH . "helper_extends/SC_Helper_Mail_Ex.php");
|
---|
| 536 | require_once(CLASS_EX_PATH . "helper_extends/SC_Helper_Mobile_Ex.php");
|
---|
| 537 | -include_once(DATA_PATH . "require_plugin.php");
|
---|
| 538 |
|
---|
| 539 | // セッションハンドラ開始
|
---|
| 540 | $objSession = new SC_Helper_Session_Ex();
|
---|
| 541 | @@ -91,6 +90,9 @@ |
---|
| 542 | $sessionFactory = SC_SessionFactory::getInstance();
|
---|
| 543 | $sessionFactory->initSession();
|
---|
| 544 |
|
---|
| 545 | +// プラグインを読み込む
|
---|
| 546 | +include_once(DATA_PATH . "require_plugin.php");
|
---|
| 547 | +
|
---|
| 548 | // 絵文字変換 (除去) フィルターを組み込む。
|
---|
| 549 | ob_start(array('SC_MobileEmoji', 'handler'));
|
---|
| 550 | ?>
|
---|
[18223] | 551 | Index: data/class/pages/LC_Page.php |
---|
| 552 | =================================================================== |
---|
[18230] | 553 | --- data/class/pages/LC_Page.php (リビジョン 18229) |
---|
[18223] | 554 | +++ data/class/pages/LC_Page.php (作業コピー) |
---|
| 555 | @@ -82,6 +82,9 @@ |
---|
| 556 | */ |
---|
| 557 | function init() { |
---|
| 558 | $this->tpl_authority = $_SESSION['authority']; |
---|
| 559 | + // XXX すべてのページで宣言するべき |
---|
| 560 | + $layout = new SC_Helper_PageLayout_Ex(); |
---|
| 561 | + $layout->sfGetPageLayout($this, false); |
---|
| 562 | } |
---|
| 563 | |
---|
| 564 | /** |
---|
| 565 | Index: data/class/helper/SC_Helper_PageLayout.php |
---|
| 566 | =================================================================== |
---|
[18230] | 567 | --- data/class/helper/SC_Helper_PageLayout.php (リビジョン 18229) |
---|
[18223] | 568 | +++ data/class/helper/SC_Helper_PageLayout.php (作業コピー) |
---|
| 569 | @@ -61,9 +61,11 @@ |
---|
| 570 | $objPage->tpl_mainpage = USER_PATH . "templates/preview/" |
---|
| 571 | . TEMPLATE_NAME . "/" . $arrPageData[0]['filename'] . ".tpl"; |
---|
| 572 | } |
---|
| 573 | - |
---|
| 574 | - foreach($arrPageData[0] as $key => $val) { |
---|
| 575 | - $debug_message.= "arrPageData[$key]:" . $val . "\n"; |
---|
| 576 | + |
---|
| 577 | + if (!empty($arrPageData[0])) { |
---|
| 578 | + foreach($arrPageData[0] as $key => $val) { |
---|
| 579 | + $debug_message.= "arrPageData[$key]:" . $val . "\n"; |
---|
| 580 | + } |
---|
| 581 | } |
---|
| 582 | |
---|
| 583 | $debug_message.= "TEMPLATE_NAME:".TEMPLATE_NAME . "\n"; |
---|