当前位置: 首页>>代码示例>>PHP>>正文


PHP i18n::set方法代码示例

本文整理汇总了PHP中i18n::set方法的典型用法代码示例。如果您正苦于以下问题:PHP i18n::set方法的具体用法?PHP i18n::set怎么用?PHP i18n::set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在i18n的用法示例。


在下文中一共展示了i18n::set方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: fileUploadBlock

    public static function fileUploadBlock()
    {
        if (self::$invalid) {
            return;
        }
        i18n::set('admin');
        $uploader = new Uploader('editFiles', 'EditPage::handleUpload', false, array('multi' => true));
        queue_js_string("/*\$(function(){\$('.view-uploads').overlay({\n\tmask: {\n\t\tcolor: '#000',\n\t\tloadSpeed: 200,\n\t\topacity: 0.7\n\t},\n\n\tcloseOnClick: true\n});});*/");
        $uploadedButton = sprintf("<a href='#' class='action view-uploads' rel='#cc_uploaded_overlay'>%s%s</a>", icon('folder_picture'), __('admin', 'view-all-files'));
        $uploadedFiles = <<<EOT
<div class="cc_uploaded_files">
{$uploadedButton}
\t<div id="cc_uploaded_overlay" class="cc_modal">
\t\t<h2>%s</h2>
\t\t<ul class="cc_file_list">
\t\t\t%s
\t\t</ul>
\t</div>
</div>
EOT;
        //foreach(Uploads::getAllFiles() as $)
        $r .= sprintf("<h3>%s</h3>%s%s", __('upload-files'), sprintf($uploadedFiles, __('uploaded-files'), $files), $uploader->createHTML());
        i18n::restore();
        return $r;
    }
开发者ID:alecgorge,项目名称:TopHat,代码行数:25,代码来源:edit-page.php

示例2: Form

<?php

i18n::set('admin');
?>
<!doctype html>
<html>
	<head>
		<title><?php 
_e('login_cc');
?>
</title>

		<?php 
load_library(array('bootstrap-css', 'jquery'));
queue_css(TH_PUB_ADMIN . 'design/styles.css');
load_css();
load_js();
?>
	</head>
	<body class="login">
		<div id="login-wrapper">
			<h2><?php 
_e('login_cc');
?>
</h2>
			<?php 
$form = new Form('self', 'post', 'login');
$form->startFieldset('');
$form->addInput(__("Username"), 'text', 'cc_login_uname');
$form->addInput(__("Password"), 'password', 'cc_login_passwd');
$form->addInput(__("remember-me"), 'checkbox', 'cc_login_remember', 'yes');
开发者ID:alecgorge,项目名称:TopHat,代码行数:31,代码来源:login.tpl.php

示例3: create_display

 public static function create_display()
 {
     i18n::set('admin');
     if ($_POST['cc_form'] == 'create_page') {
         plugin('admin_create_post_pre_proccessing');
         $id = $_GET['id'];
         $title = filter('admin_create_post_title', self::get('title'));
         $content = filter('admin_create_post_content', self::get('content_area'));
         $last_modified = filter('admin_create_post_last_modified', time());
         $settings = filter('admin_create_post_settings', self::get('settings'));
         $weight = filter('admin_create_post_weight', self::get('weight'));
         $menutitle = filter('admin_create_post_menutitle', self::get('menutitle'));
         $parent_id = filter('admin_create_post_parent_id', self::get('parent_id'));
         $slug = filter('admin_create_post_slug', self::get('slug'));
         if (empty($menutitle) || empty($slug)) {
             $message = Message::error(__('blank-error'));
             plugin('admin_create_post_blank_error');
         } else {
             plugin('admin_create_post_post_proccessing');
             $values = array('title' => $title, 'content' => $content, 'settings' => unserialize($settings), 'weight' => $weight, 'menutitle' => $menutitle, 'parent_id' => $parent_id, 'slug' => $slug);
             $values = filter('admin_create_post_posted_values', $values);
             $values['settings'] = serialize($values['settings']);
             $res = Content::createNode($_GET['type'], $values);
             if ($res) {
                 $message = Message::success(sprintf(__('page-creation-successful') . ' (<a href="%s">%s</a>)', Admin::link('content'), __('view-all-pages')));
             } else {
                 $message = Message::error(__('page-creation-failed'));
             }
         }
         //Hooks::bind('post_edit_page', 'EditPage::handlePost');
     }
     $r = $message;
     $themeList = array_subkeys(Themes::getThemeList(), 'name');
     $themeList['-1'] = 'Default Theme';
     ksort($themeList);
     $form = new Form('self', 'post', 'create_page');
     $form->addHidden('settings', 'a:0:{}');
     $form->startFieldset(__('page-info'), array('id' => 'page_info_f'));
     $form->addInput(__('page-title'), 'text', 'title', self::get('title'), array('class' => 'large'));
     $form->addHidden('content_type', self::get('type'));
     $form->addSelectList(__('theme-override'), 'theme', $themeList);
     $form->addSelectList(__('parent'), 'parent_id', self::buildParentOptions(), true, $_POST['parent_id'] ? $_POST['parent_id'] : '0');
     $form->endFieldset();
     plugin('admin_create_custom_fields', array(&$form));
     $form->startFieldset(__('menu-settings'), array('id' => 'menu_settings_f'));
     $form->addInput(__('menu-title'), 'text', 'menutitle', self::get('menutitle'));
     $form->addInput(__('slug'), 'text', 'slug', self::get('slug'));
     $form->addInput(__('weight'), 'text', 'weight', $_POST['weight'] ? $_POST['weight'] : '0');
     $form->endFieldset();
     plugin('admin_create_custom_fields2', array(&$form));
     $form->startFieldset(__('content'));
     $content = self::get('content_area');
     $form->addEditor('<p></p>', 'content_area', empty($content) ? "<p></p>" : $content);
     $form->endFieldset();
     plugin('admin_create_custom_fields3', array(&$form));
     $form->addSubmit('', 'save', __('save'));
     i18n::restore();
     return array(__('admin', 'add-page'), $r . $form->endAndGetHTML());
 }
开发者ID:alecgorge,项目名称:TopHat,代码行数:59,代码来源:page.php

示例4: create_display

 public static function create_display()
 {
     i18n::set('external-link-nodetype');
     $message = "";
     if ($_POST['cc_form'] == 'create_external_link') {
         $id = $_GET['id'];
         $weight = self::get('weight');
         $menutitle = self::get('menutitle');
         $parent_id = self::get('parent_id');
         $slug = self::get('slug');
         if (empty($url) || empty($text)) {
             $message = Message::error(__('blank-error'));
         } else {
             if (empty($weight)) {
                 $weight = '0';
             }
             $values = array('title' => '', 'content' => '', 'settings' => 'a:0:{}', 'weight' => $weight, 'menutitle' => $menutitle, 'parent_id' => $parent_id, 'slug' => $slug);
             $res = Content::createNode($_GET['type'], $values);
             if ($res) {
                 $message = Message::success(sprintf(__('link-creation-successful') . ' (<a href="%s">%s</a>)', Admin::link('content'), __('admin', 'view-all-pages')));
             } else {
                 $message = Message::error(__('link-creation-failed'));
             }
         }
     }
     $r = $message;
     $form = new Form('self', 'post', 'create_external_link');
     $form->addInput(__('url'), 'text', 'slug', self::get('slug'));
     $form->addInput(__('display-text'), 'text', 'menutitle', self::get('menutitle'));
     $form->addSelectList(__('parent'), 'parent_id', PageNode::buildParentOptions(), true, $_POST['parent_id'] ? $_POST['parent_id'] : '0');
     $form->addInput(__('weight'), 'text', 'weight', self::get('weight'));
     $form->addSubmit('', 'create', 'Create');
     i18n::restore();
     return array(__('external-link-nodetype', 'create-external-link'), $form->endAndGetHTML());
 }
开发者ID:alecgorge,项目名称:TopHat,代码行数:35,代码来源:plugin.php


注:本文中的i18n::set方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。