ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilObjLinkResourceGUI Class Reference

Class ilObjLinkResourceGUI. More...

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

Public Member Functions

 getType ()
 Functions that must be overwritten. More...
 
 executeCommand ()
 execute command More...
 
 save ()
 Save new object @access public. More...
 
 editLink ()
 Edit a single link. More...
 
 updateLink ()
 Save after editing. 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 @access public More...
 
 __prepareOutput ()
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 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)
 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...
 
 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 @access 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 ()
 @inheritDoc More...
 
 removeFromDeskObject ()
 @inheritDoc More...
 
 formatInvalidLinkArray (array $row)
 

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
 
- Data Fields inherited from ilObject2GUI
 $tree
 
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 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)
 Init object creation form. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 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...
 
 checkLinkInput ($a_mode, $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...
 
 isContainerMetaDataRequired ()
 Check if a new container title is required Necessary if there is more than one 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 ()
 called by prepare output More...
 
 showUpperIcon ()
 
 omitLocator ($a_omit=true)
 
 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...
 
 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...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) 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...
 
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 
 searchCloneSource ()
 
 buildCloneSelect ($existing_objs)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation ($a_cmd, $a_location="")
 Deprecated functions. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 showActions ()
 
 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...
 
 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 @access public More...
 
 setAdminTabs ()
 set admin tabs @access 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
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 

Detailed Description

Member Function Documentation

◆ __initLinkChecker()

ilObjLinkResourceGUI::__initLinkChecker ( )

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

1309 {
1310 global $DIC;
1311
1312 $ilDB = $DIC['ilDB'];
1313
1314 include_once './Services/LinkChecker/classes/class.ilLinkChecker.php';
1315
1316 $this->link_checker_obj = new ilLinkChecker($ilDB, false);
1317 $this->link_checker_obj->setObjId($this->object->getId());
1318
1319 return true;
1320 }
class for checking external links in page objects Normally used in Cron jobs, but should be extensibl...
global $ilDB
$DIC
Definition: xapitoken.php:46

References $DIC, and $ilDB.

Referenced by linkChecker(), and refreshLinkCheck().

+ Here is the caller graph for this function:

◆ __prepareOutput()

ilObjLinkResourceGUI::__prepareOutput ( )

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

1461 {
1462 // output objects
1463 // $this->tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
1464 // $this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
1465
1466 $this->tpl->setLocator();
1467
1468 // output message
1469 if ($this->message) {
1470 ilUtil::sendInfo($this->message);
1471 }
1472
1473 // display infopanel if something happened
1475 ;
1476 }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static infoPanel($a_keep=true)

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

Referenced by executeCommand().

+ 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 1628 of file class.ilObjLinkResourceGUI.php.

1629 {
1630 global $DIC;
1631
1632 $ilAccess = $DIC['ilAccess'];
1633 $ilErr = $DIC['ilErr'];
1634 $lng = $DIC['lng'];
1635
1636 if ($a_additional && substr($a_additional, -3) == "wsp") {
1637 $_GET["baseClass"] = "ilsharedresourceGUI";
1638 $_GET["wsp_id"] = $a_target;
1639 include("ilias.php");
1640 exit;
1641 }
1642
1643 // Will be replaced in future releases by ilAccess::checkAccess()
1644 if ($ilAccess->checkAccess("read", "", $a_target)) {
1645 ilUtil::redirect("ilias.php?baseClass=ilLinkResourceHandlerGUI&ref_id=$a_target");
1646 } else {
1647 // to do: force flat view
1648 if ($ilAccess->checkAccess("visible", "", $a_target)) {
1649 ilUtil::redirect("ilias.php?baseClass=ilLinkResourceHandlerGUI&ref_id=" . $a_target . "&cmd=infoScreen");
1650 } else {
1651 if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
1652 ilUtil::sendFailure(sprintf(
1653 $lng->txt("msg_no_perm_read_item"),
1655 ), true);
1657 }
1658 }
1659 }
1660
1661 $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
1662 }
$_GET["client_id"]
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static redirect($a_script)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
exit
Definition: login.php:29

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

+ 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 1329 of file class.ilObjLinkResourceGUI.php.

1330 {
1331 global $DIC;
1332
1333 $ilCtrl = $DIC['ilCtrl'];
1334 $ilTabs = $DIC['ilTabs'];
1335 $lng = $DIC['lng'];
1336
1337 switch ($a_active_tab) {
1338 case 'content':
1339 if ($this->checkPermissionBool('write')) {
1340 $this->lng->loadLanguageModule('cntr');
1341
1342 $this->ctrl->setParameter($this, 'switch_mode', self::VIEW_MODE_VIEW);
1343 $ilTabs->addSubTab(
1344 'id_content_view',
1345 $lng->txt('view'),
1346 $this->ctrl->getLinkTarget($this, 'switchViewMode')
1347 );
1348 $this->ctrl->setParameter($this, 'switch_mode', self::VIEW_MODE_MANAGE);
1349 $ilTabs->addSubTab(
1350 'id_content_manage',
1351 $lng->txt('cntr_manage'),
1352 $this->ctrl->getLinkTarget($this, 'switchViewMode')
1353 );
1354 include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
1355 include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
1356 include_once './Services/Container/classes/class.ilContainer.php';
1357 if ((ilLinkResourceItems::lookupNumberOfLinks($this->object->getId()) > 1)
1359 $this->ctrl->setParameter($this, 'switch_mode', self::VIEW_MODE_SORT);
1360 $ilTabs->addSubTab(
1361 'id_content_ordering',
1362 $this->lng->txt('cntr_ordering'),
1363 $this->ctrl->getLinkTarget($this, 'switchViewMode')
1364 );
1365 }
1366
1367 $ilCtrl->clearParameters($this);
1368 $ilTabs->activateSubTab($a_active_subtab);
1369 }
1370 }
1371
1372 $ilTabs->activateTab('id_content');
1373 }
static _lookupSortMode($a_obj_id)
lookup sort mode
static lookupNumberOfLinks($a_webr_id)
Get number of assigned links.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
global $ilCtrl
Definition: ilias.php:18

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

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

+ 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 385 of file class.ilObjLinkResourceGUI.php.

386 {
387 $this->checkPermission('write');
388 $this->activateTabs('content', 'id_content_view');
389
390 $this->initFormLink(self::LINK_MOD_ADD);
391 $this->tpl->setContent($this->form->getHTML());
392 }
activateTabs($a_active_tab, $a_active_subtab='')
Activate tab and subtabs.
initFormLink($a_mode)
Show create/edit single link.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.

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

+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjLinkResourceGUI::addLocatorItems ( )

Functions to be overwritten.

Reimplemented from ilObject2GUI.

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

1479 {
1480 global $DIC;
1481
1482 $ilLocator = $DIC['ilLocator'];
1483
1484 if (is_object($this->object)) {
1485 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this), "", $this->object->getRefId(), "webr");
1486 }
1487 }

References $DIC.

◆ afterSave()

ilObjLinkResourceGUI::afterSave ( ilObject  $a_new_object)
protected

Post (successful) object creation hook.

Parameters
ilObject$a_new_object

Reimplemented from ilObjectGUI.

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

