From f8a31244a12dcb4ff83ba1d10069d67886a23faa Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Sun, 13 Mar 2011 21:53:22 +0800 Subject: [PATCH] Pman.php --- Pman.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Pman.php b/Pman.php index 44759cb..8d3ab8e 100644 --- a/Pman.php +++ b/Pman.php @@ -169,6 +169,31 @@ class Pman extends HTML_FlexyFramework_Page return $au->hasPerm($name,$lvl); } + + function modules($with_component=false) + { + // appModules/appDisable contain a comma limited list of + // both modules and components that can be enabled/disabled.. + + // the modules call just lists the modules + $enabled = array('Core'); + $am = !empty($this->appModules) ? explode(',', $this->appModules) : array(); + foreach($am as $k) { + if (!$with_component && strpos( $k ,'.') ) { + continue; + } + + } + $enabled = !empty($this->appModules) ? + array_merge($enabled, explode(',', $this->appModules)) : + $enabled; + $disabled = explode(',', $this->appDisable ? $this->appDisable: ''); + + //print_R($opts); + + return in_array($name, $enabled) && !in_array($name, $disabled); + } + function hasModule($name) { $this->init(); -- 2.39.2