Exemplo n.º 1
0
 /**
  * Get static filled instance.
  *
  * @param JParameter $params
  * @return JoomDOCModuleExplorerConfig
  */
 public static function getInstance($params, $id)
 {
     static $instances;
     if (!isset($instances[$id])) {
         $instance = new JoomDOCModuleExplorerConfig();
         $instance->init($params);
         $instances[$id] = $instance;
     }
     return $instances[$id];
 }
Exemplo n.º 2
0
JLoader::register('JoomDOCAccessHelper', JOOMDOC_ADMINISTRATOR . '/libraries/joomdoc/access/helper.php');
JLoader::register('JoomDOCHelper', JOOMDOC_ADMINISTRATOR . '/libraries/joomdoc/utilities/helper.php');
JLoader::register('JoomDOCAccessFileSystem', JOOMDOC_ADMINISTRATOR . '/libraries/joomdoc/access/filesystem.php');
JLoader::register('JoomDOCAccess', JOOMDOC_ADMINISTRATOR . '/libraries/joomdoc/access/joomdoc.php');
JLoader::register('JoomDOCAccessDocument', JOOMDOC_ADMINISTRATOR . '/libraries/joomdoc/access/document.php');
JLoader::register('JHTMLJoomDOC', JOOMDOC_ADMINISTRATOR . '/libraries/joomdoc/html/joomdoc.php');
JLoader::register('JoomDOCRequest', JOOMDOC_ADMINISTRATOR . '/libraries/joomdoc/environment/request.php');
// Paths to load JoomDOC core classes (model, tables) sets.
JModelLegacy::addIncludePath(JOOMDOC_MODELS);
JModelLegacy::addIncludePath(JOOMDOC_SITE_MODELS);
JTable::addIncludePath(JOOMDOC_TABLES);
$document = JFactory::getDocument();
/* @var $document JDocument */
$document->addStyleSheet(JOOMDOC_ASSETS . 'css/general.css?' . JOOMDOC_VERSION_ALIAS);
// Module and JoomDOC comfiguration.
$moduleConfig = JoomDOCModuleExplorerConfig::getInstance($params, $module->id);
$globalConfig = JoomDOCConfig::getInstance();
$modelDocuments = JModelLegacy::getInstance(JOOMDOC_DOCUMENTS, JOOMDOC_MODEL_SITE_PREFIX);
/* @var $modelDocuments JoomDOCSiteModelDocuments */
// Only folders are loaded.
$parent = $moduleConfig->parent ? JoomDOCFileSystem::getFullPath($moduleConfig->parent) : $globalConfig->docroot;
if (!JFolder::exists($parent)) {
    // invalid or expired module config
    $parent = '';
}
// reset to root
$path = JoomDOCRequest::getPath();
// on file detail get parent folder path
if (JFile::exists(JoomDOCFileSystem::getFullPath($path)) && JFolder::exists(JoomDOCFileSystem::getFullPath(JoomDOCFileSystem::getParentPath($path)))) {
    $path = JoomDOCFileSystem::getParentPath($path);
}