Ejemplo n.º 1
0
 /**
  * Get static filled instance.
  *
  * @param JParameter $params
  * @return JoomDOCModuleConfig
  */
 public static function getInstance($params, $id)
 {
     static $instances;
     if (!isset($instances[$id])) {
         $instance = new JoomDOCModuleConfig();
         $instance->init($params);
         $instances[$id] = $instance;
     }
     return $instances[$id];
 }
Ejemplo n.º 2
0
JLoader::register('JoomDOCFolder', JOOMDOC_ADMINISTRATOR . '/libraries/joomdoc/filesystem/folder.php');
JLoader::register('JoomDOCFile', JOOMDOC_ADMINISTRATOR . '/libraries/joomdoc/filesystem/file.php');
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');
// 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 = JoomDOCModuleConfig::getInstance($params, $module->id);
$globalConfig = JoomDOCConfig::getInstance();
$modelDocuments = JModelLegacy::getInstance(JOOMDOC_DOCUMENTS, JOOMDOC_MODEL_SITE_PREFIX);
/* @var $modelDocuments JoomDOCSiteModelDocuments */
$listFields = $modelDocuments->getListFields();
// Only files are loaded.
$root = JoomDOCFileSystem::getFolderContent($moduleConfig->parent ? JoomDOCFileSystem::getFullPath($moduleConfig->parent) : $globalConfig->docroot, '', true, false, true);
// Model searchs in database for founded paths.
$modelDocuments->setState(JoomDOCView::getStateName(JOOMDOC_FILTER_PATHS), $root->getPaths());
// Filesystem extends items informations from documents.
$root->setDocuments($modelDocuments->getItems());
// Filesystem reordes items for given setting.
$root->reorder($moduleConfig->documentOrdering, $moduleConfig->fileOrdering, JOOMDOC_ORDER_DESC, 0, $moduleConfig->limit, $moduleConfig->limit);
// Active module template displayed.
require JModuleHelper::getLayoutPath('mod_joomdoc', $moduleConfig->layout);