170 {
171 // Save link
172 $this->link->setLinkResourceId($a_new_object->getId());
173 $link_id = $this->link->add();
174 $this->link->updateValid(true);
175
176 ilUtil::sendSuccess($this->lng->txt('webr_link_added'));
177
178 // personal workspace
179 if ($this->id_type == self::WORKSPACE_NODE_ID) {
180 $this->ctrl->redirect($this, "editLinks");
181 }
182 // repository
183 else {
184 ilUtil::redirect("ilias.php?baseClass=ilLinkResourceHandlerGUI&ref_id=" .
185 $a_new_object->getRefId() . "&cmd=switchViewMode&switch_mode=2");
186 }
187 }
getRefId()
get reference id @access public
getId()
get object id @access public

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

+ Here is the call graph for this function:

◆ callDirectLink()

ilObjLinkResourceGUI::callDirectLink ( )

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

1531 {
1532 $obj_id = $this->object->getId();
1533
1534 include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
1537 if ($url["target"]) {
1538 $url["target"] = $this->handleSubItemLinks($url["target"]);
1539
1540 include_once './Modules/WebResource/classes/class.ilParameterAppender.php';
1543 }
1544
1545 $this->redirectToLink($this->ref_id, $obj_id, $url["target"]);
1546 }
1547 }
1548 }
static _getFirstLink($a_webr_id)
Get first link item Check before with _isSingular() if there is more or less than one.
static _isSingular($a_webr_id)
Check whether there is only one active link in the web resource.
redirectToLink($a_ref_id, $a_obj_id, $a_url)
static _append($a_link_data)
static _isEnabled()
Check if dynamic parameters are enabled.
$url

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

+ Here is the call graph for this function:

◆ callLink()

ilObjLinkResourceGUI::callLink ( )

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

1551 {
1552 if ($_REQUEST["link_id"]) {
1553 $obj_id = $this->object->getId();
1554
1555 include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
1556 $items = new ilLinkResourceItems($obj_id);
1557 $item = $items->getItem($_REQUEST["link_id"]);
1558 if ($item["target"]) {
1559 $item["target"] = $this->handleSubItemLinks($item["target"]);
1560
1561 include_once './Modules/WebResource/classes/class.ilParameterAppender.php';
1563 $item = ilParameterAppender::_append($item);
1564 }
1565 ilLoggerFactory::getLogger('webr')->debug('Redirecting to: ' . $item['target']);
1566 $this->redirectToLink($this->ref_id, $obj_id, $item["target"]);
1567 }
1568 }
1569 }
Class ilObjLinkResourceGUI.
static getLogger($a_component_id)
Get component logger.

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

+ Here is the call graph for this function:

◆ checkLinkInput()

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

Check input after creating a new link.

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

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

624 {
625 $valid = $this->form->checkInput();
626
627 $link_input = $this->form->getInput('tar');
628
629 include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
630 $this->link = new ilLinkResourceItems($a_webr_id);
631 $this->link->setTarget(str_replace('"', '', ilUtil::stripSlashes($link_input)));
632 $this->link->setTitle($this->form->getInput('tit'));
633 $this->link->setDescription($this->form->getInput('des'));
634 $this->link->setDisableCheckStatus($this->form->getInput('che'));
635 $this->link->setInternal(ilLinkInputGUI::isInternalLink($link_input));
636
637 if ($a_mode == self::LINK_MOD_CREATE) {
638 $this->link->setActiveStatus(true);
639 } else {
640 $this->link->setActiveStatus($this->form->getInput('act'));
641 }
642
643 if ($a_mode == self::LINK_MOD_EDIT) {
644 $this->link->setValidStatus($this->form->getInput('vali'));
645 } else {
646 $this->link->setValidStatus(true);
647 }
648
650 return $valid;
651 }
652
653 $this->dynamic = new ilParameterAppender($a_webr_id);
654 $this->dynamic->setName($this->form->getInput('nam'));
655 $this->dynamic->setValue($this->form->getInput('val'));
656 if (!$this->dynamic->validate()) {
657 switch ($this->dynamic->getErrorCode()) {
659 $this->form->getItemByPostVar('nam')->setAlert($this->lng->txt('links_no_name_given'));
660 return false;
661
663 $this->form->getItemByPostVar('val')->setAlert($this->lng->txt('links_no_value_given'));
664 return false;
665
667 // Nothing entered => no error
668 return $valid;
669 }
670 $this->dynamic = null;
671 }
672 return $valid;
673 }
const LINKS_ERR_NO_NAME
const LINKS_ERR_NO_VALUE
const LINKS_ERR_NO_NAME_VALUE
static isInternalLink($a_value)
Class ilParameterAppender.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$valid

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().

+ 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 1038 of file class.ilObjLinkResourceGUI.php.

1039 {
1040 $this->checkPermission('write');
1041 $this->activateTabs('content', 'id_content_view');
1042
1043 $link_ids = array();
1044
1045 if (is_array($_POST['link_ids'])) {
1046 $link_ids = $_POST['link_ids'];
1047 } elseif (isset($_GET['link_id'])) {
1048 $link_ids = array($_GET['link_id']);
1049 }
1050
1051 if (!count($link_ids) > 0) {
1052 ilUtil::sendFailure($this->lng->txt('select_one'));
1053 $this->view();
1054 return false;
1055 }
1056
1057 include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
1058 $links = new ilLinkResourceItems($this->object->getId());
1059
1060 include_once 'Services/Utilities/classes/class.ilConfirmationGUI.php';
1061 $confirm = new ilConfirmationGUI();
1062 $confirm->setFormAction($this->ctrl->getFormAction($this, 'view'));
1063 $confirm->setHeaderText($this->lng->txt('webr_sure_delete_items'));
1064 $confirm->setConfirm($this->lng->txt('delete'), 'deleteLinks');
1065 $confirm->setCancel($this->lng->txt('cancel'), 'view');
1066
1067 foreach ($link_ids as $link_id) {
1068 $link = $links->getItem($link_id);
1069 $confirm->addItem('link_ids[]', $link_id, $link['title']);
1070 }
1071 $this->tpl->setContent($confirm->getHTML());
1072 }
$_POST["username"]
Confirmation screen class.

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

+ Here is the call graph for this function:

◆ deactivateLink()

ilObjLinkResourceGUI::deactivateLink ( )
protected

Deactivate links.

Returns

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

1101 {
1102 global $DIC;
1103
1104 $ilCtrl = $DIC['ilCtrl'];
1105
1106 $this->checkPermission('write');
1107
1108 include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
1109 $links = new ilLinkResourceItems($this->object->getId());
1110
1111 if (!$_GET['link_id']) {
1112 ilUtil::sendFailure($this->lng->txt('select_one'), true);
1113 $ilCtrl->redirect($this, 'view');
1114 }
1115
1116 $links->setLinkId((int) $_GET['link_id']);
1117 $links->updateActive(false);
1118
1119 ilUtil::sendSuccess($this->lng->txt('webr_inactive_success'), true);
1120 $ilCtrl->redirect($this, 'view');
1121 }

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

+ Here is the call graph for this function:

◆ deleteLinks()

ilObjLinkResourceGUI::deleteLinks ( )
protected

Delete links.

Returns

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

1079 {
1080 global $DIC;
1081
1082 $ilCtrl = $DIC['ilCtrl'];
1083
1084 $this->checkPermission('write');
1085
1086 include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
1087 $links = new ilLinkResourceItems($this->object->getId());
1088
1089 foreach ($_POST['link_ids'] as $link_id) {
1090 $links->delete($link_id);
1091 }
1092 ilUtil::sendSuccess($this->lng->txt('webr_deleted_items'), true);
1093 $ilCtrl->redirect($this, 'view');
1094 }

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

