var $appModules = '';
+ var $authUser; // always contains the authenticated user..
+
/**
return $au->hasPerm($name,$lvl);
}
+
+ function modules()
+ {
+ // appModules/appDisable contain a comma limited list of
+ // both modules and components that can be enabled/disabled..
+ $boot = HTML_FlexyFramework::get();
+
+ // the modules call just lists the modules
+ $enabled = array('Core' => true);
+ $am = !empty($boot->enable) ? explode(',', $boot->enable) : array();
+ foreach($am as $k) {
+ if (strpos( $k ,'.') ) {
+ continue;
+ }
+ $enabled[$k] = true;
+ }
+
+
+ $disabled = !empty($boot->disable) ? explode(',', $boot->disable) : array();
+ foreach($disabled as $k) {
+ if ( strpos( $k ,'.') ) {
+ continue;
+ }
+ if (isset($enabled[$k])) {
+ unset($enabled[$k]);
+ }
+ }
+ //echo '<PRE>'; var_Dump($enabled);
+
+ return array_keys($enabled);
+ }
+
function hasModule($name)
{
$this->init();
if (!strpos( $name,'.') ) {
// use enable / disable..
-
-
- $enabled = array('Core') ;
- $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);
+ return in_array($name, $this->modules());
}
$x = DB_DataObject::factory('Group_Rights');
/** -- these need modulizing somehow! **/
- if ($this->hasModule('Fax')) {
- // should check fax module???
- $f = DB_DataObject::factory('Fax_Queue');
- $aur['faxMax'] = $f->getMaxId();
- $aur['faxNumPending'] = $f->getNumPending();
- }
- if ($this->hasModule('Documents')) {
- // inbox...
- $d = DB_DataObject::factory('Documents_Tracking');
- $d->person_id = $au->id;
- //$d->status = 0; // unread
- $d->whereAdd('date_read IS NULL');
- $d->applyFilters(array('query'=> array('unread' => 1)), $au);
- $aur['inbox_unread'] = $d->count();
+
+ // basically calls Pman_MODULE_Login::sendAuthUserDetails($aur) on all the modules
+ //echo '<PRE>'; print_r($this->modules());
+ // technically each module should only add properties to an array named after that module..
+
+ foreach($this->modules() as $m) {
+ if (!file_exists($this->rootDir.'/Pman/'.$m.'/Login.php')) {
+ continue;
+ }
+ $cls = 'Pman_'.$m.'_Login';
+ require_once 'Pman/'.$m.'/Login.php';
+ $x = new $cls;
+ $x->authUser = $au;
+ $aur = $x->sendAuthUserDetails($aur);
}
+
+
//echo '<PRE>';print_r($aur);
$this->jok($aur);
*
* - applySort($au, $sortcol, $direction)
* - applyFilters($_REQUEST, $authUser) -- apply any query filters on data. and hide stuff not to be seen.
- * - postListExtra - add extra column data on the results (like new messages etc.)
- * -postListFilter($data, $authUser, $request) return $data - add extra data to an object
+ * - postListExtra($_REQUEST) : array(extra_data) - add extra column data on the results (like new messages etc.)
+ * - postListFilter($data, $authUser, $request) return $data - add extra data to an object
*
* - toRooSingleArray($authUser, $request) // single fetch, add data..
* - toRooArray($request) /// toArray if you need to return different data.. for a list fetch.