function __construct() { // Call parent constructor parent::__construct(basename(__DIR__)); }
public static function setModulePageTitle($page = '') { $title = self::$module_name; if (!empty($page)) { $module_pages = BGP_Module::getModulePages(); if (!empty($module_pages)) { $module_pages = $module_pages['page']; if (isset($module_pages[0])) { foreach ($module_pages as $key => $value) { if ($value['name'] == $page) { $title = $value['description']; break; } } } else { $title = $module_pages['description']; } } } self::$module_definition['module_settings']['title'] = $title; }
function __construct($module_name) { // Call module constructor parent::__construct($module_name); }
public static function getModulePublicPages($bgp_module_name) { $public_pages[0]['page'] = ucfirst(strtolower($bgp_module_name)) . '/'; $public_pages[0]['description'] = ucfirst(strtolower($bgp_module_name)) . ' Module'; if (!empty($bgp_module_name)) { // Test Manifest File if (!file_exists(MODS_DIR . '/' . strtolower($bgp_module_name) . '/manifest.xml')) { return array(); } $xml = simplexml_load_string(file_get_contents(MODS_DIR . '/' . strtolower($bgp_module_name) . '/manifest.xml')); $json = json_encode($xml); $module_definition = json_decode($json, TRUE); BGP_Module::$module_definition = $module_definition; $module_pages = BGP_Module::getModulePages(); if (!empty($module_pages)) { $module_pages = $module_pages['page']; if (isset($module_pages[0])) { foreach ($module_pages as $key => $value) { $page = array('page' => $public_pages[0]['page'] . strtolower($value['name']) . '/', 'description' => trim($value['description'])); $public_pages[] = $page; } } else { $page = array('page' => $public_pages[0]['page'] . strtolower($module_pages['name']) . '/', 'description' => trim($module_pages['description'])); $public_pages[] = $page; } } } return $public_pages; }