source: branches/version-2_5-dev/data/class/pages/admin/plugin/LC_Page_Admin_Plugin.php @ 20764

Revision 20764, 3.0 KB checked in by nanasess, 13 years ago (diff)

#601 (コピーライトの更新)

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-httpd-php; charset=UTF-8
Line 
1<?php
2/*
3 * This file is part of EC-CUBE
4 *
5 * Copyright(c) 2000-2011 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
24require_once CLASS_EX_REALDIR . 'page_extends/admin/LC_Page_Admin_Ex.php';
25
26/**
27 * プラグイン管理のページクラス
28 *
29 * @package Page
30 * @author Seasoft 塚田将久
31 * @version $Id$
32 */
33class LC_Page_Admin_Plugin extends LC_Page_Admin_Ex {
34
35    /**
36     * Page を初期化する.
37     *
38     * @return void
39     */
40    function init() {
41        if (DEBUG_LOAD_PLUGIN !== true) SC_Utils_Ex::sfDispException('プラグインは有効化されていない'); // XXX 開発途上対応
42        parent::init();
43
44        $this->tpl_mainpage = 'plugin/index.tpl';
45        $this->tpl_mainno   = 'plugin';
46        $this->tpl_subno    = 'index';
47        $this->tpl_subtitle = 'プラグイン管理';
48    }
49
50    /**
51     * Page のプロセス.
52     *
53     * @return void
54     */
55    function process() {
56        $this->action();
57        $this->sendResponse();
58    }
59
60    /**
61     * Page のアクション.
62     *
63     * @return void
64     */
65    function action() {
66        $this->loadPluginsList();
67    }
68
69    /**
70     * デストラクタ.
71     *
72     * @return void
73     */
74    function destroy() {
75        parent::destroy();
76    }
77
78    /**
79     * プラグインの一覧を読み込む
80     *
81     * @return void
82     */
83    function loadPluginsList() {
84        $plugins = array();
85        $this->arrInstalledPlugin = array();
86        $this->arrInstallablePlugin = array();
87
88        $d = dir(PLUGIN_REALDIR);
89        while (false !== ($entry = $d->read())) {
90            if ($entry == '.') continue;
91            if ($entry == '..') continue;
92            if (!is_dir($d->path . $entry)) continue;
93
94            $plugins[$entry]['dir_exists'] = true;
95        }
96        $d->close();
97
98        $pluginsXml = SC_Utils_Ex::sfGetPluginsXml();
99        foreach ($pluginsXml->plugin as $plugin) {
100            $plugins[(string)$plugin->path]['installed'] = true;
101        }
102
103        foreach ($plugins as $path=>$plugin) {
104            $plugin['info'] = SC_Utils_Ex::sfGetPluginInfoArray($path);
105            $plugin['path'] = $path;
106            if ($plugin['installed']) {
107                $this->arrInstalledPlugin[] = $plugin;
108            } else {
109                $this->arrInstallablePlugin[] = $plugin;
110            }
111        }
112
113    }
114}
115?>
Note: See TracBrowser for help on using the repository browser.