示例#1
0
 public function listPlugins()
 {
     $pathplugins = new backend_controller_plugins();
     /**
      * Si le dossier est accessible en lecture
      */
     if (!is_readable($pathplugins->directory_plugins())) {
         throw new exception('Plugin dir is not minimal permission');
     }
     $makefiles = new magixcjquery_files_makefiles();
     $dir = $makefiles->scanRecursiveDir($pathplugins->directory_plugins());
     if ($dir != null) {
         plugins_Autoloader::register();
         $list = '';
         foreach ($dir as $d) {
             if (file_exists($pathplugins->directory_plugins() . $d . DIRECTORY_SEPARATOR . 'admin.php')) {
                 $pluginPath = $pathplugins->directory_plugins() . $d;
                 if ($makefiles->scanDir($pluginPath) != null) {
                     //Nom de la classe pour le test de la méthode
                     $class = 'plugins_' . $d . '_admin';
                     //Si la méthode run existe on ajoute le plugin dans le menu
                     if (method_exists($class, 'run')) {
                         $plugin[$class] = $d;
                     }
                 }
             }
         }
         return $plugin;
     }
 }
示例#2
0
 /**
  * Execute le module dans l'administration
  * @access public
  */
 public function run()
 {
     $header = new magixglobal_model_header();
     $create = new backend_controller_template();
     $plugin = new backend_controller_plugins();
     $create->addConfigFile(array('news'), array('news_'), false);
     $access = $this->model_access->module_access("backend_controller_news");
     $create->assign('access', $access);
     if (magixcjquery_filter_request::isGet('getlang')) {
         if (isset($this->action)) {
             if ($this->action == 'list') {
                 $max = 20;
                 if (magixcjquery_filter_request::isGet('json_list_news')) {
                     $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                     $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                     $header->pragma();
                     $header->cache_control("nocache");
                     $header->getStatus('200');
                     $header->json_header("UTF-8");
                     $this->json_list_news($max);
                 } else {
                     $create->assign('pagination', $this->news_pagination($max));
                     $create->display('news/list.tpl');
                 }
             } elseif ($this->action == 'add') {
                 if (isset($this->n_title)) {
                     $this->insert_news_data();
                 }
             } elseif ($this->action == 'edit') {
                 if (isset($this->edit)) {
                     $data = parent::s_news_data($this->edit);
                     $create->assign('plugin', $plugin->menu_item_plugin('news'));
                     if (magixcjquery_filter_request::isGet('json_urinews')) {
                         $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                         $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                         $header->pragma();
                         $header->cache_control("nocache");
                         $header->getStatus('200');
                         $header->json_header("UTF-8");
                         $this->json_uri($data);
                     } elseif (magixcjquery_filter_request::isGet('ajax_image')) {
                         $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                         $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                         $header->pragma();
                         $header->cache_control("nocache");
                         $header->getStatus('200');
                         $header->html_header("UTF-8");
                         $this->ajax_image($create, $data['n_image']);
                     } elseif (isset($this->n_image)) {
                         $this->update_news_image();
                     } elseif (isset($this->n_title)) {
                         $this->update_news_data();
                     } elseif (isset($this->name_tag)) {
                         $this->add_reltag();
                     } elseif (isset($this->delete_tag)) {
                         $this->remove_tag();
                     } else {
                         if (isset($this->plugin)) {
                             // Chargement du plugin dans les actualités (edition)
                             $this->load_edit_data($create, $data);
                             $param_arr = array($this->plugin, $this->getlang, $this->edit);
                             $plugin->extend_module($this->plugin, 'news', $param_arr);
                         } else {
                             $this->load_edit_data($create, $data);
                             $create->display('news/edit.tpl');
                         }
                     }
                 } else {
                     if (isset($this->published)) {
                         $this->update_published();
                     }
                 }
             } elseif ($this->action == 'remove') {
                 if (isset($this->delete_news)) {
                     $this->remove_news();
                 } elseif (isset($this->delete_image)) {
                     $this->remove_image();
                 }
             }
         }
     } else {
         if (magixcjquery_filter_request::isGet('json_graph')) {
             $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
             $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
             $header->pragma();
             $header->cache_control("nocache");
             $header->getStatus('200');
             $header->json_header("UTF-8");
             $this->json_graph();
         } elseif (isset($this->news_search)) {
             $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
             $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
             $header->pragma();
             $header->cache_control("nocache");
             $header->getStatus('200');
             $header->json_header("UTF-8");
             $this->json_url_news();
         } else {
             $create->display('news/index.tpl');
         }
     }
 }
