public function __construct($a_dir) { // Load from dirs $plugins = find_all_dirs($a_dir); if ($plugins) { foreach ($plugins as $plugin) { $this->AppendPlugin($a_dir . "/" . $plugin, $plugin); } } // Load files $plugins = find_all_files($a_dir); if ($plugins) { foreach ($plugins as $plugin) { $this->AppendPlugin($a_dir, str_replace(PLUGIN_EXT, "", $plugin)); } } }
public static function GeneratePageData() { $page_data = array(); $page_data['id'] = self::$m_pageid; $page_data['pages'] = array(); $result = Database::Query("SELECT `id`, `name`, `template`, `default` FROM `" . DB_TBL_PAGES . "`"); do { $row = $result->GetRow(); $page_data['pages'][$row['id']] = $row; $page_data['pages'][$row['id']]['name'] = unserialize($row['name']); } while ($result->NextRow()); self::AddData(DATA_PAGE, $page_data); // Generate template data // Page templates $page_templates = find_all_files(COMPILER_TEMPLATES_DIR); foreach ($page_templates as $page_template) { $templates_data['page'][] = substr($page_template, 0, -5); } // Module templates $module_types = find_all_dirs(COMPILER_TEMPLATES_DIR . '/modules'); foreach ($module_types as $module_type) { $module_templates = find_all_files(COMPILER_TEMPLATES_DIR . '/modules/' . $module_type); foreach ($module_templates as $module_template) { $templates_data['modules'][$module_type][] = substr($module_template, 0, -5); } } self::AddData(DATA_TEMPLATES, $templates_data); }