本文整理汇总了PHP中T3::getApp方法的典型用法代码示例。如果您正苦于以下问题:PHP T3::getApp方法的具体用法?PHP T3::getApp怎么用?PHP T3::getApp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类T3
的用法示例。
在下文中一共展示了T3::getApp方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onT3LoadLayout
public function onT3LoadLayout(&$path, $layout)
{
if (JRequest::getVar('option') == 'com_mijoshop' && JRequest::getVar('route') == 'product/product') {
T3::getApp()->addBodyClass('view-detail');
}
//T3::getApp()->addBodyClass('loadlayout');
}
示例2: render
/**
* Render megamenu block
*
* @param string $position The position of the modules to render
* @param array $params Associative array of values
* @param string $content Module content
*
* @return string The output of the script
*
* @since 11.1
*/
public function render($info = null, $params = array(), $content = null)
{
T3::import('menu/t3bootstrap');
// import the renderer
$t3app = T3::getApp();
$menutype = empty($params['menutype']) ? $t3app->getParam('mm_type', 'mainmenu') : $params['menutype'];
JDispatcher::getInstance()->trigger('onT3BSMenu', array(&$menutype));
$menu = new T3Bootstrap($menutype);
return $menu->render(true);
}
示例3: onAfterRender
function onAfterRender()
{
$japp = JFactory::getApplication();
if ($japp->isAdmin()) {
if (T3::detect()) {
$t3app = T3::getApp();
$t3app->render();
}
}
}
示例4: render
/**
* Render body class of current page
*
* @param string $position The position of the modules to render
* @param array $params Associative array of values
* @param string $content Module content
*
* @return string The output of the script
*
* @since 11.1
*/
public function render($info, $params = array(), $content = null)
{
$input = JFactory::getApplication()->input;
$t3tpl = T3::getApp();
$pageclass = array();
if ($input->getCmd('option', '')) {
$pageclass[] = $input->getCmd('option', '');
}
if ($input->getCmd('view', '')) {
$pageclass[] = 'view-' . $input->getCmd('view', '');
}
if ($input->getCmd('layout', '')) {
$pageclass[] = 'layout-' . $input->getCmd('layout', '');
}
if ($input->getCmd('task', '')) {
$pageclass[] = 'task-' . $input->getCmd('task', '');
}
if ($input->getCmd('Itemid', '')) {
$pageclass[] = 'itemid-' . $input->getCmd('Itemid', '');
}
$menu = JFactory::getApplication()->getMenu();
if ($menu) {
$active = $menu->getActive();
$default = $menu->getDefault();
if ($active) {
if ($default && $active->id == $default->id) {
$pageclass[] = 'home';
}
if ($active->params && $active->params->get('pageclass_sfx')) {
$pageclass[] = $active->params->get('pageclass_sfx');
}
}
}
$pageclass[] = 'j' . str_replace('.', '', number_format((double) JVERSION, 1, '.', ''));
$pageclass = array_unique(array_merge($pageclass, $t3tpl->getPageclass()));
JDispatcher::getInstance()->trigger('onT3BodyClass', array(&$pageclass));
return implode(' ', $pageclass);
}
示例5: defined
/**
* ------------------------------------------------------------------------
* Uber Template
* ------------------------------------------------------------------------
* Copyright (C) 2004-2011 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
* @license - Copyrighted Commercial Software
* Author: J.O.O.M Solutions Co., Ltd
* Websites: http://www.joomlart.com - http://www.joomlancers.com
* This file may not be redistributed in whole or significant part.
* ------------------------------------------------------------------------
*/
defined('_JEXEC') or die;
// parse jdoc after render
$params->set('parse-jdoc', 1);
// use with T3
$t3doc = T3::getApp();
$doc = JFactory::getDocument();
// get params
$tplparams = JFactory::getApplication()->getTemplate(true)->params;
$sitename = $tplparams->get('sitename');
$slogan = $tplparams->get('slogan', '');
$logotype = $tplparams->get('logotype', 'text');
$logoimage = $logotype == 'image' ? $tplparams->get('logoimage', T3Path::getUrl('images/logo.png', '', true)) : '';
$logoimgsm = $logotype == 'image' && $tplparams->get('enable_logoimage_sm', 0) ? $tplparams->get('logoimage_sm', T3Path::getUrl('images/logo-sm.png', '', true)) : false;
$logolink = $tplparams->get('logolink');
if (!$sitename) {
$sitename = JFactory::getConfig()->get('sitename');
}
$headright = $doc->countModules('head-search or languageswitcherload or right-menu') || $tplparams->get('addon_offcanvas_enable');
// get logo url
$logourl = JURI::base(true);
示例6: defined
<?php
/**
* ------------------------------------------------------------------------
* JA Events II template
* ------------------------------------------------------------------------
* Copyright (C) 2004-2011 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
* @license - Copyrighted Commercial Software
* Author: J.O.O.M Solutions Co., Ltd
* Websites: http://www.joomlart.com - http://www.joomlancers.com
* This file may not be redistributed in whole or significant part.
* ------------------------------------------------------------------------
*/
// no direct access
defined('_JEXEC') or die;
//check if t3 plugin is existed
if (!defined('T3')) {
if (JError::$legacy) {
JError::setErrorHandling(E_ERROR, 'die');
JError::raiseError(500, JText::_('T3_MISSING_T3_PLUGIN'));
exit;
} else {
throw new Exception(JText::_('T3_MISSING_T3_PLUGIN'), 500);
}
}
$t3app = T3::getApp($this);
// get configured layout
$layout = $t3app->getLayout();
$t3app->loadLayout($layout);
示例7: defined
<?php
/**
* ------------------------------------------------------------------------
* JA Platon Template
* ------------------------------------------------------------------------
* Copyright (C) 2004-2011 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
* @license - Copyrighted Commercial Software
* Author: J.O.O.M Solutions Co., Ltd
* Websites: http://www.joomlart.com - http://www.joomlancers.com
* This file may not be redistributed in whole or significant part.
* ------------------------------------------------------------------------
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
include dirname(__FILE__) . '/index.php';
T3::getApp()->addCss('windows');
示例8: onAfterRender
function onAfterRender()
{
if (defined('T3_PLUGIN') && T3::detect()) {
$t3app = T3::getApp();
if ($t3app) {
if (JFactory::getApplication()->isAdmin()) {
$t3app->render();
} else {
$t3app->snippet();
}
JDispatcher::getInstance()->trigger('onT3AfterRender');
}
}
}
示例9: render
/**
* Render megamenu block, then push the output into megamenu renderer to display
*
* @param string $position The position of the modules to render
* @param array $params Associative array of values
* @param string $content Module content
*
* @return string The output of the script
*
* @since 11.1
*/
public function render($info = null, $params = array(), $content = null)
{
T3::import('menu/megamenu');
$t3app = T3::getApp();
//we will check from params
$menutype = empty($params['menutype']) ? empty($params['name']) ? $t3app->getParam('mm_type', 'mainmenu') : $params['name'] : $params['menutype'];
$currentconfig = json_decode($t3app->getParam('mm_config', ''), true);
//force to array
if (!is_array($currentconfig)) {
$currentconfig = (array) $currentconfig;
}
//get user access levels
$viewLevels = JFactory::getUser()->getAuthorisedViewLevels();
$mmkey = $menutype;
$mmconfig = array();
if (!empty($currentconfig)) {
//find best fit configuration based on view level
$vlevels = array_merge($viewLevels);
if (is_array($vlevels) && in_array(3, $vlevels)) {
//we assume, if a user is special, they should be registered also
$vlevels[] = 2;
}
$vlevels = array_unique($vlevels);
rsort($vlevels);
if (!is_array($vlevels)) {
$vlevels = array();
}
$vlevels[] = '';
// extend a blank, default key
// check if available configuration for language override
$langcode = JFactory::getDocument()->language;
$shortlangcode = substr($langcode, 0, 2);
$types = array($menutype . '-' . $langcode, $menutype . '-' . $shortlangcode, $menutype);
foreach ($types as $type) {
foreach ($vlevels as $vlevel) {
$key = $type . ($vlevel !== '' ? '-' . $vlevel : '');
if (isset($currentconfig[$key])) {
$mmkey = $key;
$menutype = $type;
break 2;
} else {
if (isset($currentconfig[$type])) {
$mmkey = $menutype = $type;
break 2;
}
}
}
}
if (isset($currentconfig[$mmkey])) {
$mmconfig = $currentconfig[$mmkey];
if (!is_array($mmconfig)) {
$mmconfig = array();
}
}
}
JDispatcher::getInstance()->trigger('onT3Megamenu', array(&$menutype, &$mmconfig, &$viewLevels));
$mmconfig['access'] = $viewLevels;
$menu = new T3MenuMegamenu($menutype, $mmconfig, $t3app->_tpl->params);
$t3app->setBuffer($menu->render(true), 'megamenu', empty($params['name']) ? null : $params['name'], null);
return '';
}
示例10: render
/**
* Render megamenu block
*
* @param string $position The position of the modules to render
* @param array $params Associative array of values
* @param string $content Module content
*
* @return string The output of the script
*
* @since 11.1
*/
public function render($info = null, $params = array(), $content = null)
{
T3::import('menu/megamenu');
$t3app = T3::getApp();
//we will check from params
$menutype = empty($params['menutype']) ? $t3app->getParam('mm_type', 'mainmenu') : $params['menutype'];
$currentconfig = json_decode($t3app->getParam('mm_config', ''), true);
//force to array
if (!is_array($currentconfig)) {
$currentconfig = (array) $currentconfig;
}
//get user access levels
$viewLevels = JFactory::getUser()->getAuthorisedViewLevels();
$mmkey = $menutype;
$mmconfig = array();
if (!empty($currentconfig)) {
//find best fit configuration based on view level
$vlevels = array_merge($viewLevels);
if (is_array($vlevels) && in_array(3, $vlevels)) {
//we assume, if a user is special, they should be registered also
$vlevels[] = 2;
}
$vlevels = array_unique($vlevels);
rsort($vlevels);
if (is_array($vlevels) && count($vlevels)) {
//should check for special view level first
if (in_array(3, $vlevels)) {
array_unshift($vlevels, 3);
}
$found = false;
foreach ($vlevels as $vlevel) {
$mmkey = $menutype . '-' . $vlevel;
if (isset($currentconfig[$mmkey])) {
$found = true;
break;
}
}
//fallback
if (!$found) {
$mmkey = $menutype;
}
}
// check if available configuration for language override
$langcode = substr(JFactory::getDocument()->language, 0, 2);
$langtype = $menutype . '-' . $langcode;
$langkey = $langtype . str_replace($menutype, '', $mmkey);
if (isset($currentconfig[$langkey])) {
$mmkey = $langkey;
$menutype = $langtype;
} else {
if (isset($currentconfig[$langtype])) {
$mmkey = $menutype = $langtype;
}
}
if (isset($currentconfig[$mmkey])) {
$mmconfig = $currentconfig[$mmkey];
if (!is_array($mmconfig)) {
$mmconfig = array();
}
}
}
JDispatcher::getInstance()->trigger('onT3Megamenu', array(&$menutype, &$mmconfig, &$viewLevels));
$mmconfig['access'] = $viewLevels;
$menu = new T3MenuMegamenu($menutype, $mmconfig, $t3app->_tpl->params);
return $menu->render(true);
}