ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjLinkResourceGUI Class Reference

Class ilObjLinkResourceGUI. More...

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

Public Member Functions

 getType ()
 
 executeCommand ()
 
 save ()
 Save new object public. More...
 
 editLink ()
 Edit a single link. More...
 
 updateLink ()
 Save after editing. More...
 
 getLinkToListModal ()
 Get form to transform a single weblink to a weblink list. More...
 
 saveLinkList ()
 Save form data. More...
 
 addLink ()
 Add an additional link. More...
 
 saveAddLink ()
 Save form data. More...
 
 view ()
 View object. More...
 
 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 ()
 
 formatInvalidLinkArray (array $row)
 
 saveLinkCheck ()
 
 refreshLinkCheck ()
 
 __initLinkChecker ()
 
 setTabs ()
 get tabs public More...
 
 __prepareOutput ()
 
 addLocatorItems ()
 
 callDirectLink ()
 
 callLink ()
 
 exportHTML ()
 
- Public Member Functions inherited from ilObject2GUI
 __construct ($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
 Constructor. More...
 
 executeCommand ()
 execute command More...
 
 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 ($a_mode=true)
 
 getCreationMode ()
 
 prepareOutput ($a_show_subobjects=true)
 
 isVisible ($a_ref_id, $a_type)
 
 trash ()
 
 undelete ()
 
 cancelDelete ()
 
 removeFromSystem ()
 
 cloneAll ()
 
 view ()
 view object content (repository/workspace switch) More...
 
 getType ()
 Functions that must be overwritten. More...
 
 create ()
 Deleted in ilObject. More...
 
 save ()
 
 edit ()
 
 update ()
 
 cancel ()
 
 importFile ()
 Import. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 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 public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. 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 ($a_target, $a_additional=null)
 
- Static Public Member Functions inherited from ilObject2GUI
static handleAfterSaveCallback (ilObject $a_obj, $a_callback_ref_id)
 After creation callback. More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 

Data Fields

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
 
- 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 COPY_WIZARD_NEEDS_PAGE = 1
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Protected Member Functions

 initCreateForm ($a_new_type)
 
 afterSave (ilObject $a_new_object)
 
 settings ()
 Edit settings Title, Description, Sorting. More...
 
 saveSettings ()
 Save container settings. More...
 
 initFormSettings ()
 Show settings form. More...
 
 deleteParameter ()
 Delete a dynamic parameter. More...
 
 deleteParameterForm ()
 
 updateLinks ()
 Update all visible links. More...
 
 setValuesFromLink ($a_link_id)
 Set form values from link. More...
 
 initList (int $a_mode, int $a_webr_id=0)
 Init a new link list. More...
 
 checkLinkInput ($a_mode, $a_valid, $a_webr_id=0, $a_link_id=0)
 Check input after creating a new link. More...
 
 initFormLink ($a_mode)
 Show create/edit single link. More...
 
 switchViewMode ()
 Switch between "View" "Manage" and "Sort". More...
 
 editLinks ()
 Start with manage mode. More...
 
 manage ()
 Manage links. More...
 
 showLinks ()
 Show all active links. More...
 
 sort ()
 Sort web links. More...
 
 saveSorting ()
 Save nmanual sorting. More...
 
 showToolbar ($a_tpl_var)
 Show toolbar. More...
 
 confirmDeleteLink ()
 Show delete confirmation screen. More...
 
 deleteLinks ()
 Delete links. More...
 
 deactivateLink ()
 Deactivate links. More...
 
 linkChecker ()
 Show link validation. More...
 
 activateTabs ($a_active_tab, $a_active_subtab='')
 Activate tab and subtabs. More...
 
 handleSubItemLinks ($a_target)
 
 redirectToLink ($a_ref_id, $a_obj_id, $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 ()
 Get access handler. More...
 
 setLocator ()
 set Locator More...
 
 deleteConfirmedObjects ()
 Delete objects (workspace specific) More...
 
 setTitleAndDescription ()
 
 showUpperIcon ()
 
 omitLocator ($a_omit=true)
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 
 setTargetFrame ($a_cmd, $a_target_frame)
 
 getCenterColumnHTML ()
 
 getRightColumnHTML ()
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 
 showPossibleSubObjects ()
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 
 searchCloneSource ()
 
 buildCloneSelect ($existing_objs)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation ($a_cmd, $a_location="")
 Deprecated functions. More...
 
 setReturnLocation ($a_cmd, $a_location)
 
 showActions ()
 
 getTabs ()
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
 Check permission. More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 redrawHeaderAction ()
 Updating icons after ajax call. More...
 
 getPermanentLinkWidget ($a_append=null, $a_center=false)
 
 handleAutoRating (ilObject $a_new_obj)
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 Get object service. More...
 
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 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 public More...
 
 setAdminTabs ()
 set admin tabs public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_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 $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_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...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Additional Inherited Members

- Protected Attributes inherited from ilObject2GUI
 $object_id
 
 $node_id
 
 $creation_forms = array()
 
 $id_type = array()
 
 $parent_id
 
 $access_handler
 
- Protected Attributes inherited from ilObjectGUI
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 
 $request
 

Detailed Description

Member Function Documentation

◆ __initLinkChecker()

ilObjLinkResourceGUI::__initLinkChecker ( )

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

References $DIC, and $ilDB.

Referenced by linkChecker(), and refreshLinkCheck().

1429  {
1430  global $DIC;
1431 
1432  $ilDB = $DIC['ilDB'];
1433 
1434  include_once './Services/LinkChecker/classes/class.ilLinkChecker.php';
1435 
1436  $this->link_checker_obj = new ilLinkChecker($ilDB, false);
1437  $this->link_checker_obj->setObjId($this->object->getId());
1438 
1439  return true;
1440  }
class for checking external links in page objects Normally used in Cron jobs, but should be extensibl...
global $DIC
Definition: goto.php:24
global $ilDB
+ Here is the caller graph for this function:

◆ __prepareOutput()

ilObjLinkResourceGUI::__prepareOutput ( )

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

References ilUtil\infoPanel(), and ilUtil\sendInfo().

Referenced by executeCommand().

1581  {
1582  // output objects
1583  // $this->tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
1584  // $this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
1585 
1586  $this->tpl->setLocator();
1587 
1588  // output message
1589  if ($this->message) {
1590  ilUtil::sendInfo($this->message);
1591  }
1592 
1593  // display infopanel if something happened
1595  ;
1596  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static infoPanel($a_keep=true)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _goto()

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

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

References $_GET, $DIC, ilObjectGUI\$ilErr, ilObjectGUI\$lng, ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), exit, ilUtil\redirect(), ROOT_FOLDER_ID, and ilUtil\sendFailure().

1749  {
1750  global $DIC;
1751 
1752  $ilAccess = $DIC['ilAccess'];
1753  $ilErr = $DIC['ilErr'];
1754  $lng = $DIC['lng'];
1755 
1756  if ($a_additional && substr($a_additional, -3) == "wsp") {
1757  $_GET["baseClass"] = "ilsharedresourceGUI";
1758  $_GET["wsp_id"] = $a_target;
1759  include("ilias.php");
1760  exit;
1761  }
1762 
1763  // Will be replaced in future releases by ilAccess::checkAccess()
1764  if ($ilAccess->checkAccess("read", "", $a_target)) {
1765  ilUtil::redirect("ilias.php?baseClass=ilLinkResourceHandlerGUI&ref_id=$a_target");
1766  } else {
1767  // to do: force flat view
1768  if ($ilAccess->checkAccess("visible", "", $a_target)) {
1769  ilUtil::redirect("ilias.php?baseClass=ilLinkResourceHandlerGUI&ref_id=" . $a_target . "&cmd=infoScreen");
1770  } else {
1771  if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
1772  ilUtil::sendFailure(sprintf(
1773  $lng->txt("msg_no_perm_read_item"),
1775  ), true);
1777  }
1778  }
1779  }
1780 
1781  $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
1782  }
exit
Definition: login.php:29
const ROOT_FOLDER_ID
Definition: constants.php:30
$_GET["client_id"]
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupTitle($a_id)
lookup object title
static _lookupObjId($a_id)
global $DIC
Definition: goto.php:24
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static redirect($a_script)
+ Here is the call graph for this function:

◆ activateTabs()

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

Activate tab and subtabs.

Parameters
string$a_active_tab
string$a_active_subtab[optional]
Returns

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

References $DIC, ilObjectGUI\$lng, ilContainerSortingSettings\_lookupSortMode(), ilObject2GUI\checkPermissionBool(), ilLinkResourceItems\lookupNumberOfLinks(), and ilContainer\SORT_MANUAL.

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

1450  {
1451  global $DIC;
1452 
1453  $ilCtrl = $DIC['ilCtrl'];
1454  $ilTabs = $DIC['ilTabs'];
1455  $lng = $DIC['lng'];
1456 
1457  switch ($a_active_tab) {
1458  case 'content':
1459  if ($this->checkPermissionBool('write')) {
1460  $this->lng->loadLanguageModule('cntr');
1461 
1462  $this->ctrl->setParameter($this, 'switch_mode', self::VIEW_MODE_VIEW);
1463  $ilTabs->addSubTab(
1464  'id_content_view',
1465  $lng->txt('view'),
1466  $this->ctrl->getLinkTarget($this, 'switchViewMode')
1467  );
1468  $this->ctrl->setParameter($this, 'switch_mode', self::VIEW_MODE_MANAGE);
1469  $ilTabs->addSubTab(
1470  'id_content_manage',
1471  $lng->txt('cntr_manage'),
1472  $this->ctrl->getLinkTarget($this, 'switchViewMode')
1473  );
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';
1477  if ((ilLinkResourceItems::lookupNumberOfLinks($this->object->getId()) > 1)
1479  $this->ctrl->setParameter($this, 'switch_mode', self::VIEW_MODE_SORT);
1480  $ilTabs->addSubTab(
1481  'id_content_ordering',
1482  $this->lng->txt('cntr_ordering'),
1483  $this->ctrl->getLinkTarget($this, 'switchViewMode')
1484  );
1485  }
1486 
1487  $ilCtrl->clearParameters($this);
1488  $ilTabs->activateSubTab($a_active_subtab);
1489  }
1490  }
1491 
1492  $ilTabs->activateTab('id_content');
1493  }
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
static lookupNumberOfLinks($a_webr_id)
Get number of assigned links.
global $DIC
Definition: goto.php:24
static _lookupSortMode($a_obj_id)
lookup sort mode
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addLink()

ilObjLinkResourceGUI::addLink ( )

Add an additional link.

Returns

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

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

478  {
479  $this->checkPermission('write');
480  $this->activateTabs('content', 'id_content_view');
481 
482  $this->initFormLink(self::LINK_MOD_ADD);
483  $this->tpl->setContent($this->form->getHTML());
484  }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
initFormLink($a_mode)
Show create/edit single link.
activateTabs($a_active_tab, $a_active_subtab='')
Activate tab and subtabs.
+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjLinkResourceGUI::addLocatorItems ( )

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

References $DIC.

1599  {
1600  global $DIC;
1601 
1602  $ilLocator = $DIC['ilLocator'];
1603 
1604  if (is_object($this->object)) {
1605  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this), "", $this->object->getRefId(), "webr");
1606  }
1607  }
global $DIC
Definition: goto.php:24

