예제 #1
0
파일: seo.php 프로젝트: biggtfish/magixcms
 /**
  * 
  * Execute la fonction run
  */
 public function run()
 {
     $header = new magixglobal_model_header();
     $create = new backend_controller_template();
     $create->addConfigFile(array('seo'), array('seo_'), false);
     if (magixcjquery_filter_request::isGet('getlang')) {
         if (isset($this->action)) {
             if ($this->action == 'list') {
                 if (magixcjquery_filter_request::isGet('json_list_seo')) {
                     $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_metas();
                 } else {
                     $this->select_attribute($create);
                     $this->select_level($create);
                     $this->select_metas($create);
                     $create->display('seo/list.tpl');
                 }
             } elseif ($this->action == 'add') {
                 if (isset($this->strrewrite)) {
                     $this->add();
                 }
             } elseif ($this->action == 'edit') {
                 if (isset($this->edit)) {
                     $data = parent::s_rewrite_data($this->edit);
                     if (isset($this->strrewrite)) {
                         $this->update();
                     } else {
                         $this->load_rewrite($create, $data);
                         $this->select_attribute($create, $data['attribute']);
                         $this->select_level($create, $data['level']);
                         $this->select_metas($create, $data['idmetas']);
                         $create->display('seo/edit.tpl');
                     }
                 }
             } elseif ($this->action == 'remove') {
                 if (isset($this->delete_metas)) {
                     $this->remove_rewrite();
                 }
             }
         }
     } 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();
         } else {
             $create->display('seo/index.tpl');
         }
     }
 }
예제 #2
0
 /**
  *
  */
 public function save($type)
 {
     if (!empty($this->title) && !empty($this->url)) {
         $page = array('idlang' => $this->getlang, 'title' => $this->title, 'content' => isset($this->content) && !empty($this->content) ? $this->content : NULL, 'url' => $this->url, 'blank' => isset($this->blank) && !empty($this->blank) ? 1 : 0, 'ltype' => $this->ltype);
         switch ($type) {
             case 'add':
                 $c = parent::c_link($this->getlang);
                 if ($c != null) {
                     $page['lorder'] = $c['nb'];
                 } else {
                     $page['lorder'] = 0;
                 }
                 parent::i_link($page);
                 $this->template->assign('links', parent::getLastlink($this->getlang));
                 $header = new magixglobal_model_header();
                 $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->message->json_post_response(true, 'save', self::$notify, $this->template->fetch('loop/list.tpl'));
                 break;
             case 'update':
                 $page['id'] = $this->idlink;
                 parent::u_link($page);
                 $this->notify('save');
                 break;
         }
     }
 }
예제 #3
0
파일: news.php 프로젝트: biggtfish/magixcms
 /**
  * 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');
         }
     }
 }
예제 #4
0
 /**
  *
  */
 public function run()
 {
     $header = new magixglobal_model_header();
     if (magixcjquery_filter_request::isGet('json_check')) {
         $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_check();
     } elseif (magixcjquery_filter_request::isGet('json_chmod')) {
         $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_chmod();
     } else {
         app_model_smarty::getInstance()->display('analysis/index.tpl');
     }
 }
예제 #5
0
파일: ajax.php 프로젝트: biggtfish/magixcms
 /**
  * Execution des scripts de la classe
  */
 public function run()
 {
     $header = new magixglobal_model_header();
     $create = new backend_controller_template();
     if (magixcjquery_filter_request::isGet('getlang')) {
     } else {
         if (isset($this->action)) {
             if ($this->action == 'list') {
                 if (isset($this->tab)) {
                     if ($this->tab === 'snippet') {
                         $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->javascript_header("UTF-8");
                         $this->jsSnippet('snippet');
                     }
                 }
             }
         }
     }
 }
예제 #6
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');
         }
     }
 }
예제 #7
0
 /**
  * execution du module d'accès
  */
 public function run()
 {
     $header = new magixglobal_model_header();
     $create = new backend_controller_template();
     $create->addConfigFile(array('users'), array('users_'), false);
     $access = $this->model_access->module_access("backend_controller_access");
     $all_access = $this->model_access->all_data_employee($this->model_access->data_session());
     //print_r($all_access);
     $create->assign('access', $access);
     $create->assign('all_access', $all_access);
     //if($access['view'] == 1)
     if ($this->action == 'add') {
         if (isset($this->role_name)) {
             $this->add_profile($this->role_name);
         } elseif (isset($this->id_module)) {
             $this->add_new_access($this->id_module);
         } else {
             $create->display('access/add.tpl');
         }
     } elseif ($this->action == 'list') {
         if (magixcjquery_filter_request::isGet('json_profiles')) {
             $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->listing_profile();
         } elseif (magixcjquery_filter_request::isGet('json_access')) {
             $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->listing_access();
         } else {
             $create->display('access/list.tpl');
         }
     } elseif ($this->action == 'edit') {
         if (isset($this->role_name)) {
             $this->edit_profile($this->role_name);
         } elseif ($this->id_access) {
             $this->edit_access();
         } else {
             $this->load_data_profile($create);
             $create->display('access/edit.tpl');
         }
     } elseif ($this->action == 'remove') {
         if (isset($this->delete_role)) {
             $this->remove_role($this->delete_role);
         }
     } else {
         $access = new backend_model_access();
         /*print "<pre>";
           print_r($access->listPlugins());
           print "</pre>";*/
         $create->display('access/list.tpl');
     }
 }