示例#3
0
 * @package    Exec Files
 * @copyright  MAGIX CMS Copyright (c) 2010 Gerits Aurelien, 
 * http://www.magix-cms.com, magix-cms.com http://www.magix-cjquery.com
 * @license    Dual licensed under the MIT or GPL Version 3 licenses.
 * @version    1.2
 * @author Gérits Aurélien <*****@*****.**>
 * @name plugins
 *
 */
$baseadmin = 'baseadmin.php';
if (file_exists($baseadmin)) {
    require $baseadmin;
    if (!defined('PATHADMIN')) {
        throw new Exception('PATHADMIN is not defined');
    }
}
/**
 * Charge toutes les Classes de l'application
 */
require '../lib/mcbackend.php';
/**
 * Autoload Frontend
 */
$members = new backend_controller_login();
$members->securePage();
$members->closeSession();
if (magixcjquery_filter_request::isSession('keyuniqid_admin')) {
    backend_controller_config::load_attribute_config();
    $plugin = new backend_controller_plugins();
    $plugin->run();
}
示例#4
0
 /**
  * instance singleton self (DataObjects)
  * @access public
  */
 public static function create()
 {
     if (!isset(self::$_createInstance)) {
         if (is_null(self::$_createInstance)) {
             //$c = __CLASS__;
             self::$_createInstance = new backend_controller_plugins();
         }
     }
     return self::$_createInstance;
 }
/**
 * Author: Gerits Aurelien <aurelien[at]magix-cms[point]com>
 * Copyright: MAGIX CMS
 * Date: 15/02/13
 * Time: 01:06
 * License: Dual licensed under the MIT or GPL Version
 */
function smarty_function_widget_plugins_nav($params, $template)
{
    $plugins = new backend_controller_plugins();
    return $plugins->set_html_item(false);
}
示例#6
0
 /**
  * @param $iso
  * @param $createNodeXML
  */
 public function xml_plugin($iso, $createNodeXML)
 {
     $plugins = new backend_controller_plugins();
     $this->create_xml_file_plugin($iso, $plugins->pluginName());
     $createNodeXML;
     $this->endNodeXML();
 }
示例#7
0
 /**
  * @access public
  * Execute le plugin
  */
 public function run()
 {
     $create = new backend_controller_plugins();
     if (isset($this->action)) {
         if ($this->action == 'remove') {
             if (isset($this->clear)) {
                 //Si on veut supprimer les caches
                 $this->removeCache();
             }
         }
     } else {
         if (isset($this->tab)) {
             $create->display('about.tpl');
         } else {
             // Retourne la page index.tpl
             $create->display('index.tpl');
         }
     }
 }
示例#8
0
 /**
  * Execution du plugin
  */
 public function run()
 {
     $header = new magixglobal_model_header();
     $create = new backend_controller_plugins();
     if (magixcjquery_filter_request::isGet('getlang')) {
         if (isset($this->action)) {
             if ($this->action == 'list') {
                 $create->assign('array_plugin_i18n', $this->list_plugin($create));
                 $create->display('list.tpl');
             } elseif ($this->action == 'edit') {
                 if (isset($this->section)) {
                     if (isset($this->config_value)) {
                         $header->html_header("UTF-8");
                         $this->saveFiles($create, $this->section);
                     } else {
                         $create->assign('array_config_file', $this->getConfigFile($this->section));
                         $create->display('edit.tpl');
                     }
                 }
             }
         } elseif (isset($this->tab)) {
             $create->display('about.tpl');
         }
     }
 }
