5require_once 
"./Services/Object/classes/class.ilObject2GUI.php";
 
    6include_once(
'./Modules/WebResource/classes/class.ilParameterAppender.php');
 
    7require_once 
'Services/LinkChecker/interfaces/interface.ilLinkCheckerGUIRowHandling.php';
 
   43        $ilCtrl = 
$DIC[
'ilCtrl'];
 
   44        $ilTabs = 
$DIC[
'ilTabs'];
 
   46        $ilAccess = 
$DIC[
'ilAccess'];
 
   50        if (
$_GET[
"baseClass"] == 
'ilLinkResourceHandlerGUI') {
 
   52            $ilCtrl->saveParameter($this, 
'view_mode');
 
   56        $this->lng->loadLanguageModule(
"webr");
 
   58        $next_class = $this->ctrl->getNextClass($this);
 
   59        $cmd = $this->ctrl->getCmd();
 
   61        switch ($next_class) {
 
   62            case "ilinfoscreengui":
 
   67            case 'ilobjectmetadatagui':
 
   70                $ilTabs->activateTab(
'id_meta_data');
 
   71                include_once 
'Services/Object/classes/class.ilObjectMetaDataGUI.php';
 
   73                $this->ctrl->forwardCommand($md_gui);
 
   76            case 'ilpermissiongui':
 
   78                $ilTabs->activateTab(
'id_permissions');
 
   79                include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
 
   81                $ret = &$this->ctrl->forwardCommand($perm_gui);
 
   84            case 'ilobjectcopygui':
 
   86                include_once 
'./Services/Object/classes/class.ilObjectCopyGUI.php';
 
   89                $this->ctrl->forwardCommand($cp);
 
   94                $this->tabs_gui->setTabActive(
'export');
 
   95                include_once 
'./Services/Export/classes/class.ilExportGUI.php';
 
   97                $exp->addFormat(
'xml');
 
   98                $this->ctrl->forwardCommand($exp);
 
  101            case "ilcommonactiondispatchergui":
 
  104                $this->ctrl->forwardCommand($gui);
 
  107            case "ilpropertyformgui":
 
  108                include_once 
'./Services/Form/classes/class.ilPropertyFormGUI.php';
 
  110                $this->ctrl->forwardCommand($this->form);
 
  113            case "ilinternallinkgui":
 
  114                $this->lng->loadLanguageModule(
"content");
 
  115                require_once(
"./Services/Link/classes/class.ilInternalLinkGUI.php");
 
  117                $link_gui->filterLinkType(
"PageObject");
 
  118                $link_gui->filterLinkType(
"GlossaryItem");
 
  119                $link_gui->filterLinkType(
"RepositoryItem");
 
  120                $link_gui->setFilterWhiteList(
true);
 
  121                $ilCtrl->forwardCommand($link_gui);
 
  126                    $this->ctrl->setCmd(
"view");
 
  128                parent::executeCommand();
 
  133            include_once(
'Services/MetaData/classes/class.ilMDUtils.php');
 
  155        $ilCtrl = 
$DIC[
'ilCtrl'];
 
  158        $valid = $this->form->checkInput();
 
  160            && $this->form->getInput(
'tar_mode_type') == 
'single') {
 
  163        } elseif (
$valid && $this->form->getInput(
'tar_mode_type') == 
'list') {
 
  164            $this->
initList(self::LINK_MOD_CREATE, 0);
 
  169            $this->form->setValuesByPost();
 
  170            $this->tpl->setContent($this->form->getHTML());
 
  176        if ($this->form->getInput(
'tar_mode_type') == 
'single') {
 
  178            $this->link->setLinkResourceId($a_new_object->
getId());
 
  179            $link_id = $this->link->add();
 
  180            $this->link->updateValid(
true);
 
  182            ilUtil::sendSuccess($this->lng->txt(
'webr_link_added'));
 
  185        if ($this->form->getInput(
'tar_mode_type') == 
'list') {
 
  187            $this->list->setListResourceId($a_new_object->
getId());
 
  190            ilUtil::sendSuccess($this->lng->txt(
'webr_list_added'));
 
  194        if ($this->id_type == self::WORKSPACE_NODE_ID) {
 
  195            $this->ctrl->redirect($this, 
"editLinks");
 
  200                $a_new_object->
getRefId() . 
"&cmd=switchViewMode&switch_mode=2");
 
  213        $ilTabs = 
$DIC[
'ilTabs'];
 
  216        $ilTabs->activateTab(
'id_settings');
 
  219        $this->tpl->setContent($this->form->getHTML());
 
  231        $ilTabs = 
$DIC[
'ilTabs'];
 
  234        $ilTabs->activateTab(
'id_settings');
 
  237        $valid = $this->form->checkInput();
 
  240            $this->
initList(self::LINK_MOD_EDIT_LIST, $this->object->getId());
 
  241            $this->list->update();
 
  244            $this->
object->setTitle($this->form->getInput(
'title'));
 
  245            $this->
object->setDescription($this->form->getInput(
'desc'));
 
  246            $this->
object->update();
 
  249            include_once 
'./Services/Container/classes/class.ilContainerSortingSettings.php';
 
  251            $sort->setSortMode($this->form->getInput(
'sor'));
 
  255            $obj_service->commonSettings()->legacyForm($this->form, $this->
object)->saveTileImage();
 
  258            ilUtil::sendSuccess($this->lng->txt(
'settings_saved'), 
true);
 
  259            $this->ctrl->redirect($this, 
'settings');
 
  262        $this->form->setValuesByPost();
 
  264        $this->tpl->setContent($this->form->getHTML());
 
  276        include_once 
'./Services/Form/classes/class.ilPropertyFormGUI.php';
 
  278        $this->form->setFormAction($this->ctrl->getFormAction($this, 
'saveSettings'));
 
  281            $this->form->setTitle($this->lng->txt(
'webr_edit_settings'));
 
  284            $tit = 
new ilTextInputGUI($this->lng->txt(
'webr_list_title'), 
'title');
 
  285            $tit->setValue($this->object->getTitle());
 
  286            $tit->setRequired(
true);
 
  288            $tit->setMaxLength(127);
 
  289            $this->form->addItem($tit);
 
  293            $des->setValue($this->object->getDescription());
 
  296            $this->form->addItem($des);
 
  299            $section->setTitle($this->lng->txt(
'obj_presentation'));
 
  303            $obj_service->commonSettings()->legacyForm($this->form, $this->
object)->addTileImage();
 
  306            include_once 
'./Services/Container/classes/class.ilContainerSortingSettings.php';
 
  307            include_once 
'./Services/Container/classes/class.ilContainer.php';
 
  310            $sor->setRequired(
true);
 
  311            include_once 
'./Services/Container/classes/class.ilContainerSortingSettings.php';
 
  315                $this->lng->txt(
'webr_sort_title'),
 
  318            $sor->addOption($opt);
 
  321                $this->lng->txt(
'webr_sort_manual'),
 
  324            $sor->addOption($opm);
 
  325            $this->form->addItem($sor);
 
  327            $this->form->setTitle($this->lng->txt(
'obj_presentation'));
 
  331            $tit->setValue($this->object->getTitle());
 
  332            $this->form->addItem($tit);
 
  336            $des->setValue($this->object->getDescription());
 
  337            $this->form->addItem($des);
 
  340            $obj_service->commonSettings()->legacyForm($this->form, $this->
object)->addTileImage();
 
  343        $this->form->addCommandButton(
'saveSettings', $this->lng->txt(
'save'));
 
  344        $this->form->addCommandButton(
'view', $this->lng->txt(
'cancel'));
 
  356        $ilCtrl = 
$DIC[
'ilCtrl'];
 
  361        if (!(
int) 
$_GET[
'link_id']) {
 
  363            $ilCtrl->redirect($this, 
'view');
 
  368        $this->tpl->setContent($this->form->getHTML());
 
  379        $ilCtrl = 
$DIC[
'ilCtrl'];
 
  382        $valid = $this->form->checkInput();
 
  383        if ($this->
checkLinkInput(self::LINK_MOD_EDIT, 
$valid, $this->object->getId(), (
int) $_REQUEST[
'link_id'])) {
 
  384            $this->link->setLinkId((
int) $_REQUEST[
'link_id']);
 
  385            $this->link->update();
 
  387                $this->dynamic->add((
int) $_REQUEST[
'link_id']);
 
  391                $this->
object->setTitle($this->form->getInput(
'title'));
 
  392                $this->
object->setDescription($this->form->getInput(
'desc'));
 
  393                $this->
object->update();
 
  396            ilUtil::sendSuccess($this->lng->txt(
'settings_saved'), 
true);
 
  397            $ilCtrl->redirect($this, 
'view');
 
  400        $this->form->setValuesByPost();
 
  401        $this->tpl->setContent($this->form->getHTML());
 
  411        $f = 
$DIC->ui()->factory();
 
  412        $r = 
$DIC->ui()->renderer();
 
  415        if ($this->form == 
null) {
 
  419        $form_id = 
'form_' . $this->form->getId();
 
  421        $submit = 
$f->button()->primary($this->lng->txt(
'save'), 
'#')
 
  422            ->withOnLoadCode(
function ($id) use ($form_id) {
 
  423                return "$('#{$id}').click(function() { $('#{$form_id}').submit(); return false; });";
 
  425        $info = 
$f->messageBox()->info($this->lng->txt(
'webr_new_list_info'));
 
  427        $modal = 
$f->modal()->roundtrip(
 
  428            $this->lng->txt(
'webr_new_list'),
 
  429            $f->legacy($r->render($info) . $this->form->getHTML())
 
  431            ->withActionButtons([$submit]);
 
  434        if (isset(
$_POST[
'sbmt']) && 
$_POST[
'sbmt'] == 
'submit') {
 
  435            $modal = $modal->withOnLoad($modal->getShowSignal());
 
  448        $ilCtrl = 
$DIC[
'ilCtrl'];
 
  453        $valid = $this->form->checkInput();
 
  456            $this->
object->setTitle($this->form->getInput(
'lti'));
 
  457            $this->
object->setDescription($this->form->getInput(
'tde'));
 
  458            $this->
object->update();
 
  461            $this->
initList(self::LINK_MOD_SET_LIST, $this->object->getId());
 
  463            ilUtil::sendSuccess($this->lng->txt(
'webr_list_set'), 
true);
 
  464            $ilCtrl->redirect($this, 
'view');
 
  469        $this->form->setValuesByPost();
 
  483        $this->tpl->setContent($this->form->getHTML());
 
  494        $ilCtrl = 
$DIC[
'ilCtrl'];
 
  499        $valid = $this->form->checkInput();
 
  502            $link_id = $this->link->add();
 
  503            $this->link->updateValid(
true);
 
  507                $this->dynamic->add($link_id);
 
  509            ilUtil::sendSuccess($this->lng->txt(
'webr_link_added'), 
true);
 
  510            $ilCtrl->redirect($this, 
'view');
 
  514        $this->form->setValuesByPost();
 
  517        $this->tpl->setContent($this->form->getHTML());
 
  528        $ilCtrl = 
$DIC[
'ilCtrl'];
 
  532        $this->ctrl->setParameter($this, 
'link_id', (
int) 
$_GET[
'link_id']);
 
  534        if (!isset(
$_GET[
'param_id'])) {
 
  536            $ilCtrl->redirect($this, 
'view');
 
  539        include_once 
'./Modules/WebResource/classes/class.ilParameterAppender.php';
 
  543        ilUtil::sendSuccess($this->lng->txt(
'links_parameter_deleted'), 
true);
 
  544        $ilCtrl->redirect($this, 
'editLinks');
 
  551        $ilCtrl = 
$DIC[
'ilCtrl'];
 
  555        if (!isset(
$_GET[
'param_id'])) {
 
  557            $ilCtrl->redirect($this, 
'view');
 
  560        include_once 
'./Modules/WebResource/classes/class.ilParameterAppender.php';
 
  564        ilUtil::sendSuccess($this->lng->txt(
'links_parameter_deleted'), 
true);
 
  565        $ilCtrl->redirect($this, 
'view');
 
  577        $ilCtrl = 
$DIC[
'ilCtrl'];
 
  582        if (!is_array(
$_POST[
'ids'])) {
 
  584            $ilCtrl->redirect($this, 
'view');
 
  589        foreach (
$_POST[
'ids'] as $link_id) {
 
  593            if (
$_POST[
'tar_' . $link_id . 
'_ajax_type'] &&
 
  594                $_POST[
'tar_' . $link_id . 
'_ajax_id']) {
 
  596                    $_POST[
'tar_' . $link_id . 
'_ajax_type'] . 
'|' .
 
  597                    $_POST[
'tar_' . $link_id . 
'_ajax_id'];
 
  601            if (!strlen(
$data[
'title'])) {
 
  602                $invalid[] = $link_id;
 
  605            if (!strlen(
$data[
'tar'])) {
 
  606                $invalid[] = $link_id;
 
  610                $invalid[] = $link_id;
 
  614                $invalid[] = $link_id;
 
  619        if (count($invalid)) {
 
  621            $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.webr_manage.html', 
'Modules/WebResource');
 
  623            include_once 
'./Modules/WebResource/classes/class.ilWebResourceEditableLinkTableGUI.php';
 
  625            $table->setInvalidLinks($invalid);
 
  626            $table->parseSelectedLinks(
$_POST[
'ids']);
 
  627            $table->updateFromPost();
 
  628            $this->tpl->setVariable(
'TABLE_LINKS', $table->getHTML());
 
  632        include_once 
'./Modules/WebResource/classes/class.ilLinkResourceItems.php';
 
  636        include_once 
'./Services/Form/classes/class.ilFormPropertyGUI.php';
 
  637        include_once 
'./Services/Form/classes/class.ilLinkInputGUI.php';
 
  638        foreach (
$_POST[
'ids'] as $link_id) {
 
  643            $links->setLinkId($link_id);
 
  647            $links->setActiveStatus((
int) 
$data[
'act']);
 
  648            $links->setDisableCheckStatus((
int) 
$data[
'che']);
 
  649            $links->setLastCheckDate($orig[
'last_check']);
 
  650            $links->setValidStatus((
int) 
$data[
'vali']);
 
  664                $this->
object->update();
 
  670        ilUtil::sendSuccess($this->lng->txt(
'settings_saved'), 
true);
 
  671        $ilCtrl->redirect($this, 
'view');
 
  681        include_once 
'./Modules/WebResource/classes/class.ilLinkResourceItems.php';
 
  684        $values = $link->getItem($a_link_id);
 
  689        $this->form->setValuesByArray(
 
  691                'title' => $values[
'title'],
 
  692                'tar' => $values[
'target'],
 
  693                'desc' => $values[
'description'],
 
  694                'act' => (
int) $values[
'active'],
 
  695                'che' => (
int) $values[
'disable_check'],
 
  696                'vali' => (
int) $values[
'valid']
 
  707    protected function initList(
int $a_mode, 
int $a_webr_id = 0)
 
  709        if ($a_mode == self::LINK_MOD_CREATE || $a_mode == self::LINK_MOD_EDIT_LIST) {
 
  711            $this->list->setTitle($this->form->getInput(
'title'));
 
  712            $this->list->setDescription($this->form->getInput(
'desc'));
 
  715        if ($a_mode == self::LINK_MOD_SET_LIST) {
 
  717            $this->list->setTitle($this->form->getInput(
'lti'));
 
  718            $this->list->setDescription($this->form->getInput(
'tde'));
 
  731    protected function checkLinkInput($a_mode, $a_valid, $a_webr_id = 0, $a_link_id = 0)
 
  735        $link_input = $this->form->getInput(
'tar');
 
  737        include_once 
'./Modules/WebResource/classes/class.ilLinkResourceItems.php';
 
  740        $this->link->setTitle($this->form->getInput(
'title'));
 
  741        $this->link->setDescription($this->form->getInput(
'desc'));
 
  742        $this->link->setDisableCheckStatus($this->form->getInput(
'che'));
 
  745        if ($a_mode == self::LINK_MOD_CREATE) {
 
  746            $this->link->setActiveStatus(
true);
 
  748            $this->link->setActiveStatus($this->form->getInput(
'act'));
 
  751        if ($a_mode == self::LINK_MOD_EDIT) {
 
  752            $this->link->setValidStatus($this->form->getInput(
'vali'));
 
  754            $this->link->setValidStatus(
true);
 
  762        $this->dynamic->setName($this->form->getInput(
'nam'));
 
  763        $this->dynamic->setValue($this->form->getInput(
'val'));
 
  764        if (!$this->dynamic->validate()) {
 
  765            switch ($this->dynamic->getErrorCode()) {
 
  767                    $this->form->getItemByPostVar(
'nam')->setAlert($this->lng->txt(
'links_no_name_given'));
 
  771                    $this->form->getItemByPostVar(
'val')->setAlert($this->lng->txt(
'links_no_value_given'));
 
  778            $this->dynamic = 
null;
 
  793        $ilTabs = 
$DIC[
'ilTabs'];
 
  795        $ilTabs->activateTab(
"id_content");
 
  797        include_once 
'./Services/Form/classes/class.ilPropertyFormGUI.php';
 
  803                $this->ctrl->setParameter($this, 
'new_type', 
'webr');
 
  804                $this->form->setTitle($this->lng->txt(
'webr_new_link'));
 
  805                $this->form->setTableWidth(
'600px');
 
  808                $this->form->addCommandButton(
'save', $this->lng->txt(
'webr_add'));
 
  809                $this->form->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
 
  814                $this->form->setTitle($this->lng->txt(
'webr_new_link'));
 
  817                $this->form->addCommandButton(
'saveAddLink', $this->lng->txt(
'webr_add'));
 
  818                $this->form->addCommandButton(
'view', $this->lng->txt(
'cancel'));
 
  823                $this->ctrl->setParameter($this, 
'link_id', (
int) $_REQUEST[
'link_id']);
 
  824                $this->form->setTitle($this->lng->txt(
'webr_edit'));
 
  827                $this->form->addCommandButton(
'updateLink', $this->lng->txt(
'save'));
 
  828                $this->form->addCommandButton(
'view', $this->lng->txt(
'cancel'));
 
  832        if ($a_mode == self::LINK_MOD_SET_LIST) {
 
  833            $this->form->setValuesByPost();
 
  834            $this->form->setFormAction($this->ctrl->getFormAction($this, 
'saveLinkList'));
 
  835            $this->form->setId(uniqid(
'form'));
 
  838            $title = 
new ilTextInputGUI($this->lng->txt(
'webr_list_title'), 
'lti');
 
  839            $title->setRequired(
true);
 
  841            $title->setMaxLength(127);
 
  842            $this->form->addItem($title);
 
  848            $this->form->addItem($desc);
 
  851            $item->setValue(
'submit');
 
  852            $this->form->addItem($item);
 
  857            $this->form->setFormAction($this->ctrl->getFormAction($this));
 
  867            include_once 
'Services/Form/classes/class.ilLinkInputGUI.php';
 
  869            if ($a_mode == self::LINK_MOD_CREATE) {
 
  872            $tar->setInternalLinkFilterTypes(
 
  880            $tar->setExternalLinkMaxLength(1000);
 
  881            $tar->setInternalLinkFilterTypes(array(
"PageObject", 
"GlossaryItem", 
"RepositoryItem"));
 
  882            $tar->setRequired(
true);
 
  883            $this->form->addItem($tar);
 
  886            $tit = 
new ilTextInputGUI($this->lng->txt(
'webr_link_title'), 
'title');
 
  887            $tit->setRequired(
true);
 
  889            $tit->setMaxLength(127);
 
  890            $this->form->addItem($tit);
 
  896            $this->form->addItem($des);
 
  899            if ($a_mode != self::LINK_MOD_CREATE) {
 
  902                $act->setChecked(
true);
 
  904                $this->form->addItem($act);
 
  909                $this->form->addItem($che);
 
  913            if ($a_mode == self::LINK_MOD_EDIT) {
 
  915                $this->form->addItem($val);
 
  920                $dyn->setInfo($this->lng->txt(
'links_dynamic_info'));
 
  925                    $dyn->addSubItem($ex);
 
  927                    foreach ($links as $id => $link) {
 
  930                        $ptpl = 
new ilTemplate(
'tpl.link_dyn_param_edit.html', 
true, 
true, 
'Modules/WebResource');
 
  932                        $this->ctrl->setParameter($this, 
'param_id', $id);
 
  933                        $ptpl->setVariable(
'LINK_DEL', $this->ctrl->getLinkTarget($this, 
'deleteParameterForm'));
 
  934                        $ptpl->setVariable(
'LINK_TXT', $this->lng->txt(
'delete'));
 
  935                        $p->setHtml($ptpl->get());
 
  936                        $dyn->addSubItem($p);
 
  943                if ($a_mode != self::LINK_MOD_CREATE) {
 
  944                    #$new = new ilCustomInputGUI($this->lng->txt('links_add_param'),''); 
  945                    #$dyn->addSubItem($new); 
  951                $nam->setMaxLength(128);
 
  952                $dyn->addSubItem($nam);
 
  958                $dyn->addSubItem($val);
 
  960                $this->form->addItem($dyn);
 
  973        $ilCtrl = 
$DIC[
'ilCtrl'];
 
  975        $_REQUEST[
'view_mode'] = 
$_GET[
'view_mode'] = (int) 
$_GET[
'switch_mode'];
 
  999        $ilTabs = 
$DIC[
'ilTabs'];
 
 1001        $ilTabs->activateTab(
"id_content");
 
 1005        if (strtolower(
$_GET[
"baseClass"]) == 
"iladministrationgui") {
 
 1009            switch ((
int) $_REQUEST[
'view_mode']) {
 
 1016                    include_once 
'./Services/Container/classes/class.ilContainerSortingSettings.php';
 
 1029        $GLOBALS[
'DIC'][
'tpl']->setPermanentLink($this->object->getType(), $this->object->getRefId());
 
 1042        $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.webr_manage.html', 
'Modules/WebResource');
 
 1045        include_once 
'./Modules/WebResource/classes/class.ilWebResourceEditableLinkTableGUI.php';
 
 1049        include_once 
'./Services/Link/classes/class.ilInternalLinkGUI.php';
 
 1052        $this->tpl->addJavaScript(
"Modules/WebResource/js/intLink.js");
 
 1053        $this->tpl->addJavascript(
"Services/Form/js/Form.js");
 
 1055        $this->tpl->setVariable(
'TABLE_LINKS', $table->getHTML() . $js);
 
 1067        include_once 
'./Modules/WebResource/classes/class.ilWebResourceLinkTableGUI.php';
 
 1071        $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.webr_view.html', 
'Modules/WebResource');
 
 1073        $this->tpl->setVariable(
'LINK_TABLE', $table->getHTML());
 
 1085        include_once 
'./Modules/WebResource/classes/class.ilWebResourceLinkTableGUI.php';
 
 1089        $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.webr_view.html', 
'Modules/WebResource');
 
 1091        $this->tpl->setVariable(
'LINK_TABLE', $table->getHTML());
 
 1102        include_once 
'./Services/Container/classes/class.ilContainerSorting.php';
 
 1104        $sort->savePost((array) 
$_POST[
'position']);
 
 1106        ilUtil::sendSuccess($this->lng->txt(
'settings_saved'), 
true);
 
 1120        include_once 
'./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
 
 1122        $tool->setFormAction($this->ctrl->getFormAction($this));
 
 1124        $f = 
$DIC->ui()->factory();
 
 1125        $r = 
$DIC->ui()->renderer();
 
 1129            $this->checkPermissionBool(
'write')
 
 1132                $this->lng->txt(
'webr_add'),
 
 1133                $this->ctrl->getLinkTarget($this, 
'addLink')
 
 1138            $button = 
$f->button()->standard($this->lng->txt(
'webr_set_to_list'), 
'#')
 
 1139                ->withOnClick($modal->getShowSignal());
 
 1141            $this->tpl->setVariable(
"MODAL", $r->render([$modal]));
 
 1142            $tool->addComponent($button);
 
 1145        $download_button = 
$f->button()->standard(
 
 1146            $this->lng->txt(
'export_html'),
 
 1147            $this->ctrl->getLinkTarget($this, 
'exportHTML')
 
 1149        $tool->addComponent($download_button);
 
 1150        $this->tpl->setVariable($a_tpl_var, $tool->getHTML());
 
 1163        $link_ids = array();
 
 1165        if (is_array(
$_POST[
'link_ids'])) {
 
 1166            $link_ids = 
$_POST[
'link_ids'];
 
 1167        } elseif (isset(
$_GET[
'link_id'])) {
 
 1168            $link_ids = array(
$_GET[
'link_id']);
 
 1171        if (!count($link_ids) > 0) {
 
 1177        include_once 
'./Modules/WebResource/classes/class.ilLinkResourceItems.php';
 
 1180        include_once 
'Services/Utilities/classes/class.ilConfirmationGUI.php';
 
 1182        $confirm->setFormAction($this->ctrl->getFormAction($this, 
'view'));
 
 1183        $confirm->setHeaderText($this->lng->txt(
'webr_sure_delete_items'));
 
 1184        $confirm->setConfirm($this->lng->txt(
'delete'), 
'deleteLinks');
 
 1185        $confirm->setCancel($this->lng->txt(
'cancel'), 
'view');
 
 1187        foreach ($link_ids as $link_id) {
 
 1188            $link = $links->getItem($link_id);
 
 1189            $confirm->addItem(
'link_ids[]', $link_id, $link[
'title']);
 
 1191        $this->tpl->setContent($confirm->getHTML());
 
 1202        $ilCtrl = 
$DIC[
'ilCtrl'];
 
 1206        include_once 
'./Modules/WebResource/classes/class.ilLinkResourceItems.php';
 
 1209        foreach (
$_POST[
'link_ids'] as $link_id) {
 
 1210            $links->delete($link_id);
 
 1212        ilUtil::sendSuccess($this->lng->txt(
'webr_deleted_items'), 
true);
 
 1213        $ilCtrl->redirect($this, 
'view');
 
 1224        $ilCtrl = 
$DIC[
'ilCtrl'];
 
 1228        include_once 
'./Modules/WebResource/classes/class.ilLinkResourceItems.php';
 
 1231        if (!
$_GET[
'link_id']) {
 
 1233            $ilCtrl->redirect($this, 
'view');
 
 1236        $links->setLinkId((
int) 
$_GET[
'link_id']);
 
 1237        $links->updateActive(
false);
 
 1239        ilUtil::sendSuccess($this->lng->txt(
'webr_inactive_success'), 
true);
 
 1240        $ilCtrl->redirect($this, 
'view');
 
 1251        $this->ctrl->setCmd(
"showSummary");
 
 1252        $this->ctrl->setCmdClass(
"ilinfoscreengui");
 
 1263        $ilTabs = 
$DIC[
'ilTabs'];
 
 1268        $ilTabs->activateTab(
'id_info');
 
 1270        include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
 
 1273        $info->enablePrivateNotes();
 
 1276        $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
 
 1278        if ($this->id_type == self::WORKSPACE_NODE_ID) {
 
 1279            $info->addProperty($this->lng->txt(
"perma_link"), $this->getPermanentLinkWidget());
 
 1283        $this->ctrl->forwardCommand($info);
 
 1291        $ilTabs = 
$DIC[
'ilTabs'];
 
 1294        $ilTabs->activateTab(
'id_history');
 
 1296        include_once(
"./Services/History/classes/class.ilHistoryTableGUI.php");
 
 1297        $hist_gui = 
new ilHistoryTableGUI($this, 
"history", $this->object->getId(), $this->object->getType);
 
 1298        $hist_gui->initTable();
 
 1299        $this->tpl->setContent($hist_gui->getHTML());
 
 1312        $this->
object->items_obj->readItem($row[
'page_id']);
 
 1313        $row[
'title'] = $this->
object->items_obj->getTitle();
 
 1315        require_once 
'Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php';
 
 1317        $actions->setSelectionHeaderClass(
'small');
 
 1318        $actions->setItemLinkClass(
'xsmall');
 
 1319        $actions->setListTitle($this->lng->txt(
'actions'));
 
 1321        $this->ctrl->setParameter($this, 
'link_id', $row[
'page_id']);
 
 1323            $this->lng->txt(
'edit'),
 
 1325            $this->ctrl->getLinkTarget($this, 
'editLink')
 
 1327        $this->ctrl->clearParameters($this);
 
 1328        $row[
'action_html'] = 
$actions->getHTML();
 
 1341        $ilias = 
$DIC[
'ilias'];
 
 1344        $ilTabs = 
$DIC[
'ilTabs'];
 
 1347        $ilTabs->activateTab(
'id_link_check');
 
 1350        $this->
object->initLinkResourceItemsObject();
 
 1352        require_once 
'./Services/LinkChecker/classes/class.ilLinkCheckerTableGUI.php';
 
 1356        if ((
bool) $ilias->getSetting(
'cron_web_resource_check')) {
 
 1357            include_once 
'./Services/LinkChecker/classes/class.ilLinkCheckNotify.php';
 
 1358            include_once 
'Services/Form/classes/class.ilPropertyFormGUI.php';
 
 1360            $chb = 
new ilCheckboxInputGUI($this->lng->txt(
'link_check_message_a'), 
'link_check_message');
 
 1363            $chb->setOptionTitle($this->lng->txt(
'link_check_message_b'));
 
 1366            $toolbar->addFormButton($this->lng->txt(
'save'), 
'saveLinkCheck');
 
 1367            $toolbar->setFormAction($this->ctrl->getLinkTarget($this, 
'saveLinkCheck'));
 
 1371        $tgui->setLinkChecker($this->link_checker_obj)
 
 1372             ->setRowHandler($this)
 
 1373             ->setRefreshButton($this->lng->txt(
'refresh'), 
'refreshLinkCheck');
 
 1375        return $tpl->setContent($tgui->prepareHTML()->getHTML() . 
$toolbar->getHTML());
 
 1385        include_once 
'./Services/LinkChecker/classes/class.ilLinkCheckNotify.php';
 
 1388        $link_check_notify->setUserId(
$ilUser->getId());
 
 1389        $link_check_notify->setObjId($this->object->getId());
 
 1391        if (
$_POST[
'link_check_message']) {
 
 1392            ilUtil::sendSuccess($this->lng->txt(
'link_check_message_enabled'));
 
 1393            $link_check_notify->addNotifier();
 
 1395            ilUtil::sendSuccess($this->lng->txt(
'link_check_message_disabled'));
 
 1396            $link_check_notify->deleteNotifier();
 
 1408        $this->
object->initLinkResourceItemsObject();
 
 1411        $this->
object->items_obj->updateValidByCheck();
 
 1413        foreach ($this->link_checker_obj->checkWebResourceLinks() as $invalid) {
 
 1414            $this->
object->items_obj->readItem($invalid[
'page_id']);
 
 1415            $this->
object->items_obj->setActiveStatus(
false);
 
 1416            $this->
object->items_obj->setValidStatus(
false);
 
 1417            $this->
object->items_obj->update(
false);
 
 1420        $this->
object->items_obj->updateLastCheck();
 
 1421        ilUtil::sendSuccess($this->lng->txt(
'link_checker_refreshed'));
 
 1434        include_once 
'./Services/LinkChecker/classes/class.ilLinkChecker.php';
 
 1437        $this->link_checker_obj->setObjId($this->object->getId());
 
 1453        $ilCtrl = 
$DIC[
'ilCtrl'];
 
 1454        $ilTabs = 
$DIC[
'ilTabs'];
 
 1457        switch ($a_active_tab) {
 
 1460                    $this->lng->loadLanguageModule(
'cntr');
 
 1462                    $this->ctrl->setParameter($this, 
'switch_mode', self::VIEW_MODE_VIEW);
 
 1466                        $this->ctrl->getLinkTarget($this, 
'switchViewMode')
 
 1468                    $this->ctrl->setParameter($this, 
'switch_mode', self::VIEW_MODE_MANAGE);
 
 1470                        'id_content_manage',
 
 1471                        $lng->txt(
'cntr_manage'),
 
 1472                        $this->ctrl->getLinkTarget($this, 
'switchViewMode')
 
 1474                    include_once 
'./Modules/WebResource/classes/class.ilLinkResourceItems.php';
 
 1475                    include_once 
'./Services/Container/classes/class.ilContainerSortingSettings.php';
 
 1476                    include_once 
'./Services/Container/classes/class.ilContainer.php';
 
 1479                        $this->ctrl->setParameter($this, 
'switch_mode', self::VIEW_MODE_SORT);
 
 1481                            'id_content_ordering',
 
 1482                            $this->lng->txt(
'cntr_ordering'),
 
 1483                            $this->ctrl->getLinkTarget($this, 
'switchViewMode')
 
 1487                    $ilCtrl->clearParameters($this);
 
 1488                    $ilTabs->activateSubTab($a_active_subtab);
 
 1492        $ilTabs->activateTab(
'id_content');
 
 1504        $ilTabs = 
$DIC[
'ilTabs'];
 
 1506        $ilHelp = 
$DIC[
'ilHelp'];
 
 1508        $ilHelp->setScreenIdComponent(
"webr");
 
 1513                $lng->txt(
"content"),
 
 1514                $this->ctrl->getLinkTarget($this, 
"view")
 
 1524                $lng->txt(
"info_short"),
 
 1525                $this->ctrl->getLinkTarget($this, 
"infoScreen")
 
 1532                $lng->txt(
"settings"),
 
 1533                $this->ctrl->getLinkTarget($this, 
"settings")
 
 1540                $lng->txt(
"history"),
 
 1541                $this->ctrl->getLinkTarget($this, 
"history")
 
 1549                $lng->txt(
"link_check"),
 
 1550                $this->ctrl->getLinkTarget($this, 
"linkChecker")
 
 1555            include_once 
"Services/Object/classes/class.ilObjectMetaDataGUI.php";
 
 1557            $mdtab = $mdgui->getTab();
 
 1561                    $lng->txt(
"meta_data"),
 
 1570                $this->lng->txt(
'export'),
 
 1571                $this->ctrl->getLinkTargetByClass(
'ilexportgui', 
'')
 
 1586        $this->tpl->setLocator();
 
 1589        if ($this->message) {
 
 1602        $ilLocator = 
$DIC[
'ilLocator'];
 
 1604        if (is_object($this->
object)) {
 
 1605            $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this), 
"", $this->object->getRefId(), 
"webr");
 
 1612        include_once 
"Services/Form/classes/class.ilFormPropertyGUI.php";
 
 1613        include_once 
"Services/Form/classes/class.ilLinkInputGUI.php";
 
 1616            include_once(
"./Services/Link/classes/class.ilLink.php");
 
 1619            $parts = explode(
"|", $a_target);
 
 1621            if ($parts[0] == 
'wpage') {
 
 1626                    '&target=wiki_wpage_' . $parts[1]
 
 1630            if ($parts[0] == 
"term") {
 
 1636                    "&target=git_" . $parts[1]
 
 1640            if ($parts[0] == 
"page") {
 
 1652        $obj_id = $this->
object->getId();
 
 1654        include_once 
'./Modules/WebResource/classes/class.ilLinkResourceItems.php';
 
 1657            if (
$url[
"target"]) {
 
 1660                include_once 
'./Modules/WebResource/classes/class.ilParameterAppender.php';
 
 1672        if ($_REQUEST[
"link_id"]) {
 
 1673            $obj_id = $this->
object->getId();
 
 1675            include_once 
'./Modules/WebResource/classes/class.ilLinkResourceItems.php';
 
 1677            $item = $items->getItem($_REQUEST[
"link_id"]);
 
 1678            if ($item[
"target"]) {
 
 1681                include_once 
'./Modules/WebResource/classes/class.ilParameterAppender.php';
 
 1698            require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
 
 1716        $tpl = 
new ilTemplate(
"tpl.export_html.html", 
true, 
true, 
"Modules/WebResource");
 
 1718        include_once 
'./Modules/WebResource/classes/class.ilLinkResourceItems.php';
 
 1720        foreach ($items->getAllItems() as $item) {
 
 1721            if (!$item[
"active"]) {
 
 1727            $tpl->setCurrentBlock(
"link_bl");
 
 1728            $tpl->setVariable(
"LINK_URL", $target);
 
 1729            $tpl->setVariable(
"LINK_TITLE", $item[
"title"]);
 
 1730            $tpl->setVariable(
"LINK_DESC", $item[
"description"]);
 
 1731            $tpl->setVariable(
"LINK_CREATE", $item[
"create_date"]);
 
 1732            $tpl->setVariable(
"LINK_UPDATE", $item[
"last_update"]);
 
 1733            $tpl->parseCurrentBlock();
 
 1736        $tpl->setVariable(
"CREATE_DATE", $this->object->getCreateDate());
 
 1737        $tpl->setVariable(
"LAST_UPDATE", $this->object->getLastUpdateDate());
 
 1738        $tpl->setVariable(
"TXT_TITLE", $this->object->getTitle());
 
 1739        $tpl->setVariable(
"TXT_DESC", $this->object->getLongDescription());
 
 1741        $tpl->setVariable(
"INST_ID", (
$ilSetting->get(
'short_inst_name') != 
"")
 
 1748    public static function _goto($a_target, $a_additional = 
null)
 
 1752        $ilAccess = 
$DIC[
'ilAccess'];
 
 1756        if ($a_additional && substr($a_additional, -3) == 
"wsp") {
 
 1757            $_GET[
"baseClass"] = 
"ilsharedresourceGUI";
 
 1758            $_GET[
"wsp_id"] = $a_target;
 
 1759            include(
"ilias.php");
 
 1764        if ($ilAccess->checkAccess(
"read", 
"", $a_target)) {
 
 1765            ilUtil::redirect(
"ilias.php?baseClass=ilLinkResourceHandlerGUI&ref_id=$a_target");
 
 1768            if ($ilAccess->checkAccess(
"visible", 
"", $a_target)) {
 
 1769                ilUtil::redirect(
"ilias.php?baseClass=ilLinkResourceHandlerGUI&ref_id=" . $a_target . 
"&cmd=infoScreen");
 
 1773                        $lng->txt(
"msg_no_perm_read_item"),
 
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
An exception for terminatinating execution or to throw for unit testing.
const LINKS_ERR_NO_NAME_VALUE
User interface class for advanced drop-down selection lists.
static _recordReadEvent( $a_type, $a_ref_id, $obj_id, $usr_id, $isCatchupWriteEvents=true, $a_ext_rc=false, $a_ext_time=false)
Records a read event and catches up with write events.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Confirmation screen class.
static _lookupSortMode($a_obj_id)
lookup sort mode
static _getInstance($a_obj_id)
get instance by obj_id
Export User Interface Class.
Copyright (c) 1998-2014 ILIAS open source, Extended GPL, see docs/LICENSE Date: 24....
static getInitHTML($a_url)
Get initialisation HTML to use interna link editing.
class for checking external links in page objects.
static _getNotifyStatus($a_usr_id, $a_obj_id)
class ilLinkCheckerTableGUI
class for checking external links in page objects Normally used in Cron jobs, but should be extensibl...
Class ilLinkResourceItems.
static lookupItem($a_webr_id, $a_link_id)
static _getFirstLink($a_webr_id)
Get first link item Check before with _isSingular() if there is more or less than one.
static _isSingular($a_webr_id)
Check whether there is only one active link in the web resource.
static lookupNumberOfLinks($a_webr_id)
Get number of assigned links.
Class ilLinkResourceList.
static checkListStatus(int $a_webr_id)
Check if a weblink list was already created or transformed from a single weblink.
static _getStaticLink( $a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
static getLogger($a_component_id)
Get component logger.
static _fillHTMLMetaTags($a_rbac_id, $a_obj_id, $a_type)
Fill html meta tags.
This class represents a non editable value in a property form.
Class ilObjLinkResourceGUI.
confirmDeleteLink()
Show delete confirmation screen.
addLocatorItems()
Functions to be overwritten.
deleteParameter()
Delete a dynamic parameter.
redirectToLink($a_ref_id, $a_obj_id, $a_url)
showLinks()
Show all active links.
infoScreen()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually,...
activateTabs($a_active_tab, $a_active_subtab='')
Activate tab and subtabs.
formatInvalidLinkArray(array $row)
getLinkToListModal()
Get form to transform a single weblink to a weblink list.
switchViewMode()
Switch between "View" "Manage" and "Sort".
showToolbar($a_tpl_var)
Show toolbar.
saveSorting()
Save nmanual sorting.
initCreateForm($a_new_type)
Init object creation form.
initFormLink($a_mode)
Show create/edit single link.
afterSave(ilObject $a_new_object)
Post (successful) object creation hook.
updateLinks()
Update all visible links.
setTabs()
get tabs @access public
saveLinkList()
Save form data.
saveAddLink()
Save form data.
saveSettings()
Save container settings.
editLink()
Edit a single link.
getType()
Functions that must be overwritten.
checkLinkInput($a_mode, $a_valid, $a_webr_id=0, $a_link_id=0)
Check input after creating a new link.
initList(int $a_mode, int $a_webr_id=0)
Init a new link list.
handleSubItemLinks($a_target)
linkChecker()
Show link validation.
settings()
Edit settings Title, Description, Sorting.
editLinks()
Start with manage mode.
executeCommand()
execute command
static _goto($a_target, $a_additional=null)
deactivateLink()
Deactivate links.
addLink()
Add an additional link.
deleteLinks()
Delete links.
setValuesFromLink($a_link_id)
Set form values from link.
save()
Save new object @access public.
updateLink()
Save after editing.
infoScreenForward()
show information screen
initFormSettings()
Show settings form.
New implementation of ilObjectGUI.
prepareOutput($a_show_subobjects=true)
prepare output
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
getCreationMode()
get creation mode
GUI class for the workflow of copying objects.
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
addHeaderAction()
Add header action menu.
Class ilObject Basic functions for all objects.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
getRefId()
get reference id @access public
getId()
get object id @access public
Class ilParameterAppender.
static parameterToInfo($a_name, $a_value)
Get info text describing an existing dynamic link.
static _append($a_link_data)
static _getOptionSelect()
Get options as array.
static _getParams($a_link_id)
Get dynamic parameter definitions.
static _isEnabled()
Check if dynamic parameters are enabled.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
This class represents an option in a radio group.
special template class to simplify handling of ITX/PEAR
This class represents a text area property in a property form.
This class represents a text property in a property form.
static redirect($a_script)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static deliverData($a_data, $a_filename, $mime="application/octet-stream", $charset="")
deliver data for download via browser.
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 infoPanel($a_keep=true)
TableGUI class for search results.
TableGUI class for search results.
interface ilLinkCheckerGUIRowHandling