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


PHP T3Path::getPath方法代码示例

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


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

示例1: _load

 /**
  * Load hook file
  *
  * @return void
  */
 function _load()
 {
     if (defined('_T3_HOOK_CUSTOM')) {
         return;
     }
     define('_T3_HOOK_CUSTOM', 1);
     //include hook. Get all path to hook.php in themes
     $paths = T3Path::getPath('hook.php', true);
     if (is_array($paths)) {
         foreach ($paths as $path) {
             include $path;
         }
     }
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:19,代码来源:hook.php

示例2: loadBlock

 /**
  * Load block content
  *
  * @param $block string
  *     Block name - the real block is tpls/blocks/[blockname].php
  *
  * @return string Block content
  */
 function loadBlock($block, $vars = array())
 {
     if (!$this->_block) {
         $this->_block = $block;
     }
     $path = T3Path::getPath('tpls/system/' . $block . '.php');
     if (!$path) {
         $path = T3Path::getPath('tpls/blocks/' . $block . '.php');
     }
     ob_start();
     if ($path) {
         include $path;
     } else {
         echo "<div class=\"error\">Block [{$block}] not found!</div>";
     }
     $content = ob_get_contents();
     ob_end_clean();
     if (isset($vars['spl'])) {
         $content = preg_replace('#(<[A-Za-z]+[^>^\\/]*)>#', '\\1 data-original="' . $block . '"' . (isset($vars['spl']) ? ' data-spotlight="' . $vars['name'] . '"' : '') . '>', $content, 1);
         $this->_block = null;
     }
     echo isset($vars['spl']) ? $content : "<div class=\"t3-admin-layout-section\">" . $content . "</div>";
 }
开发者ID:GitIPFire,项目名称:Homeworks,代码行数:31,代码来源:templatelayout.php

示例3: loadLayout

 /**
  * Load block content
  *
  * @param $block string
  *     Block name - the real block is tpls/blocks/[blockname].php
  *
  * @return string Block content
  */
 function loadLayout($layout)
 {
     $path = T3Path::getPath('tpls/' . $layout . '.php', 'tpls/default.php');
     if (is_file($path)) {
         include $path;
     } else {
         echo "<div class=\"error\">Layout [{$layout}] or [Default] not found!</div>";
     }
 }
开发者ID:GitIPFire,项目名称:Homeworks,代码行数:17,代码来源:template.php

示例4: defined

/**
 * ------------------------------------------------------------------------
 * JA T3v2 System Plugin for J3.x
 * ------------------------------------------------------------------------
 * Copyright (C) 2004-2011 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
 * @license - GNU/GPL, http://www.gnu.org/licenses/gpl.html
 * Author: J.O.O.M Solutions Co., Ltd
 * Websites: http://www.joomlart.com - http://www.joomlancers.com
 * ------------------------------------------------------------------------
 */
// No direct access
defined('_JEXEC') or die;
$t3_based_path = JPATH_SITE . DS . 'templates' . DS . T3_ACTIVE_TEMPLATE . DS;
$layout = str_replace($t3_based_path, '', $t3_current_layout);
$layout_path = T3Path::getPath($layout);
if (!$layout_path) {
    //Detect if it is module or component
    $parts = explode(DS, $layout, 4);
    $type = '';
    if (isset($parts[1])) {
        $type = $parts[1];
    }
    if ($type) {
        if (preg_match('/^com_/', $type)) {
            //component
            $layout_path = JPATH_SITE . DS . 'components' . DS . $parts[1] . DS . 'views' . DS . $parts[2] . DS . 'tmpl' . DS . $parts[3];
        } else {
            if (preg_match('/^mod_/', $type)) {
                //component
                $layout_path = JPATH_SITE . DS . 'modules' . DS . $parts[1] . DS . 'tmpl' . DS . $parts[2];
开发者ID:ashanrupasinghe,项目名称:slbcv2,代码行数:30,代码来源:html.php

示例5: loadLayout

 /**
  * Load block layout
  *
  * @param string &layout  Block name - the real block is tpls/[layout].php
  *
  * @return null
  */
 function loadLayout($layout)
 {
     $path = T3Path::getPath('tpls/' . $layout . '.php', 'tpls/default.php');
     JDispatcher::getInstance()->trigger('onT3LoadLayout', array(&$path, $layout));
     if (is_file($path)) {
         if ($this->responcls && !$this->getParam('responsive', 1)) {
             ob_start();
             include $path;
             $buffer = ob_get_contents();
             ob_end_clean();
             //replace
             $buffer = preg_replace_callback('@class\\s?=\\s?(\'|")(([^\'"]*)(' . implode('|', $this->prefixes) . ')+([^\'"]*))(\'|")@m', array($this, 'responCls'), $buffer);
             //output
             echo $buffer;
         } else {
             include $path;
         }
         // append modules in debug position
         if ($this->getParam('snippet_debug', 0) && $this->countModules('debug')) {
             $this->getBuffer('modules', 'debug');
         }
     } else {
         echo "<div class=\"error\">Layout [{$layout}] or [Default] not found!</div>";
     }
 }
开发者ID:Tommar,项目名称:vino2,代码行数:32,代码来源:template.php

示例6: onGetLayoutPath

 /**
  * Implement event onGetLayoutPath to return the layout which override by T3 & T3 templates
  * This event is fired by overriding ModuleHelper class
  * Return path to layout if found, false if not
  *
  * @param   string $module  The name of the module
  * @param   string $layout  The name of the module layout. If alternative
  *                           layout, in the form template:filename.
  *
  * @return  null
  */
 function onGetLayoutPath($module, $layout)
 {
     // Detect layout path in T3 themes
     if (defined('T3_PLUGIN') && T3::detect()) {
         T3::import('core/path');
         $tPath = T3Path::getPath('html/' . $module . '/' . $layout . '.php');
         if ($tPath) {
             return $tPath;
         }
     }
     return false;
 }
开发者ID:lazarch,项目名称:t3,代码行数:23,代码来源:t3.php

示例7: getListFooter

 /**
  * Return the pagination footer.
  *
  * @return  string   Pagination footer.
  * @since   11.1
  */
 public function getListFooter()
 {
     $app = JFactory::getApplication();
     $list = array();
     $list['prefix'] = $this->prefix;
     $list['limit'] = $this->limit;
     $list['limitstart'] = $this->limitstart;
     $list['total'] = $this->total;
     $list['limitfield'] = $this->getLimitBox();
     $list['pagescounter'] = $this->getPagesCounter();
     $list['pageslinks'] = $this->getPagesLinks();
     if (T3Common::detect()) {
         $chromePath = T3Path::getPath('html' . DS . 'pagination.php', false);
     } else {
         $chromePath = JPATH_THEMES . '/' . $app->getTemplate() . '/html/pagination.php';
     }
     if (file_exists($chromePath)) {
         require_once $chromePath;
         if (function_exists('pagination_list_footer')) {
             return pagination_list_footer($list);
         }
     }
     return $this->_list_footer($list);
 }
开发者ID:ashanrupasinghe,项目名称:slbcv2,代码行数:30,代码来源:pagination.php

示例8: _setPath

 /**
  * Sets an entire array of search paths for templates or resources.
  *
  * @param   string 		The type of path to set, typically 'template'.
  * @param   string|array	The new set of search paths.  If null or false, resets to the current directory only.
  */
 protected function _setPath($type, $path)
 {
     jimport('joomla.application.helper');
     $component = JApplicationHelper::getComponentName();
     $app = JFactory::getApplication();
     // Clear out the prior search dirs
     $this->_path[$type] = array();
     // Actually add the user-specified directories
     $this->_addPath($type, $path);
     // Always add the fallback directories as last resort
     switch (strtolower($type)) {
         case 'template':
             // Set the alternative template search dir
             if (isset($app)) {
                 $component = preg_replace('/[^A-Z0-9_\\.-]/i', '', $component);
                 $fallback = JPATH_THEMES . '/' . $app->getTemplate() . '/html/' . $component . '/' . $this->getName();
                 //if it is T3 template, update search path for template
                 if (T3Common::detect()) {
                     if (is_array($fallback1 = T3Path::getPath('html' . DS . $component . DS . $this->getName(), true))) {
                         $fallback = array_reverse($fallback1);
                     }
                 }
                 $this->_addPath('template', $fallback);
             }
             break;
     }
 }
开发者ID:ashanrupasinghe,项目名称:slbcv2,代码行数:33,代码来源:viewlegacy.php

示例9: _setPath

 /**
  * Sets an entire array of search paths for templates or resources.
  *
  * @access protected
  * @param string $type The type of path to set, typically 'template'.
  * @param string|array $path The new set of search paths.  If null or
  * false, resets to the current directory only.
  */
 function _setPath($type, $path)
 {
     global $mainframe, $option;
     // clear out the prior search dirs
     $this->_path[$type] = array();
     // actually add the user-specified directories
     $this->_addPath($type, $path);
     // always add the fallback directories as last resort
     switch (strtolower($type)) {
         case 'template':
             // set the alternative template search dir
             if (isset($mainframe)) {
                 $option = preg_replace('/[^A-Z0-9_\\.-]/i', '', $option);
                 $fallback = JPATH_BASE . DS . 'templates' . DS . $mainframe->getTemplate() . DS . 'html' . DS . $option . DS . $this->getName();
                 //if it is T3 template, update search path for template
                 if (T3Common::detect()) {
                     if (is_array($fallback1 = T3Path::getPath('html' . DS . $option . DS . $this->getName(), true))) {
                         $fallback = array_reverse($fallback1);
                     }
                 }
                 $this->_addPath('template', $fallback);
             }
             break;
     }
 }
开发者ID:rlee1962,项目名称:diylegalcenter,代码行数:33,代码来源:view.php

示例10: loadLayout

 /**
  * Load layout content
  * @param $layout string  Block name - the real block is tpls/blocks/[blockname].php
  *
  * @return none
  */
 function loadLayout($layout)
 {
     $path = T3Path::getPath('tpls/' . $layout . '.php', 'tpls/default.php');
     if ($path) {
         // include $path;
         $html = $this->loadFile($path);
         // parse and replace jdoc
         $html = $this->_parse($html);
         echo $html;
     } else {
         echo "<div class=\"error\">Layout [{$layout}] or [Default] not found!</div>";
     }
 }
开发者ID:grlf,项目名称:eyedock,代码行数:19,代码来源:templatelayout.php

示例11: duplicate

 /**
  *
  * Clone Profile
  */
 public static function duplicate($path)
 {
     $theme = JFactory::getApplication()->input->getCmd('theme');
     $from = JFactory::getApplication()->input->getCmd('from');
     $result = array();
     if (empty($theme) || empty($from)) {
         return self::error(JText::_('T3_TM_INVALID_DATA_TO_SAVE'));
     }
     $source = $path . '/less/themes/' . $from;
     if (!JFolder::exists($source)) {
         // try to find the source in local
         $source = T3Path::getPath('less/themes/' . $from);
         if (!$source) {
             return self::error(JText::sprintf('T3_TM_NOT_FOUND', $from));
         }
     }
     // $dest = $path . '/less/themes/' . $theme;
     // clone to local
     $dest = T3Path::getLocalPath('less/themes/' . $theme);
     if (JFolder::exists($dest)) {
         return self::error(JText::sprintf('T3_TM_EXISTED', $theme));
     }
     // copy $from to $theme
     $status = @JFolder::copy($source, $dest);
     $rtlsource = $path . '/less/rtl/' . $from;
     if (!JFolder::exists($rtlsource)) {
         // try to find the source in local
         $rtlsource = T3Path::getPath('less/rtl/' . $from);
     }
     if ($rtlsource) {
         $rtldest = T3Path::getLocalPath('less/rtl/' . $theme);
         // copy $from to $theme
         @JFolder::copy($rtlsource, $rtldest);
     }
     $result = array();
     if ($status) {
         $result['success'] = JText::_('T3_TM_CLONE_SUCCESSFULLY');
         $result['theme'] = $theme;
         $result['reset'] = true;
         $result['type'] = 'duplicate';
     } else {
         return self::error(JText::_('T3_TM_OPERATION_FAILED'));
     }
     //LessHelper::compileForTemplate(T3_TEMPLATE_PATH , $theme);
     T3::import('core/less');
     T3Less::compileAll($theme);
     return self::response($result);
 }
开发者ID:grlf,项目名称:eyedock,代码行数:52,代码来源:theme.php

示例12: getLayout

 /**
  * Get layout path
  *
  * @return string Layout path
  */
 function getLayout()
 {
     if (JRequest::getCmd('tmpl') == 'component') {
         $layout_path = T3Path::getPath("page/component.php");
         if ($layout_path) {
             return $layout_path;
         }
     }
     if (JRequest::getCmd('ajax')) {
         $layout_path = T3Path::getPath("page/ajax." . JRequest::getCmd('ajax') . ".php");
         if ($layout_path) {
             return $layout_path;
         }
     }
     $mobile = T3Common::mobile_device_detect();
     if ($mobile) {
         // try to find layout render
         $layout_path = T3Path::getPath("page/{$mobile}.php");
         if (!$layout_path) {
             $layout_path = T3Path::getPath("page/handheld.php");
         }
         if (!$layout_path) {
             $layout_path = T3Path::getPath("page/default.php");
         }
     } else {
         $layout_path = T3Path::getPath("page/default.php");
     }
     return $layout_path;
 }
开发者ID:ashanrupasinghe,项目名称:slbcv2,代码行数:34,代码来源:template.php

示例13:

    <?php 
    if (is_dir(T3Path::path('layoutinfo', true))) {
        ?>
        <link type="text/css" rel="stylesheet" href="<?php 
        echo T3Path::url('layoutinfo/style.css', true);
        ?>
" />
        <script type="text/javascript" src="<?php 
        echo T3Path::url('layoutinfo/script.js', true);
        ?>
"></script>
    <?php 
    } else {
        ?>
        <?php 
        if (T3Path::getPath('layoutinfo')) {
            ?>
        <link type="text/css" rel="stylesheet" href="<?php 
            echo T3Path::getUrl('layoutinfo/style.css');
            ?>
" />
        <script type="text/javascript" src="<?php 
            echo T3Path::getUrl('layoutinfo/script.js');
            ?>
"></script>
        <?php 
        }
        ?>
    <?php 
    }
}
开发者ID:ashanrupasinghe,项目名称:slbcv2,代码行数:31,代码来源:debug.php

示例14: onGetLayoutPath

	/**
	 * Implement event onGetLayoutPath to return the layout which override by T3 & T3 templates
	 * This event is fired by overriding ModuleHelper class
	 * Return path to layout if found, false if not
	 *
	 * @param   string  $module  The name of the module
	 * @param   string  $layout  The name of the module layout. If alternative
	 *                           layout, in the form template:filename.
	 *
	 * @return  null
	 */
	function onGetLayoutPath($module, $layout)
	{
		// Detect layout path in T3 themes
		if (T3::detect()) {
			$tPath = T3Path::getPath('html/' . $module . '/' . $layout . '.php');
			if ($tPath)
				return $tPath;
		}
		return false;
	}	
开发者ID:GitIPFire,项目名称:Homeworks,代码行数:21,代码来源:t3.php

示例15: loadLayout

 /**
  * Load block layout
  *
  * @param string &layout  Block name - the real block is tpls/[layout].php
  *
  * @return null
  */
 function loadLayout($layout)
 {
     $path = T3Path::getPath('tpls/' . $layout . '.php', 'tpls/default.php');
     JDispatcher::getInstance()->trigger('onT3LoadLayout', array(&$path, $layout));
     if (is_file($path)) {
         ob_start();
         include $path;
         $buffer = ob_get_contents();
         ob_end_clean();
         if ($this->responcls && !$this->getParam('responsive', 1)) {
             //replace
             $buffer = preg_replace_callback('@class\\s?=\\s?(\'|")(([^\'"]*)(' . implode('|', $this->prefixes) . ')+([^\'"]*))(\'|")@m', array($this, 'responCls'), $buffer);
         }
         // check if exist megamenu renderer, place megamenurender on the top to render megamenu before render head
         if (preg_match_all('/(<jdoc:include type="megamenu"[^>]*>)/i', $buffer, $match)) {
             foreach ($match[1] as $m) {
                 $buffer = str_replace('type="megamenu"', 'type="megamenurender"', $m) . $buffer;
                 T3::import('renderer/megamenurender');
             }
         }
         //output
         echo $buffer;
     } else {
         echo "<div class=\"error\">Layout [{$layout}] or [Default] not found!</div>";
     }
 }
开发者ID:ITPrism,项目名称:GamificationDistribution,代码行数:33,代码来源:template.php


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