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


PHP i18n::user方法代码示例

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


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

示例1: encode_field

    $label = i18n::s('Security salt');
    $input = '<input type="text" name="bbb_salt" id="bbb_salt" size="32" value="' . encode_field(isset($context['bbb_salt']) ? $context['bbb_salt'] : '') . '" maxlength="255" />';
    $fields[] = array($label, $input);
    // build the form
    $context['text'] .= Skin::build_form($fields);
    $fields = array();
    // bottom commands
    $menu = array();
    // the submit button
    $local['submit_en'] = 'Submit';
    $local['submit_fr'] = 'Enregistrer';
    $local['title_en'] = 'Press [s] to save data';
    $local['title_fr'] = 'Appuyer sur [s] pour enregistrer les donn&eacute;es';
    $menu[] = Skin::build_submit_button(i18n::user('submit'), i18n::user('title'), 's');
    // control panel
    $menu[] = Skin::build_link('control/', i18n::user('Control Panel'), 'span');
    // insert the menu in the page
    $context['text'] .= Skin::finalize_list($menu, 'assistant_bar');
    // end of the form
    $context['text'] .= '</form>';
    // no modifications in demo mode
} elseif (file_exists($context['path_to_root'] . 'parameters/demo.flag')) {
    Safe::header('Status: 401 Unauthorized', TRUE, 401);
    Logger::error(i18n::s('You are not allowed to perform this operation.'));
    // save updated parameters
} else {
    // build the new configuration file
    $content = '<?php' . "\n" . '// This file has been created by the configuration script overlays/bbb_meetings/configure.php' . "\n" . '// on ' . gmdate("F j, Y, g:i a") . ' GMT, for ' . Surfer::get_name() . '. Please do not modify it manually.' . "\n";
    if (isset($_REQUEST['bbb_server'])) {
        $content .= '$context[\'bbb_server\']=\'' . addcslashes($_REQUEST['bbb_server'], "\\'") . "';\n";
    }
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:configure.php

示例2:

        echo i18n::user('error') . "<br />\n";
    }
    // we have something in hand
    if ($content) {
        // create missing directories where applicable
        Safe::make_path(dirname($file));
        // create backups, if possible
        if (file_exists($context['path_to_root'] . $file)) {
            Safe::unlink($context['path_to_root'] . $file . '.bak');
            Safe::rename($context['path_to_root'] . $file, $context['path_to_root'] . $file . '.bak');
        }
        // update the target file
        if (!Safe::file_put_contents($file, $content)) {
            $local['label_en'] = 'Impossible to write to the file ' . $file . '.';
            $local['label_fr'] = 'Impossible d\'&eacute;crire le fichier ' . $file . '.';
            echo i18n::user('label') . "<br />\n";
        } else {
            $local['label_en'] = 'has been updated';
            $local['label_fr'] = 'a &eacute;t&eacute; mis &agrave; jour';
            echo $file . ' ' . i18n::user('label') . "<br />\n";
        }
    }
    // next one
    $count += 1;
    Safe::set_time_limit(30);
}
// basic reporting
$local['label_en'] = 'files have been copied';
$local['label_fr'] = 'fichiers ont &eacute;t&eacute; copi&eacute;s';
echo $count . ' ' . i18n::user('label') . "<br />\n";
开发者ID:rair,项目名称:yacs,代码行数:30,代码来源:150224_lasares_to_netgrabber.php

示例3: mktime

 /**
  * format a time stamp
  *
  * Accept either a time stamp, or a formatted string as input parameter:
  * - YYYY-MM-DD HH:MM:SS
  * - YYMMDD HH:MM:SS GMT
  *
  * @param int or string the time to be displayed
  * @param string the variant -- reserved for future use
  * @param string the language to express this stamp
  * @return string the HTML to be used
  */
 public static function &build_time($stamp, $variant = NULL, $language = NULL)
 {
     global $context, $local;
     // return by reference
     $output = '';
     // sanity check
     if (!isset($stamp) || !$stamp) {
         return $output;
     }
     // surfer offset
     $surfer_offset = Surfer::get_gmt_offset();
     // YYMMDD-HH:MM:SS GMT -- this one is natively GMT
     if (preg_match('/GMT$/', $stamp) && strlen($stamp) == 19) {
         // YYMMDD-HH:MM:SS GMT -> HH, MM, SS, MM, DD, YY
         $actual_stamp = mktime(substr($stamp, 7, 2), substr($stamp, 10, 2), substr($stamp, 13, 2), substr($stamp, 2, 2), substr($stamp, 4, 2), substr($stamp, 0, 2));
         // adjust to surfer time zone
         $actual_stamp += $surfer_offset * 3600;
         // time()-like stamp
     } elseif (intval($stamp) > 1000000000) {
         // adjust to surfer time zone
         $actual_stamp = intval($stamp) + $surfer_offset * 3600;
         // YYYY-MM-DD HH:MM:SS, or a string that can be readed
     } elseif (($actual_stamp = strtotime($stamp)) != -1) {
         // adjust to surfer time zone
         $actual_stamp += $surfer_offset * 3600;
     } else {
         $output = '*' . $stamp . '*';
         return $output;
     }
     if (!($items = @getdate($actual_stamp))) {
         $output = '*' . $stamp . '*';
         return $output;
     }
     // if undefined language, use surfer language
     if (!$language) {
         $language = $context['language'];
     }
     // format the time
     $local['label_en'] = date('h:i a', $actual_stamp);
     $local['label_fr'] = date('H:i', $actual_stamp);
     $output = i18n::user('label');
     return $output;
 }
开发者ID:rair,项目名称:yacs,代码行数:55,代码来源:skin_skeleton.php

示例4: get_local

 function get_local($label, $language = NULL)
 {
     return i18n::user($label, $language);
 }
开发者ID:rair,项目名称:yacs,代码行数:4,代码来源:i18n.php


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