+ Here is the call graph for this function:

◆ deleteParameter()

ilObjLinkResourceGUI::deleteParameter ( )
protected

Delete a dynamic parameter.

Returns

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

439 {
440 global $DIC;
441
442 $ilCtrl = $DIC['ilCtrl'];
443
444 $this->checkPermission('write');
445
446 $this->ctrl->setParameter($this, 'link_id', (int) $_GET['link_id']);
447
448 if (!isset($_GET['param_id'])) {
449 ilUtil::sendFailure($this->lng->txt('select_one'), true);
450 $ilCtrl->redirect($this, 'view');
451 }
452
453 include_once './Modules/WebResource/classes/class.ilParameterAppender.php';
454 $param = new ilParameterAppender($this->object->getId());
455 $param->delete((int) $_GET['param_id']);
456
457 ilUtil::sendSuccess($this->lng->txt('links_parameter_deleted'), true);
458 $ilCtrl->redirect($this, 'editLinks');
459 }
$param
Definition: xapitoken.php:31

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

+ Here is the call graph for this function:

◆ deleteParameterForm()

ilObjLinkResourceGUI::deleteParameterForm ( )
protected

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

462 {
463 global $DIC;
464
465 $ilCtrl = $DIC['ilCtrl'];
466
467 $this->checkPermission('write');
468
469 if (!isset($_GET['param_id'])) {
470 ilUtil::sendFailure($this->lng->txt('select_one'), true);
471 $ilCtrl->redirect($this, 'view');
472 }
473
474 include_once './Modules/WebResource/classes/class.ilParameterAppender.php';
475 $param = new ilParameterAppender($this->object->getId());
476 $param->delete((int) $_GET['param_id']);
477
478 ilUtil::sendSuccess($this->lng->txt('links_parameter_deleted'), true);
479 $ilCtrl->redirect($this, 'view');
480 }

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

+ Here is the call graph for this function:

◆ editLink()

ilObjLinkResourceGUI::editLink ( )

Edit a single link.

Returns

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

331 {
332 global $DIC;
333
334 $ilCtrl = $DIC['ilCtrl'];
335
336 $this->checkPermission('write');
337 $this->activateTabs('content', 'id_content_view');
338
339 if (!(int) $_GET['link_id']) {
340 ilUtil::sendFailure($this->lng->txt('select_one'), true);
341 $ilCtrl->redirect($this, 'view');
342 }
343
344 $this->initFormLink(self::LINK_MOD_EDIT);
345 $this->setValuesFromLink((int) $_GET['link_id']);
346 $this->tpl->setContent($this->form->getHTML());
347 }
setValuesFromLink($a_link_id)
Set form values from link.

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

+ Here is the call graph for this function:

◆ editLinks()

ilObjLinkResourceGUI::editLinks ( )
protected

Start with manage mode.

Returns

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

884 {
885 $_GET['switch_mode'] = self::VIEW_MODE_MANAGE;
886 $this->switchViewMode();
887 }
switchViewMode()
Switch between "View" "Manage" and "Sort".

References $_GET, switchViewMode(), and VIEW_MODE_MANAGE.

+ Here is the call graph for this function:

◆ executeCommand()

ilObjLinkResourceGUI::executeCommand ( )

execute command

Reimplemented from ilObject2GUI.

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

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

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

+ Here is the call graph for this function:

◆ exportHTML()

ilObjLinkResourceGUI::exportHTML ( )

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

1591 {
1592 global $DIC;
1593
1594 $ilSetting = $DIC['ilSetting'];
1595
1596 $tpl = new ilTemplate("tpl.export_html.html", true, true, "Modules/WebResource");
1597
1598 include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
1599 $items = new ilLinkResourceItems($this->object->getId());
1600 foreach ($items->getAllItems() as $item) {
1601 if (!$item["active"]) {
1602 continue;
1603 }
1604
1605 $target = $this->handleSubItemLinks($item["target"]);
1606
1607 $tpl->setCurrentBlock("link_bl");
1608 $tpl->setVariable("LINK_URL", $target);
1609 $tpl->setVariable("LINK_TITLE", $item["title"]);
1610 $tpl->setVariable("LINK_DESC", $item["description"]);
1611 $tpl->setVariable("LINK_CREATE", $item["create_date"]);
1612 $tpl->setVariable("LINK_UPDATE", $item["last_update"]);
1613 $tpl->parseCurrentBlock();
1614 }
1615
1616 $tpl->setVariable("CREATE_DATE", $this->object->getCreateDate());
1617 $tpl->setVariable("LAST_UPDATE", $this->object->getLastUpdateDate());
1618 $tpl->setVariable("TXT_TITLE", $this->object->getTitle());
1619 $tpl->setVariable("TXT_DESC", $this->object->getLongDescription());
1620
1621 $tpl->setVariable("INST_ID", ($ilSetting->get('short_inst_name') != "")
1622 ? $ilSetting->get('short_inst_name')
1623 : "ILIAS");
1624
1625 ilUtil::deliverData($tpl->get(), "bookmarks.html");
1626 }
special template class to simplify handling of ITX/PEAR
static deliverData($a_data, $a_filename, $mime="application/octet-stream", $charset="")
deliver data for download via browser.
global $ilSetting
Definition: privfeed.php:17

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

+ Here is the call graph for this function:

◆ formatInvalidLinkArray()

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

Implements ilLinkCheckerGUIRowHandling.

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

1191 {
1192 $this->object->items_obj->readItem($row['page_id']);
1193 $row['title'] = $this->object->items_obj->getTitle();
1194
1195 require_once 'Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php';
1197 $actions->setSelectionHeaderClass('small');
1198 $actions->setItemLinkClass('xsmall');
1199 $actions->setListTitle($this->lng->txt('actions'));
1200 $actions->setId($row['page_id']);
1201 $this->ctrl->setParameter($this, 'link_id', $row['page_id']);
1202 $actions->addItem(
1203 $this->lng->txt('edit'),
1204 '',
1205 $this->ctrl->getLinkTarget($this, 'editLink')
1206 );
1207 $this->ctrl->clearParameters($this);
1208 $row['action_html'] = $actions->getHTML();
1209
1210 return $row;
1211 }
User interface class for advanced drop-down selection lists.

References ilObjectGUI\$actions.

◆ getType()

ilObjLinkResourceGUI::getType ( )

Functions that must be overwritten.

Reimplemented from ilObject2GUI.

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

33 {
34 return "webr";
35 }

◆ handleSubItemLinks()

ilObjLinkResourceGUI::handleSubItemLinks (   $a_target)
protected

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

1490 {
1491 // #15647 - handle internal links
1492 include_once "Services/Form/classes/class.ilFormPropertyGUI.php";
1493 include_once "Services/Form/classes/class.ilLinkInputGUI.php";
1494
1495 if (ilLinkInputGUI::isInternalLink($a_target)) {
1496 include_once("./Services/Link/classes/class.ilLink.php");
1497
1498 // #10612
1499 $parts = explode("|", $a_target);
1500
1501 if ($parts[0] == 'wpage') {
1503 0,
1504 'wiki',
1505 true,
1506 '&target=wiki_wpage_' . $parts[1]
1507 );
1508 }
1509
1510 if ($parts[0] == "term") {
1511 // #16894
1513 0,
1514 "git",
1515 true,
1516 "&target=git_" . $parts[1]
1517 );
1518 }
1519
1520 if ($parts[0] == "page") {
1521 $parts[0] = "pg";
1522 }
1523
1524 $a_target = ilLink::_getStaticLink($parts[1], $parts[0]);
1525 }
1526
1527 return $a_target;
1528 }

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

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ history()