◆ afterSave()

ilObjLinkResourceGUI::afterSave ( ilObject  $a_new_object)
protected

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

References ilObject\getId(), ilObject\getRefId(), and ilUtil\redirect().

175  {
176  if ($this->form->getInput('tar_mode_type') == 'single') {
177  // Save link
178  $this->link->setLinkResourceId($a_new_object->getId());
179  $link_id = $this->link->add();
180  $this->link->updateValid(true);
181 
182  ilUtil::sendSuccess($this->lng->txt('webr_link_added'));
183  }
184 
185  if ($this->form->getInput('tar_mode_type') == 'list') {
186  // Save list
187  $this->list->setListResourceId($a_new_object->getId());
188  $this->list->add();
189 
190  ilUtil::sendSuccess($this->lng->txt('webr_list_added'));
191  }
192 
193  // personal workspace
194  if ($this->id_type == self::WORKSPACE_NODE_ID) {
195  $this->ctrl->redirect($this, "editLinks");
196  }
197  // repository
198  else {
199  ilUtil::redirect("ilias.php?baseClass=ilLinkResourceHandlerGUI&ref_id=" .
200  $a_new_object->getRefId() . "&cmd=switchViewMode&switch_mode=2");
201  }
202  }
getId()
get object id public
getRefId()
get reference id public
static redirect($a_script)
+ Here is the call graph for this function:

◆ callDirectLink()

ilObjLinkResourceGUI::callDirectLink ( )

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

References ilObjectGUI\$obj_id, $url, ilParameterAppender\_append(), ilLinkResourceItems\_getFirstLink(), ilParameterAppender\_isEnabled(), ilLinkResourceItems\_isSingular(), handleSubItemLinks(), and redirectToLink().

1651  {
1652  $obj_id = $this->object->getId();
1653 
1654  include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
1657  if ($url["target"]) {
1658  $url["target"] = $this->handleSubItemLinks($url["target"]);
1659 
1660  include_once './Modules/WebResource/classes/class.ilParameterAppender.php';
1663  }
1664 
1665  $this->redirectToLink($this->ref_id, $obj_id, $url["target"]);
1666  }
1667  }
1668  }
static _isSingular($a_webr_id)
Check whether there is only one active link in the web resource.
static _append($a_link_data)
static _getFirstLink($a_webr_id)
Get first link item Check before with _isSingular() if there is more or less than one...
$url
redirectToLink($a_ref_id, $a_obj_id, $a_url)
static _isEnabled()
Check if dynamic parameters are enabled.
+ Here is the call graph for this function:

◆ callLink()

ilObjLinkResourceGUI::callLink ( )

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

References ilObjectGUI\$obj_id, ilParameterAppender\_append(), ilParameterAppender\_isEnabled(), ilLoggerFactory\getLogger(), handleSubItemLinks(), and redirectToLink().

1671  {
1672  if ($_REQUEST["link_id"]) {
1673  $obj_id = $this->object->getId();
1674 
1675  include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
1676  $items = new ilLinkResourceItems($obj_id);
1677  $item = $items->getItem($_REQUEST["link_id"]);
1678  if ($item["target"]) {
1679  $item["target"] = $this->handleSubItemLinks($item["target"]);
1680 
1681  include_once './Modules/WebResource/classes/class.ilParameterAppender.php';
1683  $item = ilParameterAppender::_append($item);
1684  }
1685  ilLoggerFactory::getLogger('webr')->debug('Redirecting to: ' . $item['target']);
1686  $this->redirectToLink($this->ref_id, $obj_id, $item["target"]);
1687  }
1688  }
1689  }
static _append($a_link_data)
Class ilLinkResourceItems.
static getLogger($a_component_id)
Get component logger.
redirectToLink($a_ref_id, $a_obj_id, $a_url)
static _isEnabled()
Check if dynamic parameters are enabled.
+ Here is the call graph for this function:

◆ checkLinkInput()

ilObjLinkResourceGUI::checkLinkInput (   $a_mode,
  $a_valid,
  $a_webr_id = 0,
  $a_link_id = 0 
)
protected

Check input after creating a new link.

Parameters
object$a_mode
bool$a_valid
object$a_webr_id[optional]
object$a_link_id[optional]
Returns

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

References $valid, ilParameterAppender\_isEnabled(), ilLinkInputGUI\isInternalLink(), LINKS_ERR_NO_NAME, LINKS_ERR_NO_NAME_VALUE, LINKS_ERR_NO_VALUE, and ilUtil\stripSlashes().

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

732  {
733  $valid = $a_valid;
734 
735  $link_input = $this->form->getInput('tar');
736 
737  include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
738  $this->link = new ilLinkResourceItems($a_webr_id);
739  $this->link->setTarget(str_replace('"', '', ilUtil::stripSlashes($link_input)));
740  $this->link->setTitle($this->form->getInput('title'));
741  $this->link->setDescription($this->form->getInput('desc'));
742  $this->link->setDisableCheckStatus($this->form->getInput('che'));
743  $this->link->setInternal(ilLinkInputGUI::isInternalLink($link_input));
744 
745  if ($a_mode == self::LINK_MOD_CREATE) {
746  $this->link->setActiveStatus(true);
747  } else {
748  $this->link->setActiveStatus($this->form->getInput('act'));
749  }
750 
751  if ($a_mode == self::LINK_MOD_EDIT) {
752  $this->link->setValidStatus($this->form->getInput('vali'));
753  } else {
754  $this->link->setValidStatus(true);
755  }
756 
758  return $valid;
759  }
760 
761  $this->dynamic = new ilParameterAppender($a_webr_id);
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()) {
766  case LINKS_ERR_NO_NAME:
767  $this->form->getItemByPostVar('nam')->setAlert($this->lng->txt('links_no_name_given'));
768  return false;
769 
770  case LINKS_ERR_NO_VALUE:
771  $this->form->getItemByPostVar('val')->setAlert($this->lng->txt('links_no_value_given'));
772  return false;
773 
775  // Nothing entered => no error
776  return $valid;
777  }
778  $this->dynamic = null;
779  }
780  return $valid;
781  }
$valid
static isInternalLink($a_value)
const LINKS_ERR_NO_VALUE
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
const LINKS_ERR_NO_NAME
Class ilLinkResourceItems.
Class ilParameterAppender.
const LINKS_ERR_NO_NAME_VALUE
static _isEnabled()
Check if dynamic parameters are enabled.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirmDeleteLink()

ilObjLinkResourceGUI::confirmDeleteLink ( )
protected

Show delete confirmation screen.

Returns

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

References $_GET, $_POST, activateTabs(), ilObject2GUI\checkPermission(), ilUtil\sendFailure(), and view().

1159  {
1160  $this->checkPermission('write');
1161  $this->activateTabs('content', 'id_content_view');
1162 
1163  $link_ids = array();
1164 
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']);
1169  }
1170 
1171  if (!count($link_ids) > 0) {
1172  ilUtil::sendFailure($this->lng->txt('select_one'));
1173  $this->view();
1174  return false;
1175  }
1176 
1177  include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
1178  $links = new ilLinkResourceItems($this->object->getId());
1179 
1180  include_once 'Services/Utilities/classes/class.ilConfirmationGUI.php';
1181  $confirm = new ilConfirmationGUI();
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');
1186 
1187  foreach ($link_ids as $link_id) {
1188  $link = $links->getItem($link_id);
1189  $confirm->addItem('link_ids[]', $link_id, $link['title']);
1190  }
1191  $this->tpl->setContent($confirm->getHTML());
1192  }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
$_GET["client_id"]
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Class ilLinkResourceItems.
activateTabs($a_active_tab, $a_active_subtab='')
Activate tab and subtabs.
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ deactivateLink()

ilObjLinkResourceGUI::deactivateLink ( )
protected

Deactivate links.

Returns

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

References $_GET, $DIC, ilObject2GUI\checkPermission(), and ilUtil\sendFailure().

1221  {
1222  global $DIC;
1223 
1224  $ilCtrl = $DIC['ilCtrl'];
1225 
1226  $this->checkPermission('write');
1227 
1228  include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
1229  $links = new ilLinkResourceItems($this->object->getId());
1230 
1231  if (!$_GET['link_id']) {
1232  ilUtil::sendFailure($this->lng->txt('select_one'), true);
1233  $ilCtrl->redirect($this, 'view');
1234  }
1235 
1236  $links->setLinkId((int) $_GET['link_id']);
1237  $links->updateActive(false);
1238 
1239  ilUtil::sendSuccess($this->lng->txt('webr_inactive_success'), true);
1240  $ilCtrl->redirect($this, 'view');
1241  }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
$_GET["client_id"]
global $DIC
Definition: goto.php:24
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Class ilLinkResourceItems.
+ Here is the call graph for this function:

◆ deleteLinks()

ilObjLinkResourceGUI::deleteLinks ( )
protected

Delete links.

Returns

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

References $_POST, $DIC, ilObject2GUI\checkPermission(), and ilLinkResourceItems\delete().

1199  {
1200  global $DIC;
1201 
1202  $ilCtrl = $DIC['ilCtrl'];
1203 
1204  $this->checkPermission('write');
1205 
1206  include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
1207  $links = new ilLinkResourceItems($this->object->getId());
1208 
1209  foreach ($_POST['link_ids'] as $link_id) {
1210  $links->delete($link_id);
1211  }
1212  ilUtil::sendSuccess($this->lng->txt('webr_deleted_items'), true);
1213  $ilCtrl->redirect($this, 'view');
1214  }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
global $DIC
Definition: goto.php:24
Class ilLinkResourceItems.
delete($a_item_id, $a_update_history=true)
$_POST["username"]
+ Here is the call graph for this function:

◆ deleteParameter()

ilObjLinkResourceGUI::deleteParameter ( )
protected

Delete a dynamic parameter.

Returns

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

References $_GET, $DIC, $param, ilObject2GUI\checkPermission(), and ilUtil\sendFailure().

525  {
526  global $DIC;
527 
528  $ilCtrl = $DIC['ilCtrl'];
529 
530  $this->checkPermission('write');
531 
532  $this->ctrl->setParameter($this, 'link_id', (int) $_GET['link_id']);
533 
534  if (!isset($_GET['param_id'])) {
535  ilUtil::sendFailure($this->lng->txt('select_one'), true);
536  $ilCtrl->redirect($this, 'view');
537  }
538 
539  include_once './Modules/WebResource/classes/class.ilParameterAppender.php';
540  $param = new ilParameterAppender($this->object->getId());
541  $param->delete((int) $_GET['param_id']);
542 
543  ilUtil::sendSuccess($this->lng->txt('links_parameter_deleted'), true);
544  $ilCtrl->redirect($this, 'editLinks');
545  }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
$_GET["client_id"]
$param
Definition: xapitoken.php:29
global $DIC
Definition: goto.php:24
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Class ilParameterAppender.
+ Here is the call graph for this function:

◆ deleteParameterForm()

ilObjLinkResourceGUI::deleteParameterForm ( )
protected

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

References $_GET, $DIC, $param, ilObject2GUI\checkPermission(), and ilUtil\sendFailure().

548  {
549  global $DIC;
550 
551  $ilCtrl = $DIC['ilCtrl'];
552 
553  $this->checkPermission('write');
554 
555  if (!isset($_GET['param_id'])) {
556  ilUtil::sendFailure($this->lng->txt('select_one'), true);
557  $ilCtrl->redirect($this, 'view');
558  }
559 
560  include_once './Modules/WebResource/classes/class.ilParameterAppender.php';
561  $param = new ilParameterAppender($this->object->getId());
562  $param->delete((int) $_GET['param_id']);
563 
564  ilUtil::sendSuccess($this->lng->txt('links_parameter_deleted'), true);
565  $ilCtrl->redirect($this, 'view');
566  }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
$_GET["client_id"]
$param
Definition: xapitoken.php:29
global $DIC
Definition: goto.php:24
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Class ilParameterAppender.
+ Here is the call graph for this function:

◆ editLink()

ilObjLinkResourceGUI::editLink ( )

Edit a single link.

Returns

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

References $_GET, $DIC, activateTabs(), ilObject2GUI\checkPermission(), initFormLink(), ilUtil\sendFailure(), and setValuesFromLink().

353  {
354  global $DIC;
355 
356  $ilCtrl = $DIC['ilCtrl'];
357 
358  $this->checkPermission('write');
359  $this->activateTabs('content', 'id_content_view');
360 
361  if (!(int) $_GET['link_id']) {
362  ilUtil::sendFailure($this->lng->txt('select_one'), true);
363  $ilCtrl->redirect($this, 'view');
364  }
365 
366  $this->initFormLink(self::LINK_MOD_EDIT);
367  $this->setValuesFromLink((int) $_GET['link_id']);
368  $this->tpl->setContent($this->form->getHTML());
369  }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
$_GET["client_id"]
global $DIC
Definition: goto.php:24
setValuesFromLink($a_link_id)
Set form values from link.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
initFormLink($a_mode)
Show create/edit single link.
activateTabs($a_active_tab, $a_active_subtab='')
Activate tab and subtabs.
+ Here is the call graph for this function:

◆ editLinks()

ilObjLinkResourceGUI::editLinks ( )
protected

Start with manage mode.

Returns

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

References $_GET, and switchViewMode().

984  {
985  $_GET['switch_mode'] = self::VIEW_MODE_MANAGE;
986  $this->switchViewMode();
987  }
$_GET["client_id"]
switchViewMode()
Switch between "View" "Manage" and "Sort".
+ Here is the call graph for this function:

◆ executeCommand()

ilObjLinkResourceGUI::executeCommand ( )

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

References $_GET, $DIC, ilObjectGUI\$ilErr, $ret, __prepareOutput(), ilMDUtils\_fillHTMLMetaTags(), ilObjectGUI\addHeaderAction(), ilObject2GUI\checkPermission(), ilObject2GUI\getCreationMode(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), infoScreenForward(), initFormLink(), and ilObject2GUI\prepareOutput().

40  {
41  global $DIC;
42 
43  $ilCtrl = $DIC['ilCtrl'];
44  $ilTabs = $DIC['ilTabs'];
45  $ilErr = $DIC['ilErr'];
46  $ilAccess = $DIC['ilAccess'];
47 
48 
49  //if($this->ctrl->getTargetScript() == 'link_resources.php')
50  if ($_GET["baseClass"] == 'ilLinkResourceHandlerGUI') {
51  $_GET['view_mode'] = isset($_GET['switch_mode']) ? $_GET['switch_mode'] : $_GET['view_mode'];
52  $ilCtrl->saveParameter($this, 'view_mode');
53  $this->__prepareOutput();
54  }
55 
56  $this->lng->loadLanguageModule("webr");
57 
58  $next_class = $this->ctrl->getNextClass($this);
59  $cmd = $this->ctrl->getCmd();
60 
61  switch ($next_class) {
62  case "ilinfoscreengui":
63  $this->prepareOutput();
64  $this->infoScreenForward(); // forwards command
65  break;
66 
67  case 'ilobjectmetadatagui':
68  $this->checkPermission('write'); // #18563
69  $this->prepareOutput();
70  $ilTabs->activateTab('id_meta_data');
71  include_once 'Services/Object/classes/class.ilObjectMetaDataGUI.php';
72  $md_gui = new ilObjectMetaDataGUI($this->object);
73  $this->ctrl->forwardCommand($md_gui);
74  break;
75 
76  case 'ilpermissiongui':
77  $this->prepareOutput();
78  $ilTabs->activateTab('id_permissions');
79  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
80  $perm_gui = new ilPermissionGUI($this);
81  $ret = &$this->ctrl->forwardCommand($perm_gui);
82  break;
83 
84  case 'ilobjectcopygui':
85  $this->prepareOutput();
86  include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
87  $cp = new ilObjectCopyGUI($this);
88  $cp->setType('webr');
89  $this->ctrl->forwardCommand($cp);
90  break;
91 
92  case 'ilexportgui':
93  $this->prepareOutput();
94  $this->tabs_gui->setTabActive('export');
95  include_once './Services/Export/classes/class.ilExportGUI.php';
96  $exp = new ilExportGUI($this);
97  $exp->addFormat('xml');
98  $this->ctrl->forwardCommand($exp);
99  break;
100 
101  case "ilcommonactiondispatchergui":
102  $this->prepareOutput();
104  $this->ctrl->forwardCommand($gui);
105  break;
106 
107  case "ilpropertyformgui":
108  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
109  $this->initFormLink(self::LINK_MOD_EDIT);
110  $this->ctrl->forwardCommand($this->form);
111  break;
112 
113  case "ilinternallinkgui":
114  $this->lng->loadLanguageModule("content");
115  require_once("./Services/Link/classes/class.ilInternalLinkGUI.php");
116  $link_gui = new ilInternalLinkGUI("RepositoryItem", 0);
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);
122  break;
123 
124  default:
125  if (!$cmd) {
126  $this->ctrl->setCmd("view");
127  }
128  parent::executeCommand();
129  }
130 
131  if (!$this->getCreationMode()) {
132  // Fill meta header tags
133  include_once('Services/MetaData/classes/class.ilMDUtils.php');
134  ilMDUtils::_fillHTMLMetaTags($this->object->getId(), $this->object->getId(), 'webr');
135 
136  $this->addHeaderAction();
137  }
138  return true;
139  }
Class ilObjectMetaDataGUI.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
GUI class for the workflow of copying objects.
$_GET["client_id"]
Class ilInternalLinkGUI.
infoScreenForward()
show information screen
Export User Interface Class.
global $DIC
Definition: goto.php:24
static _fillHTMLMetaTags($a_rbac_id, $a_obj_id, $a_type)
Fill html meta tags.
$ret
Definition: parser.php:6
prepareOutput($a_show_subobjects=true)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
initFormLink($a_mode)
Show create/edit single link.
addHeaderAction()
Add header action menu.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
+ Here is the call graph for this function:

◆ exportHTML()

ilObjLinkResourceGUI::exportHTML ( )

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

References $DIC, $ilSetting, ilObjectGUI\$tpl, ilUtil\deliverData(), and handleSubItemLinks().

