Esempio n. 1
0
 /**
  * main action
  */
 public function mainAction()
 {
     $this->Node = new common_node();
     $node_data = $this->Node->nodeDetail($this->GET['id']);
     if (!is_numeric($node_data['component']['node_id'])) {
         msg("Target Id page is not number", "error");
         return false;
     }
     // set default link text if required
     $params = '';
     if (trim($node_data['component']['teaser_text']) != '') {
         $params .= ":teaser_text=" . urlencode($node_data['component']['teaser_text']);
     }
     if (trim($node_data['component']['link_text']) != '') {
         $params .= ":link_text=" . urlencode($node_data['component']['link_text']);
     }
     // check for image override
     $image = $this->Node->getTeaserImageForNodeId($this->GET['id']);
     // in the actual node/content/teaser (not the target page)
     if ($image) {
         $params .= ":img_src=" . urlencode($image['src']);
     }
     /**
      * call controller
      */
     $_Onxshop_Request = new Onxshop_Request("component/teaser~target_node_id={$node_data['component']['node_id']}{$params}~");
     $this->tpl->assign('CONTENT', $_Onxshop_Request->getContent());
     $this->tpl->assign('NODE', $node_data);
     if ($node_data['display_title']) {
         $this->tpl->parse('content.title');
     }
     return true;
 }
Esempio n. 2
0
 /**
  * main action
  */
 public function mainAction()
 {
     $this->Node = new common_node();
     $node_data = $this->Node->nodeDetail($this->GET['id']);
     /**
      * image size
      */
     $image_o = $this->getImageSizeOptions($node_data);
     /**
      * call controller
      */
     $node_ids = explode(",", trim($node_data['component']['node_ids']));
     $content = '';
     $template = $node_data['component']['template'];
     foreach ($node_ids as $node_id) {
         if (is_numeric($node_id)) {
             $_Onxshop_Request = new Onxshop_Request("component/teaser_{$template}~target_node_id={$node_id}:image_width={$image_o['width']}:image_height={$image_o['height']}:image_fill={$image_o['fill']}~");
             $content .= $_Onxshop_Request->getContent();
         }
     }
     $this->tpl->assign('CONTENT', $content);
     $this->tpl->assign('NODE', $node_data);
     if ($node_data['display_title']) {
         $this->tpl->parse('content.title');
     }
     return true;
 }
Esempio n. 3
0
 /**
  * main action
  */
 public function mainAction()
 {
     $this->initialisePromotion();
     if (is_numeric($this->GET['limit_from'])) {
         $from = $this->GET['limit_from'];
     } else {
         $from = 0;
     }
     if (is_numeric($this->GET['limit_per_page'])) {
         $per_page = $this->GET['limit_per_page'];
     } else {
         $per_page = 25;
     }
     $promotion_list = $this->Promotion->getList($from, $per_page, $_SESSION['bo']['voucher-filter']);
     if (is_array($promotion_list)) {
         $this->parseList($promotion_list);
     }
     /**
      * Display pagination
      */
     $count = $this->Promotion->getFilteredCount($_SESSION['bo']['voucher-filter']);
     if ($count > 0) {
         $_Onxshop_Request = new Onxshop_Request("component/pagination~limit_from={$from}:limit_per_page={$per_page}:count={$count}~");
         $this->tpl->assign('PAGINATION', $_Onxshop_Request->getContent());
     }
     return true;
 }
Esempio n. 4
0
 /**
  * main action
  */
 public function mainAction()
 {
     $this->Recipe = new ecommerce_recipe();
     $this->parseCategorySelect($this->GET['course']);
     $this->tpl->assign('SELECT_COOK_' . $this->GET['time'], 'selected="selected"');
     // is there a limit?
     if (is_numeric($this->GET['limit_from'])) {
         $limit_from = $this->GET['limit_from'];
     } else {
         $limit_from = 0;
     }
     if (is_numeric($this->GET['limit_per_page'])) {
         $limit_per_page = $this->GET['limit_per_page'];
     } else {
         $limit_per_page = 25;
     }
     // perform search
     $list = $this->performSearch($limit_from, $limit_per_page);
     if (count($list) == 2) {
         // show items
         $this->parseItems($list[0]);
         // show pagination
         if ($this->GET['display_pagination'] == 1) {
             $count = $list[1];
             $_Onxshop_Request = new Onxshop_Request("component/pagination~limit_from={$limit_from}:limit_per_page={$limit_per_page}:count={$count}:option_show_all=0:passthrough_get_parameters=1~");
             $this->tpl->assign('PAGINATION', $_Onxshop_Request->getContent());
         }
     }
     return true;
 }