ilObjLinkResourceGUI::history ( )

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

1168 {
1169 global $DIC;
1170
1171 $ilTabs = $DIC['ilTabs'];
1172
1173 $this->checkPermission('write');
1174 $ilTabs->activateTab('id_history');
1175
1176 include_once("./Services/History/classes/class.ilHistoryTableGUI.php");
1177 $hist_gui = new ilHistoryTableGUI($this, "history", $this->object->getId(), $this->object->getType);
1178 $hist_gui->initTable();
1179 $this->tpl->setContent($hist_gui->getHTML());
1180 }
Copyright (c) 1998-2014 ILIAS open source, Extended GPL, see docs/LICENSE Date: 24....

References $DIC, and ilObject2GUI\checkPermission().

+ 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 1129 of file class.ilObjLinkResourceGUI.php.

1130 {
1131 $this->ctrl->setCmd("showSummary");
1132 $this->ctrl->setCmdClass("ilinfoscreengui");
1133 $this->infoScreenForward();
1134 }

References infoScreenForward().

+ Here is the call graph for this function:

◆ infoScreenForward()

ilObjLinkResourceGUI::infoScreenForward ( )

show information screen

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

1140 {
1141 global $DIC;
1142
1143 $ilTabs = $DIC['ilTabs'];
1144
1145 if (!$this->checkPermissionBool('visible')) {
1146 $this->checkPermission('read');
1147 }
1148 $ilTabs->activateTab('id_info');
1149
1150 include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1151 $info = new ilInfoScreenGUI($this);
1152
1153 $info->enablePrivateNotes();
1154
1155 // standard meta data
1156 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
1157
1158 if ($this->id_type == self::WORKSPACE_NODE_ID) {
1159 $info->addProperty($this->lng->txt("perma_link"), $this->getPermanentLinkWidget());
1160 }
1161
1162 // forward the command
1163 $this->ctrl->forwardCommand($info);
1164 }
Class ilInfoScreenGUI.

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

Referenced by executeCommand(), and infoScreen().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCreateForm()

ilObjLinkResourceGUI::initCreateForm (   $a_new_type)
protected

Init object creation form.

Parameters
string$a_new_type
Returns
ilPropertyFormGUI

Reimplemented from ilObjectGUI.

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

140 {
141 $this->initFormLink(self::LINK_MOD_CREATE);
142 return $this->form;
143 }

References initFormLink().

+ 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 681 of file class.ilObjLinkResourceGUI.php.

682 {
683 global $DIC;
684
685 $ilTabs = $DIC['ilTabs'];
686
687 $ilTabs->activateTab("id_content");
688
689 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
690 $this->form = new ilPropertyFormGUI();
691
692 switch ($a_mode) {
694 // Header
695 $this->ctrl->setParameter($this, 'new_type', 'webr');
696 $this->form->setTitle($this->lng->txt('webr_new_link'));
697 $this->form->setTableWidth('600px');
698
699 // Buttons
700 $this->form->addCommandButton('save', $this->lng->txt('webr_add'));
701 $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
702 break;
703
705 // Header
706 $this->form->setTitle($this->lng->txt('webr_new_link'));
707
708 // Buttons
709 $this->form->addCommandButton('saveAddLink', $this->lng->txt('webr_add'));
710 $this->form->addCommandButton('view', $this->lng->txt('cancel'));
711 break;
712
714 // Header
715 $this->ctrl->setParameter($this, 'link_id', (int) $_REQUEST['link_id']);
716 $this->form->setTitle($this->lng->txt('webr_edit'));
717
718 // Buttons
719 $this->form->addCommandButton('updateLink', $this->lng->txt('save'));
720 $this->form->addCommandButton('view', $this->lng->txt('cancel'));
721 break;
722 }
723
724
725 $this->form->setFormAction($this->ctrl->getFormAction($this));
726
727 if ($a_mode == self::LINK_MOD_ADD and $this->isContainerMetaDataRequired()) {
728 ilUtil::sendInfo($this->lng->txt('webr_container_info'));
729
730
731 $this->form->setTitle($this->lng->txt('webr_edit_list'));
732
733 // List Title
734 $title = new ilTextInputGUI($this->lng->txt('webr_list_title'), 'lti');
735 $title->setRequired(true);
736 $title->setSize(40);
737 $title->setMaxLength(127);
738 $this->form->addItem($title);
739
740 // List Description
741 $desc = new ilTextAreaInputGUI($this->lng->txt('webr_list_desc'), 'tde');
742 $desc->setRows(3);
743 $desc->setCols(40);
744 $this->form->addItem($desc);
745
746 // Addtional section
747 $sect = new ilFormSectionHeaderGUI();
748 $sect->setTitle($this->lng->txt('webr_add'));
749 $this->form->addItem($sect);
750 }
751
752 // Target
753 /*
754 $tar = new ilTextInputGUI($this->lng->txt('webr_link_target'),'tar');
755 $tar->setValue("http://");
756
757 $tar->setSize(40);
758 $tar->setMaxLength(500);
759 */
760 include_once 'Services/Form/classes/class.ilLinkInputGUI.php';
761 $tar = new ilLinkInputGUI($this->lng->txt('webr_link_target'), 'tar');
762 $tar->setInternalLinkFilterTypes(
763 array(
764 "PageObject",
765 "GlossaryItem",
766 "RepositoryItem",
767 'WikiPage'
768 )
769 );
770 $tar->setExternalLinkMaxLength(1000);
771 $tar->setInternalLinkFilterTypes(array("PageObject", "GlossaryItem", "RepositoryItem"));
772 $tar->setRequired(true);
773 $this->form->addItem($tar);
774
775 // Title
776 $tit = new ilTextInputGUI($this->lng->txt('webr_link_title'), 'tit');
777 $tit->setRequired(true);
778 $tit->setSize(40);
779 $tit->setMaxLength(127);
780 $this->form->addItem($tit);
781
782 // Description
783 $des = new ilTextAreaInputGUI($this->lng->txt('description'), 'des');
784 $des->setRows(3);
785 $des->setCols(40);
786 $this->form->addItem($des);
787
788
789 if ($a_mode != self::LINK_MOD_CREATE) {
790 // Active
791 $act = new ilCheckboxInputGUI($this->lng->txt('active'), 'act');
792 $act->setChecked(true);
793 $act->setValue(1);
794 $this->form->addItem($act);
795
796 // Check
797 $che = new ilCheckboxInputGUI($this->lng->txt('webr_disable_check'), 'che');
798 $che->setValue(1);
799 $this->form->addItem($che);
800 }
801
802 // Valid
803 if ($a_mode == self::LINK_MOD_EDIT) {
804 $val = new ilCheckboxInputGUI($this->lng->txt('valid'), 'vali');
805 $this->form->addItem($val);
806 }
807
808 if (ilParameterAppender::_isEnabled() && $a_mode != self::LINK_MOD_CREATE) {
809 $dyn = new ilNonEditableValueGUI($this->lng->txt('links_dyn_parameter'));
810 $dyn->setInfo($this->lng->txt('links_dynamic_info'));
811
812
813 if (count($links = ilParameterAppender::_getParams((int) $_GET['link_id']))) {
814 $ex = new ilCustomInputGUI($this->lng->txt('links_existing_params'), 'ex');
815 $dyn->addSubItem($ex);
816
817 foreach ($links as $id => $link) {
818 $p = new ilCustomInputGUI();
819
820 $ptpl = new ilTemplate('tpl.link_dyn_param_edit.html', true, true, 'Modules/WebResource');
821 $ptpl->setVariable('INFO_TXT', ilParameterAppender::parameterToInfo($link['name'], $link['value']));
822 $this->ctrl->setParameter($this, 'param_id', $id);
823 $ptpl->setVariable('LINK_DEL', $this->ctrl->getLinkTarget($this, 'deleteParameterForm'));
824 $ptpl->setVariable('LINK_TXT', $this->lng->txt('delete'));
825 $p->setHtml($ptpl->get());
826 $dyn->addSubItem($p);
827 }
828 }
829
830 // Existing parameters
831
832 // New parameter
833 if ($a_mode != self::LINK_MOD_CREATE) {
834 #$new = new ilCustomInputGUI($this->lng->txt('links_add_param'),'');
835 #$dyn->addSubItem($new);
836 }
837
838 // Dynyamic name
839 $nam = new ilTextInputGUI($this->lng->txt('links_name'), 'nam');
840 $nam->setSize(12);
841 $nam->setMaxLength(128);
842 $dyn->addSubItem($nam);
843
844 // Dynamic value
845 $val = new ilSelectInputGUI($this->lng->txt('links_value'), 'val');
846 $val->setOptions(ilParameterAppender::_getOptionSelect());
847 $val->setValue(0);
848 $dyn->addSubItem($val);
849
850 $this->form->addItem($dyn);
851 }
852 }
This class represents a checkbox property in a property form.
This class represents a custom property in a property form.
This class represents a section header in a property form.
This class represents a external and/or internal link in a property form.
This class represents a non editable value in a property form.
isContainerMetaDataRequired()
Check if a new container title is required Necessary if there is more than one link.
static parameterToInfo($a_name, $a_value)
Get info text describing an existing dynamic link.
static _getOptionSelect()
Get options as array.
static _getParams($a_link_id)
Get dynamic parameter definitions.
This class represents a property form user interface.
This class represents a selection list property in a property form.
This class represents a text area property in a property form.
This class represents a text property in a property form.