1711  {
1712  global $DIC;
1713 
1714  $ilSetting = $DIC['ilSetting'];
1715 
1716  $tpl = new ilTemplate("tpl.export_html.html", true, true, "Modules/WebResource");
1717 
1718  include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
1719  $items = new ilLinkResourceItems($this->object->getId());
1720  foreach ($items->getAllItems() as $item) {
1721  if (!$item["active"]) {
1722  continue;
1723  }
1724 
1725  $target = $this->handleSubItemLinks($item["target"]);
1726 
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();
1734  }
1735 
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());
1740 
1741  $tpl->setVariable("INST_ID", ($ilSetting->get('short_inst_name') != "")
1742  ? $ilSetting->get('short_inst_name')
1743  : "ILIAS");
1744 
1745  ilUtil::deliverData($tpl->get(), "bookmarks.html");
1746  }
static deliverData($a_data, $a_filename, $mime="application/octet-stream", $charset="")
deliver data for download via browser.
global $DIC
Definition: goto.php:24
global $ilSetting
Definition: privfeed.php:17
Class ilLinkResourceItems.
+ Here is the call graph for this function:

◆ formatInvalidLinkArray()

ilObjLinkResourceGUI::formatInvalidLinkArray ( array  $row)
See also
ilLinkCheckerGUIRowHandling::formatInvalidLinkArray()
Parameters
arrayUnformatted array
Returns
array Formatted array public

Implements ilLinkCheckerGUIRowHandling.

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

References ilObjectGUI\$actions.

1311  {
1312  $this->object->items_obj->readItem($row['page_id']);
1313  $row['title'] = $this->object->items_obj->getTitle();
1314 
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'));
1320  $actions->setId($row['page_id']);
1321  $this->ctrl->setParameter($this, 'link_id', $row['page_id']);
1322  $actions->addItem(
1323  $this->lng->txt('edit'),
1324  '',
1325  $this->ctrl->getLinkTarget($this, 'editLink')
1326  );
1327  $this->ctrl->clearParameters($this);
1328  $row['action_html'] = $actions->getHTML();
1329 
1330  return $row;
1331  }

◆ getLinkToListModal()

ilObjLinkResourceGUI::getLinkToListModal ( )

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

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

References $_POST, $DIC, Vendor\Package\$f, initFormLink(), and ILIAS\UI\Implementation\Component\withOnLoadCode().

Referenced by showToolbar().

408  {
409  global $DIC;
410 
411  $f = $DIC->ui()->factory();
412  $r = $DIC->ui()->renderer();
413 
414  // check if form was already set
415  if ($this->form == null) {
416  $this->initFormLink(self::LINK_MOD_SET_LIST);
417  }
418 
419  $form_id = 'form_' . $this->form->getId();
420 
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; });";
424  });
425  $info = $f->messageBox()->info($this->lng->txt('webr_new_list_info'));
426 
427  $modal = $f->modal()->roundtrip(
428  $this->lng->txt('webr_new_list'),
429  $f->legacy($r->render($info) . $this->form->getHTML())
430  )
431  ->withActionButtons([$submit]);
432 
433  // modal triggers its show signal on load if form validation failed
434  if (isset($_POST['sbmt']) && $_POST['sbmt'] == 'submit') {
435  $modal = $modal->withOnLoad($modal->getShowSignal());
436  }
437 
438  return $modal;
439  }
global $DIC
Definition: goto.php:24
initFormLink($a_mode)
Show create/edit single link.
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getType()

ilObjLinkResourceGUI::getType ( )

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

35  {
36  return "webr";
37  }

◆ handleSubItemLinks()

ilObjLinkResourceGUI::handleSubItemLinks (   $a_target)
protected

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

References ilLink\_getStaticLink(), and ilLinkInputGUI\isInternalLink().

Referenced by callDirectLink(), callLink(), and exportHTML().

1610  {
1611  // #15647 - handle internal links
1612  include_once "Services/Form/classes/class.ilFormPropertyGUI.php";
1613  include_once "Services/Form/classes/class.ilLinkInputGUI.php";
1614 
1615  if (ilLinkInputGUI::isInternalLink($a_target)) {
1616  include_once("./Services/Link/classes/class.ilLink.php");
1617 
1618  // #10612
1619  $parts = explode("|", $a_target);
1620 
1621  if ($parts[0] == 'wpage') {
1622  return ilLink::_getStaticLink(
1623  0,
1624  'wiki',
1625  true,
1626  '&target=wiki_wpage_' . $parts[1]
1627  );
1628  }
1629 
1630  if ($parts[0] == "term") {
1631  // #16894
1632  return ilLink::_getStaticLink(
1633  0,
1634  "git",
1635  true,
1636  "&target=git_" . $parts[1]
1637  );
1638  }
1639 
1640  if ($parts[0] == "page") {
1641  $parts[0] = "pg";
1642  }
1643 
1644  $a_target = ilLink::_getStaticLink($parts[1], $parts[0]);
1645  }
1646 
1647  return $a_target;
1648  }
static isInternalLink($a_value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ history()

ilObjLinkResourceGUI::history ( )

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

References $DIC, ilObject2GUI\checkPermission(), and ilHistoryTableGUI\initTable().

1288  {
1289  global $DIC;
1290 
1291  $ilTabs = $DIC['ilTabs'];
1292 
1293  $this->checkPermission('write');
1294  $ilTabs->activateTab('id_history');
1295 
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());
1300  }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
global $DIC
Definition: goto.php:24
Copyright (c) 1998-2014 ILIAS open source, Extended GPL, see docs/LICENSE Date: 24.10.14 Time: 10:35.
+ 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 1249 of file class.ilObjLinkResourceGUI.php.

References infoScreenForward().

1250  {
1251  $this->ctrl->setCmd("showSummary");
1252  $this->ctrl->setCmdClass("ilinfoscreengui");
1253  $this->infoScreenForward();
1254  }
infoScreenForward()
show information screen
+ Here is the call graph for this function:

◆ infoScreenForward()

ilObjLinkResourceGUI::infoScreenForward ( )

show information screen

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

References $DIC, ilObject2GUI\checkPermission(), ilObject2GUI\checkPermissionBool(), and ilObject2GUI\getPermanentLinkWidget().

Referenced by executeCommand(), and infoScreen().

1260  {
1261  global $DIC;
1262 
1263  $ilTabs = $DIC['ilTabs'];
1264 
1265  if (!$this->checkPermissionBool('visible')) {
1266  $this->checkPermission('read');
1267  }
1268  $ilTabs->activateTab('id_info');
1269 
1270  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1271  $info = new ilInfoScreenGUI($this);
1272 
1273  $info->enablePrivateNotes();
1274 
1275  // standard meta data
1276  $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
1277 
1278  if ($this->id_type == self::WORKSPACE_NODE_ID) {
1279  $info->addProperty($this->lng->txt("perma_link"), $this->getPermanentLinkWidget());
1280  }
1281 
1282  // forward the command
1283  $this->ctrl->forwardCommand($info);
1284  }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Class ilInfoScreenGUI.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
getPermanentLinkWidget($a_append=null, $a_center=false)
global $DIC
Definition: goto.php:24
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCreateForm()

ilObjLinkResourceGUI::initCreateForm (   $a_new_type)
protected

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

References initFormLink().

142  {
143  $this->initFormLink(self::LINK_MOD_CREATE);
144  return $this->form;
145  }
initFormLink($a_mode)
Show create/edit single link.
+ Here is the call graph for this function:

◆ initFormLink()

ilObjLinkResourceGUI::initFormLink (   $a_mode)
protected

Show create/edit single link.

Parameters
intform mode
Returns

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

References $_GET, $DIC, ilParameterAppender\_getOptionSelect(), ilParameterAppender\_getParams(), ilParameterAppender\_isEnabled(), ilSubEnabledFormPropertyGUI\addSubItem(), ilLinkInputGUI\LIST, ilParameterAppender\parameterToInfo(), ilLinkInputGUI\setAllowedLinkTypes(), ilCheckboxInputGUI\setChecked(), ilNonEditableValueGUI\setInfo(), ilTextAreaInputGUI\setRows(), and ilCheckboxInputGUI\setValue().

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

