ILIAS  release_8 Revision v8.23
ilObjLinkResourceGUI Class Reference

Class ilObjLinkResourceGUI. More...

+ Inheritance diagram for ilObjLinkResourceGUI:
+ Collaboration diagram for ilObjLinkResourceGUI:

Public Member Functions

 __construct (int $id=0, int $id_type=self::REPOSITORY_NODE_ID, int $parent_node_id=0)
 
 getType ()
 
 executeCommand ()
 
 save ()
 
 editLink ()
 
 updateLink ()
 
 getLinkToListModal ()
 Get form to transform a single weblink to a weblink list. More...
 
 saveLinkList ()
 
 addLink ()
 
 saveAddLink ()
 
 view ()
 
 infoScreen ()
 this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed More...
 
 infoScreenForward ()
 show information screen More...
 
 history ()
 
 callDirectLink ()
 
 callLink ()
 
 exportHTML ()
 
- Public Member Functions inherited from ilObject2GUI
 __construct (int $id=0, int $id_type=self::REPOSITORY_NODE_ID, int $parent_node_id=0)
 
 executeCommand ()
 execute command More...
 
 getIdType ()
 
 delete ()
 Display delete confirmation form (repository/workspace switch) More...
 
 confirmedDelete ()
 Delete objects (repository/workspace switch) More...
 
 getHTML ()
 
 withReferences ()
 Final/Private declaration of unchanged parent methods. More...
 
 setCreationMode (bool $mode=true)
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 isVisible (int $ref_id, string $type)
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 cancelDelete ()
 
 view ()
 view object content (repository/workspace switch) More...
 
 getType ()
 Functions that must be overwritten. More...
 
 create ()
 CRUD. More...
 
 save ()
 
 edit ()
 
 update ()
 
 cancel ()
 
 importFile ()
 
 putObjectInTree (ilObject $obj, int $parent_node_id=null)
 Add object to tree at given position. More...
 
- Public Member Functions inherited from ilObjectGUI
 __construct ($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
 
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 if true, a creation screen is displayed the current [ref_id] don't belong to the current class! The mode is determined in ilRepositoryGUI More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html Should be overwritten and redirect to settings screen. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Static Public Member Functions

static _goto (string $a_target, $a_additional=null)
 
- Static Public Member Functions inherited from ilObject2GUI
static handleAfterSaveCallback (ilObject $obj, ?int $callback_ref_id)
 After creation callback. More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 

Protected Member Functions

 getWebLinkRepo ()
 
 initViewMode (?int $new_view_mode=null)
 
 initCreateForm (string $new_type)
 
 afterSave (ilObject $new_object)
 
 settings ()
 
 saveSettings ()
 
 initFormSettings ()
 
 deleteParameter ()
 
 deleteParameterForm ()
 
 updateLinks ()
 
 setValuesFromLink (int $a_link_id)
 
 initList (int $a_mode)
 
 checkLinkInput (int $a_mode, bool $a_valid, ?int $a_link_id=null)
 
 initFormLink (int $a_mode)
 
 addLinkInputToForm (int $mode)
 
 switchViewMode (?int $force_view_mode=null)
 Switch between "View" "Manage" and "Sort". More...
 
 editLinks ()
 Start with manage mode. More...
 
 manage ()
 
 showLinks ()
 
 sort ()
 
 saveSorting ()
 
 showToolbar (string $a_tpl_var)
 
 confirmDeleteLink ()
 
 deleteLinks ()
 
 deactivateLink ()
 
 activateTabs (string $a_active_tab, string $a_active_subtab='')
 Activate tab and subtabs. More...
 
 setTabs ()
 
 addLocatorItems ()
 
 redirectToLink (int $a_ref_id, int $a_obj_id, string $a_url)
 
- Protected Member Functions inherited from ilObject2GUI
 afterConstructor ()
 Do anything that should be done after constructor in here. More...
 
 assignObject ()
 create object instance as internal property (repository/workspace switch) More...
 
 getAccessHandler ()
 
 setLocator ()
 set Locator More...
 
 deleteConfirmedObjects ()
 Delete objects (workspace specific) This should probably be moved elsewhere as done with RepUtil. More...
 
 setTitleAndDescription ()
 
 omitLocator (bool $omit=true)
 
 getTargetFrame (string $cmd, string $target_frame="")
 
 setTargetFrame (string $cmd, string $target_frame)
 
 getCenterColumnHTML ()
 
 getRightColumnHTML ()
 
 checkPermission (string $perm, string $cmd="", string $type="", int $ref_id=null)
 
 showPossibleSubObjects ()
 
 redirectToRefId (int $ref_id, string $cmd="")
 
 fillCloneTemplate (?string $tpl_varname, string $type)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation (string $cmd, string $location="")
 Deprecated functions. More...
 
 setReturnLocation (string $cmd, string $location)
 
 showActions ()
 
 getTabs ()
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $node_id=null)
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 redrawHeaderAction ()
 Updating icons after ajax call. More...
 
 getPermanentLinkWidget (string $append=null, bool $center=false)
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 getCreationFormsHTML (array $forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm (string $new_type)
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm (string $new_type)
 
 importFileObject (int $parent_id=null)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current ["ref_id"] value of the request More...
 
 fillCloneTemplate (?string $tpl_name, string $type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 showCustomIconsEditing ( $input_colspan=1, ilPropertyFormGUI $form=null, $as_section=true)
 show edit section of custom icons for container More...
 

Protected Attributes

const VIEW_MODE_VIEW = 1
 
const VIEW_MODE_MANAGE = 2
 
const VIEW_MODE_SORT = 3
 
const LINK_MOD_CREATE = 1
 
const LINK_MOD_EDIT = 2
 
const LINK_MOD_ADD = 3
 
const LINK_MOD_SET_LIST = 4
 
const LINK_MOD_EDIT_LIST = 5
 
const LINK_MOD_ASYNC = 6
 
HTTPService $http
 
ilNavigationHistory $navigationHistory
 
- Protected Attributes inherited from ilObject2GUI
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilCtrl $ctrl
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ilObjectService $object_service
 
ilFavouritesManager $favourites
 
ilErrorHandling $error
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilToolbarGUI $toolbar
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Factory $refinery
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
int $request_ref_id
 
int $id_type
 
int $parent_id
 
string $type
 
string $html
 
int $object_id
 
int $node_id = null
 
array $creation_forms = array()
 
 $access_handler
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Factory $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Private Member Functions

 __prepareOutput ()
 

Private Attributes

int $view_mode = self::VIEW_MODE_VIEW
 
ilPropertyFormGUI $form = null
 
ilWebLinkDraftItem $draft_item = null
 
ilWebLinkDraftParameter $draft_parameter = null
 
ilWebLinkDraftList $draft_list = null
 

Additional Inherited Members

- Data Fields inherited from ilObject2GUI
const OBJECT_ID = 0
 
const REPOSITORY_NODE_ID = 1
 
const WORKSPACE_NODE_ID = 2
 
const REPOSITORY_OBJECT_ID = 3
 
const WORKSPACE_OBJECT_ID = 4
 
const PORTFOLIO_OBJECT_ID = 5
 
- Data Fields inherited from ilObjectGUI
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
const ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjLinkResourceGUI::__construct ( int  $id = 0,
int  $id_type = self::REPOSITORY_NODE_ID,
int  $parent_node_id = 0 
)

Definition at line 54 of file class.ilObjLinkResourceGUI.php.

References $DIC, ilObjectGUI\$id, ilObject2GUI\$id_type, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), and settings().

58  {
59  global $DIC;
60 
61  parent::__construct($id, $id_type, $parent_node_id);
62 
63  $this->lng->loadLanguageModule("webr");
64  $this->http = $DIC->http();
65  $this->navigationHistory = $DIC['ilNavigationHistory'];
66  $this->settings = $DIC->settings();
67  }
global $DIC
Definition: feed.php:28
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ __prepareOutput()

ilObjLinkResourceGUI::__prepareOutput ( )
private

Definition at line 1628 of file class.ilObjLinkResourceGUI.php.

Referenced by executeCommand().

1628  : void
1629  {
1630  $this->tpl->setLocator();
1631  }
+ Here is the caller graph for this function:

◆ _goto()

static ilObjLinkResourceGUI::_goto ( string  $a_target,
  $a_additional = null 
)
static

Definition at line 1739 of file class.ilObjLinkResourceGUI.php.

References ilObject2GUI\$ctrl, $DIC, $ilErr, ilObject2GUI\$lng, ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilUtil\redirect(), ilCtrl\redirectByClass(), ROOT_FOLDER_ID, ilCtrl\setParameterByClass(), ilCtrl\setTargetScript(), and ilLanguage\txt().

1739  : void
1740  {
1741  global $DIC;
1742 
1743  $main_tpl = $DIC->ui()->mainTemplate();
1744  $ilAccess = $DIC->access();
1745  $lng = $DIC->language();
1746  $ctrl = $DIC->ctrl();
1747  $ilErr = $DIC['ilErr'];
1748 
1749  if ($a_additional && substr($a_additional, -3) == "wsp") {
1750  $ctrl->setTargetScript('ilias.php');
1752  ilSharedResourceGUI::class,
1753  'wsp_id',
1754  $a_target
1755  );
1757  [
1758  ilSharedResourceGUI::class
1759  ],
1760  'edit'
1761  );
1762  return;
1763  }
1764 
1765  // Will be replaced in future releases by ilAccess::checkAccess()
1766  if ($ilAccess->checkAccess("read", "", (int) $a_target)) {
1768  "ilias.php?baseClass=ilLinkResourceHandlerGUI&ref_id=" . $a_target
1769  );
1770  } else {
1771  // to do: force flat view
1772  if ($ilAccess->checkAccess("visible", "", (int) $a_target)) {
1774  "ilias.php?baseClass=ilLinkResourceHandlerGUI&ref_id=" . $a_target . "&cmd=infoScreen"
1775  );
1776  } else {
1777  if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
1778  $main_tpl->setOnScreenMessage(
1779  'failure',
1780  sprintf(
1781  $lng->txt("msg_no_perm_read_item"),
1784  (int) $a_target
1785  )
1786  )
1787  ),
1788  true
1789  );
1791  }
1792  }
1793  }
1794 
1795  $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
1796  }
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
const ROOT_FOLDER_ID
Definition: constants.php:32
setParameterByClass(string $a_class, string $a_parameter, $a_value)
$ilErr
Definition: raiseError.php:17
static _lookupObjId(int $ref_id)
global $DIC
Definition: feed.php:28
static _lookupTitle(int $obj_id)
static redirect(string $a_script)
setTargetScript(string $a_target_script)
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
+ Here is the call graph for this function:

◆ activateTabs()

ilObjLinkResourceGUI::activateTabs ( string  $a_active_tab,
string  $a_active_subtab = '' 
)
protected

Activate tab and subtabs.

Definition at line 1509 of file class.ilObjLinkResourceGUI.php.