Esempio n. 5
0
 /**
  * custom comment action
  */
 public function customCommentAction($data, $options)
 {
     $_Onxshop_Request = new Onxshop_Request("component/ecommerce/recipe_review_list~node_id={$data['node_id']}:allow_anonymouse_submit={$options['allow_anonymouse_submit']}~");
     $this->tpl->assign('REVIEW_LIST', $_Onxshop_Request->getContent());
     $_Onxshop_Request = new Onxshop_Request("component/ecommerce/recipe_review_add~node_id={$data['node_id']}:allow_anonymouse_submit={$options['allow_anonymouse_submit']}~");
     $this->tpl->assign('REVIEW_ADD', $_Onxshop_Request->getContent());
 }
Esempio n. 6
0
 /**
  * main action
  */
 public function mainAction()
 {
     $vimeo_video_id = false;
     $youtube_video_id = false;
     if (is_numeric($this->GET['autoplay']) && $this->GET['autoplay'] == 1) {
         $autoplay = 1;
     } else {
         $autoplay = 0;
     }
     // detect vimeo
     preg_match("/https?:\\/\\/vimeo.com\\/(\\d+)/", $this->GET['video_url'], $matches);
     if (isset($matches[1]) && is_numeric($matches[1])) {
         $vimeo_video_id = $matches[1];
     }
     // detect youtube
     preg_match("/https?:\\/\\/youtu.be\\/([0-9a-zA-Z]+)/", $this->GET['video_url'], $matches);
     if (isset($matches[1]) && !empty($matches[1])) {
         $youtube_video_id = $matches[1];
     }
     preg_match("/https?:\\/\\/www.youtube.com\\/watch\\?v=([0-9a-zA-Z-]+)/", $this->GET['video_url'], $matches);
     if (isset($matches[1]) && !empty($matches[1])) {
         $youtube_video_id = $matches[1];
     }
     if ($vimeo_video_id) {
         $_Onxshop_Request = new Onxshop_Request("component/video_vimeo~video_id={$vimeo_video_id}:autoplay={$autoplay}~");
         $this->tpl->assign('CONTENT', $_Onxshop_Request->getContent());
     } else {
         if ($youtube_video_id) {
             $_Onxshop_Request = new Onxshop_Request("component/video_youtube~video_id={$youtube_video_id}:autoplay={$autoplay}~");
             $this->tpl->assign('CONTENT', $_Onxshop_Request->getContent());
         }
     }
     return true;
 }
Esempio n. 7
0
 /**
  * main action
  */
 public function mainAction()
 {
     /**
      * initialise node and get detail
      */
     require_once 'models/common/common_node.php';
     $Node = new common_node();
     $node_data = $Node->nodeDetail($this->GET['id']);
     /**
      * get node component options
      */
     if ($node_data['component']['provider'] == '') {
         $node_data['component']['provider'] = 'vimeo';
     }
     if ($node_data['component']['autoplay']) {
         $autoplay_param = ":autoplay=1";
     } else {
         $autoplay_param = '';
     }
     /**
      * pass to menu component
      */
     $Onxshop_Request = new Onxshop_Request("component/video_{$node_data['component']['provider']}~video_id={$node_data['component']['video_id']}{$autoplay_param}~");
     $this->tpl->assign("VIDEO", $Onxshop_Request->getContent());
     $this->tpl->assign("NODE", $node_data);
     if ($node_data['display_title']) {
         $this->tpl->parse('content.title');
     }
     return true;
 }
 /**
  * main action
  */
 public function mainAction()
 {
     /**
      * include variety confg
      */
     require_once 'models/ecommerce/ecommerce_product_variety.php';
     $variety_conf = ecommerce_product_variety::initConfiguration();
     $this->tpl->assign('VARIETY_CONF', $variety_conf);
     /**
      * product
      */
     require_once 'models/ecommerce/ecommerce_product.php';
     $Product = new ecommerce_product();
     $product = $Product->getProductDetail($this->GET['id']);
     if (is_array($product['variety'])) {
         foreach ($product['variety'] as $variety) {
             if ($variety['publish'] == 0) {
                 $this->tpl->assign('DISABLED', 'disabled');
             } else {
                 $this->tpl->assign('DISABLED', '');
             }
             $Image = new Onxshop_Request("component/image&relation=product_variety&node_id={$variety['id']}");
             $this->tpl->assign('IMAGE', $Image->getContent());
             $this->tpl->assign('VARIETY', $variety);
             $this->tpl->parse('content.variety');
         }
     } else {
         msg('This product has no variety.');
     }
     return true;
 }
 /**
  * main action
  */
 public function mainAction()
 {
     require_once 'models/common/common_node.php';
     require_once 'models/ecommerce/ecommerce_product.php';
     $Node = new common_node();
     $Product = new ecommerce_product();
     $product_id = $this->GET['id'];
     //listing
     if (is_numeric($product_id)) {
         $current = $Product->findProductInNode($product_id);
         $this->tpl->assign('NODE', $Node->detail($current[0]['id']));
         foreach ($current as $key => $node_data) {
             //don't display homepage
             if ($key > 0) {
                 if ($node_data['publish'] == 0) {
                     $node_data['class'] = "class='disabled'";
                 }
                 $this->tpl->assign("ITEM", $node_data);
                 $_Onxshop_Request = new Onxshop_Request("component/breadcrumb~id={$node_data['id']}:create_last_link=1~");
                 $this->tpl->assign('BREADCRUMB', $_Onxshop_Request->getContent());
                 $this->tpl->parse("content.multiple.item");
             }
         }
         if (count($current) > 1) {
             $this->tpl->parse('content.multiple');
         }
     }
     return true;
 }
