本文整理汇总了PHP中JSite::getMenu方法的典型用法代码示例。如果您正苦于以下问题:PHP JSite::getMenu方法的具体用法?PHP JSite::getMenu怎么用?PHP JSite::getMenu使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSite
的用法示例。
在下文中一共展示了JSite::getMenu方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($tpl = null)
{
global $mainframe;
// Check if registration is allowed
$usersConfig =& JComponentHelper::getParams('com_users');
if (!$usersConfig->get('allowUserRegistration')) {
JError::raiseError(403, JText::_('Access Forbidden'));
return;
}
$pathway =& $mainframe->getPathway();
$document =& JFactory::getDocument();
$params =& $mainframe->getParams();
// Page Title
$menus =& JSite::getMenu();
$menu = $menus->getActive();
// because the application sets a default page title, we need to get it
// right from the menu item itself
if (is_object($menu)) {
$menu_params = new JParameter($menu->params);
if (!$menu_params->get('page_title')) {
$params->set('page_title', JText::_('Registration'));
}
} else {
$params->set('page_title', JText::_('Registration'));
}
$document->setTitle($params->get('page_title'));
$pathway->addItem(JText::_('New'));
// Load the form validation behavior
JHTML::_('behavior.formvalidation');
$user =& JFactory::getUser();
$this->assignRef('user', $user);
$this->assignRef('params', $params);
parent::display($tpl);
}
示例2: getItemid
public function getItemid()
{
$Itemid = 0;
if (!$this->embedded) {
$active = $this->app->getMenu()->getActive();
$Itemid = $active ? (int) $active->id : 0;
}
return $Itemid;
}
示例3: display
function display($tpl = null)
{
global $mainframe;
$user =& JFactory::getUser();
$pathway =& $mainframe->getPathway();
$document =& JFactory::getDocument();
$model =& $this->getModel();
// GET THE PARAMETERS OF THE ACTIVE MENU ITEM
$menus =& JSite::getMenu();
$menu = $menus->getActive();
$pparams =& $mainframe->getParams('com_flippingbook');
$bookId = intval(JRequest::getVar('id', 0, 'get', 'int'));
$options['id'] = $bookId;
$book = $model->getBook($options);
$total_pages = $model->countPages($options);
$document->setTitle($book->title);
//SET BREADCRUMBS
if (isset($menu) && isset($menu->query['view']) && $menu->query['view'] == 'book') {
$pathway->addItem($book->title, '');
}
//$book->params = new JParameter($book->params);
$this->assignRef('book', $book);
$this->assignRef('params', $pparams);
$this->assignRef('total_pages', $total_pages);
echo $this->showBook($bookId, 'component');
}
示例4: display
/**
* Display function
*
* @since 1.5
*/
function display($tpl = null)
{
jimport('joomla.html.html');
$mainframe =& JFactory::getApplication();
// Get the page/component configuration
$params =& $mainframe->getParams();
$menus =& JSite::getMenu();
$menu = $menus->getActive();
// because the application sets a default page title, we need to get it
// right from the menu item itself
if (is_object($menu)) {
$menu_params = new JParameter($menu->params);
if (!$menu_params->get('page_title')) {
$params->set('page_title', JText::_('FORGOT_YOUR_USERNAME'));
}
} else {
$params->set('page_title', JText::_('FORGOT_YOUR_USERNAME'));
}
$document =& JFactory::getDocument();
$document->setTitle($params->get('page_title'));
// Load the form validation behavior
JHTML::_('behavior.formvalidation');
// Add the tooltip behavior
JHTML::_('behavior.tooltip');
$this->assignRef('params', $params);
parent::display($tpl);
}
示例5: display
function display($tpl = null)
{
global $mainframe, $option;
jimport('joomla.utilities.simplexml');
$showCaseID = JRequest::getInt('showcase_id', 0);
if ($showCaseID == 0) {
$menu =& JSite::getMenu();
$item = $menu->getActive();
$params =& $menu->getParams($item->id);
$showcase_id = $params->get('showcase_id', 0);
} else {
$showcase_id = $showCaseID;
}
$objUtils = JSNISFactory::getObj('classes.jsn_is_utils');
$URL = $objUtils->overrideURL();
$objJSNShowcase = JSNISFactory::getObj('classes.jsn_is_showcase');
$row = $objJSNShowcase->getShowCaseByID($showcase_id);
if (count($row) <= 0) {
header("HTTP/1.0 404 Not Found");
exit;
}
$objJSNJSON = JSNISFactory::getObj('classes.jsn_is_json');
$dataObj = $objJSNShowcase->getShowcase2JSON($row, $URL);
echo $objJSNJSON->encode($dataObj);
jexit();
}
示例6: _findItem
function _findItem($needles)
{
static $items;
if (!$items) {
$component =& JComponentHelper::getComponent('com_weblinks');
$menu =& JSite::getMenu();
$items = $menu->getItems('componentid', $component->id);
}
if (!is_array($items)) {
return null;
}
$match = null;
foreach ($needles as $needle => $id) {
foreach ($items as $item) {
if (@$item->query['view'] == $needle && @$item->query['id'] == $id) {
$match = $item->id;
break;
}
}
if (isset($match)) {
break;
}
}
return $match;
}
示例7: getParameters
public function getParameters()
{
$menu = JSite::getMenu();
$active = $menu->getActive();
$parameters = $active ? $menu->getParams($active->id) : $parameters = $menu->getParams(null);
$parameters->def('show_page_title', 1);
if(!$parameters->get('page_title')) {
$parameters->set('page_title', JText::_('Login'));
}
if(!$active) {
$parameters->def('header_login', '');
}
$parameters->def('pageclass_sfx', '');
$parameters->def('login', 'index.php');
$parameters->def('description_login', 1);
$parameters->def('description_login_text', JText::_('LOGIN_DESCRIPTION'));
$parameters->def('image_login', 'key.jpg');
$parameters->def('image_login_align', 'right');
$parameters->def('registration', JComponentHelper::getParams('com_users')->get('allowUserRegistration'));
return $parameters;
}
示例8: display
function display()
{
global $mainframe, $option;
$document =& JFactory::getDocument();
$menus =& JSite::getMenu();
$menu = $menus->getActive();
// Get the page/component configuration
$params =& $mainframe->getParams();
//set page title
$document->setTitle($menu->name);
$url = $params->def('url', '');
$row = new stdClass();
if ($params->def('add_scheme', 1)) {
// adds 'http://' if none is set
if (substr($url, 0, 1) == '/') {
// relative url in component. use server http_host.
$row->url = 'http://' . $_SERVER['HTTP_HOST'] . $url;
} elseif (!strstr($url, 'http') && !strstr($url, 'https')) {
$row->url = 'http://' . $url;
} else {
$row->url = $url;
}
} else {
$row->url = $url;
}
require_once JPATH_COMPONENT . DS . 'views' . DS . 'wrapper' . DS . 'view.php';
$view = new WrapperViewWrapper();
$view->assignRef('params', $params);
$view->assignRef('wrapper', $row);
$view->display();
}
示例9: search
function search()
{
$post['searchword'] = JRequest::getString('searchword', null, 'post');
$post['ordering'] = JRequest::getWord('ordering', null, 'post');
$post['searchphrase'] = JRequest::getWord('searchphrase', 'all', 'post');
$post['limit'] = JRequest::getInt('limit', null, 'post');
if ($post['limit'] === null) {
unset($post['limit']);
}
$areas = JRequest::getVar('areas', null, 'post', 'array');
if ($areas) {
foreach ($areas as $area) {
$post['areas'][] = JFilterInput::clean($area, 'cmd');
}
}
// set Itemid id for links
$menu =& JSite::getMenu();
$items = $menu->getItems('link', 'index.php?option=com_search_lucene&view=search');
if (isset($items[0])) {
$post['Itemid'] = $items[0]->id;
}
unset($post['task']);
unset($post['submit']);
$uri = JURI::getInstance();
$uri->setQuery($post);
$uri->setVar('option', 'com_search_lucene');
$this->setRedirect(JRoute::_('index.php' . $uri->toString(array('query', 'fragment')), false));
}
示例10: modChrome_submenu
function modChrome_submenu($module, &$params, &$attribs)
{
if (!empty($module->content) && strlen($module->content) > 40) {
$parent_menu = JSite::getMenu()->getActive()->tree[0];
?>
<div class="<?php
echo $params->get('moduleclass_sfx');
?>
rokmodtools-<?php
echo $module->id;
?>
">
<div class="side-mod">
<div class="module-header"><div class="module-header2">
<h3 class="side">
<?php
echo JSite::getMenu()->getItem($parent_menu)->title;
?>
Menu
</h3>
</div></div>
<div class="module">
<?php
echo $module->content;
?>
</div>
</div>
</div>
<?php
}
}
示例11: DuukaParseRoute
function DuukaParseRoute($segments)
{
$vars = array();
//Get the active menu item
$menu = JSite::getMenu();
$item = $menu->getActive();
$count = count($segments);
if ($segments[$count - 2] == 'item') {
$uri = JFactory::getURI();
$uri->setPath(str_replace('/item/', '/', $uri->getPath()));
$app = JFactory::getApplication();
$app->redirect($uri->toString());
}
if ($segments[$count - 2] == 'product') {
$uri = JFactory::getURI();
$uri->setPath(str_replace('/product/', '/', $uri->getPath()));
$app = JFactory::getApplication();
$app->redirect($uri->toString());
}
//Handle View and Identifier
switch ($item->query['view']) {
case 'items':
$vars['id'] = $segments[$count - 1];
$vars['view'] = 'item';
break;
}
return $vars;
}
示例12: display
public function display($tpl = null)
{
$menu = JSite::getMenu();
$params = $menu->getParams($menu->getActive()->id);
$url = KFactory::tmp('lib.koowa.filter.url')->sanitize($params->get('url'));
KFactory::get('lib.joomla.application')->redirect($url);
}
示例13: modChrome_submenu
function modChrome_submenu($module, &$params, &$attribs)
{
global $Itemid;
$start = $params->get('startLevel');
$tabmenu =& JSite::getMenu();
$item = $tabmenu->getItem($Itemid);
while ($item->parent != 0) {
if ($item->sublevel == $start - 1) {
break;
}
$item = $tabmenu->getItem($item->parent);
}
if (!empty($module->content) && strlen($module->content) > 40) {
?>
<div class="moduletable<?php
echo $params->get('moduleclass_sfx');
?>
"><div>
<h3><?php
echo $item->name;
?>
Menu</h3>
<?php
echo $module->content;
?>
</div>
<?php
}
}
示例14: getCampaigns
public function getCampaigns()
{
$params = JComponentHelper::getParams('com_joomailermailchimpintegration');
$menuitemid = JRequest::getInt('Itemid', 0);
if ($menuitemid) {
$jSite = new JSite();
$menu = $jSite->getMenu();
$menuparams = $menu->getParams($menuitemid);
$params->merge($menuparams);
}
$filters = array('status' => 'sent');
$page = 0;
$limit = $params->get('limit', 10);
$cacheGroup = 'joomlamailerReports';
$cacheID = 'Campaigns_' . implode('_', $filters) . '_' . $page . '_' . $limit;
if (!$this->cache($cacheGroup)->get($cacheID, $cacheGroup)) {
$campaigns = $this->getMcObject()->campaigns($filters, $page, $limit);
$Jconfig = JFactory::getConfig();
$tzoffset = $Jconfig->get('offset');
if ($tzoffset != 'UTC') {
foreach ($campaigns as $index => $campaign) {
date_default_timezone_set('Europe/London');
$datetime = new DateTime($campaign['send_time']);
$timeZone = new DateTimeZone($tzoffset);
$datetime->setTimezone($timeZone);
$campaigns[$index]['send_time'] = $datetime->format('Y-m-d H:i:s');
}
}
$this->cache($cacheGroup)->store(json_encode($campaigns), $cacheID, $cacheGroup);
}
return json_decode($this->cache($cacheGroup)->get($cacheID, $cacheGroup), true);
}
示例15: __construct
function __construct()
{
parent::__construct();
global $mainframe, $option;
$component = JComponentHelper::getComponent('com_properties');
$params = new JParameter($component->params);
$this->Mostrar = $params->get('cantidad_productos');
if (!JRequest::getVar('limitstart')) {
$this->setState('limit', $this->Mostrar);
$this->setState('limitstart', 0);
} else {
$limit = $this->Mostrar;
$this->setState('limit', $this->Mostrar);
$limitstart = JRequest::getVar('limitstart');
$this->setState('limitstart', $limitstart);
$start = JRequest::getVar('start');
$this->setState('start', $start);
}
$ShowOrderByDefault = $params->get('ShowOrderByDefault');
$ShowOrderDefault = $params->get('ShowOrderDefault');
$this->filter_order = $mainframe->getUserStateFromRequest("{$option}.filter_order", 'filter_order', $ShowOrderByDefault, 'cmd');
$this->filter_order_Dir = $mainframe->getUserStateFromRequest("{$option}.filter_order_Dir", 'filter_order_Dir', $ShowOrderDefault, 'word');
$menus =& JSite::getMenu();
$menu = $menus->getActive();
$menu_params = new JParameter($menu->params);
$DetailsMarket = $menu_params->get('DetailsMarket');
$this->DetailsMarket = $DetailsMarket;
$this->pathway();
}