References ilContainerSortingSettings\_lookupSortMode(), ilObject2GUI\checkPermissionBool(), ILIAS\Repository\ctrl(), getWebLinkRepo(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ilContainer\SORT_MANUAL.

Referenced by addLink(), confirmDeleteLink(), editLink(), manage(), saveAddLink(), showLinks(), sort(), and updateLinks().

1512  : void {
1513  switch ($a_active_tab) {
1514  case 'content':
1515  if ($this->checkPermissionBool('write')) {
1516  $this->lng->loadLanguageModule('cntr');
1517 
1518  $this->ctrl->setParameter(
1519  $this,
1520  'switch_mode',
1521  self::VIEW_MODE_VIEW
1522  );
1523  $this->tabs_gui->addSubTab(
1524  'id_content_view',
1525  $this->lng->txt('view'),
1526  $this->ctrl->getLinkTarget($this, 'switchViewMode')
1527  );
1528  $this->ctrl->setParameter(
1529  $this,
1530  'switch_mode',
1531  self::VIEW_MODE_MANAGE
1532  );
1533  $this->tabs_gui->addSubTab(
1534  'id_content_manage',
1535  $this->lng->txt('cntr_manage'),
1536  $this->ctrl->getLinkTarget($this, 'switchViewMode')
1537  );
1538  if (!$this->getWebLinkRepo()->doesOnlyOneItemExist() and
1540  $this->object->getId()
1541  ) == ilContainer::SORT_MANUAL) {
1542  $this->ctrl->setParameter(
1543  $this,
1544  'switch_mode',
1545  self::VIEW_MODE_SORT
1546  );
1547  $this->tabs_gui->addSubTab(
1548  'id_content_ordering',
1549  $this->lng->txt('cntr_ordering'),
1550  $this->ctrl->getLinkTarget($this, 'switchViewMode')
1551  );
1552  }
1553 
1554  $this->ctrl->clearParameters($this);
1555  $this->tabs_gui->activateSubTab($a_active_subtab);
1556  }
1557  }
1558 
1559  $this->tabs_gui->activateTab('id_content');
1560  }
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addLink()

ilObjLinkResourceGUI::addLink ( )

Definition at line 544 of file class.ilObjLinkResourceGUI.php.

References activateTabs(), ilObject2GUI\checkPermission(), ilPropertyFormGUI\getHTML(), and initFormLink().

544  : void
545  {
546  $this->checkPermission('write');
547  $this->activateTabs('content', 'id_content_view');
548 
549  $form = $this->initFormLink(self::LINK_MOD_ADD);
550  $this->tpl->setContent($form->getHTML());
551  }
checkPermission(string $perm, string $cmd="", string $type="", int $ref_id=null)
activateTabs(string $a_active_tab, string $a_active_subtab='')
Activate tab and subtabs.
+ Here is the call graph for this function:

◆ addLinkInputToForm()

ilObjLinkResourceGUI::addLinkInputToForm ( int  $mode)
protected

Definition at line 1117 of file class.ilObjLinkResourceGUI.php.

References ILIAS\Repository\form(), ilLinkInputGUI\LIST, ILIAS\Repository\lng(), and ilLinkInputGUI\setAllowedLinkTypes().

Referenced by initFormLink().

1117  : void
1118  {
1119  $tar = new ilLinkInputGUI(
1120  $this->lng->txt('type'),
1121  'tar'
1122  ); // lng var
1123  if ($mode == self::LINK_MOD_CREATE) {
1125  }
1126  $tar->setInternalLinkFilterTypes(
1127  [
1128  "PageObject",
1129  "GlossaryItem",
1130  "RepositoryItem",
1131  'WikiPage'
1132  ]
1133  );
1134  $tar->setExternalLinkMaxLength(1000);
1135  $tar->setInternalLinkFilterTypes(
1136  ["PageObject", "GlossaryItem", "RepositoryItem"]
1137  );
1138  $tar->setRequired(true);
1139  $this->form->addItem($tar);
1140  }
setAllowedLinkTypes(string $a_val)
Set allowed link types (LIST, BOTH, INT, EXT)
form( $class_path, string $cmd)
This class represents a external and/or internal link in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addLocatorItems()

ilObjLinkResourceGUI::addLocatorItems ( )
protected
Todo:
is this required?

Definition at line 1636 of file class.ilObjLinkResourceGUI.php.

References $DIC, ILIAS\Repository\ctrl(), and ILIAS\Repository\object().

1636  : void
1637  {
1638  global $DIC;
1639 
1640  $ilLocator = $DIC['ilLocator'];
1641  if (is_object($this->object)) {
1642  $ilLocator->addItem(
1643  $this->object->getTitle(),
1644  $this->ctrl->getLinkTarget($this),
1645  "",
1646  $this->object->getRefId(),
1647  "webr"
1648  );
1649  }
1650  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

◆ afterSave()

ilObjLinkResourceGUI::afterSave ( ilObject  $new_object)
protected

Definition at line 210 of file class.ilObjLinkResourceGUI.php.

References ilWebLinkDatabaseRepository\createItem(), ILIAS\Repository\ctrl(), ILIAS\Repository\form(), ilObject\getId(), ilObject\getRefId(), ILIAS\Repository\lng(), and ilUtil\redirect().

210  : void
211  {
212  $new_web_link_repo = new ilWebLinkDatabaseRepository($new_object->getId());
213 
214  if ($this->form->getInput('tar_mode_type') === 'single') {
215  // Save link
216  $new_web_link_repo->createItem($this->draft_item);
217  $this->tpl->setOnScreenMessage(
218  'success',
219  $this->lng->txt('webr_link_added')
220  );
221  }
222 
223  if ($this->form->getInput('tar_mode_type') === 'list') {
224  // Save list
225  $new_web_link_repo->createList($this->draft_list);
226  $this->tpl->setOnScreenMessage(
227  'success',
228  $this->lng->txt('webr_list_added')
229  );
230  }
231 
232  // personal workspace
233  if ($this->id_type == self::WORKSPACE_NODE_ID) {
234  $this->ctrl->redirect($this, "editLinks");
235  } // repository
236  else {
238  "ilias.php?baseClass=ilLinkResourceHandlerGUI&ref_id=" .
239  $new_object->getRefId() . "&cmd=switchViewMode&switch_mode=2"
240  );
241  }
242  }
createItem(ilWebLinkDraftItem $item)
Creates a new item, complete with parameters.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
form( $class_path, string $cmd)
static redirect(string $a_script)
+ Here is the call graph for this function:

◆ callDirectLink()

ilObjLinkResourceGUI::callDirectLink ( )

Definition at line 1652 of file class.ilObjLinkResourceGUI.php.

References ilObjectGUI\$obj_id, ilObjLinkResourceAccess\_getFirstLink(), getWebLinkRepo(), and redirectToLink().

1652  : void
1653  {
1654  $obj_id = $this->object->getId();
1655 
1656  if ($this->getWebLinkRepo()->doesOnlyOneItemExist(true)) {
1658 
1659  $this->redirectToLink(
1660  $this->ref_id,
1661  $obj_id,
1662  $item->getResolvedLink((bool) $this->settings->get('links_dynamic'))
1663  );
1664  }
1665  }
redirectToLink(int $a_ref_id, int $a_obj_id, string $a_url)
static _getFirstLink(int $a_webr_id)
Get first link item Check before with _isSingular() if there is more or less than one...
+ Here is the call graph for this function:

◆ callLink()

ilObjLinkResourceGUI::callLink ( )

Definition at line 1667 of file class.ilObjLinkResourceGUI.php.

References getWebLinkRepo(), ILIAS\FileDelivery\http(), ILIAS\Repository\object(), redirectToLink(), ILIAS\Repository\refinery(), and settings().

1667  : void
1668  {
1669  if ($this->http->wrapper()->query()->has('link_id')) {
1670  $link_id = $this->http->wrapper()->query()->retrieve(
1671  'link_id',
1672  $this->refinery->kindlyTo()->int()
1673  );
1674 
1675  $item = $this->getWebLinkRepo()->getItemByLinkId($link_id);
1676 
1677  $this->redirectToLink(
1678  $this->ref_id,
1679  $this->object->getId(),
1680  $item->getResolvedLink((bool) $this->settings->get('links_dynamic'))
1681  );
1682  }
1683  }
redirectToLink(int $a_ref_id, int $a_obj_id, string $a_url)
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

◆ checkLinkInput()

ilObjLinkResourceGUI::checkLinkInput ( int  $a_mode,
bool  $a_valid,
?int  $a_link_id = null 
)
protected

Definition at line 834 of file class.ilObjLinkResourceGUI.php.

References ilObject2GUI\$error, $valid, ILIAS\Repository\form(), ilLinkInputGUI\isInternalLink(), ilWebLinkDraftParameter\LINKS_ERR_NO_NAME, ilWebLinkDraftParameter\LINKS_ERR_NO_VALUE, ILIAS\Repository\lng(), and settings().

Referenced by save(), saveAddLink(), and updateLink().

