Example #1
0
 /**
  * post action
  */
 function post()
 {
     parent::post();
     //only for including of configuration
     require_once 'models/common/common_email.php';
     $EmailForm = new common_email();
     $this->tpl->assign('EMAIL_FORM_CONF', $EmailForm->conf);
     require_once 'models/common/common_file.php';
     $File = new common_file();
     $directory = "templates/component/_contact_form/";
     $this->tpl->assign('DIRECTORY', $directory);
     $templates = $File->getFlatArrayFromFsJoin($directory);
     $templates = array_reverse($templates);
     if (is_array($templates)) {
         foreach ($templates as $template) {
             $template['name'] = str_replace('.html', '', $template['name']);
             if ($template['name'] == $this->node_data['component']['node_controller']) {
                 $template['selected'] = "selected='selected'";
             } else {
                 $template['selected'] = '';
             }
             $template['title'] = $templates_info[$this->GET['node_group']][$template['name']]['title'];
             if ($template['title'] == '') {
                 $template['title'] = $template['name'];
             }
             $this->tpl->assign('LAYOUT_TEMPLATE', $template);
             $this->tpl->parse('content.templateitem');
         }
     }
     $this->tpl->assign("SPAM_PROTECTION", array('captcha_image' => $this->node_data['component']['spam_protection'] == 'captcha_image' ? 'selected="selected"' : '', 'captcha_text_js' => $this->node_data['component']['spam_protection'] == 'captcha_text_js' ? 'selected="selected"' : ''));
 }
Example #2
0
 /**
  * pre action
  */
 function pre()
 {
     parent::pre();
     $_POST['node']['component']['template'] = trim($_POST['node']['component']['template']);
     $_POST['node']['component']['controller'] = trim($_POST['node']['component']['controller']);
     $_POST['node']['component']['parameter'] = trim($_POST['node']['component']['parameter']);
 }
Example #3
0
 /**
  * post action
  */
 function post()
 {
     parent::post();
     // require user details
     $this->node_data['component']['require_user_details'] = $this->node_data['component']['require_user_details'] ? 'checked="checked"' : '';
     // require terms and conditions
     $this->node_data['component']['require_t_and_c'] = $this->node_data['component']['require_t_and_c'] ? 'checked="checked"' : '';
     // display results options
     $this->node_data['component']['display_results'] = $this->node_data['component']['display_results'] ? 'checked="checked"' : '';
     // survey dropdown
     $Survey = new education_survey();
     $surveys = $Survey->getSurveyList("publish = 1");
     foreach ($surveys as $survey) {
         $survey['selected'] = $this->node_data['component']['survey_id'] == $survey['id'] ? "selected='selected'" : '';
         $this->tpl->assign("SURVEY_ITEM", $survey);
         $this->tpl->parse("content.survey_item");
     }
     // template dropdown
     $this->tpl->assign("SELECTED_template_{$this->node_data['component']['template']}", "selected='selected'");
     // restriction dropdown
     $this->tpl->assign("SELECTED_restriction_{$this->node_data['component']['restriction']}", "selected='selected'");
     // limit dropdown
     $this->tpl->assign("SELECTED_limit_{$this->node_data['component']['limit']}", "selected='selected'");
     $this->tpl->assign("SPAM_PROTECTION", array('captcha_text_js' => $this->node_data['component']['spam_protection'] == 'captcha_text_js' ? 'selected="selected"' : ''));
 }
 /**
  * post action
  */
 function post()
 {
     parent::post();
     //template
     $this->tpl->assign("SELECTED_template_{$this->node_data['component']['template']}", "selected='selected'");
     //image role
     $this->tpl->assign("SELECTED_image_role_{$this->node_data['component']['image_role']}", "selected='selected'");
     //sorting
     $this->node_data['component']['display_sorting'] = $this->node_data['component']['display_sorting'] ? 'checked="checked"' : '';
     //pagination
     $this->node_data['component']['display_pagination'] = $this->node_data['component']['display_pagination'] ? 'checked="checked"' : '';
     $Image = new ecommerce_product_image();
     //find product in the node
     $current = $this->node_data['component']['related'];
     if (is_array($current)) {
         foreach ($current as $product_id) {
             //find product in the node
             if (is_numeric($product_id)) {
                 $detail = $this->Node->listing("node_group = 'page' AND node_controller ~ 'product' AND content = '{$product_id}'");
                 $current = $detail[0];
                 if ($current['publish'] == 0) {
                     $current['class'] = 'notpublic';
                 }
                 $image = $Image->listing("node_id = {$product_id}", "priority DESC, id ASC");
                 if (count($image) > 0) {
                     $current['image_src'] = $image[0]['src'];
                 } else {
                     $current['image_src'] = '/var/files/placeholder.png';
                 }
                 $this->tpl->assign('CURRENT', $current);
                 $this->tpl->parse('content.item');
             }
         }
     }
 }