Esempio n. 10
0
 /**
  * main action
  */
 public function mainAction()
 {
     $Store = new ecommerce_store();
     $Taxonomy_Tree = new common_taxonomy_tree();
     $node_id = (int) $this->GET['node_id'];
     $store = $Store->findStoreByNode($node_id);
     $taxonomy = $Taxonomy_Tree->getRelatedTaxonomy($store['id'], "ecommerce_store_taxonomy");
     if ($store) {
         /**
          * get store taxonomy print out
          */
         $_Onxshop_Request = new Onxshop_Request("component/ecommerce/store_taxonomy~store_id={$store['id']}~");
         $this->tpl->assign("STORE_TAXONOMY", $_Onxshop_Request->getContent());
         /**
          * text depending if my selected store
          */
         if ($_SESSION['client']['customer']['store_id'] == $store['id']) {
             $this->tpl->assign('MY_SELECTED_STORE', 'My selected store');
         } else {
             $this->tpl->assign('MY_SELECTED_STORE', 'Save as my own store');
         }
         /**
          * assign and parse
          */
         $this->tpl->assign("STORE", $store);
         $this->tpl->parse("content.store");
     } else {
         $this->tpl->parse("content.no_store");
     }
     return true;
 }
Esempio n. 11
0
 /**
  * main action
  */
 public function mainAction()
 {
     $this->initModels();
     /**
      * Store submited data to the SESSION
      */
     if (isset($_POST['comments-filter'])) {
         $_SESSION['bo'][$this->key]['comments-filter'] = $_POST['comments-filter'];
         onxshopGoTo($this->GET["translate"]);
     }
     /**
      * Initialize pagination variables
      */
     if (is_numeric($this->GET['limit_from'])) {
         $from = $this->GET['limit_from'];
     } else {
         $from = 0;
     }
     if (is_numeric($this->GET['limit_per_page'])) {
         $per_page = $this->GET['limit_per_page'];
     } else {
         $per_page = 25;
     }
     $limit = "{$from},{$per_page}";
     /**
      * Prepare filter
      */
     $filter = array();
     $s = $_SESSION['bo'][$this->key]['comments-filter'];
     if ($s['location'] > 0) {
         $filter['node_id'] = $s['location'];
     }
     if (!empty($s['query'])) {
         $filter['query'] = $s['query'];
     }
     $this->tpl->assign("QUERY", $s['query']);
     /**
      * Load List
      */
     $list = $this->Comment->getCommentList($filter, 'id DESC', $limit);
     $count = $this->Comment->getCommentCount($filter);
     /**
      * Display pagination
      */
     $_Onxshop_Request = new Onxshop_Request("component/pagination~limit_from={$from}:limit_per_page={$per_page}:count={$count}~");
     $this->tpl->assign('PAGINATION', $_Onxshop_Request->getContent());
     /**
      * Display comments
      */
     $this->parseList($list);
     /**
      * Get used node ids and corresponding names
      */
     $nodes = $this->Comment->getUsedNodes();
     /**
      * Display location filter dropdown
      */
     $this->parseLocationSelect($nodes);
     return true;
 }