790  {
791  global $DIC;
792 
793  $ilTabs = $DIC['ilTabs'];
794 
795  $ilTabs->activateTab("id_content");
796 
797  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
798  $this->form = new ilPropertyFormGUI();
799 
800  switch ($a_mode) {
801  case self::LINK_MOD_CREATE:
802  // Header
803  $this->ctrl->setParameter($this, 'new_type', 'webr');
804  $this->form->setTitle($this->lng->txt('webr_new_link'));
805  $this->form->setTableWidth('600px');
806 
807  // Buttons
808  $this->form->addCommandButton('save', $this->lng->txt('webr_add'));
809  $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
810  break;
811 
812  case self::LINK_MOD_ADD:
813  // Header
814  $this->form->setTitle($this->lng->txt('webr_new_link'));
815 
816  // Buttons
817  $this->form->addCommandButton('saveAddLink', $this->lng->txt('webr_add'));
818  $this->form->addCommandButton('view', $this->lng->txt('cancel'));
819  break;
820 
821  case self::LINK_MOD_EDIT:
822  // Header
823  $this->ctrl->setParameter($this, 'link_id', (int) $_REQUEST['link_id']);
824  $this->form->setTitle($this->lng->txt('webr_edit'));
825 
826  // Buttons
827  $this->form->addCommandButton('updateLink', $this->lng->txt('save'));
828  $this->form->addCommandButton('view', $this->lng->txt('cancel'));
829  break;
830  }
831 
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'));
836 
837  // List Title
838  $title = new ilTextInputGUI($this->lng->txt('webr_list_title'), 'lti');
839  $title->setRequired(true);
840  $title->setSize(40);
841  $title->setMaxLength(127);
842  $this->form->addItem($title);
843 
844  // List Description
845  $desc = new ilTextAreaInputGUI($this->lng->txt('webr_list_desc'), 'tde');
846  $desc->setRows(3);
847  $desc->setCols(40);
848  $this->form->addItem($desc);
849 
850  $item = new ilHiddenInputGUI('sbmt');
851  $item->setValue('submit');
852  $this->form->addItem($item);
853  }
854 
855 
856  else {
857  $this->form->setFormAction($this->ctrl->getFormAction($this));
858 
859  // Target
860  /*
861  $tar = new ilTextInputGUI($this->lng->txt('webr_link_target'),'tar');
862  $tar->setValue("http://");
863 
864  $tar->setSize(40);
865  $tar->setMaxLength(500);
866  */
867  include_once 'Services/Form/classes/class.ilLinkInputGUI.php';
868  $tar = new ilLinkInputGUI($this->lng->txt('type'), 'tar'); // lng var
869  if ($a_mode == self::LINK_MOD_CREATE) {
871  }
872  $tar->setInternalLinkFilterTypes(
873  array(
874  "PageObject",
875  "GlossaryItem",
876  "RepositoryItem",
877  'WikiPage'
878  )
879  );
880  $tar->setExternalLinkMaxLength(1000);
881  $tar->setInternalLinkFilterTypes(array("PageObject", "GlossaryItem", "RepositoryItem"));
882  $tar->setRequired(true);
883  $this->form->addItem($tar);
884 
885  // Title
886  $tit = new ilTextInputGUI($this->lng->txt('webr_link_title'), 'title');
887  $tit->setRequired(true);
888  $tit->setSize(40);
889  $tit->setMaxLength(127);
890  $this->form->addItem($tit);
891 
892  // Description
893  $des = new ilTextAreaInputGUI($this->lng->txt('description'), 'desc');
894  $des->setRows(3);
895  $des->setCols(40);
896  $this->form->addItem($des);
897 
898 
899  if ($a_mode != self::LINK_MOD_CREATE) {
900  // Active
901  $act = new ilCheckboxInputGUI($this->lng->txt('active'), 'act');
902  $act->setChecked(true);
903  $act->setValue(1);
904  $this->form->addItem($act);
905 
906  // Check
907  $che = new ilCheckboxInputGUI($this->lng->txt('webr_disable_check'), 'che');
908  $che->setValue(1);
909  $this->form->addItem($che);
910  }
911 
912  // Valid
913  if ($a_mode == self::LINK_MOD_EDIT) {
914  $val = new ilCheckboxInputGUI($this->lng->txt('valid'), 'vali');
915  $this->form->addItem($val);
916  }
917 
918  if (ilParameterAppender::_isEnabled() && $a_mode != self::LINK_MOD_CREATE) {
919  $dyn = new ilNonEditableValueGUI($this->lng->txt('links_dyn_parameter'));
920  $dyn->setInfo($this->lng->txt('links_dynamic_info'));
921 
922 
923  if (count($links = ilParameterAppender::_getParams((int)$_GET['link_id']))) {
924  $ex = new ilCustomInputGUI($this->lng->txt('links_existing_params'), 'ex');
925  $dyn->addSubItem($ex);
926 
927  foreach ($links as $id => $link) {
928  $p = new ilCustomInputGUI();
929 
930  $ptpl = new ilTemplate('tpl.link_dyn_param_edit.html', true, true, 'Modules/WebResource');
931  $ptpl->setVariable('INFO_TXT', ilParameterAppender::parameterToInfo($link['name'], $link['value']));
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);
937  }
938  }
939 
940  // Existing parameters
941 
942  // New parameter
943  if ($a_mode != self::LINK_MOD_CREATE) {
944  #$new = new ilCustomInputGUI($this->lng->txt('links_add_param'),'');
945  #$dyn->addSubItem($new);
946  }
947 
948  // Dynyamic name
949  $nam = new ilTextInputGUI($this->lng->txt('links_name'), 'nam');
950  $nam->setSize(12);
951  $nam->setMaxLength(128);
952  $dyn->addSubItem($nam);
953 
954  // Dynamic value
955  $val = new ilSelectInputGUI($this->lng->txt('links_value'), 'val');
956  $val->setOptions(ilParameterAppender::_getOptionSelect());
957  $val->setValue(0);
958  $dyn->addSubItem($val);
959 
960  $this->form->addItem($dyn);
961  }
962  }
963  }
This class represents a property form user interface.
$_GET["client_id"]
static _getOptionSelect()
Get options as array.
setInfo($a_info)
Set Information Text.
This class represents a checkbox property in a property form.
setChecked($a_checked)
Set Checked.
This class represents a hidden form property in a property form.
static parameterToInfo($a_name, $a_value)
Get info text describing an existing dynamic link.
setValue($a_value)
Set Value.
global $DIC
Definition: goto.php:24
This class represents a custom property in a property form.
This class represents a non editable value in a property form.
This class represents a text area property in a property form.
static _getParams($a_link_id)
Get dynamic parameter definitions.
static _isEnabled()
Check if dynamic parameters are enabled.
This class represents a external and/or internal link in a property form.
setAllowedLinkTypes($a_val)
Set allowed link types (LIST, BOTH, INT, EXT)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFormSettings()

ilObjLinkResourceGUI::initFormSettings ( )
protected

Show settings form.

Returns

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

References ilObjectGUI\$object_service, $section, ilContainerSortingSettings\_lookupSortMode(), ilLinkResourceList\checkListStatus(), ilFormPropertyGUI\setRequired(), ilRadioOption\setTitle(), ilTextAreaInputGUI\setValue(), ilContainer\SORT_MANUAL, and ilContainer\SORT_TITLE.

Referenced by saveSettings(), and settings().

273  {
274  $obj_service = $this->object_service;
275 
276  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
277  $this->form = new ilPropertyFormGUI();
278  $this->form->setFormAction($this->ctrl->getFormAction($this, 'saveSettings'));
279 
280  if (ilLinkResourceList::checkListStatus($this->object->getId())) {
281  $this->form->setTitle($this->lng->txt('webr_edit_settings'));
282 
283  // Title
284  $tit = new ilTextInputGUI($this->lng->txt('webr_list_title'), 'title');
285  $tit->setValue($this->object->getTitle());
286  $tit->setRequired(true);
287  $tit->setSize(40);
288  $tit->setMaxLength(127);
289  $this->form->addItem($tit);
290 
291  // Description
292  $des = new ilTextAreaInputGUI($this->lng->txt('webr_list_desc'), 'desc');
293  $des->setValue($this->object->getDescription());
294  $des->setCols(40);
295  $des->setRows(3);
296  $this->form->addItem($des);
297 
299  $section->setTitle($this->lng->txt('obj_presentation'));
300  $this->form->addItem($section);
301 
302  // tile image
303  $obj_service->commonSettings()->legacyForm($this->form, $this->object)->addTileImage();
304 
305  // Sorting
306  include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
307  include_once './Services/Container/classes/class.ilContainer.php';
308 
309  $sor = new ilRadioGroupInputGUI($this->lng->txt('webr_sorting'), 'sor');
310  $sor->setRequired(true);
311  include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
312  $sor->setValue(ilContainerSortingSettings::_lookupSortMode($this->object->getId()));
313 
314  $opt = new ilRadioOption(
315  $this->lng->txt('webr_sort_title'),
317  );
318  $sor->addOption($opt);
319 
320  $opm = new ilRadioOption(
321  $this->lng->txt('webr_sort_manual'),
323  );
324  $sor->addOption($opm);
325  $this->form->addItem($sor);
326  } else {
327  $this->form->setTitle($this->lng->txt('obj_presentation'));
328 
329  // hidden title
330  $tit = new ilHiddenInputGUI('title');
331  $tit->setValue($this->object->getTitle());
332  $this->form->addItem($tit);
333 
334  // hidden description
335  $des = new ilHiddenInputGUI('desc');
336  $des->setValue($this->object->getDescription());
337  $this->form->addItem($des);
338 
339  // tile image
340  $obj_service->commonSettings()->legacyForm($this->form, $this->object)->addTileImage();
341  }
342 
343  $this->form->addCommandButton('saveSettings', $this->lng->txt('save'));
344  $this->form->addCommandButton('view', $this->lng->txt('cancel'));
345  }
This class represents an option in a radio group.
setTitle($a_title)
Set Title.
This class represents a property form user interface.
This class represents a section header in a property form.
setValue($a_value)
Set Value.
$section
Definition: Utf8Test.php:83
This class represents a hidden form property in a property form.
This class represents a property in a property form.
static checkListStatus(int $a_webr_id)
Check if a weblink list was already created or transformed from a single weblink. ...
This class represents a text area property in a property form.
static _lookupSortMode($a_obj_id)
lookup sort mode
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initList()

ilObjLinkResourceGUI::initList ( int  $a_mode,
int  $a_webr_id = 0 
)
protected

Init a new link list.

Parameters
int$a_mode
int$a_webr_id

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

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

708  {
709  if ($a_mode == self::LINK_MOD_CREATE || $a_mode == self::LINK_MOD_EDIT_LIST) {
710  $this->list = new ilLinkResourceList($a_webr_id);
711  $this->list->setTitle($this->form->getInput('title'));
712  $this->list->setDescription($this->form->getInput('desc'));
713  }
714 
715  if ($a_mode == self::LINK_MOD_SET_LIST) {
716  $this->list = new ilLinkResourceList($a_webr_id);
717  $this->list->setTitle($this->form->getInput('lti'));
718  $this->list->setDescription($this->form->getInput('tde'));
719  }
720  }
Class ilLinkResourceList.
+ Here is the caller graph for this function:

◆ linkChecker()

ilObjLinkResourceGUI::linkChecker ( )
protected

Show link validation.

Returns

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

References $DIC, $ilUser, ilObjectGUI\$toolbar, ilObjectGUI\$tpl, __initLinkChecker(), ilLinkCheckNotify\_getNotifyStatus(), ilObject2GUI\checkPermission(), and ilCheckboxInputGUI\setValue().

Referenced by refreshLinkCheck(), and saveLinkCheck().

