/** * EcataloguE * * @author Aleksey Yaroshchuk (aleksey.yaroshchuk@gmail.com) * @license GNU/GPL * @package plugins * @subpackage ecatalogue * @copyright (c) Aleksey Yaroshchuk 2011-2012 * @link http://www.spip-contrib.net/EcataloguE */ function ecatalogue_affiche_milieu($flux) { $exec = $flux['args']['exec']; // Attach to articles if ($exec == 'article' and $id_article = $flux['args']['id_article']) { //$id_article = $flux['args']['id_article']; if (!($id_rubrique = $flux['args']['id_rubrique'])) { $id_rubrique = sql_getfetsel('id_rubrique', 'spip_articles', 'id_article=' . $id_article); } include_spip('classes/class.Ecatalogue'); $catalogue = new Ecatalogue(); if ($catalogue->IsEcatalogueRubrique($id_rubrique)) { $contexte = $_GET; //$flux['data'] .= recuperer_fond('prive/box/ecatalogue_article', $contexte, array('ajax'=>true)); $texte = recuperer_fond('prive/box/ecatalogue_article', $contexte, array('ajax' => true)); ecatalogue_attach_text_to_flux_for_affiche_milieu_pipeline($texte, $flux); } } // Attach to rubriques if ($exec == 'rubrique' and $id_rubrique = $flux['args']['id_rubrique']) { include_spip('classes/class.Ecatalogue'); $catalogue = new Ecatalogue(); if ($catalogue->IsEcatalogueRubrique($id_rubrique)) { $contexte = $_GET; $texte = recuperer_fond('prive/box/ecatalogue_rubrique', $contexte, array('ajax' => true)); ecatalogue_attach_text_to_flux_for_affiche_milieu_pipeline($texte, $flux); } } return $flux; }
/** * This filtre return TRUE if given rubrique is ecatalogue rubrique */ function filtre_is_ecatalogue_rubrique($id_rubrique) { include_spip('classes/class.Ecatalogue'); $catalogue = new Ecatalogue(); if ($catalogue->IsEcatalogueRubrique($id_rubrique)) { return 'TRUE'; } else { return ''; } }
/** * Inserts product with given $id_article if $id_rubrique is ecatalogue rubrique */ function insert_product($id_article, $id_rubrique) { include_spip('classes/class.Ecatalogue'); include_spip('classes/class.ProductModel'); $catalogue = new Ecatalogue(); $product_mdl = new ProductModel(); if ($catalogue->IsEcatalogueRubrique($id_rubrique)) { $data['id_article'] = $id_article; $product_mdl->insert($data); } }