References $_GET, $DIC, ilParameterAppender\_getOptionSelect(), ilParameterAppender\_getParams(), ilParameterAppender\_isEnabled(), isContainerMetaDataRequired(), LINK_MOD_ADD, LINK_MOD_CREATE, LINK_MOD_EDIT, ilParameterAppender\parameterToInfo(), and ilUtil\sendInfo().

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

+ 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 250 of file class.ilObjLinkResourceGUI.php.

251 {
252 $obj_service = $this->object_service;
253
254 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
255 $this->form = new ilPropertyFormGUI();
256 $this->form->setFormAction($this->ctrl->getFormAction($this, 'saveSettings'));
257
258 if (ilLinkResourceItems::lookupNumberOfLinks($this->object->getId()) > 1) {
259 $this->form->setTitle($this->lng->txt('webr_edit_settings'));
260
261 // Title
262 $tit = new ilTextInputGUI($this->lng->txt('webr_list_title'), 'tit');
263 $tit->setValue($this->object->getTitle());
264 $tit->setRequired(true);
265 $tit->setSize(40);
266 $tit->setMaxLength(127);
267 $this->form->addItem($tit);
268
269 // Description
270 $des = new ilTextAreaInputGUI($this->lng->txt('webr_list_desc'), 'des');
271 $des->setValue($this->object->getDescription());
272 $des->setCols(40);
273 $des->setRows(3);
274 $this->form->addItem($des);
275
277 $section->setTitle($this->lng->txt('obj_presentation'));
278 $this->form->addItem($section);
279
280 // tile image
281 $obj_service->commonSettings()->legacyForm($this->form, $this->object)->addTileImage();
282
283 // Sorting
284 include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
285 include_once './Services/Container/classes/class.ilContainer.php';
286
287 $sor = new ilRadioGroupInputGUI($this->lng->txt('webr_sorting'), 'sor');
288 $sor->setRequired(true);
289 include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
290 $sor->setValue(ilContainerSortingSettings::_lookupSortMode($this->object->getId()));
291
292 $opt = new ilRadioOption(
293 $this->lng->txt('webr_sort_title'),
295 );
296 $sor->addOption($opt);
297
298 $opm = new ilRadioOption(
299 $this->lng->txt('webr_sort_manual'),
301 );
302 $sor->addOption($opm);
303 $this->form->addItem($sor);
304 } else {
305 $this->form->setTitle($this->lng->txt('obj_presentation'));
306
307 // hidden title
308 $tit = new ilHiddenInputGUI('tit');
309 $tit->setValue($this->object->getTitle());
310 $this->form->addItem($tit);
311
312 // hidden description
313 $des = new ilHiddenInputGUI('des');
314 $des->setValue($this->object->getDescription());
315 $this->form->addItem($des);
316
317 // tile image
318 $obj_service->commonSettings()->legacyForm($this->form, $this->object)->addTileImage();
319 }
320
321 $this->form->addCommandButton('saveSettings', $this->lng->txt('save'));
322 $this->form->addCommandButton('view', $this->lng->txt('cancel'));
323 }
$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.
This class represents an option in a radio group.

References ilObjectGUI\$object_service, $section, ilContainerSortingSettings\_lookupSortMode(), ilLinkResourceItems\lookupNumberOfLinks(), ilContainer\SORT_MANUAL, and ilContainer\SORT_TITLE.

Referenced by saveSettings(), and settings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isContainerMetaDataRequired()

ilObjLinkResourceGUI::isContainerMetaDataRequired ( )
protected

Check if a new container title is required Necessary if there is more than one link.

Returns

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

860 {
861 include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
862 return ilLinkResourceItems::lookupNumberOfLinks($this->object->getId()) == 1;
863 }

References ilLinkResourceItems\lookupNumberOfLinks().

Referenced by initFormLink(), saveAddLink(), updateLink(), and updateLinks().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ linkChecker()

ilObjLinkResourceGUI::linkChecker ( )
protected

Show link validation.

Returns

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

