/** * 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"' : '')); }
/** * get md array for node directory */ function getList($publish = 1) { require_once 'models/common/common_file.php'; $File = new common_file(); //getting list of templates, joing project and onxshop node dir $list = $File->getFlatArrayFromFsJoin("templates/node/"); //remove .html, .php foreach ($list as $k => $item) { $list[$k]['name'] = preg_replace('/\\.html$/', '', $list[$k]['name']); $list[$k]['name'] = preg_replace('/\\.php$/', '', $list[$k]['name']); $list[$k]['id'] = preg_replace('/\\.html$/', '', $list[$k]['id']); $list[$k]['id'] = preg_replace('/\\.php$/', '', $list[$k]['id']); $list[$k]['parent'] = preg_replace('/\\.html$/', '', $list[$k]['parent']); $list[$k]['parent'] = preg_replace('/\\.php$/', '', $list[$k]['parent']); } return $list; }
/** * 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"' : '')); }