Esempio n. 12
0
 /**
  * main action
  */
 public function mainAction()
 {
     require_once 'models/common/common_node.php';
     $Node = new common_node();
     //get data
     $node_data = $Node->nodeDetail($this->GET['id']);
     $rss_options = $node_data['component'];
     //detect feed specific controller
     if (preg_match('/api.twitter.com/', $rss_options['url'])) {
         $feed_controller = 'feed_twitter';
     } else {
         $feed_controller = 'feed';
     }
     $this->tpl->assign('FEED_CONTROLLER', $feed_controller);
     //prepare data
     $rss_options['url'] = base64_encode(urlencode(trim($rss_options['url'])));
     //get RSS_RESULT
     $nsite_request = "component/{$feed_controller}~url={$rss_options['url']}:items_limit={$rss_options['items_limit']}:channel_title={$rss_options['channel_title']}:image={$rss_options['image']}:copyright={$rss_options['copyright']}:description={$rss_options['description']}:content={$rss_options['content']}:pubdate={$rss_options['pubdate']}~";
     $_Onxshop_Request = new Onxshop_Request($nsite_request);
     $this->tpl->assign("RSS_RESULT", $_Onxshop_Request->getContent());
     //if ajax option enable, allow to update dynamicaly
     if ($rss_options['ajax'] == 1) {
         //AJAX METHOD
         $this->tpl->assign("RSS_OPTIONS", $rss_options);
         $this->tpl->parse('content.ajax');
     }
     $this->tpl->assign('NODE', $node_data);
     if ($node_data['display_title']) {
         $this->tpl->parse('content.title');
     }
     return true;
 }
Esempio n. 13
0
 /**
  * main action
  */
 public function mainAction()
 {
     if ($this->GET['directory']) {
         $base_folder = $this->GET['directory'];
     } else {
         $base_folder = 'var/files/';
     }
     if ($this->GET['role']) {
         $role = $this->GET['role'];
     } else {
         $role = 'main';
     }
     //type: add_to_node, RTE
     if ($this->GET['type']) {
         $type = $this->GET['type'];
     } else {
         $type = '';
     }
     if ($this->GET['node_id']) {
         $node_id = $this->GET['node_id'];
     } else {
         $node_id = 0;
     }
     if ($this->GET['relation']) {
         $relation = $this->GET['relation'];
     } else {
         $relation = 'node';
     }
     $_Onxshop_Request = new Onxshop_Request("bo/component/server_browser_menu~directory={$base_folder}:type={$type}:role={$role}:node_id={$node_id}:relation={$relation}:expand_all=1:type=d~");
     $this->tpl->assign("SERVER_BROWSER_TREE", $_Onxshop_Request->getContent());
     $_Onxshop_Request = new Onxshop_Request("bo/component/server_browser_file_list~type={$type}:role={$role}:node_id={$node_id}:relation={$relation}~");
     $this->tpl->assign("SERVER_BROWSER_FILE_LIST", $_Onxshop_Request->getContent());
     return true;
 }
Esempio n. 14
0
 /**
  * main action
  */
 public function mainAction()
 {
     require_once 'models/common/common_node.php';
     $Node = new common_node();
     $node_data = $Node->nodeDetail($this->GET['id']);
     if (!is_array($node_data['component'])) {
         $node_data['component'] = array();
         $node_data['component']['node_controller'] = 'common_simple';
     }
     if ($node_data['component']['sending_failed'] == '') {
         $node_data['component']['sending_failed'] = 'The provided data is not valid! Required items are marked with an asterisk (*)';
     }
     if ($node_data['component']['text'] == '') {
         $node_data['component']['text'] = "Thank you for your feedback.";
     }
     $this->tpl->assign("NODE", $node_data);
     $template_folder = "component/contact_form/";
     $template_name = "{$template_folder}{$node_data['component']['node_controller']}";
     /**
      * check template file exists
      */
     if (!templateExists($template_name)) {
         // try fallback to old _contact_form folder in case it was locally created (used prior to Onxshop 1.7.6)
         $template_folder = "component/_contact_form/";
         $template_name = "{$template_folder}{$node_data['component']['node_controller']}";
         if (!templateExists($template_name)) {
             msg("selected template {$template_name} was not found");
             return false;
         }
     }
     /**
      * execute controller
      */
     $Form = new Onxshop_Request("component/contact_form@{$template_name}&node_id={$node_data['id']}&mail_to={$node_data['component']['mail_to']}&mail_toname={$node_data['component']['mail_toname']}&spam_protection={$node_data['component']['spam_protection']}");
     $this->tpl->assign("FORM", $Form->getContent());
     $reg_key = "form_notify_" . $node_data['id'];
     if (Zend_Registry::isRegistered($reg_key)) {
         if (Zend_Registry::get($reg_key) == 'sent') {
             //forward
             msg($node_data['component']['text'], 'ok');
             if ($node_data['component']['href'] != '') {
                 onxshopGoTo($node_data['component']['href']);
             }
         } else {
             if (Zend_Registry::get($reg_key) == 'failed') {
                 msg($node_data['component']['sending_failed'], 'error');
                 $this->tpl->parse('content.form');
             } else {
                 $this->tpl->parse('content.form');
             }
         }
     } else {
         $this->tpl->parse('content.form');
     }
     if ($node_data['display_title']) {
         $this->tpl->parse('content.title');
     }
     return true;
 }
