Page
[ class tree: Page ] [ index: Page ] [ all elements ]

Source for file LC_Page_Admin_Plugin.php

Documentation is available at LC_Page_Admin_Plugin.php

  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.  
  24. require_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: LC_Page_Admin_Plugin.php 20764 2011-03-22 06:26:40Z nanasess $
  32.  */
  33. class 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 !== trueSC_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. ?>

Documentation generated on Fri, 24 Feb 2012 14:01:31 +0900 by Seasoft