Example #1
0
 /**
  * @return array
  */
 public function getLinks()
 {
     $iso = $this->template->getLanguage();
     if ($iso == null) {
         $default = parent::getDefaultLang();
         $iso = $default['iso'];
     }
     $links = parent::g_links($iso);
     if ($links != null) {
         return $links;
     }
 }
Example #2
0
 /**
  * @return array
  */
 public function getAdvs()
 {
     $iso = $this->template->getLanguage();
     if ($iso == null) {
         $default = parent::getDefaultLang();
         $iso = $default['iso'];
     }
     $advs = parent::g_advs($iso);
     if ($advs != null) {
         return $advs;
     }
 }
Example #3
0
 /**
  * Execute le plugin dans la partie public
  */
 public function run()
 {
     if (isset($this->pstring1) && isset($this->pnum1)) {
         $page = $this->getAboutPage(parent::getPageId($this->pnum1, $this->getlang));
         if ($page != null && $page['uri'] == $this->pstring1) {
             $this->template->assign('page', $page);
             $this->template->assign('parent', parent::getParent($page['parent'], $this->getlang));
             $this->template->display('index.tpl');
         }
     } else {
         $page = $this->getAboutPage(parent::getPage($this->getlang));
         $this->template->assign('page', $page);
         $this->template->display('index.tpl');
     }
 }
Example #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 frontend_controller_plugins();
         }
     }
     return self::$_createInstance;
 }
Example #5
0
# -- END LICENSE BLOCK -----------------------------------

# DISCLAIMER

# Do not edit or add to this file if you wish to upgrade MAGIX CMS to newer
# versions in the future. If you wish to customize MAGIX CMS for your
# needs please refer to http://www.magix-cms.com for more information.
*/
/**
 * MAGIX CMS
 * @category   index 
 * @package    Exec Files
 * @copyright MAGIX CMS Copyright (c) 2011 Gerits Aurelien, 
 * http://www.magix-cms.com,  http://www.magix-cjquery.com
 * @license    Dual licensed under the MIT or GPL Version 3 licenses.
 * @version    1.3
 * @author Gérits Aurélien <*****@*****.**> | <*****@*****.**>
 * @name plugins
 *
 */
/**
 * Charge toutes les Classes de l'application
 */
require 'lib/mcfrontend.php';
$plugins = new frontend_controller_plugins();
if ($plugins->getplugin()) {
    $config = new frontend_model_config();
    $create = new frontend_controller_plugins();
    $config->load_data_setting($create);
    $plugins->display_plugins();
}
Example #6
0
 /**
  * Execute le plugin dans la partie public
  */
 public function run()
 {
     $this->template->configLoad();
     $this->template->assign('faq', $this->getQAs());
     $this->template->display('index.tpl');
 }