1338  {
1339  global $DIC;
1340 
1341  $ilias = $DIC['ilias'];
1342  $ilUser = $DIC['ilUser'];
1343  $tpl = $DIC['tpl'];
1344  $ilTabs = $DIC['ilTabs'];
1345 
1346  $this->checkPermission('write');
1347  $ilTabs->activateTab('id_link_check');
1348 
1349  $this->__initLinkChecker();
1350  $this->object->initLinkResourceItemsObject();
1351 
1352  require_once './Services/LinkChecker/classes/class.ilLinkCheckerTableGUI.php';
1353 
1354  $toolbar = new ilToolbarGUI();
1355 
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';
1359 
1360  $chb = new ilCheckboxInputGUI($this->lng->txt('link_check_message_a'), 'link_check_message');
1361  $chb->setValue(1);
1362  $chb->setChecked((bool) ilLinkCheckNotify::_getNotifyStatus($ilUser->getId(), $this->object->getId()));
1363  $chb->setOptionTitle($this->lng->txt('link_check_message_b'));
1364 
1365  $toolbar->addInputItem($chb);
1366  $toolbar->addFormButton($this->lng->txt('save'), 'saveLinkCheck');
1367  $toolbar->setFormAction($this->ctrl->getLinkTarget($this, 'saveLinkCheck'));
1368  }
1369 
1370  $tgui = new ilLinkCheckerTableGUI($this, 'linkChecker');
1371  $tgui->setLinkChecker($this->link_checker_obj)
1372  ->setRowHandler($this)
1373  ->setRefreshButton($this->lng->txt('refresh'), 'refreshLinkCheck');
1374 
1375  return $tpl->setContent($tgui->prepareHTML()->getHTML() . $toolbar->getHTML());
1376  }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
This class represents a checkbox property in a property form.
class ilLinkCheckerTableGUI
setValue($a_value)
Set Value.
global $DIC
Definition: goto.php:24
static _getNotifyStatus($a_usr_id, $a_obj_id)
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ manage()

ilObjLinkResourceGUI::manage ( )
protected

Manage links.

Returns

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

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

Referenced by view().

1038  {
1039  $this->checkPermission('write');
1040  $this->activateTabs('content', 'id_content_manage');
1041 
1042  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.webr_manage.html', 'Modules/WebResource');
1043  $this->showToolbar('ACTION_BUTTONS');
1044 
1045  include_once './Modules/WebResource/classes/class.ilWebResourceEditableLinkTableGUI.php';
1046  $table = new ilWebResourceEditableLinkTableGUI($this, 'view');
1047  $table->parse();
1048 
1049  include_once './Services/Link/classes/class.ilInternalLinkGUI.php';
1051 
1052  $this->tpl->addJavaScript("Modules/WebResource/js/intLink.js");
1053  $this->tpl->addJavascript("Services/Form/js/Form.js");
1054 
1055  $this->tpl->setVariable('TABLE_LINKS', $table->getHTML() . $js);
1056  }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
static getInitHTML($a_url)
Get initialisation HTML to use interna link editing.
activateTabs($a_active_tab, $a_active_subtab='')
Activate tab and subtabs.
showToolbar($a_tpl_var)
Show toolbar.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ redirectToLink()

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

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

References $DIC, $ilUser, ilChangeEvent\_recordReadEvent(), and ilUtil\redirect().

Referenced by callDirectLink(), and callLink().

1692  {
1693  global $DIC;
1694 
1695  $ilUser = $DIC['ilUser'];
1696 
1697  if ($a_url) {
1698  require_once('Services/Tracking/classes/class.ilChangeEvent.php');
1700  "webr",
1701  $a_ref_id,
1702  $a_obj_id,
1703  $ilUser->getId()
1704  );
1705 
1706  ilUtil::redirect($a_url);
1707  }
1708  }
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.
global $DIC
Definition: goto.php:24
$ilUser
Definition: imgupload.php:18
static redirect($a_script)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ refreshLinkCheck()

ilObjLinkResourceGUI::refreshLinkCheck ( )

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

References __initLinkChecker(), and linkChecker().

1406  {
1407  $this->__initLinkChecker();
1408  $this->object->initLinkResourceItemsObject();
1409 
1410  // Set all link to valid. After check invalid links will be set to invalid
1411  $this->object->items_obj->updateValidByCheck();
1412 
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);
1418  }
1419 
1420  $this->object->items_obj->updateLastCheck();
1421  ilUtil::sendSuccess($this->lng->txt('link_checker_refreshed'));
1422 
1423  $this->linkChecker();
1424 
1425  return true;
1426  }
linkChecker()
Show link validation.
+ Here is the call graph for this function:

◆ save()

ilObjLinkResourceGUI::save ( )

Save new object public.

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

References $DIC, $valid, checkLinkInput(), initFormLink(), initList(), and ilUtil\sendFailure().

152  {
153  global $DIC;
154 
155  $ilCtrl = $DIC['ilCtrl'];
156 
157  $this->initFormLink(self::LINK_MOD_CREATE);
158  $valid = $this->form->checkInput();
159  if ($this->checkLinkInput(self::LINK_MOD_CREATE, $valid, 0, 0)
160  && $this->form->getInput('tar_mode_type') == 'single') {
161  // Save new object
162  parent::save();
163  } elseif ($valid && $this->form->getInput('tar_mode_type') == 'list') {
164  $this->initList(self::LINK_MOD_CREATE, 0);
165  parent::save();
166  } else {
167  // Data incomplete or invalid
168  ilUtil::sendFailure($this->lng->txt('err_check_input'));
169  $this->form->setValuesByPost();
170  $this->tpl->setContent($this->form->getHTML());
171  }
172  }
$valid
global $DIC
Definition: goto.php:24
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
initList(int $a_mode, int $a_webr_id=0)
Init a new link list.
initFormLink($a_mode)
Show create/edit single link.
checkLinkInput($a_mode, $a_valid, $a_webr_id=0, $a_link_id=0)
Check input after creating a new link.
+ Here is the call graph for this function:

◆ saveAddLink()

ilObjLinkResourceGUI::saveAddLink ( )

Save form data.

Returns

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

References $DIC, $valid, ilParameterAppender\_isEnabled(), activateTabs(), checkLinkInput(), ilObject2GUI\checkPermission(), initFormLink(), and ilUtil\sendFailure().

491  {
492  global $DIC;
493 
494  $ilCtrl = $DIC['ilCtrl'];
495 
496  $this->checkPermission('write');
497 
498  $this->initFormLink(self::LINK_MOD_ADD);
499  $valid = $this->form->checkInput();
500  if ($this->checkLinkInput(self::LINK_MOD_ADD, $valid, $this->object->getId(), 0)) {
501  // Save Link
502  $link_id = $this->link->add();
503  $this->link->updateValid(true);
504 
505  // Dynamic parameters
506  if (ilParameterAppender::_isEnabled() and is_object($this->dynamic)) {
507  $this->dynamic->add($link_id);
508  }
509  ilUtil::sendSuccess($this->lng->txt('webr_link_added'), true);
510  $ilCtrl->redirect($this, 'view');
511  }
512  // Error handling
513  ilUtil::sendFailure($this->lng->txt('err_check_input'));
514  $this->form->setValuesByPost();
515 
516  $this->activateTabs('content', 'id_content_view');
517  $this->tpl->setContent($this->form->getHTML());
518  }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
$valid
global $DIC
Definition: goto.php:24
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
initFormLink($a_mode)
Show create/edit single link.
activateTabs($a_active_tab, $a_active_subtab='')
Activate tab and subtabs.
static _isEnabled()
Check if dynamic parameters are enabled.
checkLinkInput($a_mode, $a_valid, $a_webr_id=0, $a_link_id=0)
Check input after creating a new link.
+ Here is the call graph for this function:

◆ saveLinkCheck()

ilObjLinkResourceGUI::saveLinkCheck ( )

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

References $_POST, $DIC, $ilDB, $ilUser, and linkChecker().

1379  {
1380  global $DIC;
1381 
1382  $ilDB = $DIC['ilDB'];
1383  $ilUser = $DIC['ilUser'];
1384 
1385  include_once './Services/LinkChecker/classes/class.ilLinkCheckNotify.php';
1386 
1387  $link_check_notify = new ilLinkCheckNotify($ilDB);
1388  $link_check_notify->setUserId($ilUser->getId());
1389  $link_check_notify->setObjId($this->object->getId());
1390 
1391  if ($_POST['link_check_message']) {
1392  ilUtil::sendSuccess($this->lng->txt('link_check_message_enabled'));
1393  $link_check_notify->addNotifier();
1394  } else {
1395  ilUtil::sendSuccess($this->lng->txt('link_check_message_disabled'));
1396  $link_check_notify->deleteNotifier();
1397  }
1398  $this->linkChecker();
1399 
1400  return true;
1401  }
class for checking external links in page objects.
linkChecker()
Show link validation.
global $DIC
Definition: goto.php:24
global $ilDB
$ilUser
Definition: imgupload.php:18
$_POST["username"]
+ Here is the call graph for this function:

◆ saveLinkList()

ilObjLinkResourceGUI::saveLinkList ( )

Save form data.

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

References $DIC, $valid, ilObject2GUI\checkPermission(), initFormLink(), initList(), ilUtil\sendFailure(), and view().

445  {
446  global $DIC;
447 
448  $ilCtrl = $DIC['ilCtrl'];
449 
450  $this->checkPermission('write');
451 
452  $this->initFormLink(self::LINK_MOD_SET_LIST);
453  $valid = $this->form->checkInput();
454  if ($valid) {
455  // Save list data
456  $this->object->setTitle($this->form->getInput('lti'));
457  $this->object->setDescription($this->form->getInput('tde'));
458  $this->object->update();
459 
460  // Save Link List
461  $this->initList(self::LINK_MOD_SET_LIST, $this->object->getId());
462  $this->list->add();
463  ilUtil::sendSuccess($this->lng->txt('webr_list_set'), true);
464  $ilCtrl->redirect($this, 'view');
465  }
466 
467  // Error handling
468  ilUtil::sendFailure($this->lng->txt('err_check_input'), true);
469  $this->form->setValuesByPost();
470  $this->view();
471  }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
$valid
global $DIC
Definition: goto.php:24
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
initList(int $a_mode, int $a_webr_id=0)
Init a new link list.
initFormLink($a_mode)
Show create/edit single link.
+ Here is the call graph for this function:

◆ saveSettings()

ilObjLinkResourceGUI::saveSettings ( )
protected

Save container settings.

Returns

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

References $DIC, ilObjectGUI\$object_service, $valid, ilObject2GUI\checkPermission(), initFormSettings(), initList(), ilUtil\sendFailure(), and ilContainerSortingSettings\setSortMode().

227  {
228  global $DIC;
229 
230  $obj_service = $this->object_service;
231  $ilTabs = $DIC['ilTabs'];
232 
233  $this->checkPermission('write');
234  $ilTabs->activateTab('id_settings');
235 
236  $this->initFormSettings();
237  $valid = $this->form->checkInput();
238  if ($valid) {
239  // update list
240  $this->initList(self::LINK_MOD_EDIT_LIST, $this->object->getId());
241  $this->list->update();
242 
243  // update object
244  $this->object->setTitle($this->form->getInput('title'));
245  $this->object->setDescription($this->form->getInput('desc'));
246  $this->object->update();
247 
248  // update sorting
249  include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
250  $sort = new ilContainerSortingSettings($this->object->getId());
251  $sort->setSortMode($this->form->getInput('sor'));
252  $sort->update();
253 
254  // tile image
255  $obj_service->commonSettings()->legacyForm($this->form, $this->object)->saveTileImage();
256 
257 
258  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
259  $this->ctrl->redirect($this, 'settings');
260  }
261 
262  $this->form->setValuesByPost();
263  ilUtil::sendFailure($this->lng->txt('err_check_input'));
264  $this->tpl->setContent($this->form->getHTML());
265  }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
$valid
initFormSettings()
Show settings form.
global $DIC
Definition: goto.php:24
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
initList(int $a_mode, int $a_webr_id=0)
Init a new link list.
+ Here is the call graph for this function:

◆ saveSorting()

ilObjLinkResourceGUI::saveSorting ( )
protected

Save nmanual sorting.

Returns

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

References $_POST, ilContainerSorting\_getInstance(), ilObject2GUI\checkPermission(), and view().

1099  {
1100  $this->checkPermission('write');
1101 
1102  include_once './Services/Container/classes/class.ilContainerSorting.php';
1103  $sort = ilContainerSorting::_getInstance($this->object->getId());
1104  $sort->savePost((array) $_POST['position']);
1105 
1106  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
1107  $this->view();
1108  }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
static _getInstance($a_obj_id)
get instance by obj_id
$_POST["username"]
+ Here is the call graph for this function:

◆ setTabs()

ilObjLinkResourceGUI::setTabs ( )

get tabs public

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

References $DIC, ilObjectGUI\$lng, ilObject2GUI\checkPermissionBool(), and ilObject2GUI\getCreationMode().

1501  {
1502  global $DIC;
1503 
1504  $ilTabs = $DIC['ilTabs'];
1505  $lng = $DIC['lng'];
1506  $ilHelp = $DIC['ilHelp'];
1507 
1508  $ilHelp->setScreenIdComponent("webr");
1509 
1510  if ($this->checkPermissionBool('read')) {
1511  $ilTabs->addTab(
1512  "id_content",
1513  $lng->txt("content"),
1514  $this->ctrl->getLinkTarget($this, "view")
1515  );
1516  }
1517 
1518  if (
1519  $this->checkPermissionBool('visible') ||
1520  $this->checkPermissionBool('read')
1521  ) {
1522  $ilTabs->addTab(
1523  "id_info",
1524  $lng->txt("info_short"),
1525  $this->ctrl->getLinkTarget($this, "infoScreen")
1526  );
1527  }
1528 
1529  if ($this->checkPermissionBool('write') and !$this->getCreationMode()) {
1530  $ilTabs->addTab(
1531  "id_settings",
1532  $lng->txt("settings"),
1533  $this->ctrl->getLinkTarget($this, "settings")
1534  );
1535  }
1536 
1537  if ($this->checkPermissionBool('write')) {
1538  $ilTabs->addTab(
1539  "id_history",
1540  $lng->txt("history"),
1541  $this->ctrl->getLinkTarget($this, "history")
1542  );
1543  }
1544 
1545  if ($this->checkPermissionBool('write')) {
1546  // Check if pear library is available
1547  $ilTabs->addTab(
1548  "id_link_check",
1549  $lng->txt("link_check"),
1550  $this->ctrl->getLinkTarget($this, "linkChecker")
1551  );
1552  }
1553 
1554  if ($this->checkPermissionBool('write')) {
1555  include_once "Services/Object/classes/class.ilObjectMetaDataGUI.php";
1556  $mdgui = new ilObjectMetaDataGUI($this->object);
1557  $mdtab = $mdgui->getTab();
1558  if ($mdtab) {
1559  $ilTabs->addTab(
1560  "id_meta_data",
1561  $lng->txt("meta_data"),
1562  $mdtab
1563  );
1564  }
1565  }
1566 
1567  if ($this->checkPermissionBool('write')) {
1568  $ilTabs->addTab(
1569  'export',
1570  $this->lng->txt('export'),
1571  $this->ctrl->getLinkTargetByClass('ilexportgui', '')
1572  );
1573  }
1574 
1575  // will add permission tab if needed
1576  parent::setTabs();
1577  }
Class ilObjectMetaDataGUI.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
global $DIC
Definition: goto.php:24
+ Here is the call graph for this function:

◆ settings()

ilObjLinkResourceGUI::settings ( )
protected

Edit settings Title, Description, Sorting.

Returns

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

References $DIC, ilObject2GUI\checkPermission(), and initFormSettings().

210  {
211  global $DIC;
212 
213  $ilTabs = $DIC['ilTabs'];
214 
215  $this->checkPermission('write');
216  $ilTabs->activateTab('id_settings');
217 
218  $this->initFormSettings();
219  $this->tpl->setContent($this->form->getHTML());
220  }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
initFormSettings()
Show settings form.
global $DIC
Definition: goto.php:24
+ Here is the call graph for this function:

◆ setValuesFromLink()

ilObjLinkResourceGUI::setValuesFromLink (   $a_link_id)
protected

Set form values from link.

Parameters
object$a_link_id
Returns

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

References ilParameterAppender\_isEnabled(), and ilLinkResourceItems\getItem().

Referenced by editLink().

680  {
681  include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
682  $link = new ilLinkResourceItems($this->object->getId());
683 
684  $values = $link->getItem($a_link_id);
685 
687  }
688 
689  $this->form->setValuesByArray(
690  array(
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']
697  )
698  );
699  }
Class ilLinkResourceItems.
static _isEnabled()
Check if dynamic parameters are enabled.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showLinks()

ilObjLinkResourceGUI::showLinks ( )
protected

Show all active links.

Returns

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

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

Referenced by view().

1063  {
1064  $this->checkPermission('read');
1065  $this->activateTabs('content', 'id_content_view');
1066 
1067  include_once './Modules/WebResource/classes/class.ilWebResourceLinkTableGUI.php';
1068  $table = new ilWebResourceLinkTableGUI($this, 'showLinks');
1069  $table->parse();
1070 
1071  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.webr_view.html', 'Modules/WebResource');
1072  $this->showToolbar('ACTION_BUTTONS');
1073  $this->tpl->setVariable('LINK_TABLE', $table->getHTML());
1074  }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
TableGUI class for search results.
activateTabs($a_active_tab, $a_active_subtab='')
Activate tab and subtabs.
showToolbar($a_tpl_var)
Show toolbar.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showToolbar()

ilObjLinkResourceGUI::showToolbar (   $a_tpl_var)
protected

Show toolbar.

Parameters
string$a_tpl_varName of template variable
Returns

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

References $DIC, Vendor\Package\$f, ilLinkResourceList\checkListStatus(), ilObject2GUI\checkPermissionBool(), and getLinkToListModal().

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

1117  {
1118  global $DIC;
1119 
1120  include_once './Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
1121  $tool = new ilToolbarGUI();
1122  $tool->setFormAction($this->ctrl->getFormAction($this));
1123 
1124  $f = $DIC->ui()->factory();
1125  $r = $DIC->ui()->renderer();
1126 
1127  if (
1128  ilLinkResourceList::checkListStatus($this->object->getId()) &&
1129  $this->checkPermissionBool('write')
1130  ) {
1131  $tool->addButton(
1132  $this->lng->txt('webr_add'),
1133  $this->ctrl->getLinkTarget($this, 'addLink')
1134  );
1135  }
1136  elseif ($this->checkPermissionBool('write')) {
1137  $modal = $this->getLinkToListModal();
1138  $button = $f->button()->standard($this->lng->txt('webr_set_to_list'), '#')
1139  ->withOnClick($modal->getShowSignal());
1140 
1141  $this->tpl->setVariable("MODAL", $r->render([$modal]));
1142  $tool->addComponent($button);
1143  }
1144 
1145  $download_button = $f->button()->standard(
1146  $this->lng->txt('export_html'),
1147  $this->ctrl->getLinkTarget($this, 'exportHTML')
1148  );
1149  $tool->addComponent($download_button);
1150  $this->tpl->setVariable($a_tpl_var, $tool->getHTML());
1151  return;
1152  }
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
getLinkToListModal()
Get form to transform a single weblink to a weblink list.
global $DIC
Definition: goto.php:24
static checkListStatus(int $a_webr_id)
Check if a weblink list was already created or transformed from a single weblink. ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sort()

ilObjLinkResourceGUI::sort ( )
protected

