本文整理汇总了PHP中JApplicationHelper::_checkPath方法的典型用法代码示例。如果您正苦于以下问题:PHP JApplicationHelper::_checkPath方法的具体用法?PHP JApplicationHelper::_checkPath怎么用?PHP JApplicationHelper::_checkPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JApplicationHelper
的用法示例。
在下文中一共展示了JApplicationHelper::_checkPath方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct($original, $translation, $fieldname, $fields = null)
{
$lang = JFactory::getLanguage();
$lang->load("com_config", JPATH_ADMINISTRATOR);
$this->fieldname = $fieldname;
$content = null;
foreach ($fields as $field) {
if ($field->Name == "option") {
$comp = $field->originalValue;
break;
}
}
$lang->load($comp, JPATH_ADMINISTRATOR);
$path = DS . "components" . DS . $comp . DS . "config.xml";
$xmlfile = JApplicationHelper::_checkPath($path);
$this->origparams = new JRegistry($original);
$this->origparams->loadFile($xmlfile, 'XML');
$this->transparams = new JRegistry($translation);
$this->transparams->loadFile($xmlfile, 'XML');
$this->defaultparams = new JRegistry();
$this->defaultparams->loadFile($xmlfile, 'XML');
$this->fields = $fields;
}
示例2: TranslateParams_components
function TranslateParams_components($original, $translation, $fieldname, $fields = null)
{
$lang = JFactory::getLanguage();
$lang->load("com_config", JPATH_ADMINISTRATOR);
$this->fieldname = $fieldname;
global $mainframe;
$content = null;
foreach ($fields as $field) {
if ($field->Name == "option") {
$comp = $field->originalValue;
break;
}
}
$lang->load($comp, JPATH_ADMINISTRATOR);
$path = DS . "components" . DS . $comp . DS . "config.xml";
$xmlfile = JApplicationHelper::_checkPath($path);
$this->origparams = new JParameter($original, $xmlfile, "component");
$this->transparams = new JParameter($translation, $xmlfile, "component");
$this->defaultparams = new JParameter("", $xmlfile, "component");
$this->fields = $fields;
}
示例3: getPath
/**
* Get a path
*
* @access public
* @param string $varname
* @param string $user_option
* @return string The requested path
* @since 1.0
*/
public static function getPath($varname, $user_option = null)
{
// check needed for handling of custom/new module xml file loading
$check = $varname == 'mod0_xml' || $varname == 'mod1_xml';
if (!$user_option && !$check) {
$user_option = JRequest::getCmd('option');
} else {
$user_option = JFilterInput::clean($user_option, 'path');
}
$result = null;
$name = substr($user_option, 4);
switch ($varname) {
case 'front':
$result = JApplicationHelper::_checkPath(DS . 'components' . DS . $user_option . DS . $name . '.php', 0);
break;
case 'html':
case 'front_html':
if (!($result = JApplicationHelper::_checkPath(DS . 'templates' . DS . JApplication::getTemplate() . DS . 'components' . DS . $name . '.html.php', 0))) {
$result = JApplicationHelper::_checkPath(DS . 'components' . DS . $user_option . DS . $name . '.html.php', 0);
}
break;
case 'toolbar':
$result = JApplicationHelper::_checkPath(DS . 'components' . DS . $user_option . DS . 'toolbar.' . $name . '.php', -1);
break;
case 'toolbar_html':
$result = JApplicationHelper::_checkPath(DS . 'components' . DS . $user_option . DS . 'toolbar.' . $name . '.html.php', -1);
break;
case 'toolbar_default':
case 'toolbar_front':
$result = JApplicationHelper::_checkPath(DS . 'includes' . DS . 'HTML_toolbar.php', 0);
break;
case 'admin':
$path = DS . 'components' . DS . $user_option . DS . 'admin.' . $name . '.php';
$result = JApplicationHelper::_checkPath($path, -1);
if ($result == null) {
$path = DS . 'components' . DS . $user_option . DS . $name . '.php';
$result = JApplicationHelper::_checkPath($path, -1);
}
break;
case 'admin_html':
$path = DS . 'components' . DS . $user_option . DS . 'admin.' . $name . '.html.php';
$result = JApplicationHelper::_checkPath($path, -1);
break;
case 'admin_functions':
$path = DS . 'components' . DS . $user_option . DS . $name . '.functions.php';
$result = JApplicationHelper::_checkPath($path, -1);
break;
case 'class':
if (!($result = JApplicationHelper::_checkPath(DS . 'components' . DS . $user_option . DS . $name . '.class.php'))) {
$result = JApplicationHelper::_checkPath(DS . 'includes' . DS . $name . '.php');
}
break;
case 'helper':
$path = DS . 'components' . DS . $user_option . DS . $name . '.helper.php';
$result = JApplicationHelper::_checkPath($path);
break;
case 'com_xml':
$path = DS . 'components' . DS . $user_option . DS . $name . '.xml';
$result = JApplicationHelper::_checkPath($path, 1);
break;
case 'mod0_xml':
$path = DS . 'modules' . DS . $user_option . DS . $user_option . '.xml';
$result = JApplicationHelper::_checkPath($path);
break;
case 'mod1_xml':
// admin modules
$path = DS . 'modules' . DS . $user_option . DS . $user_option . '.xml';
$result = JApplicationHelper::_checkPath($path, -1);
break;
case 'bot_xml':
// legacy value
// legacy value
case 'plg_xml':
// Site plugins
$path = DS . 'plugins' . DS . $user_option . '.xml';
$result = JApplicationHelper::_checkPath($path, 0);
break;
case 'menu_xml':
$path = DS . 'components' . DS . 'com_menus' . DS . $user_option . DS . $user_option . '.xml';
$result = JApplicationHelper::_checkPath($path, -1);
break;
}
return $result;
}