/** * Returns an array of the folders that modules are allowed to be stored in. * These are set in *bonfire/application/third_party/MX/Modules.php*. * * @deprecated since 0.7.1 Use Modules::folders() instead. * * @return array The folders that modules are allowed to be stored in. */ function module_folders() { return Modules::folders(); }
/** * Returns a list of all modules in the system. * * @param bool $exclude_core Whether to exclude the Bonfire core modules. * * @return array A list of all modules in the system. */ public static function list_modules($exclude_core = false) { // Ensure the bcDirectoryMap function is available. if (!function_exists('bcDirectoryMap')) { get_instance()->load->helper('directory'); } $map = array(); foreach (Modules::folders() as $folder) { // If excluding core modules, skip the core module folder. if ($exclude_core && stripos($folder, 'bonfire/modules') !== false) { continue; } $dirs = bcDirectoryMap($folder, 1); if (is_array($dirs)) { $map = array_merge($map, $dirs); } } $count = count($map); if (!$count) { return $map; } // Clean out any html or php files. for ($i = 0; $i < $count; $i++) { if (stripos($map[$i], '.html') !== false || stripos($map[$i], '.php') !== false) { unset($map[$i]); } } return $map; }
/** * Returns a list of all modules in the system. * * * @return array A list of all modules in the system. */ public static function list_modules() { // Ensure the directory_map function is available. if (!function_exists('directory_map')) { get_instance()->load->helper('directory'); } $map = array(); foreach (Modules::folders() as $folder) { $dirs = directory_map($folder, 1); if (is_array($dirs)) { $map = array_merge($map, $dirs); } } $count = count($map); if (!$count) { return $map; } // Clean out any html or php files. for ($i = 0; $i < $count; $i++) { if (stripos($map[$i], '.html') !== FALSE || stripos($map[$i], '.php') !== FALSE) { unset($map[$i]); } } return $map; }