Some minor internal fixes
This commit is contained in:
@@ -10,20 +10,21 @@
|
||||
* @license http://dev.leenooks.net/license.html
|
||||
*/
|
||||
class lnApp_Menu {
|
||||
public static function items($type) {
|
||||
public static function items($type,array $list=array()) {
|
||||
$result = array();
|
||||
|
||||
if (empty(URL::$method_directory[$type]))
|
||||
return NULL;
|
||||
|
||||
$list = Kohana::list_files('classes/Controller/'.ucfirst($type));
|
||||
if (! $list)
|
||||
$list = Kohana::list_files('classes/Controller/'.ucfirst($type));
|
||||
|
||||
// This will be used a lot!
|
||||
$ext_length = strlen(EXT);
|
||||
|
||||
foreach ($list as $name => $path)
|
||||
if (is_array($path)) {
|
||||
$result += self::items($path);
|
||||
$result += self::items($type,$path);
|
||||
|
||||
} elseif (substr($name, -$ext_length) === EXT) {
|
||||
// Remove "classes/" and the extension
|
||||
|
Reference in New Issue
Block a user