/** * Get module object * * @param string $class_name Module class name * @return null */ protected function get_module($class_name) { $module = $this->portal_helper->get_module($class_name); if (!$module instanceof module_interface) { trigger_error('CLASS_NOT_FOUND', E_USER_ERROR); } else { $this->module = $module; } unset($module); }
/** * Get portal module and run module start checks * * @param array $row Module row * * @return mixed False if one of the module checks failed, the module * object if checks were successful */ public function get_portal_module($row) { // Do not try to load non-existent or disabled modules if ($row['module_status'] == self::B3_MODULE_DISABLED || !is_object($module = $this->portal_helper->get_module($row['module_classname']))) { return false; } // Check if module shouldn't be loaded if ($this->check_column_disabled($row)) { return false; } /** * Check for permissions before loading anything * the default group of a user always defines his/her permission */ return $this->check_group_access($row) ? $module : false; }