1218 {
1219 global $DIC;
1220
1221 $ilias = $DIC['ilias'];
1222 $ilUser = $DIC['ilUser'];
1223 $tpl = $DIC['tpl'];
1224 $ilTabs = $DIC['ilTabs'];
1225
1226 $this->checkPermission('write');
1227 $ilTabs->activateTab('id_link_check');
1228
1229 $this->__initLinkChecker();
1230 $this->object->initLinkResourceItemsObject();
1231
1232 require_once './Services/LinkChecker/classes/class.ilLinkCheckerTableGUI.php';
1233
1234 $toolbar = new ilToolbarGUI();
1235
1236 if ((bool) $ilias->getSetting('cron_web_resource_check')) {
1237 include_once './Services/LinkChecker/classes/class.ilLinkCheckNotify.php';
1238 include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
1239
1240 $chb = new ilCheckboxInputGUI($this->lng->txt('link_check_message_a'), 'link_check_message');
1241 $chb->setValue(1);
1242 $chb->setChecked((bool) ilLinkCheckNotify::_getNotifyStatus($ilUser->getId(), $this->object->getId()));
1243 $chb->setOptionTitle($this->lng->txt('link_check_message_b'));
1244
1245 $toolbar->addInputItem($chb);
1246 $toolbar->addFormButton($this->lng->txt('save'), 'saveLinkCheck');
1247 $toolbar->setFormAction($this->ctrl->getLinkTarget($this, 'saveLinkCheck'));
1248 }
1249
1250 $tgui = new ilLinkCheckerTableGUI($this, 'linkChecker');
1251 $tgui->setLinkChecker($this->link_checker_obj)
1252 ->setRowHandler($this)
1253 ->setRefreshButton($this->lng->txt('refresh'), 'refreshLinkCheck');
1254
1255 return $tpl->setContent($tgui->prepareHTML()->getHTML() . $toolbar->getHTML());
1256 }
static _getNotifyStatus($a_usr_id, $a_obj_id)
class ilLinkCheckerTableGUI
$ilUser
Definition: imgupload.php:18

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

Referenced by refreshLinkCheck(), and saveLinkCheck().

+ 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 937 of file class.ilObjLinkResourceGUI.php.

938 {
939 $this->checkPermission('write');
940 $this->activateTabs('content', 'id_content_manage');
941
942 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.webr_manage.html', 'Modules/WebResource');
943 $this->showToolbar('ACTION_BUTTONS');
944
945 include_once './Modules/WebResource/classes/class.ilWebResourceEditableLinkTableGUI.php';
946 $table = new ilWebResourceEditableLinkTableGUI($this, 'view');
947 $table->parse();
948
949 include_once './Services/Link/classes/class.ilInternalLinkGUI.php';
951
952 $this->tpl->addJavaScript("Modules/WebResource/js/intLink.js");
953 $this->tpl->addJavascript("Services/Form/js/Form.js");
954
955 $this->tpl->setVariable('TABLE_LINKS', $table->getHTML() . $js);
956 }
static getInitHTML($a_url)
Get initialisation HTML to use interna link editing.
showToolbar($a_tpl_var)
Show toolbar.

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

Referenced by view().

+ 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 1571 of file class.ilObjLinkResourceGUI.php.

1572 {
1573 global $DIC;
1574
1575 $ilUser = $DIC['ilUser'];
1576
1577 if ($a_url) {
1578 require_once('Services/Tracking/classes/class.ilChangeEvent.php');
1580 "webr",
1581 $a_ref_id,
1582 $a_obj_id,
1583 $ilUser->getId()
1584 );
1585
1586 ilUtil::redirect($a_url);
1587 }
1588 }
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.

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

Referenced by callDirectLink(), and callLink().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ refreshLinkCheck()

ilObjLinkResourceGUI::refreshLinkCheck ( )

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

1286 {
1287 $this->__initLinkChecker();
1288 $this->object->initLinkResourceItemsObject();
1289
1290 // Set all link to valid. After check invalid links will be set to invalid
1291 $this->object->items_obj->updateValidByCheck();
1292
1293 foreach ($this->link_checker_obj->checkWebResourceLinks() as $invalid) {
1294 $this->object->items_obj->readItem($invalid['page_id']);
1295 $this->object->items_obj->setActiveStatus(false);
1296 $this->object->items_obj->setValidStatus(false);
1297 $this->object->items_obj->update(false);
1298 }
1299
1300 $this->object->items_obj->updateLastCheck();
1301 ilUtil::sendSuccess($this->lng->txt('link_checker_refreshed'));
1302
1303 $this->linkChecker();
1304
1305 return true;
1306 }
linkChecker()
Show link validation.

References __initLinkChecker(), and linkChecker().

+ Here is the call graph for this function:

◆ save()

ilObjLinkResourceGUI::save ( )

Save new object @access public.

Reimplemented from ilObject2GUI.

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

150 {
151 global $DIC;
152
153 $ilCtrl = $DIC['ilCtrl'];
154
155 $this->initFormLink(self::LINK_MOD_CREATE);
156 if ($this->checkLinkInput(self::LINK_MOD_CREATE, 0, 0)) {
157 // Save new object
158 $_POST['title'] = $_POST['tit'];
159 $_POST['desc'] = $_POST['des'];
160 parent::save();
161 } else {
162 // Data incomplete or invalid
163 ilUtil::sendFailure($this->lng->txt('err_check_input'));
164 $this->form->setValuesByPost();
165 $this->tpl->setContent($this->form->getHTML());
166 }
167 }
checkLinkInput($a_mode, $a_webr_id=0, $a_link_id=0)
Check input after creating a new link.