예제 #8
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');
             }
         }
     }
 }
예제 #9
0
 /**
  * Affiche les pages de l'administration du plugin
  * @access public
  */
 public function run()
 {
     $header = new magixglobal_model_header();
     $create = new backend_controller_plugins();
     if (self::install_table($create) == true) {
         if (magixcjquery_filter_request::isGet('getlang')) {
             if (isset($this->action)) {
                 if ($this->action == 'json') {
                     $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->jsonList();
                 } elseif ($this->action == 'list') {
                     $create->display('list.tpl');
                 } elseif ($this->action == 'add') {
                     $this->add();
                 } elseif ($this->action == 'remove') {
                     if (isset($this->delete_contact)) {
                         $this->remove();
                     }
                 }
             } elseif (isset($this->tab)) {
                 $create->display('about.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();
             } else {
                 $create->display('index.tpl');
             }
         }
     }
 }
예제 #10
0
 /**
  * 
  * run
  */
 public function run()
 {
     $header = new magixglobal_model_header();
     $create = new backend_controller_template();
     $create->addConfigFile(array('users'), array('users_'), false);
     if (isset($this->action)) {
         if ($this->action === 'add') {
             if (isset($this->email_admin)) {
                 $this->insert_user();
             }
         } elseif ($this->action === 'list') {
             if (magixcjquery_filter_request::isGet('json_list_user')) {
                 $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_user();
             } else {
                 $create->assign('role_select', $this->role_select($create));
                 $create->display('user/list.tpl');
             }
         } elseif ($this->action === 'edit') {
             if (isset($this->email_admin)) {
                 $this->update_user_data();
             } elseif (isset($this->id_role)) {
                 $this->update_user_role();
             } elseif (isset($this->passwd_admin)) {
                 $this->update_user_password();
             } elseif (isset($this->active_admin)) {
                 $this->edit_active_employee($this->active_admin);
             } else {
                 $this->load_data($create);
                 $create->assign('role_select', $this->role_select($create, $this->edit));
                 $create->display('user/edit.tpl');
             }
         } elseif ($this->action === 'remove') {
             if (isset($this->delete_employee)) {
                 $this->remove_user();
             }
         }
     } 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();
         } else {
             $create->display('user/index.tpl');
         }
     }
 }
예제 #11
0
 /**
  * Execute le module dans l'administration
  * @access public
  */
 public function run()
 {
     $header = new magixglobal_model_header();
     $create = new backend_controller_template();
     if (isset($this->action)) {
         if ($this->action == 'list') {
             if (magixcjquery_filter_request::isGet('ajax_tpl')) {
                 $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");
                 $create->assign('themes', $this->scanTemplateDir($create));
                 $create->display('theming/req.tpl');
             }
         } elseif ($this->action == 'edit') {
             if (isset($this->ptheme)) {
                 $this->update();
             }
         }
     } else {
         $create->assign('themes', $this->scanTemplateDir($create));
         $create->display('theming/index.tpl');
     }
 }
예제 #12
0
파일: home.php 프로젝트: biggtfish/magixcms
 /**
  * Execute le module dans l'administration
  * @access public
  */
 public function run()
 {
     $header = new magixglobal_model_header();
     $create = new backend_controller_template();
     $create->addConfigFile(array('home'), array('home_'), false);
     $access = $this->model_access->module_access("backend_controller_home");
     $create->assign('access', $access);
     if (isset($this->action)) {
         if ($this->action == 'list') {
             if (magixcjquery_filter_request::isGet('json_list_home')) {
                 $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_home();
             } else {
                 $create->assign('select_lang', $this->lang_select($create));
                 $create->display('home/list.tpl');
             }
         } elseif ($this->action == 'add') {
             if (isset($this->subject)) {
                 $this->insert_new_page();
             }
         } elseif ($this->action == 'edit') {
             if (magixcjquery_filter_request::isGet('edit')) {
                 if (isset($this->subject)) {
                     $this->update_data_page();
                 } else {
                     $this->load_data_page($create);
                     $create->display('home/edit.tpl');
                 }
             }
         } elseif ($this->action == 'remove') {
             if (isset($this->delete_home)) {
                 $this->remove_home();
             }
         }
     } 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();
         } else {
             $create->display('home/index.tpl');
         }
     }
 }
