Exemplo n.º 1
0
 public function index()
 {
     // Get all user groups
     $locale = chose_language();
     $roles = $this->db->where('locale', $locale)->join('shop_rbac_roles_i18n', 'shop_rbac_roles.id=shop_rbac_roles_i18n.id')->get('shop_rbac_roles')->result_array();
     $this->template->assign('roles', $roles);
     // Get admin email
     $this->db->select('email');
     $this->db->where('id', $this->dx_auth->get_user_id());
     $query = $this->db->get('users', 1)->row_array();
     $this->template->assign('admin_mail', $query['email']);
     // Get site name
     $this->template->assign('site_settings', $this->cms_base->get_settings());
     // Display email form
     $this->display_tpl('form');
 }
Exemplo n.º 2
0
 public function getAllTemplates()
 {
     $locale = chose_language();
     $query = $this->db->select('*, mod_email_paterns.id as id')->join('mod_email_paterns_i18n', "mod_email_paterns_i18n.id = mod_email_paterns.id and mod_email_paterns_i18n.locale = '{$locale}'", 'left')->get('mod_email_paterns');
     if ($query) {
         return $query->result_array();
     } else {
         return '';
     }
 }
 public function getTemplateVariables($locale = null)
 {
     if (null === $locale) {
         $locale = chose_language();
     }
     $template_id = $this->input->post('template_id');
     $variables = $this->email->getTemplateVariables($template_id, $locale);
     if ($variables) {
         return \CMSFactory\assetManager::create()->setData('variables', $variables)->render('variablesSelectOptions', true);
     } else {
         return FALSE;
     }
 }
 /**
  * get current locale
  * @return type
  */
 public static function getCurrentLocale()
 {
     $ci = get_instance();
     if (self::$currentLocale) {
         return self::$currentLocale;
     }
     if (preg_match('/^\\/install/', $ci->input->server('PATH_INFO'))) {
         return;
     }
     $lang_id = $ci->config->item('cur_lang');
     if ($lang_id) {
         $query = $ci->db->query("SELECT `identif` FROM `languages` WHERE `id`={$lang_id}")->result();
         if ($query) {
             self::$currentLocale = $query[0]->identif;
         } else {
             $defaultLanguage = self::getDefaultLanguage();
             self::$currentLocale = $defaultLanguage['identif'];
         }
     } else {
         self::$currentLocale = chose_language();
     }
     return self::$currentLocale;
 }
Exemplo n.º 5
0
 /**
  * get current locale
  * @return type
  */
 public static function getCurrentLocale()
 {
     if (self::$currentLocale) {
         return self::$currentLocale;
     }
     if (strstr($_SERVER['PATH_INFO'], 'install')) {
         return;
     }
     $ci = get_instance();
     $lang_id = $ci->config->item('cur_lang');
     if ($lang_id) {
         $query = $ci->db->query("SELECT `identif` FROM `languages` WHERE `id`={$lang_id}")->result();
         if ($query) {
             self::$currentLocale = $query[0]->identif;
         } else {
             $defaultLanguage = self::getDefaultLanguage();
             self::$currentLocale = $defaultLanguage['identif'];
         }
     } else {
         self::$currentLocale = chose_language();
     }
     return self::$currentLocale;
 }