References $_POST, $DIC, $ilCtrl, checkLinkInput(), initFormLink(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ saveAddLink()

ilObjLinkResourceGUI::saveAddLink ( )

Save form data.

Returns

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

399 {
400 global $DIC;
401
402 $ilCtrl = $DIC['ilCtrl'];
403
404 $this->checkPermission('write');
405
406 $this->initFormLink(self::LINK_MOD_ADD);
407 if ($this->checkLinkInput(self::LINK_MOD_ADD, $this->object->getId(), 0)) {
408 if ($this->isContainerMetaDataRequired()) {
409 // Save list data
410 $this->object->setTitle($this->form->getInput('lti'));
411 $this->object->setDescription($this->form->getInput('tde'));
412 $this->object->update();
413 }
414
415 // Save Link
416 $link_id = $this->link->add();
417 $this->link->updateValid(true);
418
419 // Dynamic parameters
420 if (ilParameterAppender::_isEnabled() and is_object($this->dynamic)) {
421 $this->dynamic->add($link_id);
422 }
423 ilUtil::sendSuccess($this->lng->txt('webr_link_added'), true);
424 $ilCtrl->redirect($this, 'view');
425 }
426 // Error handling
427 ilUtil::sendFailure($this->lng->txt('err_check_input'));
428 $this->form->setValuesByPost();
429
430 $this->activateTabs('content', 'id_content_view');
431 $this->tpl->setContent($this->form->getHTML());
432 }

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

+ Here is the call graph for this function:

◆ saveLinkCheck()

ilObjLinkResourceGUI::saveLinkCheck ( )

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

1259 {
1260 global $DIC;
1261
1262 $ilDB = $DIC['ilDB'];
1263 $ilUser = $DIC['ilUser'];
1264
1265 include_once './Services/LinkChecker/classes/class.ilLinkCheckNotify.php';
1266
1267 $link_check_notify = new ilLinkCheckNotify($ilDB);
1268 $link_check_notify->setUserId($ilUser->getId());
1269 $link_check_notify->setObjId($this->object->getId());
1270
1271 if ($_POST['link_check_message']) {
1272 ilUtil::sendSuccess($this->lng->txt('link_check_message_enabled'));
1273 $link_check_notify->addNotifier();
1274 } else {
1275 ilUtil::sendSuccess($this->lng->txt('link_check_message_disabled'));
1276 $link_check_notify->deleteNotifier();
1277 }
1278 $this->linkChecker();
1279
1280 return true;
1281 }
class for checking external links in page objects.

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

+ Here is the call graph for this function:

◆ saveSettings()

ilObjLinkResourceGUI::saveSettings ( )
protected

Save container settings.

Returns

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

212 {
213 global $DIC;
214
215 $obj_service = $this->object_service;
216 $ilTabs = $DIC['ilTabs'];
217
218 $this->checkPermission('write');
219 $ilTabs->activateTab('id_settings');
220
221 $this->initFormSettings();
222 if ($this->form->checkInput()) {
223 $this->object->setTitle($this->form->getInput('tit'));
224 $this->object->setDescription($this->form->getInput('des'));
225 $this->object->update();
226
227 include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
228 $sort = new ilContainerSortingSettings($this->object->getId());
229 $sort->setSortMode($this->form->getInput('sor'));
230 $sort->update();
231
232 // tile image
233 $obj_service->commonSettings()->legacyForm($this->form, $this->object)->saveTileImage();
234
235
236 ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
237 $this->ctrl->redirect($this, 'settings');
238 }
239
240 $this->form->setValuesByPost();
241 ilUtil::sendFailure($this->lng->txt('err_check_input'));
242 $this->tpl->setContent($this->form->getHTML());
243 }
initFormSettings()
Show settings form.

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

+ Here is the call graph for this function:

◆ saveSorting()

ilObjLinkResourceGUI::saveSorting ( )
protected

Save nmanual sorting.

Returns

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

999 {
1000 $this->checkPermission('write');
1001
1002 include_once './Services/Container/classes/class.ilContainerSorting.php';
1003 $sort = ilContainerSorting::_getInstance($this->object->getId());
1004 $sort->savePost((array) $_POST['position']);
1005
1006 ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
1007 $this->view();
1008 }
static _getInstance($a_obj_id)
get instance by obj_id

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

+ Here is the call graph for this function:

◆ setTabs()

ilObjLinkResourceGUI::setTabs ( )

get tabs @access public

Reimplemented from ilObject2GUI.

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

1381 {
1382 global $DIC;
1383
1384 $ilTabs = $DIC['ilTabs'];
1385 $lng = $DIC['lng'];
1386 $ilHelp = $DIC['ilHelp'];
1387
1388 $ilHelp->setScreenIdComponent("webr");
1389
1390 if ($this->checkPermissionBool('read')) {
1391 $ilTabs->addTab(
1392 "id_content",
1393 $lng->txt("content"),
1394 $this->ctrl->getLinkTarget($this, "view")
1395 );
1396 }
1397
1398 if (
1399 $this->checkPermissionBool('visible') ||
1400 $this->checkPermissionBool('read')
1401 ) {
1402 $ilTabs->addTab(
1403 "id_info",
1404 $lng->txt("info_short"),
1405 $this->ctrl->getLinkTarget($this, "infoScreen")
1406 );
1407 }
1408
1409 if ($this->checkPermissionBool('write') and !$this->getCreationMode()) {
1410 $ilTabs->addTab(
1411 "id_settings",
1412 $lng->txt("settings"),
1413 $this->ctrl->getLinkTarget($this, "settings")
1414 );
1415 }
1416
1417 if ($this->checkPermissionBool('write')) {
1418 $ilTabs->addTab(
1419 "id_history",
1420 $lng->txt("history"),
1421 $this->ctrl->getLinkTarget($this, "history")
1422 );
1423 }
1424
1425 if ($this->checkPermissionBool('write')) {
1426 // Check if pear library is available
1427 $ilTabs->addTab(
1428 "id_link_check",
1429 $lng->txt("link_check"),
1430 $this->ctrl->getLinkTarget($this, "linkChecker")
1431 );
1432 }
1433
1434 if ($this->checkPermissionBool('write')) {
1435 include_once "Services/Object/classes/class.ilObjectMetaDataGUI.php";
1436 $mdgui = new ilObjectMetaDataGUI($this->object);
1437 $mdtab = $mdgui->getTab();
1438 if ($mdtab) {
1439 $ilTabs->addTab(
1440 "id_meta_data",
1441 $lng->txt("meta_data"),
1442 $mdtab
1443 );
1444 }
1445 }
1446
1447 if ($this->checkPermissionBool('write')) {
1448 $ilTabs->addTab(
1449 'export',
1450 $this->lng->txt('export'),
1451 $this->ctrl->getLinkTargetByClass('ilexportgui', '')
1452 );
1453 }
1454
1455 // will add permission tab if needed
1456 parent::setTabs();
1457 }

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

+ Here is the call graph for this function:

◆ settings()

ilObjLinkResourceGUI::settings ( )
protected

Edit settings Title, Description, Sorting.

Returns

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

195 {
196 global $DIC;
197
198 $ilTabs = $DIC['ilTabs'];
199
200 $this->checkPermission('write');
201 $ilTabs->activateTab('id_settings');
202
203 $this->initFormSettings();
204 $this->tpl->setContent($this->form->getHTML());
205 }

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

+ 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 593 of file class.ilObjLinkResourceGUI.php.

594 {
595 include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
596 $link = new ilLinkResourceItems($this->object->getId());
597
598 $values = $link->getItem($a_link_id);
599
601 }
602
603 $this->form->setValuesByArray(
604 array(
605 'tit' => $values['title'],
606 'tar' => $values['target'],
607 'des' => $values['description'],
608 'act' => (int) $values['active'],
609 'che' => (int) $values['disable_check'],
610 'vali' => (int) $values['valid']
611 )
612 );
613 }

References ilParameterAppender\_isEnabled().

Referenced by editLink().

+ 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 962 of file class.ilObjLinkResourceGUI.php.

963 {
964 $this->checkPermission('read');
965 $this->activateTabs('content', 'id_content_view');
966
967 include_once './Modules/WebResource/classes/class.ilWebResourceLinkTableGUI.php';
968 $table = new ilWebResourceLinkTableGUI($this, 'showLinks');
969 $table->parse();
970
971 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.webr_view.html', 'Modules/WebResource');
972 $this->showToolbar('ACTION_BUTTONS');
973 $this->tpl->setVariable('LINK_TABLE', $table->getHTML());
974 }
TableGUI class for search results.

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

Referenced by view().

+ 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 1016 of file class.ilObjLinkResourceGUI.php.

1017 {
1018 if (!$this->checkPermissionBool('write')) {
1019 return;
1020 }
1021
1022 include_once './Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
1023 $tool = new ilToolbarGUI();
1024 $tool->setFormAction($this->ctrl->getFormAction($this));
1025 $tool->addButton(
1026 $this->lng->txt('webr_add'),
1027 $this->ctrl->getLinkTarget($this, 'addLink')
1028 );
1029
1030 $this->tpl->setVariable($a_tpl_var, $tool->getHTML());
1031 return;
1032 }

References ilObject2GUI\checkPermissionBool().

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

+ 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 980 of file class.ilObjLinkResourceGUI.php.

981 {
982 $this->checkPermission('write');
983 $this->activateTabs('content', 'id_content_ordering');
984
985 include_once './Modules/WebResource/classes/class.ilWebResourceLinkTableGUI.php';
986 $table = new ilWebResourceLinkTableGUI($this, 'sort', true);
987 $table->parse();
988
989 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.webr_view.html', 'Modules/WebResource');
990 $this->showToolbar('ACTION_BUTTONS');
991 $this->tpl->setVariable('LINK_TABLE', $table->getHTML());
992 }

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

