示例#1
0
 /**
  * main action
  */
 public function mainAction()
 {
     require_once 'models/ecommerce/ecommerce_product_taxonomy.php';
     $ProductTaxonomy = new ecommerce_product_taxonomy();
     $node_id = $this->GET['id'];
     require_once 'models/common/common_taxonomy.php';
     $Taxonomy = new common_taxonomy();
     //listing
     if (is_numeric($node_id)) {
         $current = $ProductTaxonomy->getRelationsToNode($node_id);
         if (is_array($current)) {
             foreach ($current as $c_id) {
                 $taxonomy_data = $Taxonomy->taxonomyItemDetail($c_id);
                 $option = $taxonomy_data['label'];
                 $this->tpl->assign("OPTION", $taxonomy_data['label']);
                 //check if it is a Product Options
                 if ($taxonomy_data['parent'] == $ProductTaxonomy->conf['options_id']) {
                     $taxonomy_list = $Taxonomy->getChildren($taxonomy_data['id']);
                     foreach ($taxonomy_list as $item) {
                         if ($item['label']['publish'] == 1) {
                             $this->tpl->assign("ITEM", $item);
                             $this->tpl->parse("content.option.item");
                         }
                     }
                     $this->tpl->parse("content.option");
                 }
             }
         }
     }
     return true;
 }
示例#2
0
 /**
  * post action
  */
 function post()
 {
     parent::post();
     //dropdowns
     $Offer_Group = new ecommerce_offer_group();
     $Taxonomy = new common_taxonomy();
     $conf = ecommerce_offer::initConfiguration();
     $groups_in_progress = $Offer_Group->listing("schedule_start <= NOW() AND (schedule_end IS NULL OR schedule_end >= NOW())", "id DESC");
     $groups_scheduled = $Offer_Group->listing("schedule_start > NOW()", "id DESC");
     $groups_past = $Offer_Group->listing("(schedule_start < NOW() OR schedule_start IS NULL) AND schedule_end IS NOT NULL AND schedule_end < NOW()", "id DESC");
     $campaign_categories = $Taxonomy->getChildren($conf['campaign_category_parent_id']);
     $roundel_categories = $Taxonomy->getChildren($conf['roundel_category_parent_id']);
     $this->parseOffersSelectGroup($groups_in_progress, 'In Progress', $this->node_data['component']['offer_group_id']);
     $this->parseOffersSelectGroup($groups_scheduled, 'Scheduled', $this->node_data['component']['offer_group_id']);
     $this->parseOffersSelectGroup($groups_past, 'Past', $this->node_data['component']['offer_group_id']);
     $this->parseCategorySelect($campaign_categories, $this->node_data['component']['campaign_category_id'], 'campaign_category_item');
     $this->parseCategorySelect($roundel_categories, $this->node_data['component']['roundel_category_id'], 'roundel_category_item');
     $this->parseTemplatesSelect($this->node_data['component']['template']);
 }
示例#3
0
 /**
  * main action
  */
 public function mainAction()
 {
     /**
      * input variables
      */
     if (is_numeric($this->GET['parent'])) {
         $parent = $this->GET['parent'];
     } else {
         $parent = 0;
     }
     if ($this->GET['publish'] == 1) {
         $published_only = true;
     } else {
         $published_only = false;
     }
     /* optional node_id and relation to show only related items (associated categories) */
     if (is_numeric($this->GET['node_id'])) {
         $node_id = $this->GET['node_id'];
     } else {
         $node_id = false;
     }
     if ($this->GET['relation']) {
         $relation = $this->GET['relation'];
     } else {
         $relation = false;
     }
     if (is_numeric($node_id) && $relation) {
         $related_taxonomy_label_list = $this->findOnlyRelated($node_id, $relation);
     } else {
         $related_taxonomy_label_list = false;
     }
     require_once 'models/common/common_taxonomy.php';
     $Taxonomy = new common_taxonomy();
     $list = $Taxonomy->getChildren($parent, 'priority DESC, id ASC', true);
     foreach ($list as $item) {
         // process only if filtering by related isn't required or current item is matching
         if ($related_taxonomy_label_list === false || is_array($related_taxonomy_label_list) && is_array($related_taxonomy_label_list[$item['label_id']])) {
             $this->assignAndParseItem($item);
         }
     }
     return true;
 }
示例#4
0
 /**
  * main action
  */
 public function mainAction()
 {
     if (is_numeric($this->GET['parent'])) {
         $parent = $this->GET['parent'];
     } else {
         $parent = 0;
     }
     if ($this->GET['publish'] == 1) {
         $published_only = true;
     } else {
         $published_only = false;
     }
     require_once 'models/common/common_taxonomy.php';
     $Taxonomy = new common_taxonomy();
     $list = $Taxonomy->getChildren($parent, 'priority DESC, id ASC', true);
     foreach ($list as $item) {
         $this->tpl->assign('ITEM', $item);
         /**
          * image
          */
         if (is_array($item['label']['image']) && count($item['label']['image']) > 0) {
             $image = $item['label']['image'][0];
             $this->tpl->assign('IMAGE', $image);
             if (is_numeric($image['link_to_node_id'])) {
                 $this->tpl->parse('content.item.image_link');
             } else {
                 $this->tpl->parse('content.item.image');
             }
         }
         /**
          * content
          */
         $this->tpl->parse('content.item');
     }
     return true;
 }
示例#5
0
 /**
  * getTaxonomyBranch
  */
 public function getTaxonomyBranch($parent)
 {
     require_once 'models/common/common_taxonomy.php';
     $Taxonomy = new common_taxonomy();
     return $Taxonomy->getChildren($parent);
 }
示例#6
0
 /**
  * getRecipeTaxonomy
  * TODO: this should re-used or merged with /api/v1.3/recipe_category_list
  */
 public function getRecipeTaxonomy()
 {
     // get categories from taxonomy
     require_once 'models/common/common_taxonomy.php';
     $Taxonomy = new common_taxonomy();
     $recipe_categories = $Taxonomy->getChildren($this->conf['taxonomy_tree_id']);
     return $recipe_categories;
 }