예제 #13
0
파일: lang.php 프로젝트: biggtfish/magixcms
 /**
  * @access public
  * Execution de la structure
  */
 public function run()
 {
     $header = new magixglobal_model_header();
     $create = new backend_controller_template();
     $create->addConfigFile(array('language'), array('language_'), false);
     if (isset($this->action)) {
         if ($this->action == 'list') {
             if (magixcjquery_filter_request::isGet('json_list_lang')) {
                 $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_language();
             } else {
                 $iso = backend_model_forms::code_iso("iso");
                 $create->assign('iso', $iso);
                 $create->display('lang/list.tpl');
             }
         } elseif ($this->action == 'add') {
             if (isset($this->iso)) {
                 $this->insert_new_lang($create);
             }
         } elseif ($this->action == 'edit') {
             if (magixcjquery_filter_request::isGet('edit')) {
                 if (isset($this->iso)) {
                     $this->edit_lang();
                 } else {
                     $this->load_data_language($create);
                     backend_controller_template::display('lang/edit.tpl');
                 }
             } else {
                 if (isset($this->active_lang)) {
                     $this->update_activate_lang();
                 }
             }
         } elseif ($this->action == 'remove') {
             if (magixcjquery_filter_request::isPost('delete_lang')) {
                 $this->delete_lang_record($create);
             }
         }
     } 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();
         } else {
             $iso = backend_model_forms::code_iso("iso");
             backend_controller_template::assign('iso', $iso);
             backend_controller_template::display('lang/index.tpl');
         }
     }
 }
예제 #14
0
파일: cms.php 프로젝트: biggtfish/magixcms
 /**
  * execute la fonction run pour l'administration CMS
  * @access public 
  */
 public function run()
 {
     $header = new magixglobal_model_header();
     $create = new backend_controller_template();
     $create->addConfigFile(array('cms'), array('pages_'), false);
     $access = $this->model_access->module_access("backend_controller_cms");
     $create->assign('access', $access);
     if (magixcjquery_filter_request::isGet('getlang')) {
         if (isset($this->action)) {
             if ($this->action == 'list') {
                 if (magixcjquery_filter_request::isGet('json_page_p')) {
                     $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_parent_p();
                 } elseif (magixcjquery_filter_request::isGet('title_p_lang')) {
                     $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_cat_p_lang();
                 } elseif (magixcjquery_filter_request::isGet('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_autocomplete();
                 } elseif (isset($this->get_page_p)) {
                     if (magixcjquery_filter_request::isGet('json_child_p')) {
                         $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_child_page();
                     } else {
                         $create->assign('parent_title', $this->parent_page($this->get_page_p));
                         $create->assign('language', $this->parent_language($this->getlang));
                         $create->display('cms/child_page.tpl');
                     }
                 } elseif (isset($this->order_pages)) {
                     $this->update_order_page();
                 } elseif (magixcjquery_filter_request::isPost('idpage')) {
                     $this->update_sidebar_status();
                 } else {
                     $create->assign('selectlang', null);
                     $create->assign('language', $this->parent_language($this->getlang));
                     $create->display('cms/parent_page.tpl');
                 }
             } elseif ($this->action == 'add') {
                 if (isset($this->get_page_p)) {
                     if (isset($this->title_page)) {
                         $this->insert_new_child_page($create, $this->title_page, $this->get_page_p);
                     }
                 } elseif (magixcjquery_filter_request::isGet('add_parent_p')) {
                     $this->insert_new_page_p($this->title_page, $this->idlang);
                 } elseif (isset($this->title_page)) {
                     $this->insert_new_page_p($this->title_page);
                 }
             } elseif ($this->action == 'edit') {
                 if (isset($this->edit)) {
                     if (magixcjquery_filter_request::isPost('idlang_p')) {
                         $this->insert_new_rel_lang_p($this->idlang_p);
                     } elseif (magixcjquery_filter_request::isPost('title_page')) {
                         $this->update_page($this->title_page);
                     } elseif (magixcjquery_filter_request::isPost('del_relang_p')) {
                         $this->delete_related_lang();
                     } elseif (magixcjquery_filter_request::isGet('json_uricms')) {
                         $this->json_uricms($this->edit);
                     } elseif (magixcjquery_filter_request::isGet('json_child_lang_page')) {
                         $this->json_other_language_page($this->edit);
                     } else {
                         $this->load_edit_page($this->edit);
                         $create->display('cms/edit.tpl');
                     }
                 }
             } elseif ($this->action == 'move') {
                 if (magixcjquery_filter_request::isPost('idlang')) {
                     $this->update_move_page($create);
                 } else {
                     $this->load_data_move_page($create, $this->edit);
                     $create->display('cms/move.tpl');
                 }
             } elseif ($this->action == 'remove') {
                 if (magixcjquery_filter_request::isPost('delpage')) {
                     $this->delete_page();
                 }
             }
         }
     } 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->page_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_page();
         } else {
             $create->display('cms/index.tpl');
         }
     }
 }