示例#9
0
 /**
  * Execute le module dans l'administration
  * @access public
  */
 public function run()
 {
     $header = new magixglobal_model_header();
     $create = new backend_controller_template();
     $plugin = new backend_controller_plugins();
     $create->addConfigFile(array('catalog'), array('catalog_'), false);
     $access = $this->model_access->module_access("backend_controller_catalog");
     $create->assign('access', $access);
     if (isset($this->section)) {
         if ($this->section === 'category') {
             if (isset($this->getlang)) {
                 if (isset($this->action)) {
                     if ($this->action === 'list') {
                         if (magixcjquery_filter_request::isGet('json_list_category')) {
                             $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                             $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                             $header->pragma();
                             $header->cache_control("nocache");
                             $header->getStatus('200');
                             $header->json_header("UTF-8");
                             $this->json_listing_category();
                         } elseif (isset($this->name_category)) {
                             $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                             $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                             $header->pragma();
                             $header->cache_control("nocache");
                             $header->getStatus('200');
                             $header->json_header("UTF-8");
                             $this->json_autocomplete_category();
                         }
                     } elseif ($this->action === 'add') {
                         if (isset($this->clibelle)) {
                             $this->addCategory($create);
                         }
                     } elseif ($this->action === 'edit') {
                         if (isset($this->edit)) {
                             $data = parent::s_catalog_category_data($this->edit);
                             $create->assign('plugin', $plugin->menu_item_plugin('catalog_category'));
                             if (magixcjquery_filter_request::isGet('json_uri_category')) {
                                 $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                                 $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                                 $header->pragma();
                                 $header->cache_control("nocache");
                                 $header->getStatus('200');
                                 $header->json_header("UTF-8");
                                 $this->json_uri_category($data);
                             } elseif (magixcjquery_filter_request::isGet('json_list_subcategory')) {
                                 $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                                 $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                                 $header->pragma();
                                 $header->cache_control("nocache");
                                 $header->getStatus('200');
                                 $header->json_header("UTF-8");
                                 $this->json_listing_subcategory();
                             } else {
                                 if (isset($this->tab)) {
                                     if ($this->tab === 'image') {
                                         if (isset($this->img_c)) {
                                             $this->update_category_image($data);
                                         } elseif (magixcjquery_filter_request::isGet('ajax_category_image')) {
                                             $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                                             $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                                             $header->pragma();
                                             $header->cache_control("nocache");
                                             $header->getStatus('200');
                                             $header->html_header("UTF-8");
                                             $this->ajax_category_image($create, $data['img_c']);
                                         } else {
                                             $this->load_category_edit_data($create, $data);
                                             $create->display('catalog/category/edit.tpl');
                                         }
                                     } elseif ($this->tab === 'subcat') {
                                         if (isset($this->slibelle)) {
                                             $this->addSubCategory($create);
                                         } elseif (isset($this->order_pages)) {
                                             $this->update_order_subcategory();
                                         } elseif (isset($this->delete_subcategory)) {
                                             $this->remove_subcategory();
                                         } else {
                                             $this->load_category_edit_data($create, $data);
                                             $create->display('catalog/category/edit.tpl');
                                         }
                                     } elseif ($this->tab === 'product') {
                                         if (isset($this->order_pages)) {
                                             $this->update_order_category_product();
                                         } elseif (magixcjquery_filter_request::isGet('json_category_product')) {
                                             $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                                             $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                                             $header->pragma();
                                             $header->cache_control("nocache");
                                             $header->getStatus('200');
                                             $header->json_header("UTF-8");
                                             $this->json_listing_category_product();
                                         } elseif (isset($this->delete_product)) {
                                             $this->remove_product_category();
                                         } else {
                                             $this->load_category_edit_data($create, $data);
                                             $create->display('catalog/category/edit.tpl');
                                         }
                                     }
                                 } elseif (isset($this->plugin)) {
                                     // Chargement du plugin dans le produit du catalogue (edition)
                                     $this->load_category_edit_data($create, $data);
                                     $param_arr = array($this->plugin, $this->getlang, $this->edit);
                                     $plugin->extend_module($this->plugin, 'catalog_category', $param_arr);
                                 } else {
                                     if (isset($this->clibelle)) {
                                         $this->update_category($create);
                                     } elseif (isset($this->delete_image)) {
                                         $this->remove_category_image();
                                     } else {
                                         $this->load_category_edit_data($create, $data);
                                         $create->display('catalog/category/edit.tpl');
                                     }
                                 }
                             }
                         } else {
                             if (isset($this->order_pages)) {
                                 $this->update_order_category();
                             }
                         }
                     } elseif ($this->action === 'remove') {
                         $this->remove_category($create);
                     }
                 } else {
                     $create->display('catalog/category/list.tpl');
                 }
             }
         } elseif ($this->section === 'subcategory') {
             if (isset($this->getlang)) {
                 if (isset($this->action)) {
                     if ($this->action === 'add') {
                     } elseif ($this->action === 'edit') {
                         if (isset($this->edit)) {
                             $data = parent::s_catalog_subcategory_data($this->edit);
                             $create->assign('plugin', $plugin->menu_item_plugin('catalog_subcategory'));
                             if (isset($this->tab)) {
                                 if ($this->tab === 'image') {
                                     if (magixcjquery_filter_request::isGet('ajax_subcategory_image')) {
                                         $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                                         $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                                         $header->pragma();
                                         $header->cache_control("nocache");
                                         $header->getStatus('200');
                                         $header->html_header("UTF-8");
                                         $this->ajax_subcategory_image($create, $data['img_s']);
                                     } elseif (isset($this->img_s)) {
                                         $this->update_subcategory_image($data);
                                     } else {
                                         $this->load_subcategory_edit_data($create, $data);
                                         $create->display('catalog/subcategory/edit.tpl');
                                     }
                                 } elseif ($this->tab === 'product') {
                                     if (isset($this->order_pages)) {
                                         $this->update_order_subcategory_product();
                                     } elseif (magixcjquery_filter_request::isGet('json_subcategory_product')) {
                                         $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                                         $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                                         $header->pragma();
                                         $header->cache_control("nocache");
                                         $header->getStatus('200');
                                         $header->json_header("UTF-8");
                                         $this->json_listing_subcategory_product();
                                     } elseif (isset($this->delete_product)) {
                                         $this->remove_product_category();
                                     } else {
                                         $this->load_subcategory_edit_data($create, $data);
                                         $create->display('catalog/subcategory/edit.tpl');
                                     }
                                 }
                             } else {
                                 if (magixcjquery_filter_request::isGet('json_uri_subcategory')) {
                                     $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                                     $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                                     $header->pragma();
                                     $header->cache_control("nocache");
                                     $header->getStatus('200');
                                     $header->json_header("UTF-8");
                                     $this->json_uri_subcategory($data);
                                 } elseif (isset($this->slibelle)) {
                                     $this->update_subcategory($create);
                                 } elseif (isset($this->delete_image)) {
                                     $this->remove_subcategory_image();
                                 } elseif (isset($this->plugin)) {
                                     // Chargement du plugin dans le produit du catalogue (edition)
                                     $this->load_subcategory_edit_data($create, $data);
                                     $param_arr = array($this->plugin, $this->getlang, $this->edit);
                                     $plugin->extend_module($this->plugin, 'catalog_subcategory', $param_arr);
                                 } else {
                                     $this->load_subcategory_edit_data($create, $data);
                                     $create->display('catalog/subcategory/edit.tpl');
                                 }
                             }
                         }
                     }
                 }
             }
         } elseif ($this->section === 'product') {
             if (isset($this->getlang)) {
                 if (isset($this->action)) {
                     if ($this->action === 'list') {
                         if (magixcjquery_filter_request::isGet('json_listing_product')) {
                             $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                             $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                             $header->pragma();
                             $header->cache_control("nocache");
                             $header->getStatus('200');
                             $header->json_header("UTF-8");
                             $this->json_listing_product(20);
                         } elseif (magixcjquery_filter_request::isGet('idclc')) {
                             $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                             $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                             $header->pragma();
                             $header->cache_control("nocache");
                             $header->getStatus('200');
                             $header->json_header("UTF-8");
                             $this->json_idcls($this->getidclc);
                         } elseif (isset($this->title_search)) {
                             $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                             $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                             $header->pragma();
                             $header->cache_control("nocache");
                             $header->getStatus('200');
                             $header->json_header("UTF-8");
                             $this->json_list_product();
                         } elseif (isset($this->name_product)) {
                             $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                             $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                             $header->pragma();
                             $header->cache_control("nocache");
                             $header->getStatus('200');
                             $header->json_header("UTF-8");
                             $this->json_autocomplete_product();
                         }
                     } elseif ($this->action === 'add') {
                         if (isset($this->titlecatalog)) {
                             $this->addProduct($create);
                         }
                     } elseif ($this->action === 'edit') {
                         $data = parent::s_catalog_data($this->edit);
                         $create->assign('plugin', $plugin->menu_item_plugin('catalog_product'));
                         if (isset($this->tab)) {
                             if ($this->tab === 'image') {
                                 if (isset($this->imgcatalog)) {
                                     $this->update_product_image($data);
                                 } elseif (magixcjquery_filter_request::isGet('ajax_product_image')) {
                                     $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                                     $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                                     $header->pragma();
                                     $header->cache_control("nocache");
                                     $header->getStatus('200');
                                     $header->html_header("UTF-8");
                                     $this->ajax_product_image($create, $data['imgcatalog']);
                                 } else {
                                     $this->load_product_edit_data($create, $data);
                                     $create->display('catalog/product/edit.tpl');
                                 }
                             } elseif ($this->tab === 'category') {
                                 if (magixcjquery_filter_request::isGet('json_product_category')) {
                                     $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                                     $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                                     $header->pragma();
                                     $header->cache_control("nocache");
                                     $header->getStatus('200');
                                     $header->json_header("UTF-8");
                                     $this->json_listing_product_category();
                                 } elseif (isset($this->idclc)) {
                                     $this->add_product_category();
                                 } elseif (isset($this->delete_product)) {
                                     $this->remove_product_category();
                                 } else {
                                     $this->load_product_edit_data($create, $data);
                                     $create->assign('array_list_category', $this->array_list_category());
                                     $create->display('catalog/product/edit.tpl');
                                 }
                             } elseif ($this->tab === 'product') {
                                 if (isset($this->idproduct)) {
                                     $this->addProductRel($create);
                                 } elseif (magixcjquery_filter_request::isGet('json_product_rel')) {
                                     $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                                     $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                                     $header->pragma();
                                     $header->cache_control("nocache");
                                     $header->getStatus('200');
                                     $header->json_header("UTF-8");
                                     $this->json_listing_product_rel();
                                 } elseif (isset($this->delete_product)) {
                                     $this->remove_product_rel();
                                 } else {
                                     $this->load_product_edit_data($create, $data);
                                     $create->display('catalog/product/edit.tpl');
                                 }
                             } elseif ($this->tab === 'galery') {
                                 if (magixcjquery_filter_request::isGet('json_list_galery')) {
                                     $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                                     $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                                     $header->pragma();
                                     $header->cache_control("nocache");
                                     $header->getStatus('200');
                                     $header->json_header("UTF-8");
                                     $this->json_list_galery();
                                 } elseif (isset($this->img_order)) {
                                     $this->update_order_galery();
                                 } elseif (isset($this->imgcatalog)) {
                                     $this->add_galery_image();
                                 } elseif (isset($this->delete_galery)) {
                                     $this->remove_product_galery();
                                 } else {
                                     $this->load_product_edit_data($create, $data);
                                     $create->display('catalog/product/edit.tpl');
                                 }
                             }
                         } else {
                             if (isset($this->delete_image)) {
                                 $this->remove_product_image();
                             }
                             if (isset($this->titlecatalog)) {
                                 $this->update_product($create);
                             } elseif (isset($this->plugin)) {
                                 // Chargement du plugin dans le produit du catalogue (edition)
                                 $this->load_product_edit_data($create, $data);
                                 $param_arr = array($this->plugin, $this->getlang, $this->edit);
                                 $plugin->extend_module($this->plugin, 'catalog_product', $param_arr);
                             } else {
                                 $this->load_product_edit_data($create, $data);
                                 $create->display('catalog/product/edit.tpl');
                             }
                         }
                     } elseif ($this->action === 'remove') {
                         $this->remove_product();
                     } elseif ($this->action === 'copy') {
                         if (isset($this->copy)) {
                             $this->copy_product();
                         }
                     } elseif ($this->action === 'move') {
                         if (isset($this->move)) {
                             $this->move_product();
                         }
                     }
                 } else {
                     $create->assign('select_lang', $this->lang_select());
                     $create->assign('pagination', $this->product_pagination(20));
                     $create->display('catalog/product/list.tpl');
                 }
             }
         }
     } else {
         if (magixcjquery_filter_request::isGet('json_graph')) {
             $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
             $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
             $header->pragma();
             $header->cache_control("nocache");
             $header->getStatus('200');
             $header->json_header("UTF-8");
             $this->json_graph();
         } elseif (isset($this->product_search)) {
             $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
             $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
             $header->pragma();
             $header->cache_control("nocache");
             $header->getStatus('200');
             $header->json_header("UTF-8");
             $this->json_url_product();
         } else {
             $create->display('catalog/index.tpl');
         }
     }
 }