Esempio n. 15
0
 /**
  * main action
  */
 public function mainAction()
 {
     $node_id = $this->GET['id'];
     $_Onxshop_Request = new Onxshop_Request("node~id={$node_id}~");
     $node_data['content'] = $_Onxshop_Request->getContent();
     $this->tpl->assign('NODE', $node_data);
     return true;
 }
Esempio n. 16
0
 /**
  * parseItem
  */
 public function parseItem($item)
 {
     $image_width = $this->GET['image_width'];
     $image_height = $this->GET['image_height'];
     $image_fill = $this->GET['image_fill'];
     $_Onxshop_Request = new Onxshop_Request("component/teaser_stack~target_node_id={$item['id']}:image_width={$image_width}:image_height={$image_height}:image_fill={$image_fill}~");
     $item['teaser_content'] = $_Onxshop_Request->getContent();
     return parent::parseItem($item);
 }
Esempio n. 17
0
 /**
  * main action
  */
 public function mainAction()
 {
     /**
      * input data
      */
     $offer_group_id = (int) $this->GET['offer_group_id'];
     $campaign_category_id = (int) $this->GET['campaign_category_id'];
     $roundel_category_id = (int) $this->GET['roundel_category_id'];
     $template = (string) $this->GET['template'];
     $includeForthcoming = $_SESSION['fe_edit_mode'] == 'edit';
     if ($this->GET['taxonomy_tree_id']) {
         $taxonomy_tree_ids = explode(",", $this->GET['taxonomy_tree_id']);
         if (count($taxonomy_tree_ids) == 0) {
             $taxonomy_tree_ids = array();
         }
     }
     /**
      * initialise and get product list
      */
     $Offer = new ecommerce_offer();
     $product_ids = $Offer->getProductIdsForOfferGroup($offer_group_id, $campaign_category_id, $roundel_category_id, $taxonomy_tree_ids, $includeForthcoming);
     if (count($product_ids) > 0) {
         /**
          * build HTTP query
          */
         $list = array();
         foreach ($product_ids as $id) {
             $list['product_id_list'][] = $id;
         }
         if (isset($this->GET['limit_from'])) {
             $list['limit_from'] = $this->GET['limit_from'];
         }
         if (isset($this->GET['limit_per_page'])) {
             $list['limit_per_page'] = $this->GET['limit_per_page'];
         }
         if (isset($this->GET['display_pagination'])) {
             $list['display_pagination'] = $this->GET['display_pagination'];
         }
         if (!isset($this->GET['sort']['by'])) {
             $list['product_id_list_force_sorting_as_listed'] = 1;
         } else {
             if (isset($this->GET['sort']['by'])) {
                 $list['sort']['by'] = $this->GET['sort']['by'];
             }
             if (isset($this->GET['sort']['direction'])) {
                 $list['sort']['direction'] = $this->GET['sort']['direction'];
             }
         }
         $query = http_build_query($list, '', ':');
         /**
          * call product_list component
          */
         $_Onxshop_Request = new Onxshop_Request("component/ecommerce/product_list_{$template}~{$query}~");
         $this->tpl->assign('PRODUCT_LIST', $_Onxshop_Request->getContent());
     }
     return true;
 }
Esempio n. 18
0
 /**
  * main action
  */
 public function mainAction()
 {
     $content_id = $this->getContentId();
     $this->tpl->assign('NODE_ID', $content_id);
     $_Onxshop_Request = new Onxshop_Request("bo/component/node_edit~id={$content_id}~");
     $node_detail = $_Onxshop_Request->getContent();
     $this->tpl->assign("NODE_EDIT", $node_detail);
     return true;
 }
