public function __construct() { parent::__construct(); $modulePath = getModulePath('cmsemail'); $this->load->model('../' . getModContDirName('cmsemail') . '/cmsemail/models/cmsemail_model'); (new \MY_Lang())->load('cmsemail'); }
public function render($viewName, array $data = array(), $return = false) { if (!empty($data)) { $this->template->add_array($data); } $this->template->show('file:' . 'application/' . getModContDirName('comments') . '/comments/templates/' . $viewName); exit; if ($return === false) { $this->template->show('file:' . 'application/' . getModContDirName('comments') . '/comments/templates/' . $viewName); } else { return $this->template->fetch('file:' . 'application/' . getModContDirName('comments') . '/comments/templates/' . $viewName); } }
function imagebox_headers() { $ci =& get_instance(); if ($ci->config->item('imagebox_headers') !== TRUE) { $url = 'application/' . getModContDirName('imagebox') . '/imagebox/templates/js/lightbox/'; $result = '<link rel="stylesheet" href="' . media_url($url . 'css/lightbox.css') . '" type="text/css" media="screen" /> <script type="text/javascript" src="' . media_url($url . 'js/prototype.lite.js') . '"></script> <script type="text/javascript" src="' . media_url($url . 'js/moo.fx.js') . '"></script> <script type="text/javascript" src="' . media_url($url . 'js/litebox-1.0.js') . '"></script> <script type="text/javascript"> window.onload = initLightbox; </script> '; $ci->config->set_item('imagebox_headers', TRUE); return $result; } }
/** * install module(create db tables, set default values) */ public function install() { $this->load->dbforge(); $this->dx_auth->is_admin() or exit; $fields = array('id' => array('type' => 'INT', 'auto_increment' => TRUE), 'name' => array('type' => 'VARCHAR', 'constraint' => '256', 'null' => FALSE), 'patern' => array('type' => 'TEXT', 'null' => FALSE), 'from' => array('type' => 'VARCHAR', 'constraint' => '256', 'null' => FALSE), 'from_email' => array('type' => 'VARCHAR', 'constraint' => '256', 'null' => FALSE), 'admin_email' => array('type' => 'VARCHAR', 'constraint' => '256', 'null' => FALSE), 'type' => array('type' => 'ENUM', 'constraint' => "'HTML','Text'", 'default' => "HTML"), 'user_message_active' => array('type' => 'TINYINT', 'constraint' => '1'), 'admin_message_active' => array('type' => 'TINYINT', 'constraint' => '1')); $this->dbforge->add_field($fields); $this->dbforge->add_key('id', TRUE); $this->dbforge->create_table('mod_email_paterns'); $fields = array('id' => array('type' => 'INT'), 'locale' => array('type' => 'VARCHAR', 'constraint' => '5'), 'theme' => array('type' => 'VARCHAR', 'constraint' => '256', 'null' => FALSE), 'user_message' => array('type' => 'TEXT', 'null' => FALSE), 'admin_message' => array('type' => 'TEXT', 'null' => FALSE), 'description' => array('type' => 'TEXT', 'null' => FALSE), 'variables' => array('type' => 'TEXT', 'null' => FALSE)); $this->dbforge->add_field($fields); $this->dbforge->add_key('id', TRUE); $this->dbforge->add_key('locale', TRUE); $this->dbforge->create_table('mod_email_paterns_i18n'); $this->db->where('identif', 'cmsemail')->update('components', array('settings' => serialize(array('from' => 'Default From', 'from_email' => '*****@*****.**', 'admin_email' => '*****@*****.**', 'theme' => 'Default Theme', 'wraper' => 'Default $content Wraper', 'wraper_activ' => true, 'mailpath' => '/usr/sbin/sendmail', 'protocol' => 'SMTP', 'port' => '80')), 'enabled' => 1)); $sql = file_get_contents('./application/' . getModContDirName('cmsemail') . '/cmsemail/models/paterns.sql'); $this->db->query($sql); $sql = file_get_contents('./application/' . getModContDirName('cmsemail') . '/cmsemail/models/patterns_i18n.sql'); $this->db->query($sql); return TRUE; }
function getPoFileSettingsText($lang = '', $type = '', $module = NULL) { $content = "" . 'msgid ""' . PHP_EOL . 'msgstr ""' . PHP_EOL . '"Project-Id-Version: \\n"' . PHP_EOL . '"Report-Msgid-Bugs-To: \\n"' . PHP_EOL . '"POT-Creation-Date: ' . date('Y-m-d h:iO', time()) . '\\n"' . PHP_EOL . '"PO-Revision-Date: ' . date('Y-m-d h:iO', time()) . '\\n"' . PHP_EOL . '"Last-Translator: \\n"' . PHP_EOL . '"Language-Team: \\n"' . PHP_EOL . '"Language: ' . $lang . '\\n"' . PHP_EOL . '"MIME-Version: 1.0\\n"' . PHP_EOL . '"Content-Type: text/plain; charset=UTF-8\\n"' . PHP_EOL . '"Content-Transfer-Encoding: 8bit\\n"' . PHP_EOL . '"X-Poedit-KeywordsList: _;gettext;gettext_noop;lang\\n"' . PHP_EOL; switch ($type) { case 'main': if (file_exists('./application/language/main/ru_RU/LC_MESSAGES/main.po')) { $main_content = file('./application/language/main/ru_RU/LC_MESSAGES/main.po'); $content .= '"X-Poedit-Basepath: .\\n"' . PHP_EOL . '"X-Poedit-SourceCharset: utf-8\\n"' . PHP_EOL . '"X-Generator: Poedit 1.5.7\\n"' . PHP_EOL . '"X-Poedit-Language: \\n"' . PHP_EOL . '"X-Poedit-Country: \\n"' . PHP_EOL; foreach ($main_content as $line) { if (strstr($line, 'X-Poedit-SearchPath')) { $content .= $line; } if (!$line) { break; } } } else { $content .= '"X-Poedit-Basepath: .\\n"' . PHP_EOL . '"X-Poedit-SourceCharset: utf-8\\n"' . PHP_EOL . '"X-Generator: Poedit 1.5.7\\n"' . PHP_EOL . '"X-Poedit-Language: \\n"' . PHP_EOL . '"X-Poedit-Country: \\n"' . PHP_EOL . '"X-Poedit-SearchPath-0: ..\\n"' . PHP_EOL; } break; case 'module': if ($module == 'admin') { $content .= '"X-Poedit-Basepath: ../../..\\n"' . PHP_EOL . '"X-Poedit-SourceCharset: utf-8\\n"' . PHP_EOL . '"X-Generator: Poedit 1.5.7\\n"' . PHP_EOL . '"X-Poedit-Language: \\n"' . PHP_EOL . '"X-Poedit-Country: \\n"' . PHP_EOL . '"X-Poedit-SearchPath-0: .\\n"' . PHP_EOL . '"X-Poedit-SearchPath-1: ../../../templates/administrator\\n"' . PHP_EOL . '"X-Poedit-SearchPath-2: ../../' . getModContDirName('shop') . '/shop/admin\\n"' . PHP_EOL . 'X-Poedit-SearchPath-3: ../../../application/' . getModContDirName('shop') . '/shop/models/build/classes\\n' . PHP_EOL; } else { $content .= '"X-Poedit-Basepath: ../../..\\n"' . PHP_EOL . '"X-Poedit-SourceCharset: utf-8\\n"' . PHP_EOL . '"X-Generator: Poedit 1.5.7\\n"' . PHP_EOL . '"X-Poedit-Language: \\n"' . PHP_EOL . '"X-Poedit-Country: \\n"' . PHP_EOL . '"X-Poedit-SearchPath-0: .\\n"' . PHP_EOL; } break; case 'template': $content .= '"X-Poedit-Basepath: ../../../..\\n"' . PHP_EOL . '"X-Poedit-SourceCharset: utf-8\\n"' . PHP_EOL . '"X-Generator: Poedit 1.5.7\\n"' . PHP_EOL . '"X-Poedit-Language: \\n"' . PHP_EOL . '"X-Poedit-Country: \\n"' . PHP_EOL . '"X-Poedit-SearchPath-0: .\\n"' . PHP_EOL; break; } return $content; }
function get_file_name($name, $type) { switch ($type) { case 'modules': $module_info = (MAINSITE ? MAINSITE : '.') . "/application/" . getModContDirName($name) . "/{$name}/module_info.php"; include $module_info; $lang = new MY_Lang(); $lang->load($name); return lang('Module', 'translator') . ' - ' . $com_info['menu_name']; break; case 'templates': return lang('Template', 'translator') . ' - ' . $name; break; case 'main': return lang('Main file', 'translator'); break; default: return ''; break; } }
public function render($viewName, array $data = array(), $return = false) { if (!empty($data)) { $this->template->add_array($data); } // if ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') // $this->template->fetch('file:' . 'application/modules/menu/templates/' . $viewName); // else $this->template->show('file:' . 'application/' . getModContDirName('menu') . '/menu/templates/' . $viewName); exit; if ($return === false) { $this->template->show('file:' . 'application/' . getModContDirName('menu') . '/menu/templates/' . $viewName); } else { return $this->template->fetch('file:' . 'application/' . getModContDirName('menu') . '/menu/templates/' . $viewName); } }
public function render($viewName, array $data = array(), $return = false) { if (!empty($data)) { $this->template->add_array($data); } $this->template->show('file:' . APPPATH . getModContDirName('core') . '/core/templates/' . $viewName); }