/** * get commands * * Depends on permissions * * @param int $a_ref_id Reference id of course link * * this method returns an array of all possible commands/permission combinations * * example: * $commands = array * ( * array("permission" => "read", "cmd" => "view", "lang_var" => "show"), * array("permission" => "write", "cmd" => "edit", "lang_var" => "edit"), * ); */ function _getCommands($a_ref_id) { global $ilAccess; if ($ilAccess->checkAccess('write', '', $a_ref_id)) { // Only local (reference specific commands) $commands = array(array("permission" => "visible", "cmd" => "", "lang_var" => "show", "default" => true), array("permission" => "write", "cmd" => "editReference", "lang_var" => "edit")); } else { include_once './Modules/Category/classes/class.ilObjCategoryAccess.php'; $commands = ilObjCategoryAccess::_getCommands(); } return $commands; }
/** * initialisation */ function init() { $this->static_link_enabled = true; $this->delete_enabled = true; $this->cut_enabled = true; $this->copy_enabled = true; $this->subscribe_enabled = true; $this->link_enabled = false; $this->payment_enabled = false; $this->info_screen_enabled = true; $this->type = "cat"; $this->gui_class_name = "ilobjcategorygui"; include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDSubstitution.php'; $this->substitutions = ilAdvancedMDSubstitution::_getInstanceByObjectType($this->type); if ($this->substitutions->isActive()) { $this->substitutions_enabled = true; } // general commands array include_once './Modules/Category/classes/class.ilObjCategoryAccess.php'; $this->commands = ilObjCategoryAccess::_getCommands(); }