本文整理汇总了PHP中cmsFramework::getLocale方法的典型用法代码示例。如果您正苦于以下问题:PHP cmsFramework::getLocale方法的具体用法?PHP cmsFramework::getLocale怎么用?PHP cmsFramework::getLocale使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cmsFramework
的用法示例。
在下文中一共展示了cmsFramework::getLocale方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: socialBookmarks
function socialBookmarks($listing)
{
$googlePlusOne = $twitter = $facebook = '';
$facebook_xfbml = Sanitize::getBool($this->Config, 'facebook_opengraph') && Sanitize::getBool($this->Config, 'facebook_appid');
$href = cmsFramework::makeAbsUrl($listing['Listing']['url'], array('sef' => true));
$twitter = '
<a href="http://twitter.com/share" data-url="' . $href . '" class="twitter-share-button" data-count="horizontal">Tweet</a>
<script type="text/javascript">jQuery(document).ready(function(){jQuery.getScript("http://platform.twitter.com/widgets.js");})</script>';
if ($facebook_xfbml) {
$facebook = '<fb:like href="' . $href . '" action="like" colorscheme="light" layout="button_count" show_faces="false"></fb:like>';
} else {
$facebook = '<script src="http://connect.facebook.net/' . cmsFramework::getLocale() . '/all.js#xfbml=1"></script><fb:like layout="button_count" show_faces="false"></fb:like>';
}
if ($this->Config->facebook_send) {
$facebook .= '<div style="display:inline;margin-right: 15px;"><fb:send href="' . $href . '" colorscheme="light"></fb:send></div>';
}
$googlePlusOne = '
<g:plusone href="' . $href . '" size="medium"></g:plusone>
<script type="text/javascript" src="http://apis.google.com/js/plusone.js"></script>
';
return $googlePlusOne . $twitter . $facebook;
}
示例2: beforeFilter
//.........这里部分代码省略.........
} else {
$module_limit = 5;
}
$this->module_limit = Sanitize::getInt($this->data, 'module_limit', $module_limit);
$this->module_page = Sanitize::getInt($this->data, 'module_page', 1);
$this->module_page = $this->module_page === 0 ? 1 : $this->module_page;
$this->module_offset = (int) ($this->module_page - 1) * $this->module_limit;
if ($this->module_offset < 0) {
$this->module_offset = 0;
}
$this->page = $this->page === 0 ? 1 : $this->page;
$this->offset = (int) ($this->page - 1) * $this->limit;
if ($this->offset < 0) {
$this->offset = 0;
}
# Required further below for Community Model init
if (!isset($this->Menu)) {
App::import('Model', 'menu', 'jreviews');
$this->Menu = ClassRegistry::getClass('MenuModel');
}
if (!$this->ajaxRequest) {
if (!($menu_id = Configure::read('_public_menu_id'))) {
# Find and set one public Itemid to use for Ajax requests
$menu_id = '';
$menu_id = $this->Menu->get('jreviews_public');
$menu_id = $menu_id != '' ? $menu_id : 99999;
Configure::write('_public_menu_id', $menu_id);
}
if (!($search_itemid = Configure::read('_search_itemid'))) {
// Set search menu Itemid used in several of the controllers
$option = Sanitize::getString($this->params, 'option');
$auto_itemid = Sanitize::getBool($this->Config, 'search_itemid', false);
$hc_itemid = Sanitize::getInt($this->Config, 'search_itemid_hc', '');
$search_menuid = $this->Menu->get('jr_advsearch');
$search_itemid = '';
switch ($option) {
case 'com_jreviews':
// page Itemid is enabled
if (!$auto_itemid && $hc_itemid > 0) {
$search_itemid = $hc_itemid;
} elseif (!$auto_itemid & $search_menuid > 0) {
$search_itemid = $search_menuid;
}
break;
default:
// Non-JReviews pages - can't use current page Itemid
if ($hc_itemid > 0) {
$search_itemid = $hc_itemid;
} else {
$search_itemid = $search_menuid;
}
break;
}
$search_itemid == '' and $option == 'com_jreviews' and $search_itemid = Sanitize::getString($this->params, 'Itemid');
Configure::write('_search_itemid', $search_itemid);
}
$this->set(array('search_itemid' => $search_itemid, 'public_menu_id' => $menu_id));
}
if (!defined('MVC_GLOBAL_JS_VARS') && !$this->ajaxRequest && $this->action != '_save') {
# Add global javascript variables
$this->assets['head-top'][] = '<script type="text/javascript">
/* <![CDATA[ */
var s2AjaxUri = "' . getAjaxUri() . '",
jrLanguage = new Array(),
jrVars = new Array(),
datePickerImage = "' . $this->viewImages . 'calendar.gif",
jrPublicMenu = ' . $menu_id . ';
jrLanguage["cancel"] = "' . __t("Cancel", true) . '";
jrLanguage["submit"] = "' . __t("Submit", true) . '";
jrLanguage["clearDate"] = "' . __t("Clear", true) . '";
jrLanguage["field.select"] = "' . __t("-- Select --", true) . '";
jrLanguage["field.select_field"] = "' . __t("-- Select %s --", true) . '";
jrLanguage["field.no_results"] = "' . __t("No results found, try a different spelling.", true) . '";
jrLanguage["field.ui_help"] = "' . __t("Start typing for suggestions", true) . '";
jrLanguage["field.ui_add"] = "' . __t("Add", true) . '";
jrLanguage["compare.heading"] = "' . __t("Compare", true) . '";
jrLanguage["compare.compare_all"] = "' . __t("Compare All", true) . '";
jrLanguage["compare.remove_all"] = "' . __t("Remove All", true) . '";
jrLanguage["compare.select_more"] = "' . __t("You need to select more than one listing for comparison.", true) . '";
jrLanguage["compare.select_max"] = "' . __t("You selected maximum number of listings for comparison.", true) . '";
jrVars["locale"] = "' . cmsFramework::getLocale() . '";
/* ]]> */
</script>';
if ($item_id = Sanitize::getInt($this->params, 'Itemid')) {
$menu = $this->Menu->getMenuParams($item_id);
$meta_desc = Sanitize::getString($menu, 'menu-meta_description');
$meta_keys = Sanitize::getString($menu, 'menu-meta_keywords');
$meta_desc != '' and cmsFramework::meta('description', $meta_desc);
$meta_keys != '' and cmsFramework::meta('keywords', $meta_keys);
}
define('MVC_GLOBAL_JS_VARS', 1);
}
# Dynamic Community integration loading
$community_extension = Configure::read('Community.extension');
$community_extension = $community_extension != '' ? $community_extension : 'community_builder';
App::import('Model', $community_extension, 'jreviews');
$this->Community = new CommunityModel();
# Init plugin system
$this->_initPlugins();
}
示例3: beforeFilter
function beforeFilter()
{
# These should be called in each controller where they are required instead of globally
$this->_db = cmsFramework::getDB();
$this->_user = cmsFramework::getUser();
# Init Access
if (isset($this->Access)) {
$this->Access->init($this->Config);
}
App::import('Component', 'theming', 'jreviews');
$this->Theming = ClassRegistry::getClass('ThemingComponent');
$this->Theming->startup($this);
# Set pagination vars
// First check url, then menu parameter. Otherwise the limit list in pagination doesn't respond b/c menu params always wins
$this->limit = Sanitize::getInt($this->params, 'limit', Sanitize::getInt($this->data, 'limit_special', Sanitize::getInt($this->data, 'limit')));
// $this->passedArgs['limit'] = $this->limit;
$this->page = Sanitize::getInt($this->data, 'page', Sanitize::getInt($this->params, 'page', 1));
if (!$this->limit) {
if (Sanitize::getVar($this->params, 'action') == 'myreviews') {
$this->limit = Sanitize::getInt($this->params, 'limit', $this->Config->user_limit);
} else {
$this->limit = Sanitize::getInt($this->params, 'limit', $this->Config->list_limit);
}
}
// Set a hard code limit to prevent abuse
$this->limit = max(min($this->limit, 50), 1);
// Need to normalize the limit var for modules
if (isset($this->params['module'])) {
$module_limit = Sanitize::getInt($this->params['module'], 'module_limit', 5);
} else {
$module_limit = 5;
}
$this->module_limit = Sanitize::getInt($this->data, 'module_limit', $module_limit);
$this->module_page = Sanitize::getInt($this->data, 'module_page', 1);
$this->module_page = $this->module_page === 0 ? 1 : $this->module_page;
$this->module_offset = (int) ($this->module_page - 1) * $this->module_limit;
if ($this->module_offset < 0) {
$this->module_offset = 0;
}
$this->page = $this->page === 0 ? 1 : $this->page;
$this->offset = (int) ($this->page - 1) * $this->limit;
if ($this->offset < 0) {
$this->offset = 0;
}
# Required further below for Community Model init
if (!isset($this->Menu)) {
App::import('Model', 'menu', 'jreviews');
$this->Menu = ClassRegistry::getClass('MenuModel');
}
if (!defined('MVC_GLOBAL_JS_VARS') && !$this->ajaxRequest && $this->action != '_save') {
# Find and set one public Itemid to use for Ajax requests
$menu_id = '';
$menu_id = $this->Menu->get('jreviews_public');
$menu_id = $menu_id != '' ? $menu_id : 99999;
$this->set('public_menu_id', $menu_id);
# Add global javascript variables
$this->assets['head-top'][] = '<script type="text/javascript">
/* <![CDATA[ */
var s2AjaxUri = "' . getAjaxUri() . '",
jrLanguage = new Array(),
jrVars = new Array(),
datePickerImage = "' . $this->viewImages . 'calendar.gif",
jrPublicMenu = ' . $menu_id . ';
jrLanguage["cancel"] = "' . __t("Cancel", true) . '";
jrLanguage["submit"] = "' . __t("Submit", true) . '";
jrLanguage["field.select"] = "' . __t("-- Select --", true) . '";
jrLanguage["field.select_field"] = "' . __t("-- Select %s --", true) . '";
jrLanguage["field.no_results"] = "' . __t("No results found, try a different spelling.", true) . '";
jrLanguage["field.ui_help"] = "' . __t("Start typing for suggestions", true) . '";
jrLanguage["field.ui_add"] = "' . __t("Add", true) . '";
jrLanguage["compare.heading"] = "' . __t("Compare", true) . '";
jrLanguage["compare.compare_all"] = "' . __t("Compare All", true) . '";
jrLanguage["compare.remove_all"] = "' . __t("Remove All", true) . '";
jrLanguage["compare.select_more"] = "' . __t("You need to select more than one listing for comparison.", true) . '";
jrLanguage["compare.select_max"] = "' . __t("You selected maximum number of listings for comparison.", true) . '";
jrLanguage["geomaps.no_streeview"] = "' . __t("Street view not available for this address.", true) . '";
jrLanguage["geomaps.cannot_geocode"] = "' . __t("Address could not be geocoded. Modify the address and click on the Geocode Address button to try again.", true) . '";
jrLanguage["geomaps.drag_marker"] = "' . __t("Drag the marker to fine-tune the geographic location on the map.", true) . '";
jrLanguage["geomaps.directions_bad_address"] = "' . __t("No corresponding geographic location could be found for one of the specified addresses. This may be due to the fact that the address is relatively new, or it may be incorrect.", true) . '";
jrLanguage["geomaps.directions_request_error"] = "' . __t("The was an error processing the request.", true) . '";
jrVars["locale"] = "' . cmsFramework::getLocale() . '";
/* ]]> */
</script>';
if ($item_id = Sanitize::getInt($this->params, 'Itemid')) {
$menu = $this->Menu->getMenuParams($item_id);
$meta_desc = Sanitize::getString($menu, 'menu-meta_description');
$meta_keys = Sanitize::getString($menu, 'menu-meta_keywords');
$meta_desc != '' and cmsFramework::meta('description', $meta_desc);
$meta_keys != '' and cmsFramework::meta('keywords', $meta_keys);
}
define('MVC_GLOBAL_JS_VARS', 1);
}
# Dynamic Community integration loading
$community_extension = Configure::read('Community.extension');
$community_extension = $community_extension != '' ? $community_extension : 'community_builder';
App::import('Model', $community_extension, 'jreviews');
$this->Community = new CommunityModel();
# Init plugin system
$this->_initPlugins();
}