function smarty_function_cms_lang_info($params, &$template) { $smarty = $template->smarty; $lang = CmsNlsOperations::get_current_language(); if (isset($params['lang'])) { $lang = trim($params['lang']); } $info = CmsNlsOperations::get_language_info($lang); if (!$info) { return; } if (isset($params['assign'])) { $smarty->assign($params['assign'], $info); return; } return $info; }
/** * DisplayHTMLStartTag * Outputs the html open tag. Override at your own risk :) */ function DisplayHTMLStartTag() { $info = CmsNlsOperations::get_language_info(CmsNlsOperations::get_current_language()); echo $info->direction() == 'rtl' ? "<html dir=\"rtl\"\n>" : "<html>\n"; }
public function postprocess($html) { $smarty = cmsms()->GetSmarty(); $otd = $smarty->template_dir; $smarty->template_dir = dirname(__FILE__) . '/templates'; $module_help_type = $this->get_value('module_help_type'); // get a page title $title = $this->get_value('pagetitle'); $alias = $this->get_value('pagetitle'); if ($title) { if (!$module_help_type) { // if not doing module help, translate the string. $extra = $this->get_value('extra_lang_params'); if (!$extra) { $extra = array(); } $title = lang($title, $extra); } } else { // no title, get one from the breadcrumbs. $bc = $this->get_breadcrumbs(); if (is_array($bc) && count($bc)) { $title = $bc[count($bc) - 1]['title']; } } // page title and alias $smarty->assign('pagetitle', $title); $smarty->assign('pagealias', munge_string_to_url($alias)); // module name? if ($module_name = $this->get_value('module_name')) { $smarty->assign('module_name', $module_name); } // module icon? if ($module_icon_url = $this->get_value('module_icon_url')) { $smarty->assign('module_icon_url', $module_icon_url); } // module_help_url if (!get_preference(get_userid(), 'hide_help_links', 0)) { if ($module_help_url = $this->get_value('module_help_url')) { $smarty->assign('module_help_url', $module_help_url); } } // if bookmarks if (get_preference(get_userid(), 'bookmarks')) { $marks = $this->get_bookmarks(); $smarty->assign('marks', $marks); } $headtext = $this->get_value('headertext'); $smarty->assign('headertext', $headtext); // and some other common variables,. $smarty->assign('content', str_replace('</body></html>', '', $html)); $smarty->assign('config', cmsms()->GetConfig()); $smarty->assign('theme', $this); $smarty->assign('secureparam', CMS_SECURE_PARAM_NAME . '=' . $_SESSION[CMS_USER_KEY]); $userops = cmsms()->GetUserOperations(); $smarty->assign('user', $userops->LoadUserByID(get_userid())); // get user selected language $smarty->assign('lang', get_preference(get_userid(), 'default_cms_language')); // get language direction $lang = CmsNlsOperations::get_current_language(); $info = CmsNlsOperations::get_language_info($lang); $smarty->assign('lang_dir', $info->direction()); if (is_array($this->_errors) && count($this->_errors)) { $smarty->assign('errors', $this->_errors); } if (is_array($this->_messages) && count($this->_messages)) { $smarty->assign('messages', $this->_messages); } $_contents = $smarty->fetch('pagetemplate.tpl'); $smarty->template_dir = $otd; return $_contents; }
$errors[] = lang('errordeletingdirectory'); } else { // put mention into the admin log audit(-1, 'Directory: ' . $reldir . "/" . $_GET['file'], 'Deleted'); } } else { $errors[] = lang('norealdirectory'); } } else { $errors[] = lang('needpermissionto', array('Modify Files')); } } } include_once "header.php"; $current_language = CmsNlsOperations::get_current_language(); $langinfo = CmsNlsOperations::get_language_info($current_language); ?> <script type="text/javascript" src="../lib/filemanager/ImageManager/assets/dialog.js"></script> <script type="text/javascript" src="../lib/filemanager/ImageManager/IMEStandalone.js"></script> <script type="text/javascript" src="../lib/filemanager/ImageManager/lang/<?php echo $langinfo->htmlarea(); ?> .js"></script> <script type="text/javascript"> //<![CDATA[ //Create a new Image Manager, needs the directory where the manager is //and which language translation to use. var manager = new ImageManager('../lib/filemanager/ImageManager','en'); var thumbdir = "<?php echo $IMConfig['thumbnail_dir'];
#but WITHOUT ANY WARRANTY; without even the implied warranty of #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #GNU General Public License for more details. #You should have received a copy of the GNU General Public License #along with this program; if not, write to the Free Software #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # #$Id: style.php 8272 2012-08-28 17:35:32Z calguy1000 $ $CMS_ADMIN_PAGE = TRUE; $CMS_STYLESHEET = TRUE; require_once "../include.php"; $themeObject = cms_utils::get_theme_object(); $theme = $themeObject->themeName; $style = "style"; cms_admin_sendheaders('text/css'); $thelang = CmsNlsOperations::get_language_info(CmsNlsOperations::get_current_language()); if (is_object($thelang) && $thelang->direction() == 'rtl') { $style .= "-rtl"; } if (isset($_GET['ie'])) { $style .= "_ie"; } $style .= ".css"; if (file_exists(dirname(__FILE__) . "/themes/" . $theme . "/css/" . $style)) { cms_readfile(dirname(__FILE__) . "/themes/" . $theme . "/css/" . $style); } if (file_exists(dirname(__FILE__) . "/themes/" . $theme . "/extcss/" . $style)) { cms_readfile(dirname(__FILE__) . "/themes/" . $theme . "/extcss/" . $style); } // else if (file_exists(dirname(__FILE__)."/themes/default/css/".$style)) // {
function get_language_list($allow_none = true) { $tmp = array(); if ($allow_none) { $tmp = array('' => lang('nodefault')); } $langs = CmsNlsOperations::get_installed_languages(); asort($langs); foreach ($langs as $key) { $obj = CmsNlsOperations::get_language_info($key); $value = $obj->display(); if ($obj->fullname()) { $value .= ' (' . $obj->fullname() . ')'; } $tmp[$key] = $value; } return $tmp; }