本文整理汇总了PHP中JSite类的典型用法代码示例。如果您正苦于以下问题:PHP JSite类的具体用法?PHP JSite怎么用?PHP JSite使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了JSite类的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: __construct
function __construct()
{
$this->Log = new FLogger();
$this->DebugLog = new FDebugLogger("file uploader");
$this->Session = JFactory::getSession();
$cid = JRequest::getVar("cid", NULL, 'GET');
// Component id. We need to load parameters for it
if ($cid) {
$site = new JSite();
// @ avoids Warning: ini_set() has been disabled for security reasons in /var/www/libraries/joomla/[...]
$wholemenu = @$site->getMenu();
$this->Params = $wholemenu->getParams($cid);
// Component parameters
} else {
$db = JFactory::getDbo();
jimport("joomla.database.databasequery");
//$query = new JDatabaseQuery; // On J 1.7 Raises Fatal error: Cannot instantiate abstract class JDatabaseQuery
$query = $db->getQuery(true);
$query->select('id, title, module, params');
$query->from('#__modules');
$query->where('id = ' . intval(JRequest::getVar("mid", 0, 'GET')));
$db->setQuery($query);
$module = $db->loadObject();
if ($db->getErrorNum()) {
$this->Log->Write(JText::_("Error loading module. " . $db->getErrorMsg()));
}
$this->Params = new JRegistry();
if (is_object($module)) {
$this->Params->loadJSON($module->params);
}
}
}
示例3: display
/**
* Displays the form
*
* @param string $tpl - The templates
*
* @return mixed|void
*/
public function display($tpl = null)
{
$uuid = JFactory::getApplication()->input->get('uuid', 0);
$model = $this->getModel();
$params = JComponentHelper::getParams('com_matukio');
$menuitemid = JFactory::getApplication()->input->get('Itemid');
if ($menuitemid) {
$site = new JSite();
$menu = $site->getMenu();
$menuparams = $menu->getParams($menuitemid);
$params->merge($menuparams);
}
// Raise error
if (empty($uuid)) {
throw new Exception(JText::_("COM_MATUKIO_NO_ID"), 404);
}
$booking = $model->getBooking($uuid);
if (empty($booking)) {
throw new Exception(JText::_("COM_MATUKIO_NO_BOOKING_FOUND"), 404);
}
$model = JModelLegacy::getInstance('Event', 'MatukioModel');
$event = $model->getItem($booking->semid);
$this->booking = $booking;
$this->title = JText::_("COM_MATUKIO_BOOKING_DETAILS");
$title = JFactory::getDocument()->getTitle();
JFactory::getDocument()->setTitle($title . " - " . $this->title);
$this->event = $event;
$this->user = JFactory::getUser();
parent::display($tpl);
}
示例4: display
/**
* Displays the form
*
* @param bool $cachable - Is it cachable
* @param bool $urlparams - The url params
*
* @return JControllerLegacy|void
*/
public function display($cachable = false, $urlparams = false)
{
MatukioHelperUtilsBasic::loginUser();
$document = JFactory::getDocument();
$viewName = JFactory::getApplication()->input->get('view', 'event');
$viewType = $document->getType();
$view = $this->getView($viewName, $viewType);
$model = $this->getModel('Event', 'MatukioModel');
$view->setModel($model, true);
$tmpl = MatukioHelperSettings::getSettings("event_template", "default");
$params = JComponentHelper::getParams('com_matukio');
$menuitemid = JFactory::getApplication()->input->getInt('Itemid');
if ($menuitemid) {
$site = new JSite();
$menu = $site->getMenu();
$menuparams = $menu->getParams($menuitemid);
$params->merge($menuparams);
}
$ptmpl = $params->get('event_template', '');
if (!empty($ptmpl)) {
$tmpl = $ptmpl;
}
$view->setLayout($tmpl);
$view->display();
}
示例5: 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);
}
示例6: __construct
function __construct()
{
parent::__construct();
$JSite = new JSite();
$menu = $JSite->getMenu();
// pass the link for which you want the ItemId.
$items = $menu->getItems('link', 'index.php?option=com_socialads&view=socialads');
if (isset($items[0])) {
$Itemid = $items[0]->id;
}
}
示例7: display
function display($tpl = null)
{
$this->mainframe = JFactory::getApplication();
$this->option = JRequest::getCmd('option');
$filter_order = $this->mainframe->getUserStateFromRequest($this->option . '.polls.filter_order', 'filter_order', 'm.title', 'string');
$filter_order_Dir = $this->mainframe->getUserStateFromRequest($this->option . '.polls.filter_order_Dir', 'filter_order_Dir', '', 'word');
$search = $this->mainframe->getUserStateFromRequest($this->option . '.polls.search', 'search', '', 'string');
// table ordering
$lists['order_Dir'] = $filter_order_Dir;
$lists['order'] = $filter_order;
// search filter
$lists['search'] = $search;
JHTML::_('behavior.tooltip');
if (MijopollsHelper::is15()) {
$params = $this->mainframe->getParams();
} else {
$menu = JSite::getMenu()->getActive();
$menu_params = new JRegistry($menu->params);
$params = clone $this->mainframe->getParams();
$params->merge($menu_params);
}
$this->lists = $lists;
$this->params = $params;
$this->items = $this->get('Data');
$this->pagination = $this->get('Pagination');
if (MijopollsHelper::is30()) {
$tpl = '30';
}
parent::display($tpl);
}
示例8: 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;
}
示例9: _displayForm
function _displayForm($tpl = null)
{
global $mainframe;
// Load the form validation behavior
JHTML::_('behavior.formvalidation');
$user =& JFactory::getUser();
$params =& $mainframe->getParams();
// check to see if Frontend User Params have been enabled
$usersConfig =& JComponentHelper::getParams('com_users');
$check = $usersConfig->get('frontend_userparams');
if ($check == '1' || $check == 1 || $check == NULL) {
if ($user->authorize('com_user', 'edit')) {
$params = $user->getParameters(true);
}
}
$params->merge($params);
$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::_('Edit Your Details'));
}
} else {
$params->set('page_title', JText::_('Edit Your Details'));
}
$document =& JFactory::getDocument();
$document->setTitle($params->get('page_title'));
$this->assignRef('user', $user);
$this->assignRef('params', $params);
parent::display($tpl);
}
示例10: 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();
}
示例11: modChrome_submenu
function modChrome_submenu($module, &$params, &$attribs)
{
global $Itemid;
$start = $params->get('startLevel');
$tabmenu =& JSite::getMenu();
$item = $tabmenu->getItem($Itemid);
if (isset($item)) {
$tparent = $tabmenu->getItem($item->parent);
$menuname = "";
while ($tparent != null) {
$item = $tabmenu->getItem($item->parent);
if ($tparent->parent == $start - 1) {
break;
}
$tparent = $tabmenu->getItem($item->parent);
}
if (!empty($module->content) && strlen($module->content) > 40) {
?>
<div class="side-mod">
<div class="moduletable">
<h3 class="module-title"><?php
echo $item->name;
?>
Menu</h3>
<?php
echo $module->content;
?>
</div>
</div>
<?php
}
}
}
示例12: prepareMenuItem
function prepareMenuItem(&$node,&$params) {
$link_query = parse_url( $node->link );
parse_str( html_entity_decode($link_query['query']), $link_vars);
$id = intval(xmap_com_eventlist::getParam($link_vars,'id',0));
$view = xmap_com_eventlist::getParam($link_vars,'view',0);
if ( !$id ) {
$menu =& JSite::getMenu();
$params = $menu->getParams($node->id);
$id = $params->get('id',0);
}
if ( $id ) {
if ( $view == 'details' ) {
$node->uid = 'com_eventliste'.$id;
$node->expandible = false;
} elseif ( $view == 'categoryevents' ) {
$node->expandible = true;
$node->uid = 'com_eventlistc'.$id;
} elseif ( $view == 'venueevents' ) {
$node->expandible = true;
$node->uid = 'com_eventlistv'.$id;
}
} else {
$node->expandible = true;
}
}
示例13: 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();
}
示例14: __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();
}
示例15: 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);
}