本文整理汇总了PHP中l10n函数的典型用法代码示例。如果您正苦于以下问题:PHP l10n函数的具体用法?PHP l10n怎么用?PHP l10n使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了l10n函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: oauth_init
/**
* plugin initialization
*/
function oauth_init()
{
global $conf, $page, $hybridauth_conf, $template;
load_language('plugin.lang', OAUTH_PATH);
$conf['oauth'] = safe_unserialize($conf['oauth']);
// check config
if (defined('IN_ADMIN')) {
if (empty($hybridauth_conf) and strpos(@$_GET['page'], 'plugin-oAuth') === false) {
$page['warnings'][] = '<a href="' . OAUTH_ADMIN . '">' . l10n('Social Connect: You need to configure the credentials') . '</a>';
}
if (!function_exists('curl_init')) {
$page['warnings'][] = l10n('Social Connect: PHP Curl extension is needed');
}
}
// in case of registration aborded
if (script_basename() == 'index' and ($oauth_id = pwg_get_session_var('oauth_new_user')) !== null) {
pwg_unset_session_var('oauth_new_user');
if ($oauth_id[0] == 'Persona') {
oauth_assign_template_vars(get_gallery_home_url());
$template->block_footer_script(null, 'navigator.id.logout();');
} else {
require_once OAUTH_PATH . 'include/hybridauth/Hybrid/Auth.php';
try {
$hybridauth = new Hybrid_Auth($hybridauth_conf);
$adapter = $hybridauth->getAdapter($oauth_id[0]);
$adapter->logout();
} catch (Exception $e) {
}
}
}
}
示例2: osm_loc_end_element_set_global
function osm_loc_end_element_set_global()
{
global $template, $conf;
$batch_global_height = isset($conf['osm_conf']['batch']['global_height']) ? $conf['osm_conf']['batch']['global_height'] : '200';
$template->append('element_set_global_plugins_actions', array('ID' => 'openstreetmap', 'NAME' => l10n('OSM GeoTag'), 'CONTENT' => '
<label>' . l10n('Latitude') . ' (-90=S to 90=N)
<input type="text" size="8" name="osmlat">
</label>
<label>' . l10n('Longitude') . ' (-180=W to 180=E)
<input type="text" size="9" name="osmlon">
</label> (Empty values will erase coordinates)
<style type="text/css"> .map1 { height: ' . $batch_global_height . 'px !important; width:100% !important; margin: 5px; } </style>
<script src="plugins/piwigo-openstreetmap/leaflet/qleaflet.jquery.js"></script>
<div class="osm-map1 map1"></div>
<script>
$(document).ready(function() {
$("#permitAction").on("change", function (e) {
var optionSelected = $("option:selected", this);
if ("openstreetmap" == optionSelected.val()) {
$(".osm-map1").qleaflet();
}
});
});
</script>
'));
}
示例3: multimedia_publish_attachments_register
function multimedia_publish_attachments_register(&$attachment_types)
{
l10n_load('plugins/multimedia/l10n');
$attachment_types[] = array('caption' => l10n('mm.attach.pic'), 'editor' => 'multimedia/picture.php');
$attachment_types[] = array('caption' => l10n('mm.attach.link'), 'editor' => 'multimedia/link.php');
$attachment_types[] = array('caption' => l10n('mm.attach.text'), 'editor' => 'multimedia/text.php');
}
示例4: on_index_thumbnails
static function on_index_thumbnails($thumbs)
{
global $page, $template;
$total = count($page['items']);
if (count($thumbs) >= $total) {
add_event_handler('loc_end_index', array('RVTS', 'on_end_index'));
return $thumbs;
}
$url_model = str_replace('123456789', '%start%', duplicate_index_url(array('start' => 123456789)));
$ajax_url_model = add_url_params($url_model, array('rvts' => '%per%'));
$url_model = str_replace('&', '&', $url_model);
$ajax_url_model = str_replace('&', '&', $ajax_url_model);
$my_base_name = basename(dirname(__FILE__));
$ajax_loader_image = get_root_url() . "plugins/{$my_base_name}/ajax-loader.gif";
$template->func_combine_script(array('id' => 'jquery', 'load' => 'footer', 'path' => 'themes/default/js/jquery.min.js'));
$template->func_combine_script(array('id' => $my_base_name, 'load' => 'async', 'path' => 'plugins/' . $my_base_name . '/rv_tscroller.min.js', 'require' => 'jquery', 'version' => RVTS_VERSION));
$start = (int) $page['start'];
$per_page = $page['nb_image_page'];
$moreMsg = 'See the remaining %d photos';
if ('en' != $GLOBALS['lang_info']['code']) {
load_language('lang', dirname(__FILE__) . '/');
$moreMsg = l10n($moreMsg);
}
// the String.fromCharCode comes from google bot which somehow manage to get these urls
$template->block_footer_script(null, "var RVTS = {\najaxUrlModel: String.fromCharCode(" . ord($ajax_url_model[0]) . ")+'" . substr($ajax_url_model, 1) . "',\nstart: {$start},\nperPage: {$per_page},\nnext: " . ($start + $per_page) . ",\ntotal: {$total},\nurlModel: String.fromCharCode(" . ord($url_model[0]) . ")+'" . substr($url_model, 1) . "',\nmoreMsg: '{$moreMsg}',\nprevMsg: '" . l10n("Previous") . "',\najaxLoaderImage: '{$ajax_loader_image}'\n};\njQuery('.navigationBar').hide();");
return $thumbs;
}
示例5: setPluginWarnings
private function setPluginWarnings()
{
global $pwg_loaded_plugins, $page;
if (isset($pwg_loaded_plugins['language_switch'])) {
$page['errors'][] = l10n('Language Switch plugin is enabled but is not compatible with the Bootstrap Default theme. Please disable it and download the <a href="http://piwigo.org/ext/extension_view.php?eid=797" target="_new">Bootstrap Default Language Switch</a> instead.');
}
}
示例6: friends_list_rowcallback
function friends_list_rowcallback($ds)
{
$rowid = 'row_'.$ds['_key'];
?><div id="<?= $rowid ?>">
<input type="button" value="<?= l10n('remove') ?>" onclick="friend_remove('<?= $rowid ?>', <?= $ds['_key'] ?>);"/>
<span id="<?= $rowid ?>_status"></span>
</div><?
}
示例7: cdnplus_admin_menu
function cdnplus_admin_menu($menu)
{
global $page, $conf;
if (!empty($conf['cdnplus_conf']['cdn_enabled']) && empty($conf['cdnplus_conf']['cdn_1']['host']) and in_array($page['page'], array('intro', 'plugins_list'))) {
$page['errors'][] = l10n('You need to set your CDN host');
}
$admin_url = get_admin_plugin_menu_link(dirname(__FILE__) . '/admin.php');
array_push($menu, array('NAME' => 'CDNPlus', 'URL' => get_admin_plugin_menu_link(dirname(__FILE__)) . '/admin.php'));
return $menu;
}
示例8: index
function index()
{
$this->form = new CQForm('settings');
$this->form->ds =& $this->user->settings;
$this->form->add('html', l10n('email.notify'))->add('checkbox', 'email_friendrequest')->add('checkbox', 'email_wallpost')->add('checkbox', 'email_comment')->add('checkbox', 'email_response')->add('checkbox', 'email_message')->add('html', '<br/>')->add('submit', 'save');
if ($this->form->submitted) {
$this->form->getData();
#$this->user->ds['u_email'] = getDefault($this->user->ds['u_email'], $this->form->ds['email']);
$this->user->save();
}
}
示例9: content_55bbb4a38f51d5_13758895
function content_55bbb4a38f51d5_13758895($_smarty_tpl)
{
if (empty($_smarty_tpl->tpl_vars['load_mode']->value)) {
$_smarty_tpl->tpl_vars['load_mode'] = new Smarty_variable('footer', null, 0);
}
echo $_smarty_tpl->getSubTemplate('include/colorbox.inc.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array('load_mode' => $_smarty_tpl->tpl_vars['load_mode']->value), 0);
?>
<?php
echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['combine_script'][0][0]->func_combine_script(array('id' => 'jquery.selectize', 'load' => 'footer', 'path' => 'themes/default/js/plugins/selectize.min.js'), $_smarty_tpl);
?>
<?php
echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['combine_css'][0][0]->func_combine_css(array('id' => 'jquery.selectize', 'path' => "themes/default/js/plugins/selectize." . (string) $_smarty_tpl->tpl_vars['themeconf']->value['colorscheme'] . ".css"), $_smarty_tpl);
?>
<?php
echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['combine_script'][0][0]->func_combine_script(array('id' => 'addAlbum', 'load' => $_smarty_tpl->tpl_vars['load_mode']->value, 'path' => 'admin/themes/default/js/addAlbum.js'), $_smarty_tpl);
?>
<div style="display:none">
<div id="addAlbumForm">
<form>
<?php
echo l10n('Parent album');
?>
<br>
<select name="category_parent"></select>
<br><br>
<?php
echo l10n('Album name');
?>
<br>
<input name="category_name" type="text" maxlength="255">
<span id="categoryNameError" style="color:red;"><?php
echo l10n('The name of an album must not be empty');
?>
</span>
<br><br><br>
<input type="submit" value="<?php
echo l10n('Create');
?>
">
<span id="albumCreationLoading" style="display:none"><img src="themes/default/images/ajax-loader-small.gif"></span>
</form>
</div>
</div>
<?php
}
开发者ID:abhinay100,项目名称:piwigo_app,代码行数:54,代码来源:p6jhns_1rf28ly^b19c913f95548d36adef1d980c1ad76b8772c4a0.file.add_album.inc.tpl.php
示例10: getMenuLinks
static function getMenuLinks()
{
$items = array();
$items[] = array('icon' => 'building-o', 'title' => l10n('devices.index'), 'url' => actionUrl('index', 'devices'));
$items[] = array('icon' => 'hand-o-down', 'title' => l10n('events.manual'), 'url' => actionUrl('manual', 'events'));
$items[] = array('icon' => 'heartbeat', 'title' => l10n('radiator.minion'), 'url' => actionUrl('index', 'radiator'));
if (cfg('cameras')) {
$items[] = array('icon' => 'video-camera', 'title' => l10n('cam.index'), 'url' => actionUrl('index', 'cam'));
}
return $items;
}
示例11: gb_section_init
function gb_section_init()
{
global $tokens, $page, $conf;
if ($tokens[0] == 'guestbook') {
$page['section'] = 'guestbook';
$page['body_id'] = 'theGuestBook';
$page['is_external'] = true;
$page['is_homepage'] = false;
$page['title'] = l10n('GuestBook');
$page['section_title'] = '<a href="' . get_gallery_home_url() . '">' . l10n('Home') . '</a>' . $conf['level_separator'] . l10n('GuestBook');
}
}
示例12: vjs_loc_end_element_set_global
function vjs_loc_end_element_set_global()
{
global $template;
$template->append('element_set_global_plugins_actions', array('ID' => 'videojs', 'NAME' => l10n('Videos'), 'CONTENT' => '
<legend>Synchronize metadata</legend>
<ul>
<li>
<label><input type="checkbox" name="vjs_metadata" value="1" checked="checked" /> filesize, width, height, latitude, longitude, date_creation, rotation</label>
<br/><small>Will overwrite the information in the database with the metadata from the video.</small>
<br/><small><strong>Require <a href="https://github.com/xbgmsharp/piwigo-videojs/wiki/How-to-add-videos#external-tools" target="_blank">\'MediaInfo\'</a> to be install.</strong></small>
</li>
</ul>
<legend>Poster</legend>
<ul>
<li>
<label><input type="checkbox" name="vjs_poster" value="1" checked="checked" /> Create a poster at position in second:</label>
<!-- <input type="range" name="vjs_postersec" value="4" min="0" max="60" step="1"/> -->
<input type="text" name="vjs_postersec" value="4" size="2" required/>
<br/><small>Create a poster from the video at specify position.</small>
<br/><small><strong>Require <a href="https://github.com/xbgmsharp/piwigo-videojs/wiki/How-to-add-videos#external-tools" target="_blank">\'FFmpeg\'</a> to be install.</strong></small>
</li>
<li>
<label><input type="checkbox" name="vjs_posteroverwrite" value="1" checked="checked"> Overwrite existing posters</label>
<br/><small>Overwrite existing thumbnails with new ones. If uncheck it should only run for newly added video.</small>
</li>
<li>
<label><span class="property">Output format : </span></label>
<label><input type="radio" name="vjs_output" value="jpg" checked="checked"/> JPG</label>
<label><input type="radio" name="vjs_output" value="png" /> PNG</label>
<br/><small>Select the output format for the poster and thumbnail.</small>
</li>
<li>
<label><input type="checkbox" name="vjs_posteroverlay" value="1" /> Add film effect</label>
<br/><small>Apply an overlay on the poster creation.</small>
</li>
</ul>
<legend>Thumbnail</legend>
<ul>
<li>
<label><input type="checkbox" name="vjs_thumb" value="1" /> Create a thumbnail at every seconds:</label>
<!-- <input type="range" name="vjs_thumbsec" value="5" min="0" max="60" step="1"/> -->
<input type="text" name="vjs_thumbsec" value="5" size="2" required/>
<br/><small>Create a thumbnail every x seconds. <strong>Use by the videoJS plugin thumbnail</strong>.</small>
</li>
<li>
<label>Size of the thumbnail:</label>
<input type="text" name="vjs_thumbsize" value="120x68" size="5" placeholder="120x68" required/>
<br/><small>Size in pixel, keep it small, default is fine, Youtube use 190x68.</small>
</li>
</ul>
'));
}
示例13: friends_rcv_rowcallback
function friends_rcv_rowcallback($ds)
{
$rowid = 'row_'.$ds['_key'];
?><div id="<?= $rowid ?>">
<input type="button" value="<?= l10n('ignore') ?>" onclick="friend_ignore('<?= $rowid ?>', <?= $ds['_key'] ?>);"/>
<input type="button" value="<?= l10n('accept') ?>" onclick="friend_accept('<?= $rowid ?>', <?= $ds['_key'] ?>);"/>
<span class="smalltext">into</span>
<select id="group_select_<?= $rowid ?>">
<?= implode('', $GLOBALS['group.options']) ?>
</select>
<span id="<?= $rowid ?>_status"></span>
</div><?
}
示例14: CM_CheckComment
/**
* Check comment rules set in plugin before accepting it
*
* @param : comment action, comment
*
* @return : comment action
*
*/
function CM_CheckComment($comment_action, $comm)
{
global $page, $conf, $user, $template;
load_language('plugin.lang', CM_PATH);
$conf_CM = unserialize($conf['CommentsManager']);
if ($conf['comments_forall']) {
// Does not allow empty author name on comments for all
if (isset($conf_CM['CM_No_Comment_Anonymous']) and $conf_CM['CM_No_Comment_Anonymous'] == 'true' and $comm['author'] == 'guest') {
$comment_action = 'reject';
array_push($page['errors'], l10n('CM_Not_Allowed_Author'));
}
if (isset($conf_CM['CM_GROUPVALID2']) and $conf_CM['CM_GROUPVALID2'] == 'true' and !is_a_guest() and $conf['comments_validation']) {
if (CM_CheckValidGroup($comm['author']) or is_admin()) {
$comment_action = 'validate';
// Comment is validated if author is not in the validated group
} else {
$comment_action = 'moderate';
// Comment needs moderation if author is not in the validated group
}
}
}
// Rules on comments NOT for all
if (!$conf['comments_forall'] and !is_admin()) {
if (isset($conf_CM['CM_GROUPCOMM']) and $conf_CM['CM_GROUPCOMM'] == 'true' and (isset($conf_CM['CM_GROUPVALID1']) and $conf_CM['CM_GROUPVALID1'] == 'false') and !CM_CheckAuthor($comm['author'])) {
$comment_action = 'reject';
// Comment rejected if author is not in the allowed group
array_push($page['errors'], l10n('CM_Not_Allowed_Author'));
} elseif (isset($conf_CM['CM_GROUPCOMM']) and $conf_CM['CM_GROUPCOMM'] == 'false' and (isset($conf_CM['CM_GROUPVALID1']) and $conf_CM['CM_GROUPVALID1'] == 'true') and $conf['comments_validation']) {
if (CM_CheckValidGroup($comm['author']) and $conf['comments_validation']) {
$comment_action = 'validate';
// Comment is validated if author is not in the validated group
} else {
$comment_action = 'moderate';
// Comment needs moderation if author is not in the validated group
}
} elseif (isset($conf_CM['CM_GROUPCOMM']) and $conf_CM['CM_GROUPCOMM'] == 'true' and (isset($conf_CM['CM_GROUPVALID1']) and $conf_CM['CM_GROUPVALID1'] == 'true') and $conf['comments_validation']) {
if (!CM_CheckAuthor($comm['author'])) {
$comment_action = 'reject';
// Comment rejected if author is not in the allowed group
array_push($page['errors'], l10n('CM_Not_Allowed_Author'));
} elseif (CM_CheckValidGroup($comm['author']) and $conf['comments_validation']) {
$comment_action = 'validate';
// Comment is validated if author is not in the validated group
} else {
$comment_action = 'moderate';
}
// Comment needs moderation if author is not in the validated group
}
}
return $comment_action;
}
示例15: osm_render_category
function osm_render_category()
{
global $template, $page, $conf, $filter;
include_once dirname(__FILE__) . '/include/functions.php';
include_once dirname(__FILE__) . '/include/functions_map.php';
osm_load_language();
load_language('plugin.lang', OSM_PATH);
// TF, 20160102: pass config as parameter
$js_data = osm_get_items($conf, $page);
if ($js_data != array()) {
$local_conf = array();
$local_conf['contextmenu'] = 'false';
$local_conf['control'] = true;
$local_conf['img_popup'] = false;
$local_conf['popup'] = 1;
$local_conf['center_lat'] = 0;
$local_conf['center_lng'] = 0;
$local_conf['zoom'] = 2;
$local_conf['auto_center'] = 1;
// TF, 20160102: pass config as parameter
$local_conf['paths'] = osm_get_gps($conf, $page);
$height = isset($conf['osm_conf']['category_description']['height']) ? $conf['osm_conf']['category_description']['height'] : '200';
$width = isset($conf['osm_conf']['category_description']['width']) ? $conf['osm_conf']['category_description']['width'] : 'auto';
$js = osm_get_js($conf, $local_conf, $js_data);
$template->set_filename('map', dirname(__FILE__) . '/template/osm-category.tpl');
$template->assign(array('CONTENT_ENCODING' => get_pwg_charset(), 'OSM_PATH' => embellish_url(get_gallery_home_url() . OSM_PATH), 'HOME' => make_index_url(), 'HOME_PREV' => isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : get_absolute_root_url(), 'HOME_NAME' => l10n("Home"), 'HOME_PREV_NAME' => l10n("Previous"), 'OSMJS' => $js, 'HEIGHT' => $height, 'WIDTH' => $width));
$osm_content = $template->parse('map', true);
//$osm_content = '<div id="osmmap"><div class="map_title">'.l10n('EDIT_MAP').'</div>' . $osm_content . '</div>';
$index = isset($conf['osm_conf']['category_description']['index']) ? $conf['osm_conf']['category_description']['index'] : 0;
// 0 - PLUGIN_INDEX_CONTENT_BEGIN
// 1 - PLUGIN_INDEX_CONTENT_COMMENT
// 2 - PLUGIN_INDEX_CONTENT_END
if ($index <= 1) {
// From index category comment at L300
if ($page['start'] == 0 and !isset($page['chronology_field'])) {
if (empty($page['comment'])) {
$page['comment'] = $osm_content;
} else {
if ($index == 0) {
$page['comment'] = '<div>' . $osm_content . $page['comment'] . '</div>';
} else {
$page['comment'] = '<div>' . $page['comment'] . $osm_content . '</div>';
}
}
}
} else {
$osm_content = '<div id="osmmap">' . $osm_content . '</div>';
$template->concat('PLUGIN_INDEX_CONTENT_END', "\n" . $osm_content);
}
}
}