Example #7
0
 /**
  *
  * Execute le plugin dans la partie public
  */
 public function run()
 {
     if (magixcjquery_filter_request::isSession('key_cart')) {
         $session_key = $_SESSION['key_cart'];
     } else {
         $session_key = null;
     }
     if (isset($this->module)) {
         $this->activeMods = $this->module->load_module(false);
     }
     //Chargement des données de traduction
     $this->_loadConfigVars();
     $create = frontend_controller_plugins::create();
     $header = new magixglobal_model_header();
     if (isset($this->mod) && isset($this->action)) {
         $cartMod = $this->activeMods[$this->mod];
         $params = array('params' => $_GET['params'], 'controller' => $this->template);
         call_user_func(array($cartMod, $this->action), $params);
     } elseif (isset($this->add_cart)) {
         $this->add_item_cart($_POST, $session_key);
     } elseif (isset($this->delete_item)) {
         $this->delete_item_cart($this->item_to_delete, $create);
     } elseif (isset($this->json_cart)) {
         $this->template->assign('getDataConfig', $this->getConfigData());
         $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->load_cart_ajax($this->json_cart);
         $cartData = $this->getItemCartData($this->json_cart);
         $this->template->assign('getItemCartData', $cartData);
         if (!empty($cartData)) {
             $this->template->assign('getItemPriceData', $this->getItemPriceData($this->json_cart));
             $this->template->assign('setParamsData', array('remove' => 'true', 'editQuantity' => 'true'));
             $this->template->display('loop/cart.tpl');
         } else {
             return false;
         }
     } elseif (isset($this->get_nbr_items)) {
         $this->load_cart_nbr_item($session_key);
     } elseif (isset($this->get_price_items)) {
         $this->load_cart_price_item($session_key);
     } elseif (isset($this->get_amount_to_pay)) {
         $prices = $this->load_cart_amount($this->get_amount_to_pay);
         $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");
         print $prices['amount_to_pay'];
     } elseif (isset($this->pstring1)) {
         $this->template->assign('getDataConfig', $this->getConfigData());
         if ($this->pstring2 == 'process') {
             $this->getProcessOrder($create);
         } elseif (isset($this->pstring2)) {
             if ($this->pstring2 == 'success') {
                 unset($_SESSION['key_cart']);
                 $this->getNotify('success', false);
             } elseif ($this->pstring2 == 'refused') {
                 unset($_SESSION['key_cart']);
                 $this->getNotify('refused', false);
             } elseif ($this->pstring2 == 'cancel') {
                 unset($_SESSION['key_cart']);
                 $this->getNotify('cancel', false);
             } elseif ($this->pstring2 == 'exception') {
                 unset($_SESSION['key_cart']);
                 $this->getNotify('exception', false);
             }
             $create->display('payment_statut.tpl');
         } else {
             if (isset($this->id_cart_to_send)) {
                 $this->validate_cart($this->id_cart_to_send, $create);
                 $this->load_cart_data($session_key, $create);
                 $create->assign('getItemCartData', $this->getItemCartData($this->id_cart_to_send));
                 $create->assign('getItemPriceData', $this->getItemPriceData($this->id_cart_to_send));
                 $create->assign('setParamsData', array('remove' => 'false', 'editQuantity' => 'false'));
                 $create->display('payment_resume.tpl');
             } else {
                 $this->load_cart_data($session_key, $create);
                 $create->assign('getItemCartData', $this->getItemCartData($this->id_cart_to_send));
                 $create->assign('getItemPriceData', $this->getItemPriceData($this->id_cart_to_send));
                 $create->assign('setParamsData', array('remove' => 'false', 'editQuantity' => 'false'));
                 $create->display('payment_resume.tpl');
             }
         }
     } else {
         if (magixcjquery_filter_request::isSession('key_cart')) {
             if (isset($this->devis_to_send)) {
                 //$this->validate_cart($this->id_cart_to_send,$create);
                 $dataCart = $this->getItemPriceData($this->id_cart_to_send);
                 parent::i_cart_order($this->id_cart_to_send, magixglobal_model_cryptrsa::uuid_generator(), $dataCart['amount_products'], $dataCart['shipping_ttc'], 'EUR', 'bank_wire');
                 $this->sendOrder($this->id_cart_to_send, $create, false);
                 parent::u_transmission_cart($this->id_cart_to_send, 1);
                 $this->getNotify('success', true);
                 //Supprime la session du panier après envoi du mail si le système de devis est activé
                 unset($_SESSION['key_cart']);
                 //return;
             } elseif (isset($this->quantity_qty)) {
                 $this->update_quantity_item();
             } elseif (isset($this->attr)) {
                 $this->update_attr_item();
             } elseif (isset($_GET['testmail'])) {
                 $cart = 1;
                 if (!empty($_GET['testmail'])) {
                     $testmail = intval($_GET['testmail']);
                     $cart = is_int($testmail) ? $testmail : 1;
                 }
                 $this->sendOrder($cart, $create, true);
             } else {
                 $this->modelSystem = new magixglobal_model_system();
                 frontend_model_template::addConfigFile(array($this->modelSystem->base_path() . 'plugins/cartpay/i18n/tools'), array('country_'), false);
                 $data_cart = parent::s_cart_session($session_key);
                 $id_cart = $data_cart['id_cart'];
                 $this->load_cart_data($session_key, $create);
                 $create->assign('getItemCartData', $this->getItemCartData($id_cart));
                 $create->assign('getItemPriceData', $this->getItemPriceData($id_cart));
                 $create->assign('setParamsData', array('remove' => 'true', 'editQuantity' => 'true'));
                 // getDataConfig
                 $getDataConfig = $this->getConfigData();
                 if ($getDataConfig['online_payment'] === '1') {
                     $create->assign('setPaymentType', 'secure');
                 } else {
                     $create->assign('setPaymentType', 'devis');
                 }
                 $this->template->assign('getDataConfig', $getDataConfig);
                 $this->template->assign('getItemsCountryData', $this->getItemsTvaData(array('fetch' => 'all', 'context' => 'country')));
                 $moduleJS = array();
                 $dynamicForm = false;
                 if (!empty($this->activeMods)) {
                     foreach ($this->activeMods as $name => $mod) {
                         if (property_exists($mod, 'js_impact')) {
                             if ($mod->js_impact) {
                                 $moduleJS[] = $name;
                             }
                         }
                         if ($name == 'profil' && $getDataConfig['profil'] || $name != 'profil') {
                             if (property_exists($mod, 'dynamicForm')) {
                                 if ($mod->dynamicForm) {
                                     $confdir = magixglobal_model_system::base_path() . 'plugins/' . $name . '/i18n/';
                                     $lang = frontend_model_template::getLanguage();
                                     if (file_exists($confdir)) {
                                         $translate = !empty($lang) ? $lang : 'fr';
                                         frontend_model_smarty::getInstance()->configLoad($confdir . 'public_local_' . $translate . '.conf', null);
                                         $dynamicForm = $this->template->fetch('forms/order.tpl', $name);
                                     }
                                 }
                             }
                         }
                     }
                 }
                 $this->template->assign('moduleJS', $moduleJS);
                 $this->template->assign('dynamicForm', $dynamicForm);
                 $create->display('index.tpl');
             }
         }
     }
 }
Example #8
0
 /**
  * Execute le plugin dans la partie public
  */
 public function run()
 {
     $create = frontend_controller_plugins::create();
     $create->configLoad();
     if (isset($this->email)) {
         $this->send_email($create);
     } else {
         $create->display('index.tpl');
     }
 }