Example #5
0
 /**
  * post action
  */
 function post()
 {
     parent::post();
     $this->node_data['body_attributes'] = htmlspecialchars($this->node_data['body_attributes'], ENT_QUOTES, 'UTF-8');
     if ($this->node_data['content'] == '' && !$_POST['save']) {
         $this->tpl->parse('content.empty');
     }
 }
Example #6
0
 /**
  * post action
  */
 function post()
 {
     parent::post();
     $this->node_data['component']['display_title'] = $this->node_data['component']['display_title'] ? 'checked="checked"' : '';
     $this->node_data['component']['display_teaser'] = $this->node_data['component']['display_teaser'] ? 'checked="checked"' : '';
     $this->node_data['component']['display_all'] = $this->node_data['component']['display_all'] ? 'checked="checked"' : '';
     $this->tpl->assign("SELECTED_{$this->node_data['component']['template']}", "selected='selected'");
 }
Example #7
0
 /**
  * post action
  */
 function post()
 {
     parent::post();
     /**
      * container selected
      */
     $this->tpl->assign("SELECTED_container_{$this->node_data['component']['container']}", "selected='selected'");
 }
Example #8
0
 /**
  * post action
  */
 function post()
 {
     parent::post();
     /**
      * other options
      */
     $this->node_data['component']['autoplay'] = $this->node_data['component']['autoplay'] ? 'checked="checked"' : '';
 }
Example #9
0
 /**
  * post action
  */
 function post()
 {
     parent::post();
     $this->node_data['component']['channel_title'] = $this->node_data['component']['channel_title'] ? 'checked="checked"' : '';
     $this->node_data['component']['image'] = $this->node_data['component']['image'] ? 'checked="checked"' : '';
     $this->node_data['component']['description'] = $this->node_data['component']['description'] ? 'checked="checked"' : '';
     $this->node_data['component']['content'] = $this->node_data['component']['content'] ? 'checked="checked"' : '';
     $this->node_data['component']['pubdate'] = $this->node_data['component']['pubdate'] ? 'checked="checked"' : '';
     $this->node_data['component']['copyright'] = $this->node_data['component']['copyright'] ? 'checked="checked"' : '';
     $this->node_data['component']['ajax'] = $this->node_data['component']['ajax'] ? 'checked="checked"' : '';
 }
Example #10
0
 /**
  * post action
  */
 function post()
 {
     parent::post();
     //template
     $this->tpl->assign("SELECTED_template_{$this->node_data['component']['template']}", "selected='selected'");
     //sort-by
     $this->tpl->assign("SELECTED_sort_by_{$this->node_data['component']['sort']['by']}", "selected='selected'");
     //sort-order
     $this->tpl->assign("SELECTED_sort_direction_{$this->node_data['component']['sort']['direction']}", "selected='selected'");
     //pagination
     $this->node_data['component']['pagination'] = $this->node_data['component']['pagination'] ? 'checked="checked"' : '';
 }
Example #11
0
 /**
  * post action
  */
 function post()
 {
     parent::post();
     /**
      * other options
      */
     $this->node_data['component']['pagination'] = $this->node_data['component']['pagination'] ? 'checked="checked"' : '';
     $this->node_data['component']['display_title'] = $this->node_data['component']['display_title'] ? 'checked="checked"' : '';
     /**
      * template selected
      */
     $this->tpl->assign("SELECTED_template_{$this->node_data['component']['template']}", "selected='selected'");
 }