Referenced by view().

+ 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 869 of file class.ilObjLinkResourceGUI.php.

870 {
871 global $DIC;
872
873 $ilCtrl = $DIC['ilCtrl'];
874
875 $_REQUEST['view_mode'] = $_GET['view_mode'] = (int) $_GET['switch_mode'];
876 $this->view();
877 }

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

Referenced by editLinks().

+ 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 353 of file class.ilObjLinkResourceGUI.php.

354 {
355 global $DIC;
356
357 $ilCtrl = $DIC['ilCtrl'];
358
359 $this->initFormLink(self::LINK_MOD_EDIT);
360 if ($this->checkLinkInput(self::LINK_MOD_EDIT, $this->object->getId(), (int) $_REQUEST['link_id'])) {
361 $this->link->setLinkId((int) $_REQUEST['link_id']);
362 $this->link->update();
363 if (ilParameterAppender::_isEnabled() and is_object($this->dynamic)) {
364 $this->dynamic->add((int) $_REQUEST['link_id']);
365 }
366
367 if ($this->isContainerMetaDataRequired()) {
368 $this->object->setTitle($this->form->getInput('tit'));
369 $this->object->setDescription($this->form->getInput('des'));
370 $this->object->update();
371 }
372
373 ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
374 $ilCtrl->redirect($this, 'view');
375 }
376 ilUtil::sendFailure($this->lng->txt('err_check_input'));
377 $this->form->setValuesByPost();
378 $this->tpl->setContent($this->form->getHTML());
379 }

References $DIC, $ilCtrl, ilParameterAppender\_isEnabled(), checkLinkInput(), initFormLink(), isContainerMetaDataRequired(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ updateLinks()

ilObjLinkResourceGUI::updateLinks ( )
protected

Update all visible links.

Returns

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

488 {
489 global $DIC;
490
491 $ilCtrl = $DIC['ilCtrl'];
492
493 $this->checkPermission('write');
494 $this->activateTabs('content', '');
495
496 if (!is_array($_POST['ids'])) {
497 ilUtil::sendFailure($this->lng->txt('select_one'), true);
498 $ilCtrl->redirect($this, 'view');
499 }
500
501 // Validate
502 $invalid = array();
503 foreach ($_POST['ids'] as $link_id) {
504 $data = $_POST['links'][$link_id];
505
506 // handle internal links
507 if ($_POST['tar_' . $link_id . '_ajax_type'] &&
508 $_POST['tar_' . $link_id . '_ajax_id']) {
509 $data['tar'] = $_POST['links'][$link_id]['tar'] =
510 $_POST['tar_' . $link_id . '_ajax_type'] . '|' .
511 $_POST['tar_' . $link_id . '_ajax_id'];
512 }
513
514
515 if (!strlen($data['tit'])) {
516 $invalid[] = $link_id;
517 continue;
518 }
519 if (!strlen($data['tar'])) {
520 $invalid[] = $link_id;
521 continue;
522 }
523 if ($data['nam'] and !$data['val']) {
524 $invalid[] = $link_id;
525 continue;
526 }
527 if (!$data['nam'] and $data['val']) {
528 $invalid[] = $link_id;
529 continue;
530 }
531 }
532
533 if (count($invalid)) {
534 ilUtil::sendFailure($this->lng->txt('err_check_input'));
535 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.webr_manage.html', 'Modules/WebResource');
536
537 include_once './Modules/WebResource/classes/class.ilWebResourceEditableLinkTableGUI.php';
538 $table = new ilWebResourceEditableLinkTableGUI($this, 'view');
539 $table->setInvalidLinks($invalid);
540 $table->parseSelectedLinks($_POST['ids']);
541 $table->updateFromPost();
542 $this->tpl->setVariable('TABLE_LINKS', $table->getHTML());
543 return false;
544 }
545
546 include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
547 $links = new ilLinkResourceItems($this->object->getId());
548
549 // Save Settings
550 include_once './Services/Form/classes/class.ilFormPropertyGUI.php';
551 include_once './Services/Form/classes/class.ilLinkInputGUI.php';
552 foreach ($_POST['ids'] as $link_id) {
553 $data = $_POST['links'][$link_id];
554
555 $orig = ilLinkResourceItems::lookupItem($this->object->getId(), $link_id);
556
557 $links->setLinkId($link_id);
558 $links->setTitle(ilUtil::stripSlashes($data['tit']));
559 $links->setDescription(ilUtil::stripSlashes($data['des']));
560 $links->setTarget(str_replace('"', '', ilUtil::stripSlashes($data['tar'])));
561 $links->setActiveStatus((int) $data['act']);
562 $links->setDisableCheckStatus((int) $data['che']);
563 $links->setLastCheckDate($orig['last_check']);
564 $links->setValidStatus((int) $data['vali']);
565 $links->setInternal(ilLinkInputGUI::isInternalLink($data['tar']));
566 $links->update();
567
568 if (strlen($data['nam']) and $data['val']) {
569 $param = new ilParameterAppender($this->object->getId());
570 $param->setName(ilUtil::stripSlashes($data['nam']));
571 $param->setValue((int) $data['val']);
572 $param->add($link_id);
573 }
574
575 if ($this->isContainerMetaDataRequired()) {
576 $this->object->setTitle(ilUtil::stripSlashes($data['tit']));
577 $this->object->setDescription(ilUtil::stripSlashes($data['des']));
578 $this->object->update();
579 }
580
581 // TODO: Dynamic parameters
582 }
583
584 ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
585 $ilCtrl->redirect($this, 'view');
586 }
static lookupItem($a_webr_id, $a_link_id)

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

+ Here is the call graph for this function:

◆ view()

ilObjLinkResourceGUI::view ( )

View object.

Returns

Reimplemented from ilObject2GUI.

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

895 {
896 global $DIC;
897
898 $ilErr = $DIC['ilErr'];
899 $ilTabs = $DIC['ilTabs'];
900
901 $ilTabs->activateTab("id_content");
902
903 $this->checkPermission('read');
904
905 if (strtolower($_GET["baseClass"]) == "iladministrationgui") {
906 parent::view();
907 return true;
908 } else {
909 switch ((int) $_REQUEST['view_mode']) {
911 $this->manage();
912 break;
913
915 // #14638
916 include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
918 $this->sort();
919 break;
920 }
921 // fallthrough
922
923 // no break
924 default:
925 $this->showLinks();
926 break;
927 }
928 }
929 $GLOBALS['DIC']['tpl']->setPermanentLink($this->object->getType(), $this->object->getRefId());
930 return true;
931 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
showLinks()
Show all active links.

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

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

+ 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.

Referenced by initFormLink().

◆ LINK_MOD_CREATE

const ilObjLinkResourceGUI::LINK_MOD_CREATE = 1

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

Referenced by initFormLink().

◆ LINK_MOD_EDIT

const ilObjLinkResourceGUI::LINK_MOD_EDIT = 2

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

Referenced by initFormLink().

◆ VIEW_MODE_MANAGE

const ilObjLinkResourceGUI::VIEW_MODE_MANAGE = 2

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

Referenced by editLinks(), and view().

◆ VIEW_MODE_SORT

const ilObjLinkResourceGUI::VIEW_MODE_SORT = 3

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

Referenced by view().

◆ 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: