Esempio n. 1
0
 /**
  * settings for mail tempalte design
  *
  * @global <type> $objDatabase
  * @global <type> $_ARRAYLANG
  * @return true
  */
 function mailTemplates()
 {
     global $_CORELANG, $_ARRAYLANG;
     $_REQUEST['active_tab'] = 1;
     if (isset($_REQUEST['act']) && $_REQUEST['act'] == 'mailtemplate_edit') {
         $_REQUEST['active_tab'] = 2;
     }
     \Cx\Core\MailTemplate\Controller\MailTemplate::deleteTemplate('Crm');
     // If there is anything to be stored, and if that fails, return to
     // the edit view in order to save the posted form content
     $result_store = \Cx\Core\MailTemplate\Controller\MailTemplate::storeFromPost('Crm');
     if ($result_store === false) {
         $_REQUEST['active_tab'] = 2;
     }
     $objTemplate = null;
     $result &= \Cx\Core\Setting\Controller\Setting::show_external($objTemplate, $_CORELANG['TXT_CORE_MAILTEMPLATES'], \Cx\Core\MailTemplate\Controller\MailTemplate::overview('Crm', 'config', \Cx\Core\Setting\Controller\Setting::getValue('numof_mailtemplate_per_page_backend', 'Crm'))->get());
     $result &= \Cx\Core\Setting\Controller\Setting::show_external($objTemplate, empty($_REQUEST['key']) ? $_CORELANG['TXT_CORE_MAILTEMPLATE_ADD'] : $_CORELANG['TXT_CORE_MAILTEMPLATE_EDIT'], \Cx\Core\MailTemplate\Controller\MailTemplate::edit('Crm')->get());
     $result &= \Cx\Core\Setting\Controller\Setting::show_external($objTemplate, $_ARRAYLANG['TXT_CRM_PLACEHOLDERS'], $this->getCrmModulePlaceHolders());
     $this->_objTpl->addBlock('CRM_MAIL_SETTINGS_FILE', 'settings_block', $objTemplate->get());
     $this->_objTpl->touchBlock('settings_block');
 }
 /**
  * Parse Settings E-mail templates section
  */
 function emailTemplates()
 {
     global $_CORELANG, $_ARRAYLANG, $objDatabase;
     $this->_objTpl->addBlockfile('NEWSLETTER_SETTINGS_FILE', 'settings_block', 'newsletter_config_email_templates.html');
     $this->_objTpl->setVariable('TXT_TITLE', $_ARRAYLANG['TXT_NEWSLETTER_EMAIL_TEMPLATES']);
     $_REQUEST['active_tab'] = 1;
     if (isset($_REQUEST['act']) && $_REQUEST['act'] == 'mailtemplate_edit') {
         $_REQUEST['active_tab'] = 2;
     }
     \Cx\Core\MailTemplate\Controller\MailTemplate::deleteTemplate('Newsletter');
     // If there is anything to be stored, and if that fails, return to
     // the edit view in order to save the posted form content
     $resultStore = \Cx\Core\MailTemplate\Controller\MailTemplate::storeFromPost('Newsletter');
     if ($resultStore === false) {
         $_REQUEST['active_tab'] = 2;
     }
     $objTemplate = null;
     \Cx\Core\Setting\Controller\Setting::show_external($objTemplate, $_CORELANG['TXT_CORE_MAILTEMPLATES'], \Cx\Core\MailTemplate\Controller\MailTemplate::overview('Newsletter', 'config')->get());
     \Cx\Core\Setting\Controller\Setting::show_external($objTemplate, empty($_REQUEST['key']) ? $_CORELANG['TXT_CORE_MAILTEMPLATE_ADD'] : $_CORELANG['TXT_CORE_MAILTEMPLATE_EDIT'], \Cx\Core\MailTemplate\Controller\MailTemplate::edit('Newsletter')->get());
     \Cx\Core\Setting\Controller\Setting::show_external($objTemplate, $_ARRAYLANG['TXT_NEWSLETTER_PLACEHOLDERS'], $this->getNewsletterPlaceHoldersList());
     $this->_objTpl->setVariable(array('NEWSLETTER_MAIL_TEMPLATE_SETTINGS' => $objTemplate->get(), 'TXT_NEWSLETTER_EMAIL_TEMPLATES' => $_ARRAYLANG['TXT_NEWSLETTER_EMAIL_TEMPLATES']));
 }
Esempio n. 3
0
 /**
  * The mailtemplate settings view
  *
  * Stores MailTemplates posted from the {@see MailTemplate::edit()} view.
  * Deletes a MailTemplate on request from the
  * {@see MailTemplate::overview()} view.
  * Includes both the overview and the edit view, activates one depending
  * on the outcome of the call to {@see MailTemplate::storeFromPost()}
  * or the current active_tab.
  * @return  boolean               True on success, false otherwise
  */
 static function view_settings_mail()
 {
     global $_CORELANG;
     // TODO: TEMPORARY.  Remove when a proper update is available.
     $template = \Cx\Core\MailTemplate\Controller\MailTemplate::get('Shop', 'order_confirmation');
     //die(var_export($template, true));
     if (!$template) {
         ShopMail::errorHandler();
     }
     $result = true;
     $_REQUEST['active_tab'] = 1;
     if (isset($_REQUEST['act']) && $_REQUEST['act'] == 'mailtemplate_edit') {
         $_REQUEST['active_tab'] = 2;
     }
     \Cx\Core\MailTemplate\Controller\MailTemplate::deleteTemplate('Shop');
     // If there is anything to be stored, and if that fails, return to
     // the edit view in order to save the posted form content
     $result_store = \Cx\Core\MailTemplate\Controller\MailTemplate::storeFromPost('Shop');
     if ($result_store === false) {
         $_REQUEST['active_tab'] = 2;
     }
     $objTemplate = null;
     $result &= \Cx\Core\Setting\Controller\Setting::show_external($objTemplate, $_CORELANG['TXT_CORE_MAILTEMPLATES'], \Cx\Core\MailTemplate\Controller\MailTemplate::overview('Shop', 'config', \Cx\Core\Setting\Controller\Setting::getValue('numof_mailtemplate_per_page_backend', 'Shop'))->get());
     $result &= \Cx\Core\Setting\Controller\Setting::show_external($objTemplate, empty($_REQUEST['key']) ? $_CORELANG['TXT_CORE_MAILTEMPLATE_ADD'] : $_CORELANG['TXT_CORE_MAILTEMPLATE_EDIT'], \Cx\Core\MailTemplate\Controller\MailTemplate::edit('Shop')->get());
     self::$objTemplate->addBlock('SHOP_SETTINGS_FILE', 'settings_block', $objTemplate->get());
     self::$objTemplate->touchBlock('settings_block');
     return $result;
 }