当前位置: 首页>>代码示例>>PHP>>正文


PHP cmsFramework::getInstance方法代码示例

本文整理汇总了PHP中cmsFramework::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP cmsFramework::getInstance方法的具体用法?PHP cmsFramework::getInstance怎么用?PHP cmsFramework::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cmsFramework的用法示例。


在下文中一共展示了cmsFramework::getInstance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: siteRoute

 /**
  * This function is used as a replacement to JRoute::_() to generate sef urls in Joomla admin
  * 
  * @param mixed $urls
  * @param mixed $xhtml
  * @param mixed $ssl
  */
 function siteRoute($urls, $xhtml = true, $ssl = null)
 {
     global $mainframe;
     !is_array($urls) and $urls = array($urls);
     $parsed_urls = array();
     // Check if plugins already processed
     $_this = cmsFramework::getInstance();
     if (!is_object($_this->jMainframe)) {
         // Backup original mainframe object
         $_this->jMainframe = clone $mainframe;
         // Get a new mainframe object to process the sef plugins
         $mainframe = JApplication::getInstance('site');
         $router = $mainframe->getRouter();
         $plugins = JPluginHelper::_load();
         $total = count($plugins);
         for ($i = 0; $i < $total; $i++) {
             $plugins[$i]->type == 'system' and in_array($plugins[$i]->name, $_this->sef_plugins) and JPluginHelper::_import($plugins[$i]);
         }
         if (class_exists('plgSystemSEF_Advance')) {
             plgSystemSEF_Advance::trigger();
         } else {
             $mainframe->triggerEvent('onAfterInitialise');
         }
         // Store modified mainframe object with sef plugin router
         $_this->newMainframe = $mainframe;
     } else {
         // Load the modified mainframe object with sef plugin router
         $mainframe = $_this->newMainframe;
     }
     $router = $mainframe->getRouter();
     foreach ($urls as $url) {
         $uri = $router->build($url);
         $parsed_url = $uri->toString();
         $parsed_urls[] = str_replace('/administrator', '', $parsed_url);
     }
     // Restore original mainframe object
     $mainframe = $_this->jMainframe;
     return count($parsed_urls) == 1 ? array_shift($parsed_urls) : $parsed_urls;
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:46,代码来源:joomla15.php

示例2: onPrepareContent

 function onPrepareContent(&$article, &$params)
 {
     if (!class_exists('cmsFramework')) {
         return;
     }
     // Check whether to perform the replacement or not
     $option = Sanitize::getString($_REQUEST, 'option', '');
     $view = Sanitize::getString($_REQUEST, 'view', '');
     $layout = Sanitize::getString($_REQUEST, 'layout', '');
     $id = Sanitize::getInt($_REQUEST, 'id');
     if ($option == 'com_content' && in_array($view, array('article', 'category', 'section', 'frontpage')) && ($layout != '' || in_array($view, array('article', 'frontpage')))) {
         $row =& $article;
         if ((isset($row->params) || isset($row->parameters)) && isset($row->id) && isset($row->catid) && isset($row->sectionid) && $row->id > 0 && $row->catid > 0 && $row->sectionid > 0) {
             $Dispatcher = new S2Dispatcher('jreviews', true);
             if ($option == 'com_content' && $view == 'article' & $id > 0) {
                 $_GET['url'] = 'com_content/com_content_view';
             } elseif ($option == 'com_content' && (($layout == 'blog' || $layout == 'blogfull') && ($view == 'category' || $view == 'section') || $view == 'frontpage')) {
                 $_GET['url'] = 'com_content/com_content_blog';
             }
             $passedArgs = array('params' => $params, 'row' => $row, 'component' => 'com_content');
             $passedArgs['cat'] = $row->catid;
             $passedArgs['section'] = $row->sectionid;
             $passedArgs['listing_id'] = $row->id;
             $output = $Dispatcher->dispatch($passedArgs);
             if ($output) {
                 $row =& $output['row'];
                 $params =& $output['params'];
             }
             /**
              * Store a copy of the $listing and $crumbs arrays in memory for use in the onBeforeDisplayContent method
              */
             $_this =& cmsFramework::getInstance();
             $_this->listing =& $output['listing'];
             $_this->crumbs =& $output['crumbs'];
             // Destroy pathway
             if (isset($_this->crumbs) && !empty($_this->crumbs)) {
                 cmsFramework::setPathway(array());
             }
             unset($Dispatcher);
         }
     }
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:42,代码来源:jreviews.php

示例3:

/css/ieonly.css" rel="stylesheet" type="text/css" />
	<![endif]-->
	<!--[if IE 7]>
		<link href="<?php 
echo $this->baseurl;
?>
/templates/<?php 
echo $this->template;
?>
/css/ie7only.css" rel="stylesheet" type="text/css" />
	<![endif]-->
<?php 
?>

<?php 
if (JRequest::getString('option') != "com_jreviews" && !(class_exists('cmsFramework') && ($jreviews =& cmsFramework::getInstance()) && isset($jreviews->listing))) {
    ?>
<!-- mvcjr -->
<?php 
}
?>

<?php 
if (!$registration_page) {
    ?>
<script type="text/javascript">
jQuery(function ($) {
	$('#lnav ul.menu > li > a').each(
		function () {
			if ($(this).parent().find('ul').length > 0) {
				$(this).click(function () {
开发者ID:bizanto,项目名称:Hooked,代码行数:31,代码来源:index.php


注:本文中的cmsFramework::getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。