本文整理汇总了PHP中JoomFishManager::addIncludePath方法的典型用法代码示例。如果您正苦于以下问题:PHP JoomFishManager::addIncludePath方法的具体用法?PHP JoomFishManager::addIncludePath怎么用?PHP JoomFishManager::addIncludePath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JoomFishManager
的用法示例。
在下文中一共展示了JoomFishManager::addIncludePath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTranslateParams
public static function getTranslateParams($type = '', $original, $translation, $fieldname, $fields = null)
{
JoomFishManager::addIncludePath(JOOMFISH_LIBPATH . DS . 'translateparams', 'translateparams');
JoomFishManager::addIncludePath(JOOMFISH_LIBPATH . DS . 'contentelement' . DS . 'contentelements', 'translateparams');
$paramsclass = "TranslateParams_" . $type;
if (!class_exists($paramsclass)) {
// Search for the class file in the include paths.
jimport('joomla.filesystem.path');
if ($path = JPath::find(JoomFishManager::addIncludePath('', 'translateparams'), strtolower($type) . '.php')) {
include_once $path;
} else {
if ($path = JPath::find(JoomFishManager::addIncludePath('', 'translateparams'), $paramsclass . '.php')) {
include_once $path;
}
}
}
if (!class_exists($paramsclass)) {
jimport('joomfish.translateparams.translateparams');
$paramsclass = "TranslateParams";
}
return new $paramsclass($original, $translation, $fieldname, $fields);
}
示例2: getTranslationFilters
/**
* Load and instantiate all necessary translation fitler classes
*/
public static function getTranslationFilters($catid, $contentElement)
{
JoomFishManager::addIncludePath(JOOMFISH_LIBPATH . DS . 'translationfilter', 'translationfilter');
JoomFishManager::addIncludePath(JOOMFISH_LIBPATH . DS . 'contentelement' . DS . 'contentelements', 'translationfilter');
if (!$contentElement) {
return array();
}
$filterNames = $contentElement->getAllFilters();
if (count($filterNames) > 0) {
$filterNames["reset"] = "reset";
}
$filters = array();
foreach ($filterNames as $key => $value) {
$filterType = "translation" . ucfirst(strtolower($key)) . "Filter";
//$classFile = JOOMFISH_LIBPATH .DS. 'contentelement' .DS. 'contentelements'.DS. "$filterType.php";
if (!class_exists($filterType)) {
/*if (file_exists($classFile))
include_once($classFile);*/
// Search for the class file in the include paths.
jimport('joomla.filesystem.path');
if ($path = JPath::find(JoomFishManager::addIncludePath('', 'translationfilter'), strtolower($key) . '.php')) {
include_once $path;
} else {
if ($path = JPath::find(JoomFishManager::addIncludePath('', 'translationfilter'), $filterType . '.php')) {
include_once $path;
}
}
if (!class_exists($filterType)) {
continue;
}
}
$filters[strtolower($key)] = new $filterType($contentElement);
}
return $filters;
}