Esempio n. 19
0
 /**
  * main action
  */
 public function mainAction()
 {
     /**
      * input
      */
     if ($this->GET['sort']['by']) {
         $sort_by = $this->GET['sort']['by'];
     } else {
         $sort_by = null;
     }
     if ($this->GET['sort']['direction']) {
         $sort_direction = $this->GET['sort']['direction'];
     } else {
         $sort_direction = null;
     }
     /**
      * initialize node
      */
     require_once 'models/common/common_node.php';
     $Node = new common_node();
     $node_data = $Node->nodeDetail($this->GET['id']);
     /**
      * prepare query
      */
     $query_raw = array();
     if ($node_data['component']['template']) {
         $query_raw['template'] = $node_data['component']['template'];
     }
     if ($node_data['component']['offer_group_id']) {
         $query_raw['offer_group_id'] = $node_data['component']['offer_group_id'];
     }
     if ($node_data['component']['campaign_category_id']) {
         $query_raw['campaign_category_id'] = $node_data['component']['campaign_category_id'];
     }
     if ($node_data['component']['campaign_category_id']) {
         $query_raw['campaign_category_id'] = $node_data['component']['campaign_category_id'];
     }
     $query_raw['sort']['by'] = $sort_by;
     $query_raw['sort']['direction'] = $sort_direction;
     $query_raw['limit_per_page'] = 999;
     $query = http_build_query($query_raw, '', ':');
     /**
      * call special offer component
      */
     $_Onxshop_Request = new Onxshop_Request("component/ecommerce/special_offer_list~{$query}~");
     $content = $_Onxshop_Request->getContent();
     if (empty($content)) {
         return true;
     }
     $this->tpl->assign('PRODUCT_LIST', $content);
     $this->tpl->assign('NODE', $node_data);
     if ($node_data['display_title']) {
         $this->tpl->parse('content.title');
     }
     return true;
 }
Esempio n. 20
0
 /**
  * main action
  */
 public function mainAction()
 {
     /**
      * initialise node and get detail
      */
     require_once 'models/common/common_node.php';
     $Node = new common_node();
     $node_data = $Node->nodeDetail($this->GET['id']);
     /**
      * get node component options
      */
     switch ($node_data['component']['template']) {
         case 'menu_SELECT':
             $template = 'component/menu_select';
             break;
         case 'menu_GRID':
             $template = 'component/menu_grid';
             break;
         case 'menu_STACK':
             $template = 'component/menu_stack';
             break;
         default:
             $template = 'component/menu';
     }
     if (is_numeric($node_data['component']['level'])) {
         $level = $node_data['component']['level'];
     } else {
         $level = 0;
     }
     if (is_numeric($node_data['component']['display_all'])) {
         $display_all = $node_data['component']['display_all'];
     } else {
         $display_all = 0;
     }
     if (is_numeric($node_data['component']['open'])) {
         $open = $node_data['component']['open'];
     } else {
         $open = '';
     }
     /**
      * image size
      */
     if ($template == 'component/menu_grid' || $template == 'component/menu_stack') {
         $image_o = $this->getImageSizeOptions($node_data);
     }
     /**
      * pass to menu component
      */
     $Onxshop_Request = new Onxshop_Request("{$template}~id={$node_data['component']['node_id']}:display_teaser={$node_data['component']['display_teaser']}:level={$level}:expand_all={$display_all}:open={$open}:image_width={$image_o['width']}:image_height={$image_o['height']}:image_fill={$image_o['fill']}~");
     $this->tpl->assign("MENU", $Onxshop_Request->getContent());
     $this->tpl->assign("NODE", $node_data);
     if ($node_data['display_title']) {
         $this->tpl->parse('content.title');
     }
     return true;
 }
Esempio n. 21
0
 /**
  * main action
  */
 public function mainAction()
 {
     // set transparent cache
     //$rss->cache_dir = ONXSHOP_PROJECT_DIR . 'var/tmp/';
     //$rss->cache_time = 3600; // one hour
     require_once 'models/common/common_node.php';
     $Node = new common_node();
     $node_data = $Node->nodeDetail($this->GET['id']);
     if ($this->GET['link']) {
         $url = base64_decode($this->GET['link']);
     } else {
         $url = trim($node_data['component']['url']);
     }
     msg("Opening {$url}", 'ok', 2);
     $wget_url = base64_encode($url);
     $_Onxshop_Request = new Onxshop_Request("component/wget&url={$wget_url}");
     $source = $_Onxshop_Request->getContent();
     $source = translateLinks("", $source);
     //$source = preg_replace("/.*\<body\>(.*)\<\/body\>.*/i", '\\1', $source);
     //grab with pregmatch
     $source = preg_replace("/[\r\n ]{1,}/", " ", $source);
     preg_match("/<body>(?!body)(.*)<\\/body>/mi", $source, $match);
     $source = $match[1];
     //grab by XML
     /*
     //init simple XML
     require_once('lib/simplexml44/class/IsterXmlSimpleXMLImpl.php');
     $SimpleXML = new IsterXmlSimpleXMLImpl;
     
     // load some source file
     if ($doc  = $SimpleXML->load_string($source)) {
     	
     	$component['content'] = '';
     	
     	if (is_object($doc->html->body)) {
     		foreach( $doc->html->body->children() as $child ) {
     			$component['content'] .= $child->asXML();
     		}
     	} else {
     		msg("Source is not valid XHTML", 'error');
     	}
     	
     	$this->tpl->assign("COMPONENT", $component);	
     } else {
     	msg ("Could not open '$url'", 'error');
     }
     */
     $this->tpl->assign("RESULT", $source);
     $this->tpl->assign('NODE', $node_data);
     if ($node_data['display_title']) {
         $this->tpl->parse('content.title');
     }
     return true;
 }