838  : bool {
839  $valid = $a_valid;
840 
841  $link_input = $this->form->getInput('tar');
842  $active = false;
843 
844  if ($a_mode == self::LINK_MOD_CREATE) {
845  $active = true;
846  } else {
847  $active = (bool) $this->form->getInput('act');
848  }
849 
850  $this->draft_item = new ilWebLinkDraftItem(
851  ilLinkInputGUI::isInternalLink($link_input),
852  $this->form->getInput('title'),
853  $this->form->getInput('desc'),
854  str_replace('"', '', $link_input),
855  $active,
856  []
857  );
858 
859  if (!$this->settings->get('links_dynamic')) {
860  return $valid;
861  }
862 
863  $this->draft_parameter = new ilWebLinkDraftParameter(
864  (int) $this->form->getInput('val'),
865  $this->form->getInput('nam')
866  );
867 
868  $error = $this->draft_parameter->validate();
869  if (!$error) {
870  return $valid;
871  }
872 
873  $this->draft_parameter = null;
874 
875  switch ($error) {
877  $this->form->getItemByPostVar('nam')->setAlert(
878  $this->lng->txt('links_no_name_given')
879  );
880  return false;
881 
883  $this->form->getItemByPostVar('val')->setAlert(
884  $this->lng->txt('links_no_value_given')
885  );
886  return false;
887 
888  default:
889  // Nothing entered => no error
890  return $valid;
891  }
892  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilErrorHandling $error
$valid
form( $class_path, string $cmd)
static isInternalLink(string $a_value)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const LINKS_ERR_NO_NAME
TODO: This can be removed when validate is.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirmDeleteLink()

ilObjLinkResourceGUI::confirmDeleteLink ( )
protected

Definition at line 1332 of file class.ilObjLinkResourceGUI.php.

References activateTabs(), ilObject2GUI\checkPermission(), ILIAS\Repository\ctrl(), getWebLinkRepo(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and view().

1332  : void
1333  {
1334  $this->checkPermission('write');
1335  $this->activateTabs('content', 'id_content_view');
1336 
1337  $link_ids = [];
1338  if ($this->http->wrapper()->query()->has('link_id')) {
1339  $link_ids = (array) $this->http->wrapper()->query()->retrieve(
1340  'link_id',
1341  $this->refinery->kindlyTo()->int()
1342  );
1343  } else {
1344  if ($this->http->wrapper()->post()->has('link_ids')) {
1345  $link_ids = $this->http->wrapper()->post()->retrieve(
1346  'link_ids',
1347  $this->refinery->kindlyTo()->dictOf(
1348  $this->refinery->kindlyTo()->int()
1349  )
1350  );
1351  }
1352  }
1353  if ($link_ids === []) {
1354  $this->tpl->setOnScreenMessage(
1355  'failure',
1356  $this->lng->txt('select_one')
1357  );
1358  $this->view();
1359  return;
1360  }
1361 
1362  $confirm = new ilConfirmationGUI();
1363  $confirm->setFormAction($this->ctrl->getFormAction($this, 'view'));
1364  $confirm->setHeaderText($this->lng->txt('webr_sure_delete_items'));
1365  $confirm->setConfirm($this->lng->txt('delete'), 'deleteLinks');
1366  $confirm->setCancel($this->lng->txt('cancel'), 'view');
1367 
1368  $items = $this->getWebLinkRepo()->getAllItemsAsContainer()->getItems();
1369 
1370  foreach ($items as $item) {
1371  if (!in_array($item->getLinkId(), $link_ids)) {
1372  continue;
1373  }
1374  $confirm->addItem(
1375  'link_ids[]',
1376  (string) $item->getLinkId(),
1377  $item->getTitle()
1378  );
1379  }
1380  $this->tpl->setContent($confirm->getHTML());
1381  }
checkPermission(string $perm, string $cmd="", string $type="", int $ref_id=null)
activateTabs(string $a_active_tab, string $a_active_subtab='')
Activate tab and subtabs.
static http()
Fetches the global http state from ILIAS.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ deactivateLink()

ilObjLinkResourceGUI::deactivateLink ( )
protected

Definition at line 1409 of file class.ilObjLinkResourceGUI.php.

References ilObject2GUI\checkPermission(), ILIAS\Repository\ctrl(), getWebLinkRepo(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

1409  : void
1410  {
1411  $this->checkPermission('write');
1412 
1413  $link_id = 0;
1414  if ($this->http->wrapper()->query()->has('link_id')) {
1415  $link_id = $this->http->wrapper()->query()->retrieve(
1416  'link_id',
1417  $this->refinery->kindlyTo()->int()
1418  );
1419  }
1420  if (!$link_id) {
1421  $this->tpl->setOnScreenMessage(
1422  'failure',
1423  $this->lng->txt('select_one'),
1424  true
1425  );
1426  $this->ctrl->redirect($this, 'view');
1427  }
1428 
1429  $item = $this->getWebLinkRepo()->getItemByLinkId($link_id);
1430  $draft = new ilWebLinkDraftItem(
1431  $item->isInternal(),
1432  $item->getTitle(),
1433  $item->getDescription(),
1434  $item->getTarget(),
1435  false,
1436  $item->getParameters()
1437  );
1438 
1439  $this->tpl->setOnScreenMessage(
1440  'success',
1441  $this->lng->txt('webr_inactive_success'),
1442  true
1443  );
1444  $this->ctrl->redirect($this, 'view');
1445  }
checkPermission(string $perm, string $cmd="", string $type="", int $ref_id=null)
static http()
Fetches the global http state from ILIAS.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ deleteLinks()

ilObjLinkResourceGUI::deleteLinks ( )
protected

Definition at line 1383 of file class.ilObjLinkResourceGUI.php.

References ilObject2GUI\checkPermission(), ILIAS\Repository\ctrl(), getWebLinkRepo(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

1383  : void
1384  {
1385  $this->checkPermission('write');
1386 
1387  $link_ids = [];
1388  if ($this->http->wrapper()->post()->has('link_ids')) {
1389  $link_ids = $this->http->wrapper()->post()->retrieve(
1390  'link_ids',
1391  $this->refinery->kindlyTo()->dictOf(
1392  $this->refinery->kindlyTo()->int()
1393  )
1394  );
1395  }
1396 
1397  foreach ($link_ids as $link_id) {
1398  $this->getWebLinkRepo()->deleteItemByLinkID($link_id);
1399  }
1400 
1401  $this->tpl->setOnScreenMessage(
1402  'success',
1403  $this->lng->txt('webr_deleted_items'),
1404  true
1405  );
1406  $this->ctrl->redirect($this, 'view');
1407  }
checkPermission(string $perm, string $cmd="", string $type="", int $ref_id=null)
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

◆ deleteParameter()

ilObjLinkResourceGUI::deleteParameter ( )
protected

Definition at line 589 of file class.ilObjLinkResourceGUI.php.

References ilObject2GUI\checkPermission(), ILIAS\Repository\ctrl(), getWebLinkRepo(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

589  : void
590  {
591  $this->checkPermission('write');
592 
593  $link_id = $this->http->wrapper()->query()->retrieve(
594  'link_id',
595  $this->refinery->kindlyTo()->int()
596  );
597  $this->ctrl->setParameter($this, 'link_id', $link_id);
598 
599  $param_id = $this->http->wrapper()->query()->retrieve(
600  'param_id',
601  $this->refinery->kindlyTo()->int()
602  );
603 
604  if (!$param_id) {
605  $this->tpl->setOnScreenMessage(
606  'failure',
607  $this->lng->txt('select_one'),
608  true
609  );
610  $this->ctrl->redirect($this, 'view');
611  }
612 
613  $this->getWebLinkRepo()->deleteParameterByLinkIdAndParamId($link_id, $param_id);
614 
615  $this->tpl->setOnScreenMessage(
616  'success',
617  $this->lng->txt(
618  'links_parameter_deleted'
619  ),
620  true
621  );
622  $this->ctrl->redirect($this, 'editLinks');
623  }
checkPermission(string $perm, string $cmd="", string $type="", int $ref_id=null)
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

◆ deleteParameterForm()

ilObjLinkResourceGUI::deleteParameterForm ( )
protected

Definition at line 625 of file class.ilObjLinkResourceGUI.php.

References ilObject2GUI\checkPermission(), ILIAS\Repository\ctrl(), getWebLinkRepo(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

625  : void
626  {
627  $this->checkPermission('write');
628 
629  $link_id = $this->http->wrapper()->query()->retrieve(
630  'link_id',
631  $this->refinery->kindlyTo()->int()
632  );
633 
634  $param_id = $this->http->wrapper()->query()->retrieve(
635  'param_id',
636  $this->refinery->kindlyTo()->int()
637  );
638  if (!$param_id) {
639  $this->tpl->setOnScreenMessage(
640  'failure',
641  $this->lng->txt('select_one'),
642  true
643  );
644  $this->ctrl->redirect($this, 'view');
645  }
646 
647  $this->getWebLinkRepo()->deleteParameterByLinkIdAndParamId($link_id, $param_id);
648 
649  $this->tpl->setOnScreenMessage(
650  'success',
651  $this->lng->txt(
652  'links_parameter_deleted'
653  ),
654  true
655  );
656  $this->ctrl->redirect($this, 'view');
657  }
checkPermission(string $perm, string $cmd="", string $type="", int $ref_id=null)
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

◆ editLink()

ilObjLinkResourceGUI::editLink ( )

Definition at line 395 of file class.ilObjLinkResourceGUI.php.

References activateTabs(), ilObject2GUI\checkPermission(), ILIAS\Repository\ctrl(), ilPropertyFormGUI\getHTML(), ILIAS\FileDelivery\http(), initFormLink(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and setValuesFromLink().

395  : void
396  {
397  $this->checkPermission('write');
398  $this->activateTabs('content', 'id_content_view');
399 
400  $link_id = 0;
401  if ($this->http->wrapper()->query()->has('link_id')) {
402  $link_id = $this->http->wrapper()->query()->retrieve(
403  'link_id',
404  $this->refinery->kindlyTo()->int()
405  );
406  }
407  if (!$link_id) {
408  $this->tpl->setOnScreenMessage(
409  'failure',
410  $this->lng->txt('select_one'),
411  true
412  );
413  $this->ctrl->redirect($this, 'view');
414  }
415  $form = $this->initFormLink(self::LINK_MOD_EDIT);
416  $this->setValuesFromLink($link_id);
417  $this->tpl->setContent($form->getHTML());
418  }
checkPermission(string $perm, string $cmd="", string $type="", int $ref_id=null)
activateTabs(string $a_active_tab, string $a_active_subtab='')
Activate tab and subtabs.
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

◆ editLinks()

ilObjLinkResourceGUI::editLinks ( )
protected

Start with manage mode.

Definition at line 1165 of file class.ilObjLinkResourceGUI.php.

References switchViewMode().

1165  : void
1166  {
1167  $this->switchViewMode(self::VIEW_MODE_MANAGE);
1168  }
switchViewMode(?int $force_view_mode=null)
Switch between "View" "Manage" and "Sort".
+ Here is the call graph for this function:

◆ executeCommand()

ilObjLinkResourceGUI::executeCommand ( )

Definition at line 92 of file class.ilObjLinkResourceGUI.php.

References __prepareOutput(), ilMDUtils\_fillHTMLMetaTags(), ilObjectGUI\addHeaderAction(), ilObject2GUI\checkPermission(), ILIAS\Repository\ctrl(), ILIAS\Repository\form(), ilObject2GUI\getCreationMode(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), ILIAS\FileDelivery\http(), infoScreenForward(), initFormLink(), initViewMode(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ilObject2GUI\prepareOutput(), and ILIAS\Repository\refinery().

92  : void
93  {
94  $this->initViewMode();
95 
96  $base_class = $this->http->wrapper()->query()->retrieve(
97  'baseClass',
98  $this->refinery->kindlyTo()->string()
99  );
100  if ($base_class === ilLinkResourceHandlerGUI::class) {
101  $this->__prepareOutput();
102  }
103  $next_class = $this->ctrl->getNextClass($this);
104  $cmd = $this->ctrl->getCmd();
105  switch ($next_class) {
106  case "ilinfoscreengui":
107  $this->prepareOutput();
108  $this->infoScreenForward(); // forwards command
109  break;
110 
111  case 'ilobjectmetadatagui':
112  $this->checkPermission('write'); // #18563
113  $this->prepareOutput();
114  $this->tabs_gui->activateTab('id_meta_data');
115  $md_gui = new ilObjectMetaDataGUI($this->object);
116  $this->ctrl->forwardCommand($md_gui);
117  break;
118 
119  case 'ilpermissiongui':
120  $this->prepareOutput();
121  $this->tabs_gui->activateTab('id_permissions');
122  $perm_gui = new ilPermissionGUI($this);
123  $this->ctrl->forwardCommand($perm_gui);
124  break;
125 
126  case 'ilobjectcopygui':
127  $this->prepareOutput();
128  $cp = new ilObjectCopyGUI($this);
129  $cp->setType('webr');
130  $this->ctrl->forwardCommand($cp);
131  break;
132 
133  case 'ilexportgui':
134  $this->prepareOutput();
135  $this->tabs_gui->setTabActive('export');
136  $exp = new ilExportGUI($this);
137  $exp->addFormat('xml');
138  $this->ctrl->forwardCommand($exp);
139  break;
140 
141  case "ilcommonactiondispatchergui":
142  $this->prepareOutput();
144  $this->ctrl->forwardCommand($gui);
145  break;
146 
147  case "ilpropertyformgui":
148  $mode = $this->ctrl->isAsynch() ?
149  self::LINK_MOD_ASYNC : self::LINK_MOD_EDIT;
150  $this->initFormLink($mode);
151  $this->ctrl->forwardCommand($this->form);
152  break;
153 
154  case "ilinternallinkgui":
155  $this->lng->loadLanguageModule("content");
156  $link_gui = new ilInternalLinkGUI("RepositoryItem", 0);
157  $link_gui->filterLinkType("PageObject");
158  $link_gui->filterLinkType("GlossaryItem");
159  $link_gui->filterLinkType("RepositoryItem");
160  $link_gui->setFilterWhiteList(true);
161  $this->ctrl->forwardCommand($link_gui);
162  break;
163 
164  default:
165  if (!$cmd) {
166  $this->ctrl->setCmd("view");
167  }
168  parent::executeCommand();
169  }
170 
171  if (!$this->getCreationMode()) {
173  $this->object->getId(),
174  $this->object->getId(),
175  'webr'
176  );
177  $this->addHeaderAction();
178  }
179  }
checkPermission(string $perm, string $cmd="", string $type="", int $ref_id=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
GUI class for the workflow of copying objects.
static _fillHTMLMetaTags(int $a_rbac_id, int $a_obj_id, string $a_type)
prepareOutput(bool $show_sub_objects=true)
Internal link selector.
infoScreenForward()
show information screen
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static http()
Fetches the global http state from ILIAS.
form( $class_path, string $cmd)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
addHeaderAction()
Add header action menu.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
initViewMode(?int $new_view_mode=null)
+ Here is the call graph for this function:

◆ exportHTML()

ilObjLinkResourceGUI::exportHTML ( )

Definition at line 1701 of file class.ilObjLinkResourceGUI.php.

References ilObject2GUI\$tpl, ilUtil\deliverData(), ilGlobalTemplateInterface\get(), getWebLinkRepo(), ILIAS\Repository\object(), ilGlobalTemplateInterface\parseCurrentBlock(), ilGlobalTemplateInterface\setCurrentBlock(), settings(), and ilGlobalTemplateInterface\setVariable().

1701  : void
1702  {
1703  $tpl = new ilTemplate(
1704  "tpl.export_html.html",
1705  true,
1706  true,
1707  "Modules/WebResource"
1708  );
1709 
1710  $items = $this->getWebLinkRepo()->getAllItemsAsContainer(true)
1711  ->getItems();
1712  foreach ($items as $item) {
1713  $tpl->setCurrentBlock("link_bl");
1714  $tpl->setVariable("LINK_URL", $item->getResolvedLink(false));
1715  $tpl->setVariable("LINK_TITLE", $item->getTitle());
1716  $tpl->setVariable("LINK_DESC", $item->getDescription() ?? '');
1717  $tpl->setVariable("LINK_CREATE", $item->getCreateDate()
1718  ->format('Y-m-d H-i-s'));
1719  $tpl->setVariable("LINK_UPDATE", $item->getLastUpdate()
1720  ->format('Y-m-d H-i-s'));
1722  }
1723 
1724  $tpl->setVariable("CREATE_DATE", $this->object->getCreateDate());
1725  $tpl->setVariable("LAST_UPDATE", $this->object->getLastUpdateDate());
1726  $tpl->setVariable("TXT_TITLE", $this->object->getTitle());
1727  $tpl->setVariable("TXT_DESC", $this->object->getLongDescription());
1728 
1729  $tpl->setVariable(
1730  "INST_ID",
1731  ($this->settings->get('short_inst_name') != "")
1732  ? $this->settings->get('short_inst_name')
1733  : "ILIAS"
1734  );
1735 
1736  ilUtil::deliverData($tpl->get(), "bookmarks.html");
1737  }
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
static deliverData(string $a_data, string $a_filename, string $mime="application/octet-stream")
ilGlobalTemplateInterface $tpl
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
+ Here is the call graph for this function:

◆ getLinkToListModal()

ilObjLinkResourceGUI::getLinkToListModal ( )

Get form to transform a single weblink to a weblink list.

Definition at line 474 of file class.ilObjLinkResourceGUI.php.

References $DIC, Vendor\Package\$f, ilObjectGUI\$id, ILIAS\Repository\form(), ILIAS\FileDelivery\http(), initFormLink(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ILIAS\UI\Implementation\Component\withOnLoadCode().

Referenced by showToolbar().

474  : Component
475  {
476  global $DIC;
477 
478  $f = $DIC->ui()->factory();
479  $r = $DIC->ui()->renderer();
480 
481  // check if form was already set
482  if ($this->form == null) {
483  $this->initFormLink(self::LINK_MOD_SET_LIST);
484  }
485 
486  $form_id = 'form_' . $this->form->getId();
487 
488  $submit = $f->button()->primary($this->lng->txt('save'), '#')
489  ->withOnLoadCode(
490  function ($id) use ($form_id) {
491  return "$('#{$id}').click(function() { $('#{$form_id}').submit(); return false; });";
492  }
493  );
494  $info = $f->messageBox()->info($this->lng->txt('webr_new_list_info'));
495 
496  $modal = $f->modal()->roundtrip(
497  $this->lng->txt('webr_new_list'),
498  $f->legacy($r->render($info) . $this->form->getHTML())
499  )
500  ->withActionButtons([$submit]);
501 
502  $submit = '';
503  if ($this->http->wrapper()->post()->has('sbmt')) {
504  $submit = $this->http->wrapper()->post()->retrieve(
505  'sbmt',
506  $this->refinery->kindlyTo()->string()
507  );
508  }
509  // modal triggers its show signal on load if form validation failed
510  if ($submit === 'submit') {
511  $modal = $modal->withOnLoad($modal->getShowSignal());
512  }
513  return $modal;
514  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
static http()
Fetches the global http state from ILIAS.
form( $class_path, string $cmd)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getType()

ilObjLinkResourceGUI::getType ( )

Definition at line 74 of file class.ilObjLinkResourceGUI.php.

74  : string
75  {
76  return "webr";
77  }

◆ getWebLinkRepo()

ilObjLinkResourceGUI::getWebLinkRepo ( )
protected

Definition at line 69 of file class.ilObjLinkResourceGUI.php.

References ILIAS\Repository\object().

Referenced by activateTabs(), callDirectLink(), callLink(), confirmDeleteLink(), deactivateLink(), deleteLinks(), deleteParameter(), deleteParameterForm(), exportHTML(), initFormLink(), initFormSettings(), saveAddLink(), saveLinkList(), saveSettings(), setValuesFromLink(), showToolbar(), updateLink(), and updateLinks().

70  {
71  return new ilWebLinkDatabaseRepository($this->object->getId());
72  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ history()

ilObjLinkResourceGUI::history ( )

Definition at line 1491 of file class.ilObjLinkResourceGUI.php.

References ilObject2GUI\checkPermission(), ilHistoryTableGUI\initTable(), and ILIAS\Repository\object().

1491  : void
1492  {
1493  $this->checkPermission('write');
1494  $this->tabs_gui->activateTab('id_history');
1495 
1496  $hist_gui = new ilHistoryTableGUI(
1497  $this,
1498  "history",
1499  $this->object->getId(),
1500  $this->object->getType()
1501  );
1502  $hist_gui->initTable();
1503  $this->tpl->setContent($hist_gui->getHTML());
1504  }
checkPermission(string $perm, string $cmd="", string $type="", int $ref_id=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ infoScreen()

ilObjLinkResourceGUI::infoScreen ( )

this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed

Definition at line 1452 of file class.ilObjLinkResourceGUI.php.

References ILIAS\Repository\ctrl(), and infoScreenForward().

1452  : void
1453  {
1454  $this->ctrl->setCmd("showSummary");
1455  $this->ctrl->setCmdClass("ilinfoscreengui");
1456  $this->infoScreenForward();
1457  }
infoScreenForward()
show information screen
+ Here is the call graph for this function:

◆ infoScreenForward()

ilObjLinkResourceGUI::infoScreenForward ( )

show information screen

Definition at line 1462 of file class.ilObjLinkResourceGUI.php.

References ilObject2GUI\checkPermission(), ilObject2GUI\checkPermissionBool(), ILIAS\Repository\ctrl(), ilObject2GUI\getPermanentLinkWidget(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

Referenced by executeCommand(), and infoScreen().

1462  : void
1463  {
1464  if (!$this->checkPermissionBool('visible')) {
1465  $this->checkPermission('read');
1466  }
1467  $this->tabs_gui->activateTab('id_info');
1468 
1469  $info = new ilInfoScreenGUI($this);
1470 
1471  $info->enablePrivateNotes();
1472 
1473  // standard meta data
1474  $info->addMetaDataSections(
1475  $this->object->getId(),
1476  0,
1477  $this->object->getType()
1478  );
1479 
1480  if ($this->id_type == self::WORKSPACE_NODE_ID) {
1481  $info->addProperty(
1482  $this->lng->txt("perma_link"),
1483  $this->getPermanentLinkWidget()
1484  );
1485  }
1486 
1487  // forward the command
1488  $this->ctrl->forwardCommand($info);
1489  }
checkPermission(string $perm, string $cmd="", string $type="", int $ref_id=null)
Class ilInfoScreenGUI.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
getPermanentLinkWidget(string $append=null, bool $center=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCreateForm()

ilObjLinkResourceGUI::initCreateForm ( string  $new_type)
protected

Definition at line 181 of file class.ilObjLinkResourceGUI.php.

References $form, and initFormLink().

182  {
183  $this->initFormLink(self::LINK_MOD_CREATE);
184  return $this->form;
185  }
+ Here is the call graph for this function:

◆ initFormLink()

ilObjLinkResourceGUI::initFormLink ( int  $a_mode)
protected

Definition at line 894 of file class.ilObjLinkResourceGUI.php.

References $form, $name, $param, $params, addLinkInputToForm(), ilSubEnabledFormPropertyGUI\addSubItem(), ILIAS\Repository\ctrl(), ILIAS\Repository\form(), getWebLinkRepo(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), ilWebLinkBaseParameter\SESSION_ID_NAME, ilCheckboxInputGUI\setChecked(), ilNonEditableValueGUI\setInfo(), ilTextAreaInputGUI\setRows(), settings(), ilWebLinkBaseParameter\VALUES, and ilWebLinkBaseParameter\VALUES_TEXT.

Referenced by addLink(), editLink(), executeCommand(), getLinkToListModal(), initCreateForm(), save(), saveAddLink(), saveLinkList(), and updateLink().

895  {
896  $this->tabs_gui->activateTab("id_content");
897 
898  $this->form = new ilPropertyFormGUI();
899  switch ($a_mode) {
900  case self::LINK_MOD_CREATE:
901  // Header
902  $this->ctrl->setParameter($this, 'new_type', 'webr');
903  $this->form->setTitle($this->lng->txt('webr_new_link'));
904  $this->form->setTableWidth('600px');
905 
906  // Buttons
907  $this->form->addCommandButton(
908  'save',
909  $this->lng->txt('webr_add')
910  );
911  $this->form->addCommandButton(
912  'cancel',
913  $this->lng->txt('cancel')
914  );
915  break;
916 
917  case self::LINK_MOD_ADD:
918  // Header
919  $this->form->setTitle($this->lng->txt('webr_new_link'));
920 
921  // Buttons
922  $this->form->addCommandButton(
923  'saveAddLink',
924  $this->lng->txt('webr_add')
925  );
926  $this->form->addCommandButton(
927  'view',
928  $this->lng->txt('cancel')
929  );
930  break;
931 
932  case self::LINK_MOD_EDIT:
933  // Header
934  $this->ctrl->setParameter(
935  $this,
936  'link_id',
937  // TODO PHP8 Review: Remove/Replace SuperGlobals
938  (int) $_REQUEST['link_id']
939  );
940  $this->form->setTitle($this->lng->txt('webr_edit'));
941 
942  // Buttons
943  $this->form->addCommandButton(
944  'updateLink',
945  $this->lng->txt('save')
946  );
947  $this->form->addCommandButton(
948  'view',
949  $this->lng->txt('cancel')
950  );
951  break;
952 
953  /*
954  * The async call for displaying the object explorer for
955  * internal links goes through ilPropertyFormGUI to get
956  * to the right ilLinkInputGUI, so we only add that field
957  * to the form here.
958  */
959  case self::LINK_MOD_ASYNC:
960  $this->addLinkInputToForm($a_mode);
961  return $this->form;
962  }
963 
964  if ($a_mode == self::LINK_MOD_SET_LIST) {
965  $this->form->setValuesByPost();
966  $this->form->setFormAction(
967  $this->ctrl->getFormAction($this, 'saveLinkList')
968  );
969  $this->form->setId(uniqid('form'));
970 
971  // List Title
972  $title = new ilTextInputGUI(
973  $this->lng->txt('webr_list_title'),
974  'lti'
975  );
976  $title->setRequired(true);
977  $title->setSize(40);
978  $title->setMaxLength(127);
979  $this->form->addItem($title);
980 
981  // List Description
982  $desc = new ilTextAreaInputGUI(
983  $this->lng->txt('webr_list_desc'),
984  'tde'
985  );
986  $desc->setRows(3);
987  $desc->setCols(40);
988  $this->form->addItem($desc);
989 
990  $item = new ilHiddenInputGUI('sbmt');
991  $item->setValue('submit');
992  $this->form->addItem($item);
993  } else {
994  $this->form->setFormAction($this->ctrl->getFormAction($this));
995 
996  $this->addLinkInputToForm($a_mode);
997 
998  // Title
999  $tit = new ilTextInputGUI(
1000  $this->lng->txt('webr_link_title'),
1001  'title'
1002  );
1003  $tit->setRequired(true);
1004  $tit->setSize(40);
1005  $tit->setMaxLength(127);
1006  $this->form->addItem($tit);
1007 
1008  // Description
1009  $des = new ilTextAreaInputGUI(
1010  $this->lng->txt('description'),
1011  'desc'
1012  );
1013  $des->setRows(3);
1014  $des->setCols(40);
1015  $this->form->addItem($des);
1016 
1017  if ($a_mode != self::LINK_MOD_CREATE) {
1018  // Active
1019  $act = new ilCheckboxInputGUI($this->lng->txt('active'), 'act');
1020  $act->setChecked(true);
1021  $act->setValue('1');
1022  $this->form->addItem($act);
1023  }
1024 
1025  if ($this->settings->get('links_dynamic') &&
1026  $a_mode != self::LINK_MOD_CREATE
1027  ) {
1028  $dyn = new ilNonEditableValueGUI(
1029  $this->lng->txt('links_dyn_parameter')
1030  );
1031  $dyn->setInfo($this->lng->txt('links_dynamic_info'));
1032 
1033  if ($this->http->wrapper()->query()->has('link_id')) {
1034  $link_id = $this->http->wrapper()->query()->retrieve(
1035  'link_id',
1036  $this->refinery->kindlyTo()->int()
1037  );
1038  }
1039  if (
1040  isset($link_id) &&
1041  $link_id > 0 &&
1042  ($params = $this->getWebLinkRepo()->getItemByLinkId($link_id)->getParameters()) !== []
1043  ) {
1044  $ex = new ilCustomInputGUI(
1045  $this->lng->txt('links_existing_params'),
1046  'ex'
1047  );
1048  $dyn->addSubItem($ex);
1049 
1050  foreach ($params as $param) {
1051  $p = new ilCustomInputGUI();
1052 
1053  $ptpl = new ilTemplate(
1054  'tpl.link_dyn_param_edit.html',
1055  true,
1056  true,
1057  'Modules/WebResource'
1058  );
1059  $ptpl->setVariable(
1060  'INFO_TXT',
1061  $param->getInfo()
1062  );
1063  $this->ctrl->setParameter($this, 'param_id', $param->getParamId());
1064  $this->ctrl->setParameter($this, 'link_id', $link_id);
1065  $ptpl->setVariable(
1066  'LINK_DEL',
1067  $this->ctrl->getLinkTarget(
1068  $this,
1069  'deleteParameterForm'
1070  )
1071  );
1072  $ptpl->setVariable(
1073  'LINK_TXT',
1074  $this->lng->txt('delete')
1075  );
1076  $p->setHtml($ptpl->get());
1077  $dyn->addSubItem($p);
1078  }
1079  }
1080 
1081  // Dynyamic name
1082  $nam = new ilTextInputGUI($this->lng->txt('links_name'), 'nam');
1083  $nam->setSize(12);
1084  $nam->setMaxLength(128);
1085  $dyn->addSubItem($nam);
1086 
1087  // Dynamic value
1088  $val = new ilSelectInputGUI(
1089  $this->lng->txt('links_value'),
1090  'val'
1091  );
1092  /*
1093  $val->setOptions(array_map(
1094  function ($s) {
1095  return $this->lng->txt($s);
1096  },
1097  ilWebLinkBaseParameter::VALUES_TEXT
1098  ));
1099  */
1100  $options = [];
1101  foreach(ilWebLinkBaseParameter::VALUES as $name => $identifier) {
1103  continue;
1104  }
1105  $options[] = ilWebLinkBaseParameter::VALUES_TEXT[$identifier];
1106  }
1107  $val->setOptions($options);
1108  $val->setValue(0);
1109  $dyn->addSubItem($val);
1110 
1111  $this->form->addItem($dyn);
1112  }
1113  }
1114  return $this->form;
1115  }
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33
This class represents a checkbox property in a property form.
if($format !==null) $name
Definition: metadata.php:247
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static http()
Fetches the global http state from ILIAS.
$param
Definition: xapitoken.php:46
form( $class_path, string $cmd)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a text area property in a property form.
const VALUES
TODO Once the GUI is updated, undefined can be dropped.
const VALUES_TEXT
Keys of the language variables to the possible values, e.g.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFormSettings()

ilObjLinkResourceGUI::initFormSettings ( )
protected

Definition at line 303 of file class.ilObjLinkResourceGUI.php.

References $form, ilObject2GUI\$object_service, ilContainerSortingSettings\_lookupSortMode(), ILIAS\Repository\ctrl(), ILIAS\Repository\form(), getWebLinkRepo(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ilFormPropertyGUI\setRequired(), ilTextAreaInputGUI\setValue(), ilContainer\SORT_MANUAL, and ilContainer\SORT_TITLE.

Referenced by saveSettings(), and settings().

304  {
305  $obj_service = $this->object_service;
306 
307  $this->form = new ilPropertyFormGUI();
308  $this->form->setFormAction(
309  $this->ctrl->getFormAction($this, 'saveSettings')
310  );
311 
312  if ($this->getWebLinkRepo()->doesListExist()) {
313  $this->form->setTitle($this->lng->txt('webr_edit_settings'));
314 
315  // Title
316  $tit = new ilTextInputGUI(
317  $this->lng->txt('webr_list_title'),
318  'title'
319  );
320  $tit->setValue($this->object->getTitle());
321  $tit->setRequired(true);
322  $tit->setSize(40);
323  $tit->setMaxLength(127);
324  $this->form->addItem($tit);
325 
326  // Description
327  $des = new ilTextAreaInputGUI(
328  $this->lng->txt('webr_list_desc'),
329  'desc'
330  );
331  $des->setValue($this->object->getDescription());
332  $des->setCols(40);
333  $des->setRows(3);
334  $this->form->addItem($des);
335 
336  $section = new ilFormSectionHeaderGUI();
337  $section->setTitle($this->lng->txt('obj_presentation'));
338  $this->form->addItem($section);
339 
340  // tile image
341  $obj_service->commonSettings()->legacyForm(
342  $this->form,
343  $this->object
344  )->addTileImage();
345 
346  // Sorting
347  $sor = new ilRadioGroupInputGUI(
348  $this->lng->txt('webr_sorting'),
349  'sor'
350  );
351  $sor->setRequired(true);
352  $sor->setValue(
354  $this->object->getId()
355  )
356  );
357 
358  $opt = new ilRadioOption(
359  $this->lng->txt('webr_sort_title'),
360  (string) ilContainer::SORT_TITLE
361  );
362  $sor->addOption($opt);
363 
364  $opm = new ilRadioOption(
365  $this->lng->txt('webr_sort_manual'),
366  (string) ilContainer::SORT_MANUAL
367  );
368  $sor->addOption($opm);
369  $this->form->addItem($sor);
370  } else {
371  $this->form->setTitle($this->lng->txt('obj_presentation'));
372 
373  // hidden title
374  $tit = new ilHiddenInputGUI('title');
375  $tit->setValue($this->object->getTitle());
376  $this->form->addItem($tit);
377 
378  // hidden description
379  $des = new ilHiddenInputGUI('desc');
380  $des->setValue($this->object->getDescription());
381  $this->form->addItem($des);
382 
383  // tile image
384  $obj_service->commonSettings()->legacyForm(
385  $this->form,
386  $this->object
387  )->addTileImage();
388  }
389 
390  $this->form->addCommandButton('saveSettings', $this->lng->txt('save'));
391  $this->form->addCommandButton('view', $this->lng->txt('cancel'));
392  return $this->form;
393  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a property in a property form.
setRequired(bool $a_required)
form( $class_path, string $cmd)
ilObjectService $object_service
This class represents a text area property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initList()

ilObjLinkResourceGUI::initList ( int  $a_mode)
protected

Definition at line 817 of file class.ilObjLinkResourceGUI.php.

References ILIAS\Repository\form().

Referenced by save(), saveLinkList(), and saveSettings().

817  : void
818  {
819  if ($a_mode == self::LINK_MOD_CREATE || $a_mode == self::LINK_MOD_EDIT_LIST) {
820  $this->draft_list = new ilWebLinkDraftList(
821  $this->form->getInput('title'),
822  $this->form->getInput('desc')
823  );
824  }
825 
826  if ($a_mode == self::LINK_MOD_SET_LIST) {
827  $this->draft_list = new ilWebLinkDraftList(
828  $this->form->getInput('lti'),
829  $this->form->getInput('tde')
830  );
831  }
832  }
form( $class_path, string $cmd)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initViewMode()

ilObjLinkResourceGUI::initViewMode ( ?int  $new_view_mode = null)
protected
Todo:
no view mode for workspace?

Definition at line 82 of file class.ilObjLinkResourceGUI.php.

References ilSession\get(), ilSession\has(), ILIAS\Repository\int(), and ilSession\set().

Referenced by executeCommand(), and switchViewMode().

82  : void
83  {
84  if ($new_view_mode !== null) {
85  ilSession::set('webr_view_mode', $new_view_mode);
86  }
87  if (ilSession::has('webr_view_mode')) {
88  $this->view_mode = (int) ilSession::get('webr_view_mode');
89  }
90  }
static get(string $a_var)
static has($a_var)
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ manage()

ilObjLinkResourceGUI::manage ( )
protected

Definition at line 1210 of file class.ilObjLinkResourceGUI.php.

References activateTabs(), ilObject2GUI\checkPermission(), ilInternalLinkGUI\getInitHTML(), and showToolbar().

Referenced by view().

1210  : void
1211  {
1212  $this->checkPermission('write');
1213  $this->activateTabs('content', 'id_content_manage');
1214 
1215  $this->tpl->addBlockFile(
1216  'ADM_CONTENT',
1217  'adm_content',
1218  'tpl.webr_manage.html',
1219  'Modules/WebResource'
1220  );
1221  $this->showToolbar('ACTION_BUTTONS');
1222 
1223  $table = new ilWebResourceEditableLinkTableGUI($this, 'view');
1224  $table->parse();
1225 
1227 
1228  $this->tpl->addJavaScript("Modules/WebResource/js/intLink.js");
1229  $this->tpl->addJavascript("Services/Form/js/Form.js");
1230 
1231  $this->tpl->setVariable('TABLE_LINKS', $table->getHTML() . $js);
1232  }
checkPermission(string $perm, string $cmd="", string $type="", int $ref_id=null)
static getInitHTML(string $a_url)
Get initialisation HTML to use internal link editing.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
activateTabs(string $a_active_tab, string $a_active_subtab='')
Activate tab and subtabs.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ redirectToLink()

ilObjLinkResourceGUI::redirectToLink ( int  $a_ref_id,
int  $a_obj_id,
string  $a_url 
)
protected

Definition at line 1685 of file class.ilObjLinkResourceGUI.php.

References ilChangeEvent\_recordReadEvent(), ilUtil\redirect(), and ILIAS\Repository\user().

Referenced by callDirectLink(), and callLink().

1689  : void {
1690  if ($a_url) {
1692  "webr",
1693  $a_ref_id,
1694  $a_obj_id,
1695  $this->user->getId()
1696  );
1697  ilUtil::redirect($a_url);
1698  }
1699  }
static _recordReadEvent(string $a_type, int $a_ref_id, int $obj_id, int $usr_id, bool $isCatchupWriteEvents=true, $a_ext_rc=null, $a_ext_time=null)
static redirect(string $a_script)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilObjLinkResourceGUI::save ( )

Definition at line 187 of file class.ilObjLinkResourceGUI.php.

References $valid, checkLinkInput(), ILIAS\Repository\form(), initFormLink(), initList(), and ILIAS\Repository\lng().

187  : void
188  {
189  $this->initFormLink(self::LINK_MOD_CREATE);
190  $valid = $this->form->checkInput();
191  if (
192  $this->checkLinkInput(self::LINK_MOD_CREATE, $valid, 0) &&
193  $this->form->getInput('tar_mode_type') === 'single'
194  ) {
195  parent::save();
196  } elseif ($valid && $this->form->getInput('tar_mode_type') == 'list') {
197  $this->initList(self::LINK_MOD_CREATE);
198  parent::save();
199  } else {
200  // Data incomplete or invalid
201  $this->tpl->setOnScreenMessage(
202  'failure',
203  $this->lng->txt('err_check_input')
204  );
205  $this->form->setValuesByPost();
206  $this->tpl->setContent($this->form->getHTML());
207  }
208  }
$valid
checkLinkInput(int $a_mode, bool $a_valid, ?int $a_link_id=null)
form( $class_path, string $cmd)
+ Here is the call graph for this function:

◆ saveAddLink()

ilObjLinkResourceGUI::saveAddLink ( )

Definition at line 553 of file class.ilObjLinkResourceGUI.php.

References $valid, activateTabs(), ilPropertyFormGUI\checkInput(), checkLinkInput(), ilObject2GUI\checkPermission(), ILIAS\Repository\ctrl(), ILIAS\Repository\form(), ilPropertyFormGUI\getHTML(), getWebLinkRepo(), initFormLink(), ILIAS\Repository\lng(), and settings().

553  : void
554  {
555  $this->checkPermission('write');
556 
557  $form = $this->initFormLink(self::LINK_MOD_ADD);
558  $valid = $form->checkInput();
559  if ($this->checkLinkInput(
560  self::LINK_MOD_ADD,
561  $valid,
562  0
563  )
564  ) {
565  if (
566  $this->settings->get('links_dynamic') &&
567  $this->draft_parameter !== null
568  ) {
569  $this->draft_item->addParameter($this->draft_parameter);
570  }
571  $this->getWebLinkRepo()->createItem($this->draft_item);
572 
573  $this->tpl->setOnScreenMessage(
574  'success',
575  $this->lng->txt('webr_link_added'),
576  true
577  );
578  $this->ctrl->redirect($this, 'view');
579  }
580  $this->tpl->setOnScreenMessage(
581  'failure',
582  $this->lng->txt('err_check_input')
583  );
584  $this->form->setValuesByPost();
585  $this->activateTabs('content', 'id_content_view');
586  $this->tpl->setContent($form->getHTML());
587  }
checkPermission(string $perm, string $cmd="", string $type="", int $ref_id=null)
$valid
activateTabs(string $a_active_tab, string $a_active_subtab='')
Activate tab and subtabs.
checkLinkInput(int $a_mode, bool $a_valid, ?int $a_link_id=null)
form( $class_path, string $cmd)
+ Here is the call graph for this function:

◆ saveLinkList()

ilObjLinkResourceGUI::saveLinkList ( )

Definition at line 516 of file class.ilObjLinkResourceGUI.php.

References $valid, ilPropertyFormGUI\checkInput(), ilObject2GUI\checkPermission(), ILIAS\Repository\ctrl(), ilPropertyFormGUI\getInput(), getWebLinkRepo(), initFormLink(), initList(), ILIAS\Repository\lng(), ilPropertyFormGUI\setValuesByPost(), and view().

516  : void
517  {
518  $this->checkPermission('write');
519  $form = $this->initFormLink(self::LINK_MOD_SET_LIST);
520  $valid = $form->checkInput();
521  if ($valid) {
522  $this->object->setTitle($form->getInput('lti'));
523  $this->object->setDescription($form->getInput('tde'));
524  $this->object->update();
525 
526  $this->initList(self::LINK_MOD_SET_LIST);
527  $this->getWebLinkRepo()->createList($this->draft_list);
528  $this->tpl->setOnScreenMessage(
529  'success',
530  $this->lng->txt('webr_list_set'),
531  true
532  );
533  $this->ctrl->redirect($this, 'view');
534  }
535  $this->tpl->setOnScreenMessage(
536  'failure',
537  $this->lng->txt('err_check_input'),
538  true
539  );
541  $this->view();
542  }
checkPermission(string $perm, string $cmd="", string $type="", int $ref_id=null)
$valid
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
+ Here is the call graph for this function:

◆ saveSettings()

ilObjLinkResourceGUI::saveSettings ( )
protected

Definition at line 253 of file class.ilObjLinkResourceGUI.php.

References Vendor\Package\$e, ilObject2GUI\$object_service, $valid, ilPropertyFormGUI\checkInput(), ilObject2GUI\checkPermission(), ILIAS\Repository\ctrl(), ilPropertyFormGUI\getHTML(), ilPropertyFormGUI\getInput(), getWebLinkRepo(), initFormSettings(), initList(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ilContainerSortingSettings\setSortMode(), and ilPropertyFormGUI\setValuesByPost().

253  : void
254  {
255  $obj_service = $this->object_service;
256 
257  $this->checkPermission('write');
258  $this->tabs_gui->activateTab('id_settings');
259 
260  $form = $this->initFormSettings();
261  $valid = $form->checkInput();
262  if ($valid) {
263  // update list
264  $this->initList(self::LINK_MOD_EDIT_LIST);
265  try {
266  $list = $this->getWebLinkRepo()->getList();
267  $this->getWebLinkRepo()->updateList($list, $this->draft_list);
269  // no weblink list here => update tile image, title, description, sorting
270  }
271 
272  // update object
273  $this->object->setTitle($form->getInput('title'));
274  $this->object->setDescription((string) $form->getInput('desc'));
275  $this->object->update();
276 
277  // update sorting
278  $sort = new ilContainerSortingSettings($this->object->getId());
279  $sort->setSortMode((int) $form->getInput('sor'));
280  $sort->update();
281 
282  // tile image
283  $obj_service->commonSettings()->legacyForm(
284  $form,
285  $this->object
286  )->saveTileImage();
287  $this->tpl->setOnScreenMessage(
288  'success',
289  $this->lng->txt('settings_saved'),
290  true
291  );
292  $this->ctrl->redirect($this, 'settings');
293  }
294 
296  $this->tpl->setOnScreenMessage(
297  'failure',
298  $this->lng->txt('err_check_input')
299  );
300  $this->tpl->setContent($form->getHTML());
301  }
checkPermission(string $perm, string $cmd="", string $type="", int $ref_id=null)
$valid
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilObjectService $object_service
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ saveSorting()

ilObjLinkResourceGUI::saveSorting ( )
protected

Definition at line 1270 of file class.ilObjLinkResourceGUI.php.

References ilContainerSorting\_getInstance(), ilObject2GUI\checkPermission(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ILIAS\Repository\refinery(), and view().

1270  : void
1271  {
1272  $this->checkPermission('write');
1273  $sort = ilContainerSorting::_getInstance($this->object->getId());
1274 
1275  $position = [];
1276  if ($this->http->wrapper()->post()->has('position')) {
1277  $position = $this->http->wrapper()->post()->retrieve(
1278  'position',
1279  $this->refinery->kindlyTo()->dictOf(
1280  $this->refinery->kindlyTo()->string()
1281  )
1282  );
1283  }
1284  $sort->savePost($position);
1285  $this->tpl->setOnScreenMessage(
1286  'success',
1287  $this->lng->txt('settings_saved'),
1288  true
1289  );
1290  $this->view();
1291  }
checkPermission(string $perm, string $cmd="", string $type="", int $ref_id=null)
static http()
Fetches the global http state from ILIAS.
static _getInstance(int $a_obj_id)
+ Here is the call graph for this function:

◆ setTabs()

ilObjLinkResourceGUI::setTabs ( )
protected

Definition at line 1562 of file class.ilObjLinkResourceGUI.php.

References $DIC, ilObject2GUI\checkPermissionBool(), ILIAS\Repository\ctrl(), ilObject2GUI\getCreationMode(), and ILIAS\Repository\lng().

1562  : void
1563  {
1564  global $DIC;
1565 
1566  $ilHelp = $DIC['ilHelp'];
1567  $ilHelp->setScreenIdComponent("webr");
1568 
1569  if ($this->checkPermissionBool('read')) {
1570  $this->tabs_gui->addTab(
1571  "id_content",
1572  $this->lng->txt("content"),
1573  $this->ctrl->getLinkTarget($this, "view")
1574  );
1575  }
1576 
1577  if (
1578  $this->checkPermissionBool('visible') ||
1579  $this->checkPermissionBool('read')
1580  ) {
1581  $this->tabs_gui->addTab(
1582  "id_info",
1583  $this->lng->txt("info_short"),
1584  $this->ctrl->getLinkTarget($this, "infoScreen")
1585  );
1586  }
1587 
1588  if ($this->checkPermissionBool('write') and !$this->getCreationMode()) {
1589  $this->tabs_gui->addTab(
1590  "id_settings",
1591  $this->lng->txt("settings"),
1592  $this->ctrl->getLinkTarget($this, "settings")
1593  );
1594  }
1595 
1596  if ($this->checkPermissionBool('write')) {
1597  $this->tabs_gui->addTab(
1598  "id_history",
1599  $this->lng->txt("history"),
1600  $this->ctrl->getLinkTarget($this, "history")
1601  );
1602  }
1603 
1604  if ($this->checkPermissionBool('write')) {
1605  $mdgui = new ilObjectMetaDataGUI($this->object);
1606  $mdtab = $mdgui->getTab();
1607  if ($mdtab) {
1608  $this->tabs_gui->addTab(
1609  "id_meta_data",
1610  $this->lng->txt("meta_data"),
1611  $mdtab
1612  );
1613  }
1614  }
1615 
1616  if ($this->checkPermissionBool('write')) {
1617  $this->tabs_gui->addTab(
1618  'export',
1619  $this->lng->txt('export'),
1620  $this->ctrl->getLinkTargetByClass('ilexportgui', '')
1621  );
1622  }
1623 
1624  // will add permission tab if needed
1625  parent::setTabs();
1626  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
+ Here is the call graph for this function:

◆ settings()

ilObjLinkResourceGUI::settings ( )
protected

Definition at line 244 of file class.ilObjLinkResourceGUI.php.

References ilObject2GUI\checkPermission(), ilPropertyFormGUI\getHTML(), and initFormSettings().

Referenced by __construct(), callLink(), checkLinkInput(), exportHTML(), initFormLink(), saveAddLink(), and updateLink().

244  : void
245  {
246  $this->checkPermission('write');
247  $this->tabs_gui->activateTab('id_settings');
248 
249  $form = $this->initFormSettings();
250  $this->tpl->setContent($form->getHTML());
251  }
checkPermission(string $perm, string $cmd="", string $type="", int $ref_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setValuesFromLink()

ilObjLinkResourceGUI::setValuesFromLink ( int  $a_link_id)
protected

Definition at line 804 of file class.ilObjLinkResourceGUI.php.

References ILIAS\Repository\form(), getWebLinkRepo(), and ILIAS\Repository\int().

Referenced by editLink().

804  : void
805  {
806  $item = $this->getWebLinkRepo()->getItemByLinkId($a_link_id);
807  $this->form->setValuesByArray(
808  array(
809  'title' => $item->getTitle(),
810  'tar' => $item->getTarget(),
811  'desc' => $item->getDescription(),
812  'act' => (int) $item->isActive()
813  )
814  );
815  }
form( $class_path, string $cmd)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showLinks()

ilObjLinkResourceGUI::showLinks ( )
protected

Definition at line 1234 of file class.ilObjLinkResourceGUI.php.

References activateTabs(), ilObject2GUI\checkPermission(), and showToolbar().

Referenced by view().

1234  : void
1235  {
1236  $this->checkPermission('read');
1237  $this->activateTabs('content', 'id_content_view');
1238 
1239  $table = new ilWebResourceLinkTableGUI($this, 'showLinks');
1240  $table->parse();
1241 
1242  $this->tpl->addBlockFile(
1243  'ADM_CONTENT',
1244  'adm_content',
1245  'tpl.webr_view.html',
1246  'Modules/WebResource'
1247  );
1248  $this->showToolbar('ACTION_BUTTONS');
1249  $this->tpl->setVariable('LINK_TABLE', $table->getHTML());
1250  }
checkPermission(string $perm, string $cmd="", string $type="", int $ref_id=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
activateTabs(string $a_active_tab, string $a_active_subtab='')
Activate tab and subtabs.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showToolbar()

ilObjLinkResourceGUI::showToolbar ( string  $a_tpl_var)
protected

Definition at line 1293 of file class.ilObjLinkResourceGUI.php.

References $DIC, Vendor\Package\$f, ilObject2GUI\checkPermissionBool(), ILIAS\Repository\ctrl(), getLinkToListModal(), getWebLinkRepo(), and ILIAS\Repository\lng().

Referenced by manage(), showLinks(), and sort().

1293  : void
1294  {
1295  global $DIC;
1296 
1297  $tool = new ilToolbarGUI();
1298  $tool->setFormAction($this->ctrl->getFormAction($this));
1299 
1300  $f = $DIC->ui()->factory();
1301  $r = $DIC->ui()->renderer();
1302 
1303  if (
1304  $this->getWebLinkRepo()->doesListExist() &&
1305  $this->checkPermissionBool('write')
1306  ) {
1307  $tool->addButton(
1308  $this->lng->txt('webr_add'),
1309  $this->ctrl->getLinkTarget($this, 'addLink')
1310  );
1311  } elseif ($this->checkPermissionBool('write')) {
1312  $modal = $this->getLinkToListModal();
1313  $button = $f->button()->standard(
1314  $this->lng->txt('webr_set_to_list'),
1315  '#'
1316  )
1317  ->withOnClick($modal->getShowSignal());
1318 
1319  $this->tpl->setVariable("MODAL", $r->render([$modal]));
1320 
1321  $tool->addComponent($button);
1322  }
1323 
1324  $download_button = $f->button()->standard(
1325  $this->lng->txt('export_html'),
1326  $this->ctrl->getLinkTarget($this, 'exportHTML')
1327  );
1328  $tool->addComponent($download_button);
1329  $this->tpl->setVariable($a_tpl_var, $tool->getHTML());
1330  }
getLinkToListModal()
Get form to transform a single weblink to a weblink list.
global $DIC
Definition: feed.php:28
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sort()

ilObjLinkResourceGUI::sort ( )
protected

Definition at line 1252 of file class.ilObjLinkResourceGUI.php.

References activateTabs(), ilObject2GUI\checkPermission(), and showToolbar().

Referenced by view().

1252  : void
1253  {
1254  $this->checkPermission('write');
1255  $this->activateTabs('content', 'id_content_ordering');
1256 
1257  $table = new ilWebResourceLinkTableGUI($this, 'sort', true);
1258  $table->parse();
1259 
1260  $this->tpl->addBlockFile(
1261  'ADM_CONTENT',
1262  'adm_content',
1263  'tpl.webr_view.html',
1264  'Modules/WebResource'
1265  );
1266  $this->showToolbar('ACTION_BUTTONS');
1267  $this->tpl->setVariable('LINK_TABLE', $table->getHTML());
1268  }
checkPermission(string $perm, string $cmd="", string $type="", int $ref_id=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
activateTabs(string $a_active_tab, string $a_active_subtab='')
Activate tab and subtabs.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ switchViewMode()

ilObjLinkResourceGUI::switchViewMode ( ?int  $force_view_mode = null)
protected

Switch between "View" "Manage" and "Sort".

Definition at line 1145 of file class.ilObjLinkResourceGUI.php.

References $view_mode, ILIAS\FileDelivery\http(), initViewMode(), ILIAS\Repository\refinery(), and view().

Referenced by editLinks().

1145  : void
1146  {
1147  $new_view_mode = $this->view_mode;
1148  if ($force_view_mode !== null) {
1149  $new_view_mode = $force_view_mode;
1150  } else {
1151  if ($this->http->wrapper()->query()->has('switch_mode')) {
1152  $new_view_mode = $this->http->wrapper()->query()->retrieve(
1153  'switch_mode',
1154  $this->refinery->kindlyTo()->int()
1155  );
1156  }
1157  }
1158  $this->initViewMode($new_view_mode);
1159  $this->view();
1160  }
static http()
Fetches the global http state from ILIAS.
initViewMode(?int $new_view_mode=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateLink()

ilObjLinkResourceGUI::updateLink ( )

Definition at line 420 of file class.ilObjLinkResourceGUI.php.

References $valid, ilPropertyFormGUI\checkInput(), checkLinkInput(), ilObject2GUI\checkPermission(), ILIAS\Repository\ctrl(), ilPropertyFormGUI\getHTML(), ilPropertyFormGUI\getInput(), getWebLinkRepo(), ILIAS\FileDelivery\http(), initFormLink(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), settings(), and ilPropertyFormGUI\setValuesByPost().

420  : void
421  {
422  $this->checkPermission('write');
423 
424  $form = $this->initFormLink(self::LINK_MOD_EDIT);
425  $valid = $form->checkInput();
426  $link_id = 0;
427  if ($this->http->wrapper()->query()->has('link_id')) {
428  $link_id = $this->http->wrapper()->query()->retrieve(
429  'link_id',
430  $this->refinery->kindlyTo()->int()
431  );
432  }
433  if ($this->checkLinkInput(
434  self::LINK_MOD_EDIT,
435  $valid,
436  $link_id
437  )) {
438  $item = $this->getWebLinkRepo()->getItemByLinkId($link_id);
439  foreach ($item->getParameters() as $parameter) {
440  $this->draft_item->addParameter($parameter);
441  }
442 
443  if (
444  $this->settings->get('links_dynamic') &&
445  $this->draft_parameter !== null
446  ) {
447  $this->draft_item->addParameter($this->draft_parameter);
448  }
449  $this->getWebLinkRepo()->updateItem($item, $this->draft_item);
450 
451  if (!$this->getWebLinkRepo()->doesListExist()) {
452  $this->object->setTitle($form->getInput('title'));
453  $this->object->setDescription($form->getInput('desc'));
454  $this->object->update();
455  }
456  $this->tpl->setOnScreenMessage(
457  'success',
458  $this->lng->txt('settings_saved'),
459  true
460  );
461  $this->ctrl->redirect($this, 'view');
462  }
463  $this->tpl->setOnScreenMessage(
464  'failure',
465  $this->lng->txt('err_check_input')
466  );
468  $this->tpl->setContent($form->getHTML());
469  }
checkPermission(string $perm, string $cmd="", string $type="", int $ref_id=null)
$valid
checkLinkInput(int $a_mode, bool $a_valid, ?int $a_link_id=null)
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

◆ updateLinks()

ilObjLinkResourceGUI::updateLinks ( )
protected

Definition at line 659 of file class.ilObjLinkResourceGUI.php.

References ilObjectGUI\$data, $param, activateTabs(), ilObject2GUI\checkPermission(), ILIAS\Repository\ctrl(), getWebLinkRepo(), ILIAS\FileDelivery\http(), ilLinkInputGUI\isInternalLink(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ilUtil\stripSlashes().

659  : void
660  {
661  $this->checkPermission('write');
662  $this->activateTabs('content', '');
663 
664  $ids = [];
665  if ($this->http->wrapper()->post()->has('ids')) {
666  $ids = $this->http->wrapper()->post()->retrieve(
667  'ids',
668  $this->refinery->kindlyTo()->dictOf(
669  $this->refinery->kindlyTo()->int()
670  )
671  );
672  }
673 
674  if ($ids === []) {
675  $this->tpl->setOnScreenMessage(
676  'failure',
677  $this->lng->txt('select_one'),
678  true
679  );
680  $this->ctrl->redirect($this, 'view');
681  }
682 
683  $link_post = (array) ($this->http->request()->getParsedBody(
684  )['links'] ?? []);
685 
686  // Validate
687  $invalid = [];
688  foreach ($ids as $link_id) {
689  $data = $link_post[$link_id];
690 
691  if (
692  $this->http->wrapper()->post()->has(
693  'tar_' . $link_id . '_ajax_type'
694  ) &&
695  $this->http->wrapper()->post()->has(
696  'tar_' . $link_id . '_ajax_id'
697  )
698  ) {
699  $data['tar'] =
700  $this->http->wrapper()->post()->retrieve(
701  'tar_' . $link_id . '_ajax_type',
702  $this->refinery->kindlyTo()->string()
703  ) . '|' .
704  $this->http->wrapper()->post()->retrieve(
705  'tar_' . $link_id . '_ajax_id',
706  $this->refinery->kindlyTo()->string()
707  );
708  }
709  if (!strlen($data['title'] ?? '')) {
710  $invalid[] = $link_id;
711  continue;
712  }
713  if (!strlen($data['tar'] ?? '')) {
714  $invalid[] = $link_id;
715  continue;
716  }
717  if (($data['nam'] ?? false) && !($data['val'] ?? false)) {
718  $invalid[] = $link_id;
719  continue;
720  }
721  if (!($data['nam'] ?? false) && ($data['val'] ?? false)) {
722  $invalid[] = $link_id;
723  }
724  }
725 
726  if ($invalid !== []) {
727  $this->tpl->setOnScreenMessage(
728  'failure',
729  $this->lng->txt('err_check_input')
730  );
731  $this->tpl->addBlockFile(
732  'ADM_CONTENT',
733  'adm_content',
734  'tpl.webr_manage.html',
735  'Modules/WebResource'
736  );
737  $table = new ilWebResourceEditableLinkTableGUI($this, 'view');
738  $table->setInvalidLinks($invalid);
739  $table->parseSelectedLinks($ids);
740  $table->updateFromPost();
741  $this->tpl->setVariable('TABLE_LINKS', $table->getHTML());
742  return;
743  }
744 
745  // Save Settings
746  foreach ($ids as $link_id) {
747  $data = $link_post[$link_id];
748 
749  if (
750  $this->http->wrapper()->post()->has(
751  'tar_' . $link_id . '_ajax_type'
752  ) &&
753  $this->http->wrapper()->post()->has(
754  'tar_' . $link_id . '_ajax_id'
755  )
756  ) {
757  $data['tar'] =
758  $this->http->wrapper()->post()->retrieve(
759  'tar_' . $link_id . '_ajax_type',
760  $this->refinery->kindlyTo()->string()
761  ) . '|' .
762  $this->http->wrapper()->post()->retrieve(
763  'tar_' . $link_id . '_ajax_id',
764  $this->refinery->kindlyTo()->string()
765  );
766  }
767 
768  $item = $this->getWebLinkRepo()->getItemByLinkId($link_id);
769  $draft = new ilWebLinkDraftItem(
771  ilUtil::stripSlashes($data['title'] ?? ''),
772  ilUtil::stripSlashes($data['desc'] ?? ''),
773  str_replace('"', '', ilUtil::stripSlashes($data['tar'] ?? '')),
774  (bool) ($data['act'] ?? false),
775  $item->getParameters()
776  );
777 
778  if (strlen($data['nam'] ?? '') && $data['val'] ?? '') {
780  (int) ($data['val'] ?? 0),
781  ilUtil::stripSlashes($data['nam'] ?? '')
782  );
783  $draft->addParameter($param);
784  }
785 
786  $this->getWebLinkRepo()->updateItem($item, $draft);
787 
788  if (!$this->getWebLinkRepo()->doesListExist()) {
789  $this->object->setTitle(ilUtil::stripSlashes($data['title'] ?? ''));
790  $this->object->setDescription(
791  ilUtil::stripSlashes($data['desc'] ?? '')
792  );
793  $this->object->update();
794  }
795  }
796  $this->tpl->setOnScreenMessage(
797  'success',
798  $this->lng->txt('settings_saved'),
799  true
800  );
801  $this->ctrl->redirect($this, 'view');
802  }
checkPermission(string $perm, string $cmd="", string $type="", int $ref_id=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
activateTabs(string $a_active_tab, string $a_active_subtab='')
Activate tab and subtabs.
static http()
Fetches the global http state from ILIAS.
$param
Definition: xapitoken.php:46
static isInternalLink(string $a_value)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ view()

ilObjLinkResourceGUI::view ( )

Definition at line 1170 of file class.ilObjLinkResourceGUI.php.

References ilContainerSortingSettings\_lookupSortMode(), ilObject2GUI\checkPermission(), ILIAS\FileDelivery\http(), manage(), ILIAS\Repository\object(), ILIAS\Repository\refinery(), showLinks(), sort(), and ilContainer\SORT_MANUAL.

Referenced by confirmDeleteLink(), saveLinkList(), saveSorting(), and switchViewMode().

1170  : void
1171  {
1172  $this->tabs_gui->activateTab("id_content");
1173  $this->checkPermission('read');
1174 
1175  $base_class = $this->http->wrapper()->query()->retrieve(
1176  'baseClass',
1177  $this->refinery->kindlyTo()->string()
1178  );
1179  if (strcasecmp($base_class, ilAdministrationGUI::class) === 0) {
1180  parent::view();
1181  return;
1182  } else {
1183  switch ($this->view_mode) {
1184  case self::VIEW_MODE_MANAGE:
1185  $this->manage();
1186  break;
1187 
1188  case self::VIEW_MODE_SORT:
1189  // #14638
1191  $this->object->getId()
1192  ) == ilContainer::SORT_MANUAL) {
1193  $this->sort();
1194  break;
1195  }
1196  $this->showLinks();
1197  break;
1198 
1199  default:
1200  $this->showLinks();
1201  break;
1202  }
1203  }
1204  $this->tpl->setPermanentLink(
1205  $this->object->getType(),
1206  $this->object->getRefId()
1207  );
1208  }
checkPermission(string $perm, string $cmd="", string $type="", int $ref_id=null)
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $draft_item

ilWebLinkDraftItem ilObjLinkResourceGUI::$draft_item = null
private

Definition at line 50 of file class.ilObjLinkResourceGUI.php.

◆ $draft_list

ilWebLinkDraftList ilObjLinkResourceGUI::$draft_list = null
private

Definition at line 52 of file class.ilObjLinkResourceGUI.php.

◆ $draft_parameter

ilWebLinkDraftParameter ilObjLinkResourceGUI::$draft_parameter = null
private

Definition at line 51 of file class.ilObjLinkResourceGUI.php.

◆ $form

ilPropertyFormGUI ilObjLinkResourceGUI::$form = null
private

Definition at line 49 of file class.ilObjLinkResourceGUI.php.

Referenced by initCreateForm(), initFormLink(), and initFormSettings().

◆ $http

HTTPService ilObjLinkResourceGUI::$http
protected

Definition at line 44 of file class.ilObjLinkResourceGUI.php.

◆ $navigationHistory

ilNavigationHistory ilObjLinkResourceGUI::$navigationHistory
protected

Definition at line 45 of file class.ilObjLinkResourceGUI.php.

◆ $view_mode

int ilObjLinkResourceGUI::$view_mode = self::VIEW_MODE_VIEW
private

Definition at line 47 of file class.ilObjLinkResourceGUI.php.

Referenced by switchViewMode().

◆ LINK_MOD_ADD

const ilObjLinkResourceGUI::LINK_MOD_ADD = 3
protected

Definition at line 39 of file class.ilObjLinkResourceGUI.php.

◆ LINK_MOD_ASYNC

const ilObjLinkResourceGUI::LINK_MOD_ASYNC = 6
protected

Definition at line 42 of file class.ilObjLinkResourceGUI.php.

◆ LINK_MOD_CREATE

const ilObjLinkResourceGUI::LINK_MOD_CREATE = 1
protected

Definition at line 37 of file class.ilObjLinkResourceGUI.php.

◆ LINK_MOD_EDIT

const ilObjLinkResourceGUI::LINK_MOD_EDIT = 2
protected

Definition at line 38 of file class.ilObjLinkResourceGUI.php.

◆ LINK_MOD_EDIT_LIST

const ilObjLinkResourceGUI::LINK_MOD_EDIT_LIST = 5
protected

Definition at line 41 of file class.ilObjLinkResourceGUI.php.

◆ LINK_MOD_SET_LIST

const ilObjLinkResourceGUI::LINK_MOD_SET_LIST = 4
protected

Definition at line 40 of file class.ilObjLinkResourceGUI.php.

◆ VIEW_MODE_MANAGE

const ilObjLinkResourceGUI::VIEW_MODE_MANAGE = 2
protected

Definition at line 34 of file class.ilObjLinkResourceGUI.php.

◆ VIEW_MODE_SORT

const ilObjLinkResourceGUI::VIEW_MODE_SORT = 3
protected

Definition at line 35 of file class.ilObjLinkResourceGUI.php.

◆ VIEW_MODE_VIEW

const ilObjLinkResourceGUI::VIEW_MODE_VIEW = 1
protected

Definition at line 33 of file class.ilObjLinkResourceGUI.php.


The documentation for this class was generated from the following file: