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


PHP theme::t方法代码示例

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


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

示例1: websites_form

function websites_form($item)
{
    global $user;
    global $DB;
    global $layout;
    global $events;
    $navibars = new navibars();
    $naviforms = new naviforms();
    $layout->navigate_media_browser();
    // we want to use media browser in this function
    $layout->navigate_editorfield_link_dialog();
    $theme = new theme();
    if (!empty($item->theme)) {
        $theme->load($item->theme);
    }
    if (empty($item->id)) {
        $navibars->title(t(241, 'Websites') . ' / ' . t(38, 'Create'));
    } else {
        $navibars->title(t(241, 'Websites') . ' / ' . t(170, 'Edit') . ' [' . $item->id . ']');
    }
    if ($user->permission('websites.edit') == 'true') {
        $navibars->add_actions(array('<a href="#" onclick="javascript: navigate_media_browser();" title="Ctrl+m">
					<img height="16" align="absmiddle" width="16" src="img/icons/silk/images.png"> ' . t(36, 'Media') . '</a>'));
        $extra_actions = array();
        $extra_actions[] = '<a href="#" action="navigate_reset_statistics" onclick="javascript: navigate_reset_statistics();"><img height="16" align="absmiddle" width="16" src="img/icons/silk/chart_line.png"> ' . t(429, 'Reset statistics') . '</a>';
        $layout->add_script('
            function navigate_reset_statistics()
            {
                navigate_confirmation_dialog(
                    function()
                    {
                        $.post(
                            "?fid=websites&act=reset_statistics&website=' . $item->id . '",
                            {},
                            function(data)
                            {
                                $("a[action=\'navigate_reset_statistics\']").parent().fadeOut();
                            }
                        );
                    }, 
                    "<div>' . t(430, 'Do you really want to remove all statistics of this website?') . '</div>" 
                );
            }
        ');
        if (!empty($item->id)) {
            $extra_actions[] = '<a href="#" action="navigate_replace_urls" onclick="javascript: navigate_replace_urls();"><img height="16" align="absmiddle" width="16" src="img/icons/silk/database_refresh.png"> ' . t(603, 'Replace URLs') . '</a>';
            // try to find the OLD url for NAVIGATE_DOWNLOAD
            $old_url_guessed = "";
            $DB->query('
				SELECT text
				  FROM nv_webdictionary
				  WHERE node_type = "item"
				    AND website = ' . $item->id . '
				    AND text LIKE ' . protect("%navigate_download.php%") . '
			    LIMIT 1
		    ');
            $rs = $DB->result('text');
            preg_match("/<img .*?(?=src)src=\"([^\"]+)\"/si", $rs[0], $old_url_guessed);
            $old_url_guessed = @$old_url_guessed[1];
            $old_url_guessed = substr($old_url_guessed, 0, strpos($old_url_guessed, NAVIGATE_FOLDER));
            $layout->add_content('
		        <div id="navigate_replace_urls_dialog" style="display: none;">
		            <div id="" class="navigate-form-row">
						<label>' . t(604, "Old") . '</label>
						<input type="text" style=" width: 300px;" id="replace_urls_old" name="replace_urls_old" value="' . $old_url_guessed . '/" />
					</div>
					<div id="" class="navigate-form-row">
						<label>' . t(605, "New") . '</label>
						<input type="text" style=" width: 300px;" id="replace_urls_new" name="replace_urls_new" value="' . NAVIGATE_PARENT . '/" />
					</div>
					<div class="navigate-form-row">
						<div class="subcomment">' . t(523, "This action can NOT be undone.") . '</div>
					</div>
		        </div>
		    ');
            $layout->add_script('
	            function navigate_replace_urls()
	            {
	                $("#navigate_replace_urls_dialog").dialog({
	                        resizable: true,
	                        height: 180,
	                        width: 520,
	                        modal: true,
	                        title: "' . t(603, 'Replace URLs') . '",
	                        buttons: {
	                            "' . t(190, 'Ok') . '": function()
	                            {
	                                $.post(
	                                    "?fid=websites&act=replace_urls",
	                                    {
	                                        old: $("#replace_urls_old").val(),
	                                        new: $("#replace_urls_new").val(),
	                                        website: ' . $item->id . '
	                                    },
	                                    function(data)
	                                    {
	                                        if(data!="true")
					                            navigate_notification("' . t(56, "Unexpected error.") . '");
					                        else
					                        {
//.........这里部分代码省略.........
开发者ID:NavigateCMS,项目名称:Navigate-CMS,代码行数:101,代码来源:websites.php

示例2: load_from_webuser

 public function load_from_webuser($property_id, $webuser_id = null)
 {
     global $website;
     global $theme;
     global $webuser;
     $wu = $webuser;
     if (!empty($webuser_id)) {
         $wu = new webuser();
         $wu->load($webuser_id);
     }
     $ws = $website;
     $ws_theme = $theme;
     if ($wu->website != $website->id) {
         $ws = new website();
         $ws->load($wu->website);
         $ws_theme = new theme();
         $ws_theme->load($ws->theme);
     }
     if (empty($ws_theme->webusers['properties'])) {
         $ws_theme->webusers['properties'] = array();
     }
     foreach ($ws_theme->webusers['properties'] as $to) {
         if ($to->id == $property_id || $to->name == $property_id) {
             $webuser_option = $to;
             $webuser_option->element = 'webuser';
             break;
         }
     }
     $this->id = $webuser_option->id;
     $this->website = $ws->id;
     $this->element = $webuser_option->element;
     $this->template = '';
     $this->name = $webuser_option->name;
     $this->type = $webuser_option->type;
     $this->options = (array) $webuser_option->options;
     $this->dvalue = $webuser_option->dvalue;
     // default value
     $this->width = $webuser_option->width;
     $this->multilanguage = $webuser_option->multilanguage;
     $this->helper = $webuser_option->helper;
     $this->function = $webuser_option->function;
     $this->conditional = $webuser_option->conditional;
     $this->position = 0;
     $this->enabled = 1;
     // decimal format extra fields
     $this->precision = $webuser_option->precision;
     $this->prefix = $webuser_option->prefix;
     $this->suffix = $webuser_option->suffix;
     if (substr($this->name, 0, 1) == '@') {
         // get translation from theme dictionary
         $this->name = $ws_theme->t(substr($this->name, 1));
     }
     if (substr($this->helper, 0, 1) == '@') {
         $this->helper = $ws_theme->t(substr($this->helper, 1));
     }
     $values = property::load_properties_associative('webuser', '', 'webuser', $wu->id);
     $this->value = $values[$this->id];
     if (is_null($this->value) && !empty($this->dvalue)) {
         $this->value = $this->dvalue;
     }
     if (is_object($this->value)) {
         $this->value = (array) $this->value;
     }
 }
开发者ID:NavigateCMS,项目名称:Navigate-CMS,代码行数:64,代码来源:property.class.php

示例3: load_from_theme

 public function load_from_theme($id, $theme_name = null)
 {
     global $theme;
     global $website;
     $ws_theme = $theme;
     if (empty($ws_theme) && !empty($theme_name)) {
         $ws_theme = new theme();
         $ws_theme->load($theme_name);
     }
     $template = NULL;
     for ($t = 0; $t < count($ws_theme->templates); $t++) {
         if ($ws_theme->templates[$t]->type == $id) {
             $template = $ws_theme->templates[$t];
         }
     }
     if (!$template) {
         return;
     }
     $defaults = array('sections' => array(0 => array('id' => 'main', 'name' => '#main#', 'editor' => 'tinymce', 'width' => '960')), 'gallery' => 0, 'comments' => 0, 'tags' => 0, 'statistics' => 1, 'permission' => 0, 'enabled' => 1, 'properties' => array());
     $this->id = $template->type;
     $this->website = $website->id;
     $this->title = $ws_theme->template_title($template->type);
     $this->file = NAVIGATE_PATH . '/themes/' . $ws_theme->name . '/' . $template->file;
     $this->sections = isset($template->sections) ? json_decode(json_encode($template->sections), true) : $defaults['sections'];
     $this->gallery = isset($template->gallery) ? $template->gallery : $defaults['gallery'];
     $this->comments = isset($template->comments) ? $template->comments : $defaults['comments'];
     $this->tags = isset($template->tags) ? $template->tags : $defaults['tags'];
     $this->statistics = isset($template->statistics) ? $template->statistics : $defaults['statistics'];
     $this->permission = isset($template->permission) ? $template->permission : $defaults['permission'];
     $this->enabled = isset($template->enabled) ? $template->enabled : $defaults['enabled'];
     $this->properties = isset($template->properties) ? (array) $template->properties : $defaults['properties'];
     // process properties (translate titles, etc.)
     for ($p = 0; $p < count($this->properties); $p++) {
         if ($this->properties[$p]->type == 'option') {
             $poptions = array();
             foreach ($this->properties[$p]->options as $key => $value) {
                 $poptions[$key] = $ws_theme->t($value);
             }
             $this->properties[$p]->options = $poptions;
         }
     }
 }
开发者ID:NavigateCMS,项目名称:Navigate-CMS,代码行数:42,代码来源:template.class.php


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