36    public function __construct($a_data, $a_id, $a_call_by_reference = 
true, $a_prepare_output = 
true)
 
   40        $this->ctrl = 
$DIC->ctrl();
 
   41        $this->rbacsystem = 
$DIC->rbac()->system();
 
   42        $this->
error = $DIC[
"ilErr"];
 
   43        $this->access = 
$DIC->access();
 
   44        $this->tabs = 
$DIC->tabs();
 
   45        $this->lng = 
$DIC->language();
 
   47        $this->tpl = 
$DIC[
"tpl"];
 
   48        $this->toolbar = 
$DIC->toolbar();
 
   49        $this->
user = $DIC->user();
 
   50        $ilCtrl = 
$DIC->ctrl();
 
   52        $this->tool_context = 
$DIC->globalScreen()->tool()->context();
 
   57        $this->lng->loadLanguageModule(
'skmg');
 
   61        $ilCtrl->saveParameter($this, 
"obj_id");
 
   76        $next_class = $this->ctrl->getNextClass($this);
 
   77        $cmd = $this->ctrl->getCmd();
 
   82        if (!
$rbacsystem->checkAccess(
"visible,read", $this->object->getRefId())) {
 
   83            $ilErr->raiseError($this->lng->txt(
'no_permission'), 
$ilErr->WARNING);
 
   86        switch ($next_class) {
 
   87            case 'ilskillrootgui':
 
   89                $skrt_gui->setParentGUI($this);
 
   90                $ret = $this->ctrl->forwardCommand($skrt_gui);
 
   93            case 'ilskillcategorygui':
 
   94                $this->tabs_gui->activateTab(
"skills");
 
   96                $scat_gui->setParentGUI($this);
 
   97                $this->
showTree(
false, $scat_gui, 
"listItems");
 
   98                $ret = $this->ctrl->forwardCommand($scat_gui);
 
  101            case 'ilbasicskillgui':
 
  102                $this->tabs_gui->activateTab(
"skills");
 
  104                $skill_gui->setParentGUI($this);
 
  105                $this->
showTree(
false, $skill_gui, 
"edit");
 
  106                $ret = $this->ctrl->forwardCommand($skill_gui);
 
  109            case 'ilskilltemplatecategorygui':
 
  110                $this->tabs_gui->activateTab(
"skill_templates");
 
  112                $sctp_gui->setParentGUI($this);
 
  113                $this->
showTree(((
int) $_GET[
"tref_id"] == 0), $sctp_gui, 
"listItems");
 
  114                $ret = $this->ctrl->forwardCommand($sctp_gui);
 
  117            case 'ilbasicskilltemplategui':
 
  118                $this->tabs_gui->activateTab(
"skill_templates");
 
  120                $sktp_gui->setParentGUI($this);
 
  121                $this->
showTree(((
int) $_GET[
"tref_id"] == 0), $sktp_gui, 
"edit");
 
  122                $ret = $this->ctrl->forwardCommand($sktp_gui);
 
  125            case 'ilskilltemplatereferencegui':
 
  126                $this->tabs_gui->activateTab(
"skills");
 
  128                $sktr_gui->setParentGUI($this);
 
  129                $this->
showTree(
false, $sktr_gui, 
"listItems");
 
  130                $ret = $this->ctrl->forwardCommand($sktr_gui);
 
  133            case "ilskillprofilegui":
 
  134                $ilTabs->activateTab(
"profiles");
 
  136                $ret = $this->ctrl->forwardCommand($skprof_gui);
 
  139            case 'ilpermissiongui':
 
  140                $this->tabs_gui->activateTab(
'permissions');
 
  142                $ret = $this->ctrl->forwardCommand($perm_gui);
 
  146                $this->tabs_gui->activateTab(
'export');
 
  148                $exp_gui->addFormat(
"xml");
 
  150                $ret = $this->ctrl->forwardCommand($exp_gui);
 
  154                if (!$cmd || $cmd == 
'view') {
 
  158                if ($cmd == 
"showTree") {
 
  159                    $this->
showTree($_GET[
"templates_tree"]);
 
  180        if (
$rbacsystem->checkAccess(
"visible,read", $this->object->getRefId())) {
 
  181            $this->tabs_gui->addTab(
 
  183                $lng->txt(
"skmg_skills"),
 
  184                $this->ctrl->getLinkTarget($this, 
"editSkills")
 
  187            $this->tabs_gui->addTab(
 
  189                $lng->txt(
"skmg_skill_templates"),
 
  190                $this->ctrl->getLinkTarget($this, 
"editSkillTemplates")
 
  193            $this->tabs_gui->addTab(
 
  195                $lng->txt(
"skmg_skill_profiles"),
 
  196                $this->ctrl->getLinkTargetByClass(
"ilskillprofilegui")
 
  199            $this->tabs_gui->addTab(
 
  201                $lng->txt(
"settings"),
 
  202                $this->ctrl->getLinkTarget($this, 
"editSettings")
 
  205            if ($ilAccess->checkAccess(
"write", 
"", $this->object->getRefId())) {
 
  206                $this->tabs_gui->addTab(
 
  209                    $this->ctrl->getLinkTargetByClass(
"ilexportgui", 
"")
 
  214                $this->tabs_gui->addTab(
 
  217                    $this->ctrl->getLinkTarget($this, 
"test")
 
  222        if (
$rbacsystem->checkAccess(
'edit_permission', $this->object->getRefId())) {
 
  223            $this->tabs_gui->addTab(
 
  225                $lng->txt(
"perm_settings"),
 
  226                $this->ctrl->getLinkTargetByClass(
'ilpermissiongui', 
"perm")
 
  240        $ilTabs->activateTab(
"settings");
 
  243        $enable_skmg = $skmg_set->isActivated();
 
  246        $form->setFormAction($ilCtrl->getFormAction($this));
 
  247        $form->setTitle(
$lng->txt(
"skmg_settings"));
 
  251            $lng->txt(
"skmg_enable_skmg"),
 
  254        $cb_prop->setValue(
"1");
 
  255        $cb_prop->setChecked($enable_skmg);
 
  256        $form->addItem($cb_prop);
 
  260            $lng->txt(
"skmg_hide_profile_self_eval"),
 
  261            "hide_profile_self_eval" 
  263        $cb_prop->setValue(
"1");
 
  264        $cb_prop->setInfo(
$lng->txt(
"skmg_hide_profile_self_eval_info"));
 
  265        $cb_prop->setChecked($skmg_set->getHideProfileBeforeSelfEval());
 
  266        $form->addItem($cb_prop);
 
  270            $lng->txt(
"skmg_local_assignment_profiles"),
 
  271            "local_assignment_profiles" 
  273        $cb_prop->setValue(
"1");
 
  274        $cb_prop->setChecked($skmg_set->getLocalAssignmentOfProfiles());
 
  275        $form->addItem($cb_prop);
 
  279            $lng->txt(
"skmg_allow_local_profiles"),
 
  280            "allow_local_profiles" 
  282        $cb_prop->setValue(
"1");
 
  283        $cb_prop->setInfo(
$lng->txt(
"skmg_allow_local_profiles_info"));
 
  284        $cb_prop->setChecked($skmg_set->getAllowLocalProfiles());
 
  285        $form->addItem($cb_prop);
 
  289            $form->addCommandButton(
"saveSettings", 
$lng->txt(
"save"));
 
  292        $this->tpl->setContent($form->getHTML());
 
  308        $skmg_set->activate((
int) 
$_POST[
"enable_skmg"]);
 
  309        $skmg_set->setHideProfileBeforeSelfEval((
int) 
$_POST[
"hide_profile_self_eval"]);
 
  310        $skmg_set->setLocalAssignmentOfProfiles((
int) 
$_POST[
"local_assignment_profiles"]);
 
  311        $skmg_set->setAllowLocalProfiles((
int) 
$_POST[
"allow_local_profiles"]);
 
  313        ilUtil::sendSuccess($this->lng->txt(
"settings_saved"), 
true);
 
  315        $ilCtrl->redirect($this, 
"editSettings");
 
  328        $ilTabs->activateTab(
"skills");
 
  330        $ilCtrl->setParameterByClass(
"ilobjskillmanagementgui", 
"obj_id", $this->skill_tree->getRootId());
 
  331        $ilCtrl->redirectByClass(
"ilskillrootgui", 
"listSkills");
 
  343        if (is_array(
$_POST[
"title"])) {
 
  344            foreach (
$_POST[
"title"] as $id => $title) {
 
  346                if (is_object($node_obj)) {
 
  352                ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"), 
true);
 
  355        $ilCtrl->redirect($this, 
"editSkills");
 
  366        if (is_array(
$_POST[
"title"])) {
 
  367            foreach (
$_POST[
"title"] as $id => $title) {
 
  369                if (is_object($node_obj)) {
 
  375                ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"), 
true);
 
  378        $ilCtrl->redirect($this, 
"editSkillTemplates");
 
  387        $_GET[
"skexpand"] = 
"";
 
  388        $n_id = (
$_GET[
"obj_id"] > 0)
 
  390            : $this->skill_tree->readRootId();
 
  391        $stree = $this->skill_tree->getSubTree($this->skill_tree->getNodeData($n_id));
 
  393        foreach ($stree as 
$n) {
 
  394            $n_arr[] = 
$n[
"child"];
 
  405        $_GET[
"skexpand"] = 
"";
 
  406        $n_id = (
$_GET[
"obj_id"] > 0)
 
  408            : $this->skill_tree->readRootId();
 
  409        $stree = $this->skill_tree->getSubTree($this->skill_tree->getNodeData($n_id));
 
  411        foreach ($stree as 
$n) {
 
  412            if (in_array(
$n[
"child"], $old) && 
$n[
"child"] != $n_id) {
 
  413                $k = array_search(
$n[
"child"], $old);
 
  432        if (!isset(
$_POST[
"id"])) {
 
  433            $this->
ilias->raiseError($this->lng->txt(
"no_checkbox"), $this->ilias->error_obj->MESSAGE);
 
  436        $ilTabs->clearTargets();
 
  440        $cskill_ids = array();
 
  441        foreach (
$_POST[
"id"] as $id) {
 
  443                if ($mode == 
"templates") {
 
  444                    $this->
ilias->raiseError(
"Skill Deletion - type mismatch.", $this->
ilias->error_obj->MESSAGE);
 
  453                $cskill_ids[] = array(
"skill_id" => $skill_id, 
"tref_id" => $tref_id);
 
  456                if ($mode == 
"basic") {
 
  457                    $this->
ilias->raiseError(
"Skill Deletion - type mismatch.", $this->
ilias->error_obj->MESSAGE);
 
  462                    $cskill_ids[] = array(
"skill_id" => $id, 
"tref_id" => $tref_id);
 
  469        if ($mode == 
"basic" || $mode == 
"templates") {
 
  471            $usages = $u->getAllUsagesInfoOfSubtrees($cskill_ids);
 
  472            if (count($usages) > 0) {
 
  474                foreach ($usages as $k => $usage) {
 
  476                    $html .= $tab->getHTML() . 
"<br/><br/>";
 
  478                $tpl->setContent($html);
 
  479                $ilCtrl->saveParameter($a_gui, 
"tmpmode");
 
  480                $ilToolbar->addButton(
 
  482                    $ilCtrl->getLinkTarget($a_gui, 
"cancelDelete")
 
  488            $this->
ilias->raiseError(
"Skill Deletion - type mismatch.", $this->
ilias->error_obj->MESSAGE);
 
  496        $ilCtrl->setParameter($a_gui, 
"tmpmode", 
$_GET[
"tmpmode"]);
 
  497        $a_form_action = $this->ctrl->getFormAction($a_gui);
 
  498        $confirmation_gui->setFormAction($a_form_action);
 
  499        $confirmation_gui->setHeaderText($this->lng->txt(
"info_delete_sure"));
 
  502        foreach (
$_POST[
"id"] as $id) {
 
  505                $obj_title = (!in_array($node_obj->getType(), [
"sktp", 
"sctp"]))
 
  506                    ? $node_obj->getTitle()
 
  507                    : $node_obj->getTitle() .
 
  509                    $this->lng->txt(
"skmg_count_references") . 
" " .
 
  513                $confirmation_gui->addItem(
 
  522        $confirmation_gui->setCancel(
$lng->txt(
"cancel"), 
"cancelDelete");
 
  523        $confirmation_gui->setConfirm(
$lng->txt(
"confirm"), 
"confirmedDelete");
 
  525        $tpl->setContent($confirmation_gui->getHTML());
 
  533        $this->ctrl->redirect($this, 
"editSkills");
 
  544        foreach (
$_POST[
"id"] as $id) {
 
  547                $node_data = $this->skill_tree->getNodeData($id);
 
  548                if (is_object($obj)) {
 
  551                if ($this->skill_tree->isInTree($id)) {
 
  552                    $this->skill_tree->deleteTree($node_data);
 
  580        $this->setTestSubTabs(
"test");
 
  582        $ilTabs->activateTab(
"test");
 
  586        if ($this->rbacsystem->checkAccess(
'write', 
$_GET[
'ref_id'])) {
 
  587            $this->form->addCommandButton(
"test", 
$lng->txt(
"execute"));
 
  590        $this->form->setTitle(
"getCompletionDateForTriggerRefId()");
 
  591        $this->form->setFormAction($ilCtrl->getFormAction($this));
 
  595        $ti->setMaxLength(200);
 
  596        $ti->setInfo(
"Separate multiple IDs by :");
 
  597        $ti->setValue(
$_POST[
"user_id"]);
 
  598        $this->form->addItem($ti);
 
  602        $ti->setMaxLength(200);
 
  603        $ti->setInfo(
"Separate multiple IDs by :");
 
  604        $ti->setValue(
$_POST[
"ref_id"]);
 
  605        $this->form->addItem($ti);
 
  608        if (isset(
$_POST[
"user_id"])) {
 
  609            $user_ids = explode(
":", 
$_POST[
"user_id"]);
 
  610            $ref_ids = explode(
":", 
$_POST[
"ref_id"]);
 
  611            if (count($user_ids) <= 1) {
 
  612                $user_ids = $user_ids[0];
 
  614            if (count($ref_ids) == 1) {
 
  615                $ref_ids = $ref_ids[0];
 
  616            } elseif (count($ref_ids) == 0) {
 
  620            $result = ilBasicSkill::getCompletionDateForTriggerRefId($user_ids, $ref_ids);
 
  624        $tpl->setContent($this->form->getHTML() . 
$result);
 
  640        $this->setTestSubTabs(
"cert");
 
  641        $ilTabs->activateTab(
"test");
 
  645        if ($this->rbacsystem->checkAccess(
'write', 
$_GET[
'ref_id'])) {
 
  646            $this->form->addCommandButton(
"testCert", 
$lng->txt(
"execute"));
 
  649        $this->form->setTitle(
"checkUserCertificateForTriggerRefId()");
 
  650        $this->form->setFormAction($ilCtrl->getFormAction($this));
 
  654        $ti->setMaxLength(200);
 
  655        $ti->setInfo(
"Separate multiple IDs by :");
 
  656        $ti->setValue(
$_POST[
"user_id"]);
 
  657        $this->form->addItem($ti);
 
  661        $ti->setMaxLength(200);
 
  662        $ti->setInfo(
"Separate multiple IDs by :");
 
  663        $ti->setValue(
$_POST[
"ref_id"]);
 
  664        $this->form->addItem($ti);
 
  667        if (isset(
$_POST[
"user_id"])) {
 
  668            $user_ids = explode(
":", 
$_POST[
"user_id"]);
 
  669            $ref_ids = explode(
":", 
$_POST[
"ref_id"]);
 
  670            if (count($user_ids) <= 1) {
 
  671                $user_ids = $user_ids[0];
 
  673            if (count($ref_ids) == 1) {
 
  674                $ref_ids = $ref_ids[0];
 
  675            } elseif (count($ref_ids) == 0) {
 
  679            $result = ilBasicSkill::checkUserCertificateForTriggerRefId($user_ids, $ref_ids);
 
  683        $tpl->setContent($this->form->getHTML() . 
$result);
 
  699        $this->setTestSubTabs(
"all_cert");
 
  700        $ilTabs->activateTab(
"test");
 
  704        if ($this->rbacsystem->checkAccess(
'write', 
$_GET[
'ref_id'])) {
 
  705            $this->form->addCommandButton(
"testAllCert", 
$lng->txt(
"execute"));
 
  708        $this->form->setTitle(
"getTriggerOfAllCertificates()");
 
  709        $this->form->setFormAction($ilCtrl->getFormAction($this));
 
  713        $ti->setMaxLength(200);
 
  714        $ti->setInfo(
"Separate multiple IDs by :");
 
  715        $ti->setValue(
$_POST[
"user_id"]);
 
  716        $this->form->addItem($ti);
 
  719        if (isset(
$_POST[
"user_id"])) {
 
  720            $user_ids = explode(
":", 
$_POST[
"user_id"]);
 
  721            $ref_ids = explode(
":", 
$_POST[
"ref_id"]);
 
  722            if (count($user_ids) <= 1) {
 
  723                $user_ids = $user_ids[0];
 
  726            $result = ilBasicSkill::getTriggerOfAllCertificates($user_ids);
 
  730        $tpl->setContent($this->form->getHTML() . 
$result);
 
  746        $this->setTestSubTabs(
"levels");
 
  747        $ilTabs->activateTab(
"test");
 
  751        if ($this->rbacsystem->checkAccess(
'write', 
$_GET[
'ref_id'])) {
 
  752            $this->form->addCommandButton(
"testLevels", 
$lng->txt(
"execute"));
 
  755        $this->form->setTitle(
"getTriggerOfAllCertificates()");
 
  756        $this->form->setFormAction($ilCtrl->getFormAction($this));
 
  760        $ti->setMaxLength(200);
 
  761        $ti->setValue(
$_POST[
"ref_id"]);
 
  762        $this->form->addItem($ti);
 
  765        if (isset(
$_POST[
"ref_id"])) {
 
  766            $result = ilBasicSkill::getSkillLevelsForTrigger(
$_POST[
"ref_id"]);
 
  770        $tpl->setContent($this->form->getHTML() . 
$result);
 
  787            "getCompletionDateForTriggerRefId",
 
  788            $ilCtrl->getLinkTarget($this, 
"test")
 
  793            "checkUserCertificateForTriggerRefId",
 
  794            $ilCtrl->getLinkTarget($this, 
"testCert")
 
  799            "getTriggerOfAllCertificates",
 
  800            $ilCtrl->getLinkTarget($this, 
"testAllCert")
 
  805            "getSkillLevelsForTrigger",
 
  806            $ilCtrl->getLinkTarget($this, 
"testLevels")
 
  809        $ilTabs->activateSubtab($a_act);
 
  826        $ilTabs->activateTab(
"skill_templates");
 
  827        $ilCtrl->setParameterByClass(
"ilobjskillmanagementgui", 
"obj_id", $this->skill_tree->getRootId());
 
  828        $ilCtrl->redirectByClass(
"ilskillrootgui", 
"listTemplates");
 
  838    public function showTree($a_templates, $a_gui = 
"", $a_gui_cmd = 
"")
 
  846            if (
$_GET[
"obj_id"] == 
"" || 
$_GET[
"obj_id"] == 1) {
 
  850            if (
$_GET[
"obj_id"] > 1) {
 
  851                $path = $this->skill_tree->getPathId(
$_GET[
"obj_id"]);
 
  858        $ilCtrl->setParameter($this, 
"templates_tree", $a_templates);
 
  867        if (!$exp->handleCommand()) {
 
  868            $tpl->setLeftNavContent($exp->getHTML());
 
An exception for terminatinating execution or to throw for unit testing.
error($a_errmsg)
set error message @access public
Basic skill template GUI class.
Confirmation screen class.
Export User Interface Class.
Skill management main GUI class.
testAllCert()
Test getTriggerOfAllCertificates.
editSettings()
Edit news settings.
__construct($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
Contructor.
saveAllTitles($a_succ_mess=true)
Save all titles of chapters/scos/pages.
cancelDelete()
cancel delete
confirmedDelete()
Delete chapters/scos/pages.
setTestSubtabs($a_act)
Set test subtabs.
expandAll($a_redirect=true)
Expand all.
saveSettings()
Save skill management settings.
executeCommand()
Execute command.
saveAllTemplateTitles($a_succ_mess=true)
Save all titles of chapters/scos/pages.
testLevels()
Test getSkillLevelsForTrigger.
deleteNodes($a_gui)
confirm deletion screen of skill tree nodes
collapseAll($a_redirect=true)
Collapse all.
showTree($a_templates, $a_gui="", $a_gui_cmd="")
Show Editing Tree.
testCert()
Test checkUserCertificateForTriggerRefId.
editSkillTemplates()
Edit skill templates.
test()
Test getCompletionDateForTriggerRefId.
Class ilObjectGUI Basic methods of all Output classes.
prepareOutput($a_show_subobjects=true)
prepare output
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
Skill category GUI class.
Skill management settings.
Skill template category GUI class.
Skill template reference GUI class.
static _lookupTrefIdsForTemplateId($a_tid)
Get all tref ids for a template id.
static _lookupTrefIdsForTopTemplateId($a_template_id)
Lookup tref ids for template id.
static _lookupTemplateId($a_obj_id)
Lookup template ID.
Explorer class that works on tree objects (Services/Tree)
Explorer class that works on tree objects (Services/Tree)
static getInstance($a_id=0)
static _writeTitle($a_obj_id, $a_title)
Write Title.
static _lookupType($a_obj_id)
Lookup Type.
TableGUI class for skill usages.
This class represents a text property in a property form.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
redirection script todo: (a better solution should control the processing via a xml file)