Esempio n. 22
0
 /**
  * main action
  */
 public function mainAction()
 {
     /**
      * input data
      */
     if (is_numeric($this->GET['expand_all'])) {
         $expand_all = $this->GET['expand_all'];
     } else {
         $expand_all = 0;
     }
     /**
      * initialize
      */
     require_once 'models/common/common_node.php';
     $node_data = $_POST['node'];
     $Node = new common_node();
     if ($_POST['save']) {
         //$parent_data = $Node->getDetail($this->GET['parent']);
         if ($node_data['parent'] == $Node->conf['id_map-homepage'] && $node_data['node_group'] == 'page') {
             $home_page_data = $Node->getDetail($Node->conf['id_map-homepage']);
             $node_data['parent'] = $home_page_data['parent'];
             $home_page_parent_data = $Node->getDetail($home_page_data['parent']);
             msg("Inserting page under {$home_page_parent_data['title']}");
         }
         /**
          * insert a new node
          */
         if ($id = $Node->nodeInsert($node_data)) {
             //quick pages builder
             //is broken :) $Page_builder = new Onxshop_Request("bo/page_builder@blank&parent=$id&node_group={$node_data['node_group']}&node_controller={$node_data['node_controller']}");
             msg(ucfirst($node_data['node_group']) . " " . $node_data['title'] . " has been added.");
             $this->tpl->assign("INSERTED_NODE_ID", $id);
             $this->tpl->parse('content.inserted');
             // clean
             $node_data['title'] = '';
             //return true;
         }
     }
     $this->tpl->assign('NODE', $node_data);
     /**
      * prepare
      */
     $node_controller = $node_data['node_controller'];
     $node_group = $this->GET['node_group'];
     if ($node_group == 'container') {
         $node_group = 'page';
     }
     // get the list of node types
     $Node_type = new Onxshop_Request("bo/component/node_type_menu~id=new:open={$node_controller}:node_group={$node_group}:expand_all={$expand_all}~");
     $this->tpl->assign("NODE_TYPE", $Node_type->getContent());
     $this->tpl->parse('content.form');
     return true;
 }
Esempio n. 23
0
 /**
  * main action
  */
 public function mainAction()
 {
     if (is_numeric($this->GET['node_id'])) {
         $node_id = $this->GET['node_id'];
     }
     if ($this->GET['template'] == '') {
         $template = 'menu_UL';
     }
     $Onxshop_Request = new Onxshop_Request("component/menu&type=taxonomy&level=2&display_all=1&id={$node_id}&template={$template}");
     $this->tpl->assign("FILTER", $Onxshop_Request->getContent());
     return true;
 }
Esempio n. 24
0
 /**
  * main action
  */
 public function mainAction()
 {
     require_once 'models/common/common_node.php';
     $Node = new common_node();
     $node_data = $Node->nodeDetail($this->GET['id']);
     $_Onxshop_Request = new Onxshop_Request("component/comment~node_id={$node_data['id']}:allow_anonymouse_submit={$node_data['component']['allow_anonymouse_submit']}~");
     $node_data['content'] = $_Onxshop_Request->getContent();
     $this->tpl->assign("NODE", $node_data);
     if ($node_data['display_title']) {
         $this->tpl->parse('content.title');
     }
     return true;
 }
Esempio n. 25
0
 /**
  * main action
  */
 public function mainAction()
 {
     $promotion_id = $this->GET['promotion_id'];
     if (is_numeric($promotion_id)) {
         $request = new Onxshop_Request("component/ecommerce/gift_voucher_send~promotion_id={$promotion_id}~");
         $result = $request->getContent();
         $this->setActionStatus(true);
     } else {
         msg("Promotion_id not specified");
         $this->setActionStatus(false);
     }
     return true;
 }
Esempio n. 26
0
 /**
  * main action
  */
 public function mainAction()
 {
     require_once 'models/common/common_node.php';
     $Node = new common_node();
     $node_data = $Node->nodeDetail($this->GET['id']);
     $linked_node_id = $node_data['component']['node_id'];
     if (is_numeric($linked_node_id)) {
         $_Onxshop_Request = new Onxshop_Request("node~id={$linked_node_id}:fe_edit=0:shared=1~");
         $node_data['content'] = $_Onxshop_Request->getContent();
         $this->tpl->assign("NODE", $node_data);
     } else {
         msg("Please select a content");
     }
     return true;
 }