Sort web links.

Returns

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

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

Referenced by view().

1081  {
1082  $this->checkPermission('write');
1083  $this->activateTabs('content', 'id_content_ordering');
1084 
1085  include_once './Modules/WebResource/classes/class.ilWebResourceLinkTableGUI.php';
1086  $table = new ilWebResourceLinkTableGUI($this, 'sort', true);
1087  $table->parse();
1088 
1089  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.webr_view.html', 'Modules/WebResource');
1090  $this->showToolbar('ACTION_BUTTONS');
1091  $this->tpl->setVariable('LINK_TABLE', $table->getHTML());
1092  }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
TableGUI class for search results.
activateTabs($a_active_tab, $a_active_subtab='')
Activate tab and subtabs.
showToolbar($a_tpl_var)
Show toolbar.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ switchViewMode()

ilObjLinkResourceGUI::switchViewMode ( )
protected

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

Returns

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

References $_GET, $DIC, and view().

Referenced by editLinks().

970  {
971  global $DIC;
972 
973  $ilCtrl = $DIC['ilCtrl'];
974 
975  $_REQUEST['view_mode'] = $_GET['view_mode'] = (int) $_GET['switch_mode'];
976  $this->view();
977  }
$_GET["client_id"]
global $DIC
Definition: goto.php:24
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateLink()

ilObjLinkResourceGUI::updateLink ( )

Save after editing.

Returns

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

References $DIC, $valid, ilParameterAppender\_isEnabled(), checkLinkInput(), ilLinkResourceList\checkListStatus(), initFormLink(), and ilUtil\sendFailure().

376  {
377  global $DIC;
378 
379  $ilCtrl = $DIC['ilCtrl'];
380 
381  $this->initFormLink(self::LINK_MOD_EDIT);
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();
386  if (ilParameterAppender::_isEnabled() and is_object($this->dynamic)) {
387  $this->dynamic->add((int) $_REQUEST['link_id']);
388  }
389 
390  if (!ilLinkResourceList::checkListStatus($this->object->getId())) {
391  $this->object->setTitle($this->form->getInput('title'));
392  $this->object->setDescription($this->form->getInput('desc'));
393  $this->object->update();
394  }
395 
396  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
397  $ilCtrl->redirect($this, 'view');
398  }
399  ilUtil::sendFailure($this->lng->txt('err_check_input'));
400  $this->form->setValuesByPost();
401  $this->tpl->setContent($this->form->getHTML());
402  }
$valid
global $DIC
Definition: goto.php:24
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static checkListStatus(int $a_webr_id)
Check if a weblink list was already created or transformed from a single weblink. ...
initFormLink($a_mode)
Show create/edit single link.
static _isEnabled()
Check if dynamic parameters are enabled.
checkLinkInput($a_mode, $a_valid, $a_webr_id=0, $a_link_id=0)
Check input after creating a new link.
+ Here is the call graph for this function:

◆ updateLinks()

ilObjLinkResourceGUI::updateLinks ( )
protected

Update all visible links.

Returns

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

References $_POST, ilObjectGUI\$data, $DIC, $param, activateTabs(), ilLinkResourceList\checkListStatus(), ilObject2GUI\checkPermission(), ilLinkInputGUI\isInternalLink(), ilLinkResourceItems\lookupItem(), ilUtil\sendFailure(), and ilUtil\stripSlashes().

574  {
575  global $DIC;
576 
577  $ilCtrl = $DIC['ilCtrl'];
578 
579  $this->checkPermission('write');
580  $this->activateTabs('content', '');
581 
582  if (!is_array($_POST['ids'])) {
583  ilUtil::sendFailure($this->lng->txt('select_one'), true);
584  $ilCtrl->redirect($this, 'view');
585  }
586 
587  // Validate
588  $invalid = array();
589  foreach ($_POST['ids'] as $link_id) {
590  $data = $_POST['links'][$link_id];
591 
592  // handle internal links
593  if ($_POST['tar_' . $link_id . '_ajax_type'] &&
594  $_POST['tar_' . $link_id . '_ajax_id']) {
595  $data['tar'] = $_POST['links'][$link_id]['tar'] =
596  $_POST['tar_' . $link_id . '_ajax_type'] . '|' .
597  $_POST['tar_' . $link_id . '_ajax_id'];
598  }
599 
600 
601  if (!strlen($data['title'])) {
602  $invalid[] = $link_id;
603  continue;
604  }
605  if (!strlen($data['tar'])) {
606  $invalid[] = $link_id;
607  continue;
608  }
609  if ($data['nam'] and !$data['val']) {
610  $invalid[] = $link_id;
611  continue;
612  }
613  if (!$data['nam'] and $data['val']) {
614  $invalid[] = $link_id;
615  continue;
616  }
617  }
618 
619  if (count($invalid)) {
620  ilUtil::sendFailure($this->lng->txt('err_check_input'));
621  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.webr_manage.html', 'Modules/WebResource');
622 
623  include_once './Modules/WebResource/classes/class.ilWebResourceEditableLinkTableGUI.php';
624  $table = new ilWebResourceEditableLinkTableGUI($this, 'view');
625  $table->setInvalidLinks($invalid);
626  $table->parseSelectedLinks($_POST['ids']);
627  $table->updateFromPost();
628  $this->tpl->setVariable('TABLE_LINKS', $table->getHTML());
629  return false;
630  }
631 
632  include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
633  $links = new ilLinkResourceItems($this->object->getId());
634 
635  // Save Settings
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) {
639  $data = $_POST['links'][$link_id];
640 
641  $orig = ilLinkResourceItems::lookupItem($this->object->getId(), $link_id);
642 
643  $links->setLinkId($link_id);
644  $links->setTitle(ilUtil::stripSlashes($data['title']));
645  $links->setDescription(ilUtil::stripSlashes($data['desc']));
646  $links->setTarget(str_replace('"', '', ilUtil::stripSlashes($data['tar'])));
647  $links->setActiveStatus((int) $data['act']);
648  $links->setDisableCheckStatus((int) $data['che']);
649  $links->setLastCheckDate($orig['last_check']);
650  $links->setValidStatus((int) $data['vali']);
651  $links->setInternal(ilLinkInputGUI::isInternalLink($data['tar']));
652  $links->update();
653 
654  if (strlen($data['nam']) and $data['val']) {
655  $param = new ilParameterAppender($this->object->getId());
656  $param->setName(ilUtil::stripSlashes($data['nam']));
657  $param->setValue((int) $data['val']);
658  $param->add($link_id);
659  }
660 
661  if (!ilLinkResourceList::checkListStatus($this->object->getId())) {
662  $this->object->setTitle(ilUtil::stripSlashes($data['title']));
663  $this->object->setDescription(ilUtil::stripSlashes($data['desc']));
664  $this->object->update();
665  }
666 
667  // TODO: Dynamic parameters
668  }
669 
670  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
671  $ilCtrl->redirect($this, 'view');
672  }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
$param
Definition: xapitoken.php:29
static isInternalLink($a_value)
global $DIC
Definition: goto.php:24
static lookupItem($a_webr_id, $a_link_id)
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static checkListStatus(int $a_webr_id)
Check if a weblink list was already created or transformed from a single weblink. ...
Class ilLinkResourceItems.
Class ilParameterAppender.
activateTabs($a_active_tab, $a_active_subtab='')
Activate tab and subtabs.
$_POST["username"]
+ Here is the call graph for this function:

◆ view()

ilObjLinkResourceGUI::view ( )

View object.

Returns

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

References $_GET, $DIC, $GLOBALS, ilObjectGUI\$ilErr, ilContainerSortingSettings\_lookupSortMode(), ilObject2GUI\checkPermission(), manage(), showLinks(), sort(), and ilContainer\SORT_MANUAL.

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

995  {
996  global $DIC;
997 
998  $ilErr = $DIC['ilErr'];
999  $ilTabs = $DIC['ilTabs'];
1000 
1001  $ilTabs->activateTab("id_content");
1002 
1003  $this->checkPermission('read');
1004 
1005  if (strtolower($_GET["baseClass"]) == "iladministrationgui") {
1006  parent::view();
1007  return true;
1008  } else {
1009  switch ((int) $_REQUEST['view_mode']) {
1010  case self::VIEW_MODE_MANAGE:
1011  $this->manage();
1012  break;
1013 
1014  case self::VIEW_MODE_SORT:
1015  // #14638
1016  include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
1018  $this->sort();
1019  break;
1020  }
1021  // fallthrough
1022 
1023  // no break
1024  default:
1025  $this->showLinks();
1026  break;
1027  }
1028  }
1029  $GLOBALS['DIC']['tpl']->setPermanentLink($this->object->getType(), $this->object->getRefId());
1030  return true;
1031  }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
$_GET["client_id"]
showLinks()
Show all active links.
global $DIC
Definition: goto.php:24
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
static _lookupSortMode($a_obj_id)
lookup sort mode
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ LINK_MOD_ADD

const ilObjLinkResourceGUI::LINK_MOD_ADD = 3

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

◆ LINK_MOD_CREATE

const ilObjLinkResourceGUI::LINK_MOD_CREATE = 1

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

◆ LINK_MOD_EDIT

const ilObjLinkResourceGUI::LINK_MOD_EDIT = 2

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

◆ LINK_MOD_EDIT_LIST

const ilObjLinkResourceGUI::LINK_MOD_EDIT_LIST = 5

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

◆ LINK_MOD_SET_LIST

const ilObjLinkResourceGUI::LINK_MOD_SET_LIST = 4

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

◆ VIEW_MODE_MANAGE

const ilObjLinkResourceGUI::VIEW_MODE_MANAGE = 2

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

◆ VIEW_MODE_SORT

const ilObjLinkResourceGUI::VIEW_MODE_SORT = 3

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

◆ VIEW_MODE_VIEW

const ilObjLinkResourceGUI::VIEW_MODE_VIEW = 1

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


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