Example #12
0
 /**
  * post action
  */
 function post()
 {
     parent::post();
     /**
      * check hard link
      */
     $hard_links = $this->Node->findHardLinks($this->GET['id']);
     if (count($hard_links) > 0) {
         msg("Hard link detected, please fix.", 'error');
     }
     /*
     foreach ($hard_links as $hard_link) {
     	$this->tpl->assign('ITEM', $hard_link);
     	$this->tpl->parse('content.hard_links.item');
     }
     $this->tpl->parse('content.hard_links');
     */
 }
Example #13
0
 /**
  * pre action
  */
 function pre()
 {
     parent::pre();
     $node_id = $this->GET['id'];
     $select = $this->GET['select'];
     $node_detail = $this->Node->detail($node_id);
     //$list = $Node->getTree(0, 'all');
     if (is_numeric($select)) {
         $selected_node_detail = $this->Node->detail($select);
         if ($selected_node_detail['node_group'] == 'content') {
             $node_detail['content'] = $select;
             if ($this->Node->update($node_data)) {
                 msg('updated');
             }
         } else {
             msg("This element is a " . ucfirst($selected_node_detail['node_group']) . ", not a Content!", 'error');
         }
     }
 }
Example #14
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']);
 }
Example #15
0
 /**
  * post action
  */
 function post()
 {
     parent::post();
     //only for including of configuration
     require_once 'models/common/common_email.php';
     $EmailForm = new common_email();
     $this->tpl->assign('EMAIL_FORM_CONF', $EmailForm->conf);
     require_once 'models/common/common_file.php';
     $File = new common_file();
     /**
      * contact form template directory name
      */
     $directory = "templates/component/contact_form/";
     $this->tpl->assign('DIRECTORY', $directory);
     // show warning if old _contact_form directory is found
     $old_directory = 'templates/component/_contact_form/';
     if (file_exists(ONXSHOP_PROJECT_DIR . $old_directory)) {
         msg("Found deprecated folder name in your installation. Please contact your developers and ask them to rename {$old_directory} to {$directory}", 'error');
     }
     /**
      * list templates
      */
     $templates = $File->getFlatArrayFromFsJoin($directory);
     $templates = array_reverse($templates);
     if (is_array($templates)) {
         foreach ($templates as $template) {
             $template['name'] = str_replace('.html', '', $template['name']);
             if ($template['name'] == $this->node_data['component']['node_controller']) {
                 $template['selected'] = "selected='selected'";
             } else {
                 $template['selected'] = '';
             }
             $template['title'] = $templates_info[$this->GET['node_group']][$template['name']]['title'];
             if ($template['title'] == '') {
                 $template['title'] = $template['name'];
             }
             $this->tpl->assign('LAYOUT_TEMPLATE', $template);
             $this->tpl->parse('content.templateitem');
         }
     }
     $this->tpl->assign("SPAM_PROTECTION", array('captcha_image' => $this->node_data['component']['spam_protection'] == 'captcha_image' ? 'selected="selected"' : '', 'captcha_text_js' => $this->node_data['component']['spam_protection'] == 'captcha_text_js' ? 'selected="selected"' : ''));
 }
Example #16
0
 /**
  * post
  */
 function post()
 {
     parent::post();
     /* we need to include config, can be removed when we initialize all conf on beggining */
     require_once 'models/common/common_image.php';
     $common_image_conf = common_image::initConfiguration();
     $this->tpl->assign('IMAGE_CONF', $common_image_conf);
     //TODO?: images size can be extracted from COMMON_IMAGE_THUMBNAIL
     /**
      * cycle gallery options
      */
     if ($this->node_data['component']['template'] == 'cycle') {
         if (!$this->node_data['component']['cycle']['fx']) {
             $this->node_data['component']['cycle']['fx'] = $common_image_conf['common_image']['cycle_fx'];
         }
         if (!$this->node_data['component']['cycle']['easing']) {
             $this->node_data['component']['cycle']['easing'] = $common_image_conf['common_image']['cycle_easing'];
         }
         if (!is_numeric($this->node_data['component']['cycle']['timeout']) || $this->node_data['component']['cycle']['timeout'] < 0) {
             $this->node_data['component']['cycle']['timeout'] = $common_image_conf['common_image']['cycle_timeout'];
         }
         if (!is_numeric($this->node_data['component']['cycle']['speed']) || $this->node_data['component']['cycle']['speed'] < 0) {
             $this->node_data['component']['cycle']['speed'] = $common_image_conf['common_image']['cycle_speed'];
         }
         $this->tpl->assign("SELECTED_cycle_fx_{$this->node_data['component']['cycle']['fx']}", "selected='selected'");
         $this->tpl->assign("SELECTED_cycle_easing_{$this->node_data['component']['cycle']['easing']}", "selected='selected'");
         //must assign NODE before parsing
         $this->tpl->assign("NODE", $this->node_data);
         $this->tpl->parse('content.cycle_options');
     }
     /**
      * local templates
      */
     $this->displayLocalImageGalleryTemplates();
     /**
      * template selected
      */
     $this->tpl->assign("SELECTED_template_{$this->node_data['component']['template']}", "selected='selected'");
 }