Esempio n. 27
0
 /**
  * main action
  */
 public function mainAction()
 {
     require_once 'models/common/common_node.php';
     $Node = new common_node();
     $node_data = $Node->nodeDetail($this->GET['id']);
     if ($node_data['component']['template'] == '') {
         $node_data['component']['template'] = 'menu_UL';
     }
     $Onxshop_Request = new Onxshop_Request("component/menu&type=taxonomy&level=2&display_all=1&id={$node_data['component']['node_id']}&template={$node_data['component']['template']}");
     $this->tpl->assign("FILTER", $Onxshop_Request->getContent());
     $this->tpl->assign("NODE", $node_data);
     if ($node_data['display_title']) {
         $this->tpl->parse('content.title');
     }
     return true;
 }
Esempio n. 28
0
 /**
  * prepare data for payment gateway
  */
 function prepare($order_id)
 {
     $order_data = $this->Transaction->getOrderDetail($order_id);
     // send email to the customer
     require_once 'models/common/common_email.php';
     $EmailForm = new common_email();
     $_Onxshop_Request = new Onxshop_Request("component/ecommerce/order_detail~order_id={$order_data['id']}~");
     $order_data['order_detail'] = $_Onxshop_Request->getContent();
     //this allows use customer data and company data in the mail template
     //is passed as DATA to template in common_email->_format
     $GLOBALS['common_email']['transaction'] = $transaction_data;
     $GLOBALS['common_email']['order'] = $order_data;
     if (!$EmailForm->sendEmail('pay_by_cheque', 'n/a', $order_data['client']['customer']['email'], $order_data['client']['customer']['first_name'] . " " . $order_data['client']['customer']['last_name'])) {
         msg('payment: Cant send email pay_by_cheque.', 'error', 2);
     }
 }
Esempio n. 29
0
 public function runJob($job_data)
 {
     // preprare request URI
     $request = "bo/scheduler/" . $job_data['controller'] . "@bo/scheduler/action_base~node_id={$job_data['node_id']}:" . "node_type={$job_data['node_type']}";
     if (strlen($job_data['parameters']) > 0) {
         $request .= ":" . $job_data['parameters'];
     }
     $request .= "~";
     $job = new Onxshop_Request($request);
     $content = $job->getContent();
     $result = json_decode($content);
     if ($result === null) {
         msg("Invalid JSON response from bo/scheduler/" . $job_data['controller'], 2);
     }
     return $result;
 }
Esempio n. 30
0
 /**
  * main action
  */
 public function mainAction()
 {
     require_once 'models/common/common_node.php';
     require_once 'models/ecommerce/ecommerce_recipe.php';
     $Node = new common_node();
     $Recipe = new ecommerce_recipe();
     $recipe_id = $this->GET['id'];
     /**
      * find recipe homepage
      */
     $recipe_homepage = $Recipe->getRecipeHomepage($recipe_id);
     /**
      * allow to insert new
      */
     if (!is_array($recipe_homepage) && !is_numeric($this->GET['add_to_parent'])) {
         $this->tpl->parse('content.not_exists');
     }
     /**
      * move page if requested
      */
     if (is_numeric($this->GET['add_to_parent'])) {
         if (is_array($recipe_homepage)) {
             //moving
             $recipe_homepage = $this->moveRecipeNode($recipe_id, $this->GET['add_to_parent']);
         } else {
             //insert new
             $recipe_homepage = $this->insertNewRecipeToNode($recipe_id, $this->GET['add_to_parent']);
         }
     }
     /**
      * display recipe homepage detail
      */
     if (is_array($recipe_homepage)) {
         //parent detail
         $parent_detail = $Node->detail($recipe_homepage['parent']);
         $this->tpl->assign("PARENT_DETAIL", $parent_detail);
         //breadcrumb
         $_Onxshop_Request = new Onxshop_Request("component/breadcrumb~id={$recipe_homepage['id']}:create_last_link=1~");
         $this->tpl->assign('BREADCRUMB', $_Onxshop_Request->getContent());
         //children node list
         $_Onxshop_Request = new Onxshop_Request("bo/component/node_list~id={$recipe_homepage['id']}:node_group=content~");
         $this->tpl->assign('NODE_LIST', $_Onxshop_Request->getContent());
         //parse
         $this->tpl->parse('content.recipe_node');
     }
     return true;
 }