get_all(); foreach ($this->modules as $key => $var) { if ($this->modules[$key]['dir'] == $module) { if ($this->get_config($this->modules[$key]['dir'])) { if ($GLOBALS['conf']['modules'][$this->modules[$key]['dir']]['active']) { return true; } else { return false; } } else { return false; } } } } function auth($module) { if ($this->exists($module)) { include_once(dirname(__FILE__).'/../modules/'.$module.'/hcl/auth.php'); return true; } else { return false; } } function links($type, $display = '') { $this->links = array(); $this->get_all(); foreach ($this->modules as $key => $val) { if ($this->get_config($this->modules[$key]['dir'])) { if ($GLOBALS['conf']['modules'][$this->modules[$key]['dir']]['active'] && ($GLOBALS['conf']['modules'][$this->modules[$key]['dir']]['display'] || $display == 'true')) { if ($GLOBALS['conf']['modules'][$this->modules[$key]['dir']]['operator'] !== '') { $this->array['name'] = $this->modules[$key]['dir']; $this->array['title'] = $GLOBALS['conf']['modules'][$this->modules[$key]['dir']]['title']; switch ($type) { case 'operator': $this->array['url'] = $GLOBALS['conf']['url'].'/admin/module.php?module='.$this->modules[$key]['dir'].'&file='.$GLOBALS['conf']['modules'][$this->modules[$key]['dir']]['operator'].'&type=operator'; break; case 'admin': $this->array['url'] = $GLOBALS['conf']['url'].'/admin/module.php?module='.$this->modules[$key]['dir'].'&file='.$GLOBALS['conf']['modules'][$this->modules[$key]['dir']]['admin'].'&type=admin'; break; case 'conf': $this->array['url'] = $GLOBALS['conf']['url'].'/admin/module.php?module='.$this->modules[$key]['dir'].'&file='.$GLOBALS['conf']['modules'][$this->modules[$key]['dir']]['conf'].'&type=conf'; break; } $this->links[] = $this->array; } } } } return $this->links; } function get_all() { $this->modules = $GLOBALS['file']->dirlist(dirname(__FILE__).'/../modules/'); return $this->modules; } function get_config($module = '') { if ($module !== '') { if ($this->exists($module)) { include_once(dirname(__FILE__).'/../modules/'.$module.'/hcl/config.php'); return true; } else { return false; } } else { $this->get_all(); foreach ($this->modules as $key => $val) { $this->get_config($this->modules[$key]['dir']); } } } } ?>