Example #17
0
 /**
  * post action
  */
 function post()
 {
     parent::post();
     $this->node_data['component']['allow_anonymouse_submit'] = $this->node_data['component']['allow_anonymouse_submit'] ? 'checked="checked"' : '';
 }
Example #18
0
 /**
  * post action
  */
 function post()
 {
     parent::post();
     $this->tpl->assign("SELECTED_{$this->component_data['type']}", "selected='selected'");
 }
Example #19
0
 /**
  * post action
  */
 function post()
 {
     parent::post();
     //template
     $this->tpl->assign("SELECTED_template_{$this->node_data['component']['template']}", "selected='selected'");
 }
Example #20
0
 /**
  * post action
  */
 function post()
 {
     parent::post();
     $node_id = $this->GET['id'];
     require_once 'models/common/common_print_article.php';
     $File = new common_print_article();
     if ($_POST['add'] == 'add') {
         $_POST['file']['other'] = serialize($_POST['file']['other']);
         if ($File->insertFile($_POST['file'])) {
             msg('File inserted');
         }
     }
     if ($_POST['delete_file'] != '') {
         msg("Not implemented", "error");
         //can't use File->deleteFile(file_name),
         //use File->unlink(id) instead
         //if ($File->deleteFile($_POST['delete_file'])) $_POST['upload'] = 1;
     }
     if (is_numeric($_POST['update'])) {
         //$File->detail($_POST['update']);
         $_POST['file']['other'] = serialize($_POST['file']['other']);
         if ($File->update($_POST['file'])) {
             msg('updated');
         }
     }
     $files = $File->listFiles($node_id);
     foreach ($files as $f) {
         $this->tpl->assign('FILE', $f);
         if ($this->GET['type'] == 'RTE') {
             $this->tpl->parse("content.item.RTE_select");
         }
         $this->tpl->parse("content.item");
     }
     //print_r($_POST); exit;
     if ($_POST['upload'] && !$_POST['edit_file']) {
         $_POST['action'] = 'add';
     } else {
         if ($_POST['edit_file'] || is_numeric($_POST['update'])) {
             $_POST['action'] = 'edit';
         }
     }
     switch ($_POST['action']) {
         case 'edit':
         case 'update':
             $detail = $File->detail($_POST['edit_file']);
             if (is_array($detail)) {
                 $detail['other'] = unserialize($detail['other']);
                 if (!is_array($detail['other'])) {
                     $detail['other'] = 0;
                 }
                 $this->tpl->assign("SELECTED_{$detail['type']}", 'selected="selected"');
                 $this->tpl->assign('FILE', $detail);
                 $this->tpl->parse("content.file_edit");
             } else {
                 msg("Cant get info of {$_POST['edit_file']} from DB", 'error');
             }
             break;
         case 'add':
         default:
             if ($_POST['upload'] == 'new') {
                 $_POST['file']['priority'] = 0;
                 $_POST['file']['src'] = '';
             }
             $this->tpl->assign('FILE', $_POST['file']);
             $this->tpl->parse("content.file_upload");
             break;
     }
 }
Example #21
0
 /**
  * post action
  */
 function post()
 {
     parent::post();
     $this->node_data['component']['image'] = $this->node_data['component']['image'] ? 'checked="checked"' : '';
 }
Example #22
0
 /**
  * post action
  */
 function post()
 {
     parent::post();
     $this->tpl->assign("SELECT_condition_" . $this->node_data['component']['condition'], 'selected="selected"');
 }
Example #23
0
 /**
  * pre action
  */
 function pre()
 {
     parent::pre();
     $_POST['node']['content'] = serialize($_POST['component']);
 }