ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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...
 
 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...
 
- 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...
 
 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 ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 

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
 
 $ilias
 
 $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...
 
 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...
 
 deleteConfirmation ()
 Display delete confirmation form (workspace specific) 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...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. 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
 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...
 
 showMountWebfolderIcon ()
 
 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...
 
 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...
 
 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
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 

Detailed Description

Member Function Documentation

◆ __initLinkChecker()

ilObjLinkResourceGUI::__initLinkChecker ( )

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

References $ilDB, and object.

Referenced by linkChecker(), and refreshLinkCheck().

1290  {
1291  global $ilDB;
1292 
1293  include_once './Services/LinkChecker/classes/class.ilLinkChecker.php';
1294 
1295  $this->link_checker_obj = new ilLinkChecker($ilDB,false);
1296  $this->link_checker_obj->setObjId($this->object->getId());
1297 
1298  return true;
1299  }
class for checking external links in page objects Normally used in Cron jobs, but should be extensibl...
Create new PHPExcel object
obj_idprivate
global $ilDB
+ Here is the caller graph for this function:

◆ __prepareOutput()

ilObjLinkResourceGUI::__prepareOutput ( )

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

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

Referenced by executeCommand().

1430  {
1431  // output objects
1432  // $this->tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
1433  // $this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
1434 
1435  $this->tpl->setLocator();
1436 
1437  // output message
1438  if ($this->message)
1439  {
1440  ilUtil::sendInfo($this->message);
1441  }
1442 
1443  // display infopanel if something happened
1444  ilUtil::infoPanel();;
1445  }
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 1590 of file class.ilObjLinkResourceGUI.php.

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

1591  {
1592  global $ilAccess, $ilErr, $lng;
1593 
1594  if($a_additional && substr($a_additional, -3) == "wsp")
1595  {
1596  $_GET["baseClass"] = "ilsharedresourceGUI";
1597  $_GET["wsp_id"] = $a_target;
1598  include("ilias.php");
1599  exit;
1600  }
1601 
1602  // Will be replaced in future releases by ilAccess::checkAccess()
1603  if ($ilAccess->checkAccess("read", "", $a_target))
1604  {
1605  ilUtil::redirect("ilias.php?baseClass=ilLinkResourceHandlerGUI&ref_id=$a_target");
1606  }
1607  else
1608  {
1609  // to do: force flat view
1610  if ($ilAccess->checkAccess("visible", "", $a_target))
1611  {
1612  ilUtil::redirect("ilias.php?baseClass=ilLinkResourceHandlerGUI&ref_id=".$a_target."&cmd=infoScreen");
1613  }
1614  else
1615  {
1616  if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
1617  {
1618  ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
1619  ilObject::_lookupTitle(ilObject::_lookupObjId($a_target))), true);
1621  }
1622  }
1623  }
1624 
1625  $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
1626  }
global $ilErr
Definition: raiseError.php:16
$_GET["client_id"]
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupTitle($a_id)
lookup object title
static _lookupObjId($a_id)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static redirect($a_script)
http redirect to other 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 1308 of file class.ilObjLinkResourceGUI.php.

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

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

1309  {
1310  global $ilCtrl, $ilTabs, $lng;
1311 
1312  switch($a_active_tab)
1313  {
1314  case 'content':
1315  if($this->checkPermissionBool('write'))
1316  {
1317  $this->lng->loadLanguageModule('cntr');
1318 
1319  $this->ctrl->setParameter($this,'switch_mode',self::VIEW_MODE_VIEW);
1320  $ilTabs->addSubTab('id_content_view',
1321  $lng->txt('view'),
1322  $this->ctrl->getLinkTarget($this,'switchViewMode')
1323  );
1324  $this->ctrl->setParameter($this,'switch_mode',self::VIEW_MODE_MANAGE);
1325  $ilTabs->addSubTab('id_content_manage',
1326  $lng->txt('cntr_manage'),
1327  $this->ctrl->getLinkTarget($this,'switchViewMode')
1328  );
1329  include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
1330  include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
1331  include_once './Services/Container/classes/class.ilContainer.php';
1332  if((ilLinkResourceItems::lookupNumberOfLinks($this->object->getId()) > 1)
1334  {
1335  $this->ctrl->setParameter($this,'switch_mode',self::VIEW_MODE_SORT);
1336  $ilTabs->addSubTab('id_content_ordering',
1337  $this->lng->txt('cntr_ordering'),
1338  $this->ctrl->getLinkTarget($this,'switchViewMode')
1339  );
1340  }
1341 
1342  $ilCtrl->clearParameters($this);
1343  $ilTabs->activateSubTab($a_active_subtab);
1344  }
1345  }
1346 
1347  $ilTabs->activateTab('id_content');
1348  }
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
static lookupNumberOfLinks($a_webr_id)
Get number of assigned links.
global $ilCtrl
Definition: ilias.php:18
Create new PHPExcel object
obj_idprivate
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 353 of file class.ilObjLinkResourceGUI.php.

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

354  {
355  $this->checkPermission('write');
356  $this->activateTabs('content','id_content_view');
357 
358  $this->initFormLink(self::LINK_MOD_ADD);
359  $this->tpl->setContent($this->form->getHTML());
360  }
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 1447 of file class.ilObjLinkResourceGUI.php.

References object.

1448  {
1449  global $ilLocator;
1450 
1451  if (is_object($this->object))
1452  {
1453  $ilLocator->addItem($this->object->getTitle(),$this->ctrl->getLinkTarget($this),"",$this->object->getRefId(), "webr");
1454  }
1455  }
Create new PHPExcel object
obj_idprivate

◆ afterSave()

ilObjLinkResourceGUI::afterSave ( ilObject  $a_new_object)
protected

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

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

171  {
172  // Save link
173  $this->link->setLinkResourceId($a_new_object->getId());
174  $link_id = $this->link->add();
175  $this->link->updateValid(true);
176 
177  ilUtil::sendSuccess($this->lng->txt('webr_link_added'));
178 
179  // personal workspace
180  if($this->id_type == self::WORKSPACE_NODE_ID)
181  {
182  $this->ctrl->redirect($this, "editLinks");
183  }
184  // repository
185  else
186  {
187  ilUtil::redirect("ilias.php?baseClass=ilLinkResourceHandlerGUI&ref_id=".
188  $a_new_object->getRefId()."&cmd=switchViewMode&switch_mode=2");
189  }
190  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getId()
get object id public
getRefId()
get reference id public
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

◆ callDirectLink()

ilObjLinkResourceGUI::callDirectLink ( )

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

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

1492  {
1493  $obj_id = $this->object->getId();
1494 
1495  include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
1497  {
1499  if($url["target"])
1500  {
1501  $url["target"] = $this->handleSubItemLinks($url["target"]);
1502 
1503  include_once './Modules/WebResource/classes/class.ilParameterAppender.php';
1505  {
1507  }
1508 
1509  $this->redirectToLink($this->ref_id, $obj_id, $url["target"]);
1510  }
1511  }
1512  }
static _isSingular($a_webr_id)
Check whether there is only one active link in the web resource.
$url
Definition: shib_logout.php:72
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...
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 1514 of file class.ilObjLinkResourceGUI.php.

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

1515  {
1516  if($_REQUEST["link_id"])
1517  {
1518  $obj_id = $this->object->getId();
1519 
1520  include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
1521  $items = new ilLinkResourceItems($obj_id);
1522  $item = $items->getItem($_REQUEST["link_id"]);
1523  if($item["target"])
1524  {
1525  $item["target"] = $this->handleSubItemLinks($item["target"]);
1526 
1527  include_once './Modules/WebResource/classes/class.ilParameterAppender.php';
1529  {
1530  $item = ilParameterAppender::_append($item);
1531  }
1532  ilLoggerFactory::getLogger('webr')->debug('Redirecting to: '. $item['target']);
1533  $this->redirectToLink($this->ref_id, $obj_id, $item["target"]);
1534  }
1535  }
1536  }
static _append($a_link_data)
Class ilObjLinkResourceGUI.
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_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 601 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().

602  {
603  $valid = $this->form->checkInput();
604 
605  $link_input = $this->form->getInput('tar');
606 
607  include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
608  $this->link = new ilLinkResourceItems($a_webr_id);
609  $this->link->setTarget(str_replace('"', '', ilUtil::stripSlashes($link_input)));
610  $this->link->setTitle($this->form->getInput('tit'));
611  $this->link->setDescription($this->form->getInput('des'));
612  $this->link->setDisableCheckStatus($this->form->getInput('che'));
613  $this->link->setInternal(ilLinkInputGUI::isInternalLink($link_input));
614 
615  if($a_mode == self::LINK_MOD_CREATE)
616  {
617  $this->link->setActiveStatus(true);
618  }
619  else
620  {
621  $this->link->setActiveStatus($this->form->getInput('act'));
622  }
623 
624  if($a_mode == self::LINK_MOD_EDIT)
625  {
626  $this->link->setValidStatus($this->form->getInput('vali'));
627  }
628  else
629  {
630  $this->link->setValidStatus(true);
631  }
632 
634  {
635  return $valid;
636  }
637 
638  $this->dynamic = new ilParameterAppender($a_webr_id);
639  $this->dynamic->setName($this->form->getInput('nam'));
640  $this->dynamic->setValue($this->form->getInput('val'));
641  if(!$this->dynamic->validate())
642  {
643  switch($this->dynamic->getErrorCode())
644  {
645  case LINKS_ERR_NO_NAME:
646  $this->form->getItemByPostVar('nam')->setAlert($this->lng->txt('links_no_name_given'));
647  return false;
648 
649  case LINKS_ERR_NO_VALUE:
650  $this->form->getItemByPostVar('val')->setAlert($this->lng->txt('links_no_value_given'));
651  return false;
652 
654  // Nothing entered => no error
655  return $valid;
656  }
657  $this->dynamic = null;
658  }
659  return $valid;
660  }
$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 ilObjLinkResourceGUI.
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 1024 of file class.ilObjLinkResourceGUI.php.

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

1025  {
1026  $this->checkPermission('write');
1027  $this->activateTabs('content','id_content_view');
1028 
1029  $link_ids = array();
1030 
1031  if(is_array($_POST['link_ids']))
1032  {
1033  $link_ids =$_POST['link_ids'];
1034  }
1035  elseif(isset($_GET['link_id']))
1036  {
1037  $link_ids = array($_GET['link_id']);
1038  }
1039 
1040  if(!count($link_ids) > 0)
1041  {
1042  ilUtil::sendFailure($this->lng->txt('select_one'));
1043  $this->view();
1044  return false;
1045  }
1046 
1047  include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
1048  $links = new ilLinkResourceItems($this->object->getId());
1049 
1050  include_once 'Services/Utilities/classes/class.ilConfirmationGUI.php';
1051  $confirm = new ilConfirmationGUI();
1052  $confirm->setFormAction($this->ctrl->getFormAction($this,'view'));
1053  $confirm->setHeaderText($this->lng->txt('webr_sure_delete_items'));
1054  $confirm->setConfirm($this->lng->txt('delete'), 'deleteLinks');
1055  $confirm->setCancel($this->lng->txt('cancel'), 'view');
1056 
1057  foreach($link_ids as $link_id)
1058  {
1059  $link = $links->getItem($link_id);
1060  $confirm->addItem('link_ids[]', $link_id,$link['title']);
1061  }
1062  $this->tpl->setContent($confirm->getHTML());
1063  }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
$_GET["client_id"]
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Create new PHPExcel object
obj_idprivate
Class ilObjLinkResourceGUI.
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 1090 of file class.ilObjLinkResourceGUI.php.

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

1091  {
1092  global $ilCtrl;
1093 
1094  $this->checkPermission('write');
1095 
1096  include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
1097  $links = new ilLinkResourceItems($this->object->getId());
1098 
1099  if(!$_GET['link_id'])
1100  {
1101  ilUtil::sendFailure($this->lng->txt('select_one'),true);
1102  $ilCtrl->redirect($this,'view');
1103  }
1104 
1105  $links->setLinkId((int) $_GET['link_id']);
1106  $links->updateActive(false);
1107 
1108  ilUtil::sendSuccess($this->lng->txt('webr_inactive_success'),true);
1109  $ilCtrl->redirect($this,'view');
1110  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Create new PHPExcel object
obj_idprivate
Class ilObjLinkResourceGUI.
+ Here is the call graph for this function:

◆ deleteLinks()

ilObjLinkResourceGUI::deleteLinks ( )
protected

Delete links.

Returns

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

References $_POST, $ilCtrl, ilObject2GUI\checkPermission(), ilLinkResourceItems\delete(), object, and ilUtil\sendSuccess().

1070  {
1071  global $ilCtrl;
1072 
1073  $this->checkPermission('write');
1074 
1075  include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
1076  $links = new ilLinkResourceItems($this->object->getId());
1077 
1078  foreach($_POST['link_ids'] as $link_id)
1079  {
1080  $links->delete($link_id);
1081  }
1082  ilUtil::sendSuccess($this->lng->txt('webr_deleted_items'),true);
1083  $ilCtrl->redirect($this,'view');
1084  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
global $ilCtrl
Definition: ilias.php:18
Create new PHPExcel object
obj_idprivate
Class ilObjLinkResourceGUI.
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 407 of file class.ilObjLinkResourceGUI.php.

References $_GET, $ilCtrl, ilObject2GUI\checkPermission(), ilParameterAppender\delete(), object, ilUtil\sendFailure(), and ilUtil\sendSuccess().

408  {
409  global $ilCtrl;
410 
411  $this->checkPermission('write');
412 
413  $this->ctrl->setParameter($this,'link_id',(int) $_GET['link_id']);
414 
415  if(!isset($_GET['param_id']))
416  {
417  ilUtil::sendFailure($this->lng->txt('select_one'),TRUE);
418  $ilCtrl->redirect($this,'view');
419  }
420 
421  include_once './Modules/WebResource/classes/class.ilParameterAppender.php';
422  $param = new ilParameterAppender($this->object->getId());
423  $param->delete((int) $_GET['param_id']);
424 
425  ilUtil::sendSuccess($this->lng->txt('links_parameter_deleted'),true);
426  $ilCtrl->redirect($this,'editLinks');
427  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Create new PHPExcel object
obj_idprivate
Class ilParameterAppender.
+ Here is the call graph for this function:

◆ deleteParameterForm()

ilObjLinkResourceGUI::deleteParameterForm ( )
protected

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

References $_GET, $ilCtrl, ilObject2GUI\checkPermission(), ilParameterAppender\delete(), object, ilUtil\sendFailure(), and ilUtil\sendSuccess().

430  {
431  global $ilCtrl;
432 
433  $this->checkPermission('write');
434 
435  if(!isset($_GET['param_id']))
436  {
437  ilUtil::sendFailure($this->lng->txt('select_one'),TRUE);
438  $ilCtrl->redirect($this,'view');
439  }
440 
441  include_once './Modules/WebResource/classes/class.ilParameterAppender.php';
442  $param = new ilParameterAppender($this->object->getId());
443  $param->delete((int) $_GET['param_id']);
444 
445  ilUtil::sendSuccess($this->lng->txt('links_parameter_deleted'),true);
446  $ilCtrl->redirect($this,'view');
447 
448  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Create new PHPExcel object
obj_idprivate
Class ilParameterAppender.
+ Here is the call graph for this function:

◆ editLink()

ilObjLinkResourceGUI::editLink ( )

Edit a single link.

Returns

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

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

299  {
300  global $ilCtrl;
301 
302  $this->checkPermission('write');
303  $this->activateTabs('content','id_content_view');
304 
305  if(!(int) $_GET['link_id'])
306  {
307  ilUtil::sendFailure($this->lng->txt('select_one'),true);
308  $ilCtrl->redirect($this,'view');
309  }
310 
311  $this->initFormLink(self::LINK_MOD_EDIT);
312  $this->setValuesFromLink((int) $_GET['link_id']);
313  $this->tpl->setContent($this->form->getHTML());
314  }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
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 867 of file class.ilObjLinkResourceGUI.php.

References $_GET, and switchViewMode().

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

◆ executeCommand()

ilObjLinkResourceGUI::executeCommand ( )

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

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

38  {
39  global $ilCtrl, $ilTabs, $ilErr, $ilAccess;
40 
41 
42  //if($this->ctrl->getTargetScript() == 'link_resources.php')
43  if($_GET["baseClass"] == 'ilLinkResourceHandlerGUI')
44  {
45  $_GET['view_mode'] = isset($_GET['switch_mode']) ? $_GET['switch_mode'] : $_GET['view_mode'];
46  $ilCtrl->saveParameter($this, 'view_mode');
47  $this->__prepareOutput();
48  }
49 
50  $this->lng->loadLanguageModule("webr");
51 
52  $next_class = $this->ctrl->getNextClass($this);
53  $cmd = $this->ctrl->getCmd();
54 
55  switch($next_class)
56  {
57  case "ilinfoscreengui":
58  $this->prepareOutput();
59  $this->infoScreenForward(); // forwards command
60  break;
61 
62  case 'ilobjectmetadatagui':
63  $this->checkPermission('write'); // #18563
64  $this->prepareOutput();
65  $ilTabs->activateTab('id_meta_data');
66  include_once 'Services/Object/classes/class.ilObjectMetaDataGUI.php';
67  $md_gui = new ilObjectMetaDataGUI($this->object);
68  $this->ctrl->forwardCommand($md_gui);
69  break;
70 
71  case 'ilpermissiongui':
72  $this->prepareOutput();
73  $ilTabs->activateTab('id_permissions');
74  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
75  $perm_gui = new ilPermissionGUI($this);
76  $ret =& $this->ctrl->forwardCommand($perm_gui);
77  break;
78 
79  case 'ilobjectcopygui':
80  $this->prepareOutput();
81  include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
82  $cp = new ilObjectCopyGUI($this);
83  $cp->setType('webr');
84  $this->ctrl->forwardCommand($cp);
85  break;
86 
87  case 'ilexportgui':
88  $this->prepareOutput();
89  $this->tabs_gui->setTabActive('export');
90  include_once './Services/Export/classes/class.ilExportGUI.php';
91  $exp = new ilExportGUI($this);
92  $exp->addFormat('xml');
93  $this->ctrl->forwardCommand($exp);
94  break;
95 
96  case "ilcommonactiondispatchergui":
97  include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
99  $this->ctrl->forwardCommand($gui);
100  break;
101 
102  case "ilpropertyformgui":
103  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
104  $this->initFormLink(self::LINK_MOD_EDIT);
105  $this->ctrl->forwardCommand($this->form);
106  break;
107 
108  case "ilinternallinkgui":
109  $this->lng->loadLanguageModule("content");
110  require_once("./Services/Link/classes/class.ilInternalLinkGUI.php");
111  $link_gui = new ilInternalLinkGUI("RepositoryItem", 0);
112  $link_gui->filterLinkType("PageObject");
113  $link_gui->filterLinkType("GlossaryItem");
114  $link_gui->filterLinkType("RepositoryItem");
115  $link_gui->setFilterWhiteList(true);
116  $link_gui->setMode("asynch");
117  $ilCtrl->forwardCommand($link_gui);
118  break;
119 
120  default:
121  if(!$cmd)
122  {
123  $this->ctrl->setCmd("view");
124  }
125  parent::executeCommand();
126  }
127 
128  if(!$this->getCreationMode())
129  {
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  }
global $ilErr
Definition: raiseError.php:16
Class ilObjectMetaDataGUI.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
GUI class for the workflow of copying objects.
$_GET["client_id"]
$cmd
Definition: sahs_server.php:35
Class ilInternalLinkGUI.
infoScreenForward()
show information screen
global $ilCtrl
Definition: ilias.php:18
Export User Interface Class.
static _fillHTMLMetaTags($a_rbac_id, $a_obj_id, $a_type)
Fill html meta tags.
Create new PHPExcel object
obj_idprivate
$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 1552 of file class.ilObjLinkResourceGUI.php.

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

1553  {
1554  global $ilSetting;
1555 
1556  $tpl = new ilTemplate("tpl.export_html.html", true, true, "Modules/WebResource");
1557 
1558  include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
1559  $items = new ilLinkResourceItems($this->object->getId());
1560  foreach($items->getAllItems() as $item)
1561  {
1562  if(!$item["active"])
1563  {
1564  continue;
1565  }
1566 
1567  $target = $this->handleSubItemLinks($item["target"]);
1568 
1569  $tpl->setCurrentBlock("link_bl");
1570  $tpl->setVariable("LINK_URL", $target);
1571  $tpl->setVariable("LINK_TITLE", $item["title"]);
1572  $tpl->setVariable("LINK_DESC", $item["description"]);
1573  $tpl->setVariable("LINK_CREATE", $item["create_date"]);
1574  $tpl->setVariable("LINK_UPDATE", $item["last_update"]);
1575  $tpl->parseCurrentBlock();
1576  }
1577 
1578  $tpl->setVariable("CREATE_DATE", $this->object->getCreateDate());
1579  $tpl->setVariable("LAST_UPDATE", $this->object->getLastUpdateDate());
1580  $tpl->setVariable("TXT_TITLE", $this->object->getTitle());
1581  $tpl->setVariable("TXT_DESC", $this->object->getLongDescription());
1582 
1583  $tpl->setVariable("INST_ID", ($ilSetting->get('short_inst_name') != "")
1584  ? $ilSetting->get('short_inst_name')
1585  : "ILIAS");
1586 
1587  ilUtil::deliverData($tpl->get(), "bookmarks.html");
1588  }
static deliverData($a_data, $a_filename, $mime="application/octet-stream", $charset="")
deliver data for download via browser.
special template class to simplify handling of ITX/PEAR
Create new PHPExcel object
obj_idprivate
global $ilSetting
Definition: privfeed.php:17
Class ilObjLinkResourceGUI.
+ 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 1174 of file class.ilObjLinkResourceGUI.php.

References ilObjectGUI\$actions, and $row.

1175  {
1176  $this->object->items_obj->readItem($row['page_id']);
1177  $row['title'] = $this->object->items_obj->getTitle();
1178 
1179  require_once 'Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php';
1181  $actions->setSelectionHeaderClass('small');
1182  $actions->setItemLinkClass('xsmall');
1183  $actions->setListTitle($this->lng->txt('actions'));
1184  $actions->setId($row['page_id']);
1185  $this->ctrl->setParameter($this, 'link_id', $row['page_id']);
1186  $actions->addItem(
1187  $this->lng->txt('edit'),
1188  '',
1189  $this->ctrl->getLinkTarget($this, 'editLink')
1190  );
1191  $this->ctrl->clearParameters($this);
1192  $row['action_html'] = $actions->getHTML();
1193 
1194  return $row;
1195  }
User interface class for advanced drop-down selection lists.

◆ getType()

ilObjLinkResourceGUI::getType ( )

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

33  {
34  return "webr";
35  }

◆ handleSubItemLinks()

ilObjLinkResourceGUI::handleSubItemLinks (   $a_target)
protected

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

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

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

1458  {
1459  // #15647 - handle internal links
1460  include_once "Services/Form/classes/class.ilFormPropertyGUI.php";
1461  include_once "Services/Form/classes/class.ilLinkInputGUI.php";
1462  if(ilLinkInputGUI::isInternalLink($a_target))
1463  {
1464  include_once("./Services/Link/classes/class.ilLink.php");
1465 
1466  // #10612
1467  $parts = explode("|", $a_target);
1468 
1469  if ($parts[0] == "term")
1470  {
1471  // #16894
1472  return ilLink::_getStaticLink(
1473  0,
1474  "git",
1475  true,
1476  "&target=git_".$parts[1]
1477  );
1478  }
1479 
1480  if ($parts[0] == "page")
1481  {
1482  $parts[0] = "pg";
1483  }
1484 
1485  $a_target = ilLink::_getStaticLink($parts[1], $parts[0]);
1486  }
1487 
1488  return $a_target;
1489  }
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 1153 of file class.ilObjLinkResourceGUI.php.

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

1154  {
1155  global $ilTabs;
1156 
1157  $this->checkPermission('write');
1158  $ilTabs->activateTab('id_history');
1159 
1160  include_once("./Services/History/classes/class.ilHistoryTableGUI.php");
1161  $hist_gui = new ilHistoryTableGUI($this, "history", $this->object->getId(), $this->object->getType);
1162  $hist_gui->initTable();
1163  $this->tpl->setContent($hist_gui->getHTML());
1164  }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Copyright (c) 1998-2014 ILIAS open source, Extended GPL, see docs/LICENSE Date: 24.10.14 Time: 10:35.
Create new PHPExcel object
obj_idprivate
+ 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 1118 of file class.ilObjLinkResourceGUI.php.

References infoScreenForward().

1119  {
1120  $this->ctrl->setCmd("showSummary");
1121  $this->ctrl->setCmdClass("ilinfoscreengui");
1122  $this->infoScreenForward();
1123  }
infoScreenForward()
show information screen
+ Here is the call graph for this function:

◆ infoScreenForward()

ilObjLinkResourceGUI::infoScreenForward ( )

show information screen

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

References $info, ilObject2GUI\checkPermission(), ilObject2GUI\getPermanentLinkWidget(), and object.

Referenced by executeCommand(), and infoScreen().

1129  {
1130  global $ilTabs;
1131 
1132  $this->checkPermission('visible');
1133  $ilTabs->activateTab('id_info');
1134 
1135  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1136  $info = new ilInfoScreenGUI($this);
1137 
1138  $info->enablePrivateNotes();
1139 
1140  // standard meta data
1141  $info->addMetaDataSections($this->object->getId(),0, $this->object->getType());
1142 
1143  if($this->id_type == self::WORKSPACE_NODE_ID)
1144  {
1145  $info->addProperty($this->lng->txt("perma_link"), $this->getPermanentLinkWidget());
1146  }
1147 
1148  // forward the command
1149  $this->ctrl->forwardCommand($info);
1150  }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Class ilInfoScreenGUI.
getPermanentLinkWidget($a_append=null, $a_center=false)
$info
Definition: example_052.php:80
Create new PHPExcel object
obj_idprivate
+ 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 139 of file class.ilObjLinkResourceGUI.php.

References initFormLink().

140  {
141  $this->initFormLink(self::LINK_MOD_CREATE);
142  return $this->form;
143  }
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 668 of file class.ilObjLinkResourceGUI.php.

References $_GET, $title, ilParameterAppender\_getOptionSelect(), ilParameterAppender\_getParams(), ilParameterAppender\_isEnabled(), ilSubEnabledFormPropertyGUI\addSubItem(), array, isContainerMetaDataRequired(), ilParameterAppender\parameterToInfo(), ilUtil\sendInfo(), ilCheckboxInputGUI\setChecked(), ilLinkInputGUI\setExternalLinkMaxLength(), ilNonEditableValueGUI\setInfo(), ilSelectInputGUI\setOptions(), ilFormPropertyGUI\setRequired(), ilTextAreaInputGUI\setRows(), ilTextInputGUI\setSize(), and ilCheckboxInputGUI\setValue().

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

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

◆ initFormSettings()

ilObjLinkResourceGUI::initFormSettings ( )
protected

Show settings form.

Returns

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

References ilContainerSortingSettings\_lookupSortMode(), object, ilFormPropertyGUI\setRequired(), ilTextInputGUI\setValue(), ilTextAreaInputGUI\setValue(), ilContainer\SORT_MANUAL, and ilContainer\SORT_TITLE.

Referenced by saveSettings(), and settings().

246  {
247  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
248  $this->form = new ilPropertyFormGUI();
249  $this->form->setFormAction($this->ctrl->getFormAction($this,'saveSettings'));
250  $this->form->setTitle($this->lng->txt('webr_edit_settings'));
251 
252  // Title
253  $tit = new ilTextInputGUI($this->lng->txt('webr_list_title'),'tit');
254  $tit->setValue($this->object->getTitle());
255  $tit->setRequired(true);
256  $tit->setSize(40);
257  $tit->setMaxLength(127);
258  $this->form->addItem($tit);
259 
260  // Description
261  $des = new ilTextAreaInputGUI($this->lng->txt('webr_list_desc'),'des');
262  $des->setValue($this->object->getDescription());
263  $des->setCols(40);
264  $des->setRows(3);
265  $this->form->addItem($des);
266 
267  // Sorting
268  include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
269  include_once './Services/Container/classes/class.ilContainer.php';
270 
271  $sor = new ilRadioGroupInputGUI($this->lng->txt('webr_sorting'),'sor');
272  $sor->setRequired(true);
273  include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
274  $sor->setValue(ilContainerSortingSettings::_lookupSortMode($this->object->getId()));
275 
276  $opt = new ilRadioOption(
277  $this->lng->txt('webr_sort_title'),
279  );
280  $sor->addOption($opt);
281 
282  $opm = new ilRadioOption(
283  $this->lng->txt('webr_sort_manual'),
285  );
286  $sor->addOption($opm);
287  $this->form->addItem($sor);
288 
289  $this->form->addCommandButton('saveSettings', $this->lng->txt('save'));
290  $this->form->addCommandButton('view', $this->lng->txt('cancel'));
291  }
This class represents an option in a radio group.
This class represents a property form user interface.
setValue($a_value)
Set Value.
This class represents a property in a property form.
This class represents a text property in a property form.
Create new PHPExcel object
obj_idprivate
This class represents a text area property in a property form.
static _lookupSortMode($a_obj_id)
lookup sort mode
setValue($a_value)
Set Value.
setRequired($a_required)
Set Required.
+ 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 845 of file class.ilObjLinkResourceGUI.php.

References ilLinkResourceItems\lookupNumberOfLinks(), and object.

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

846  {
847  include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
848  return ilLinkResourceItems::lookupNumberOfLinks($this->object->getId()) == 1;
849  }
static lookupNumberOfLinks($a_webr_id)
Get number of assigned links.
Create new PHPExcel object
obj_idprivate
+ 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 1201 of file class.ilObjLinkResourceGUI.php.

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

Referenced by refreshLinkCheck(), and saveLinkCheck().

1202  {
1203  global $ilias, $ilUser, $tpl, $ilTabs;
1204 
1205  $this->checkPermission('write');
1206  $ilTabs->activateTab('id_link_check');
1207 
1208  $this->__initLinkChecker();
1209  $this->object->initLinkResourceItemsObject();
1210 
1211  require_once './Services/LinkChecker/classes/class.ilLinkCheckerTableGUI.php';
1212 
1213  $toolbar = new ilToolbarGUI();
1214 
1215  if((bool)$ilias->getSetting('cron_web_resource_check'))
1216  {
1217  include_once './Services/LinkChecker/classes/class.ilLinkCheckNotify.php';
1218  include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
1219 
1220  $chb = new ilCheckboxInputGUI($this->lng->txt('link_check_message_a'), 'link_check_message');
1221  $chb->setValue(1);
1222  $chb->setChecked((bool)ilLinkCheckNotify::_getNotifyStatus($ilUser->getId(), $this->object->getId()));
1223  $chb->setOptionTitle($this->lng->txt('link_check_message_b'));
1224 
1225  $toolbar->addInputItem($chb);
1226  $toolbar->addFormButton($this->lng->txt('save'), 'saveLinkCheck');
1227  $toolbar->setFormAction($this->ctrl->getLinkTarget($this, 'saveLinkCheck'));
1228  }
1229 
1230  $tgui = new ilLinkCheckerTableGUI($this, 'linkChecker');
1231  $tgui->setLinkChecker($this->link_checker_obj)
1232  ->setRowHandler($this)
1233  ->setRefreshButton($this->lng->txt('refresh'), 'refreshLinkCheck');
1234 
1235  return $tpl->setContent($tgui->prepareHTML()->getHTML().$toolbar->getHTML());
1236  }
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.
$ilUser
Definition: imgupload.php:18
static _getNotifyStatus($a_usr_id, $a_obj_id)
+ 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 922 of file class.ilObjLinkResourceGUI.php.

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

Referenced by view().

923  {
924  $this->checkPermission('write');
925  $this->activateTabs('content','id_content_manage');
926 
927  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.webr_manage.html','Modules/WebResource');
928  $this->showToolbar('ACTION_BUTTONS');
929 
930  include_once './Modules/WebResource/classes/class.ilWebResourceEditableLinkTableGUI.php';
931  $table = new ilWebResourceEditableLinkTableGUI($this,'view');
932  $table->parse();
933 
934  include_once './Services/Link/classes/class.ilInternalLinkGUI.php';
936 
937  $this->tpl->addJavaScript("Modules/WebResource/js/intLink.js");
938  $this->tpl->addJavascript("Services/Form/js/Form.js");
939 
940  $this->tpl->setVariable('TABLE_LINKS',$table->getHTML().$js);
941  }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
static getInitHTML($a_url)
Get initialisation HTML to use interna link editing.
$js
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 1538 of file class.ilObjLinkResourceGUI.php.

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

Referenced by callDirectLink(), and callLink().

1539  {
1540  global $ilUser;
1541 
1542  if($a_url)
1543  {
1544  require_once('Services/Tracking/classes/class.ilChangeEvent.php');
1545  ilChangeEvent::_recordReadEvent("webr", $a_ref_id, $a_obj_id,
1546  $ilUser->getId());
1547 
1548  ilUtil::redirect($a_url);
1549  }
1550  }
$ilUser
Definition: imgupload.php:18
static _recordReadEvent($a_type, $a_ref_id, $obj_id, $usr_id, $isCatchupWriteEvents=true, $a_ext_rc=false, $a_ext_time=false)
Records a read event and catches up with write events.
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ refreshLinkCheck()

ilObjLinkResourceGUI::refreshLinkCheck ( )

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

References __initLinkChecker(), linkChecker(), and ilUtil\sendSuccess().

1266  {
1267  $this->__initLinkChecker();
1268  $this->object->initLinkResourceItemsObject();
1269 
1270  // Set all link to valid. After check invalid links will be set to invalid
1271  $this->object->items_obj->updateValidByCheck();
1272 
1273  foreach($this->link_checker_obj->checkWebResourceLinks() as $invalid)
1274  {
1275  $this->object->items_obj->readItem($invalid['page_id']);
1276  $this->object->items_obj->setActiveStatus(false);
1277  $this->object->items_obj->setValidStatus(false);
1278  $this->object->items_obj->update(false);
1279  }
1280 
1281  $this->object->items_obj->updateLastCheck();
1282  ilUtil::sendSuccess($this->lng->txt('link_checker_refreshed'));
1283 
1284  $this->linkChecker();
1285 
1286  return true;
1287  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
linkChecker()
Show link validation.
+ Here is the call graph for this function:

◆ save()

ilObjLinkResourceGUI::save ( )

Save new object public.

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

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

150  {
151  global $ilCtrl;
152 
153  $this->initFormLink(self::LINK_MOD_CREATE);
154  if($this->checkLinkInput(self::LINK_MOD_CREATE,0,0))
155  {
156  // Save new object
157  $_POST['title'] = $_POST['tit'];
158  $_POST['desc'] = $_POST['des'];
159  parent::save();
160  }
161  else
162  {
163  // Data incomplete or invalid
164  ilUtil::sendFailure($this->lng->txt('err_check_input'));
165  $this->form->setValuesByPost();
166  $this->tpl->setContent($this->form->getHTML());
167  }
168  }
checkLinkInput($a_mode, $a_webr_id=0, $a_link_id=0)
Check input after creating a new link.
global $ilCtrl
Definition: ilias.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
initFormLink($a_mode)
Show create/edit single link.
$_POST["username"]
+ Here is the call graph for this function:

◆ saveAddLink()

ilObjLinkResourceGUI::saveAddLink ( )

Save form data.

Returns

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

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

367  {
368  global $ilCtrl;
369 
370  $this->checkPermission('write');
371 
372  $this->initFormLink(self::LINK_MOD_ADD);
373  if($this->checkLinkInput(self::LINK_MOD_ADD,$this->object->getId(),0))
374  {
375  if($this->isContainerMetaDataRequired())
376  {
377  // Save list data
378  $this->object->setTitle($this->form->getInput('lti'));
379  $this->object->setDescription($this->form->getInput('tde'));
380  $this->object->update();
381  }
382 
383  // Save Link
384  $link_id = $this->link->add();
385  $this->link->updateValid(true);
386 
387  // Dynamic parameters
388  if(ilParameterAppender::_isEnabled() and is_object($this->dynamic))
389  {
390  $this->dynamic->add($link_id);
391  }
392  ilUtil::sendSuccess($this->lng->txt('webr_link_added'),true);
393  $ilCtrl->redirect($this,'view');
394  }
395  // Error handling
396  ilUtil::sendFailure($this->lng->txt('err_check_input'));
397  $this->form->setValuesByPost();
398 
399  $this->activateTabs('content','id_content_view');
400  $this->tpl->setContent($this->form->getHTML());
401  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
checkLinkInput($a_mode, $a_webr_id=0, $a_link_id=0)
Check input after creating a new link.
global $ilCtrl
Definition: ilias.php:18
isContainerMetaDataRequired()
Check if a new container title is required Necessary if there is more than one link.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Create new PHPExcel object
obj_idprivate
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.
+ Here is the call graph for this function:

◆ saveLinkCheck()

ilObjLinkResourceGUI::saveLinkCheck ( )

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

References $_POST, $ilDB, $ilUser, linkChecker(), object, and ilUtil\sendSuccess().

1239  {
1240  global $ilDB,$ilUser;
1241 
1242  include_once './Services/LinkChecker/classes/class.ilLinkCheckNotify.php';
1243 
1244  $link_check_notify = new ilLinkCheckNotify($ilDB);
1245  $link_check_notify->setUserId($ilUser->getId());
1246  $link_check_notify->setObjId($this->object->getId());
1247 
1248  if($_POST['link_check_message'])
1249  {
1250  ilUtil::sendSuccess($this->lng->txt('link_check_message_enabled'));
1251  $link_check_notify->addNotifier();
1252  }
1253  else
1254  {
1255  ilUtil::sendSuccess($this->lng->txt('link_check_message_disabled'));
1256  $link_check_notify->deleteNotifier();
1257  }
1258  $this->linkChecker();
1259 
1260  return true;
1261  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
class for checking external links in page objects.
linkChecker()
Show link validation.
$ilUser
Definition: imgupload.php:18
Create new PHPExcel object
obj_idprivate
global $ilDB
$_POST["username"]
+ Here is the call graph for this function:

◆ saveSettings()

ilObjLinkResourceGUI::saveSettings ( )
protected

Save container settings.

Returns

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

References ilObject2GUI\checkPermission(), initFormSettings(), object, ilUtil\sendFailure(), ilUtil\sendSuccess(), and ilContainerSortingSettings\setSortMode().

213  {
214  global $ilTabs;
215 
216  $this->checkPermission('write');
217  $ilTabs->activateTab('id_settings');
218 
219  $this->initFormSettings();
220  if($this->form->checkInput())
221  {
222  $this->object->setTitle($this->form->getInput('tit'));
223  $this->object->setDescription($this->form->getInput('des'));
224  $this->object->update();
225 
226  include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
227  $sort = new ilContainerSortingSettings($this->object->getId());
228  $sort->setSortMode($this->form->getInput('sor'));
229  $sort->update();
230 
231  ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
232  $this->ctrl->redirect($this,'settings');
233  }
234 
235  $this->form->setValuesByPost();
236  ilUtil::sendFailure($this->lng->txt('err_check_input'));
237  $this->tpl->setContent($this->form->getHTML());
238  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
initFormSettings()
Show settings form.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:

◆ saveSorting()

ilObjLinkResourceGUI::saveSorting ( )
protected

Save nmanual sorting.

Returns

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

References $_POST, ilContainerSorting\_getInstance(), array, ilObject2GUI\checkPermission(), object, ilUtil\sendSuccess(), and view().

984  {
985  $this->checkPermission('write');
986 
987  include_once './Services/Container/classes/class.ilContainerSorting.php';
988  $sort = ilContainerSorting::_getInstance($this->object->getId());
989  $sort->savePost((array) $_POST['position']);
990 
991  ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
992  $this->view();
993  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Create styles array
The data for the language used.
Create new PHPExcel object
obj_idprivate
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 1355 of file class.ilObjLinkResourceGUI.php.

References ilObjectGUI\$lng, ilObject2GUI\checkPermissionBool(), ilObject2GUI\getCreationMode(), ilLinkResourceItems\lookupNumberOfLinks(), and object.

1356  {
1357  global $ilTabs, $lng, $ilHelp;
1358 
1359  $ilHelp->setScreenIdComponent("webr");
1360 
1361  if ($this->checkPermissionBool('read'))
1362  {
1363  $ilTabs->addTab("id_content",
1364  $lng->txt("content"),
1365  $this->ctrl->getLinkTarget($this, "view"));
1366  }
1367 
1368  if ($this->checkPermissionBool('visible'))
1369  {
1370  $ilTabs->addTab("id_info",
1371  $lng->txt("info_short"),
1372  $this->ctrl->getLinkTarget($this, "infoScreen"));
1373  }
1374 
1375  if($this->checkPermissionBool('write') and !$this->getCreationMode())
1376  {
1377  include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
1378  if(ilLinkResourceItems::lookupNumberOfLinks($this->object->getId()) > 1)
1379  {
1380  $ilTabs->addTab("id_settings",
1381  $lng->txt("settings"),
1382  $this->ctrl->getLinkTarget($this, "settings"));
1383  }
1384 
1385  }
1386 
1387  if ($this->checkPermissionBool('write'))
1388  {
1389  $ilTabs->addTab("id_history",
1390  $lng->txt("history"),
1391  $this->ctrl->getLinkTarget($this, "history"));
1392  }
1393 
1394  if ($this->checkPermissionBool('write'))
1395  {
1396  // Check if pear library is available
1397  $ilTabs->addTab("id_link_check",
1398  $lng->txt("link_check"),
1399  $this->ctrl->getLinkTarget($this, "linkChecker"));
1400  }
1401 
1402  if ($this->checkPermissionBool('write'))
1403  {
1404  include_once "Services/Object/classes/class.ilObjectMetaDataGUI.php";
1405  $mdgui = new ilObjectMetaDataGUI($this->object);
1406  $mdtab = $mdgui->getTab();
1407  if($mdtab)
1408  {
1409  $ilTabs->addTab("id_meta_data",
1410  $lng->txt("meta_data"),
1411  $mdtab);
1412  }
1413  }
1414 
1415  if($this->checkPermissionBool('write'))
1416  {
1417  $ilTabs->addTab(
1418  'export',
1419  $this->lng->txt('export'),
1420  $this->ctrl->getLinkTargetByClass('ilexportgui','')
1421  );
1422  }
1423 
1424  // will add permission tab if needed
1425  parent::setTabs();
1426  }
Class ilObjectMetaDataGUI.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
static lookupNumberOfLinks($a_webr_id)
Get number of assigned links.
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:

◆ settings()

ilObjLinkResourceGUI::settings ( )
protected

Edit settings Title, Description, Sorting.

Returns

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

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

198  {
199  global $ilTabs;
200 
201  $this->checkPermission('write');
202  $ilTabs->activateTab('id_settings');
203 
204  $this->initFormSettings();
205  $this->tpl->setContent($this->form->getHTML());
206  }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
initFormSettings()
Show settings form.
+ 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 570 of file class.ilObjLinkResourceGUI.php.

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

Referenced by editLink().

571  {
572  include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
573  $link = new ilLinkResourceItems($this->object->getId());
574 
575  $values = $link->getItem($a_link_id);
576 
578  {
579  }
580 
581  $this->form->setValuesByArray(
582  array(
583  'tit' => $values['title'],
584  'tar' => $values['target'],
585  'des' => $values['description'],
586  'act' => (int) $values['active'],
587  'che' => (int) $values['disable_check'],
588  'vali' => (int) $values['valid']
589  )
590  );
591  }
Create styles array
The data for the language used.
Create new PHPExcel object
obj_idprivate
Class ilObjLinkResourceGUI.
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 947 of file class.ilObjLinkResourceGUI.php.

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

Referenced by view().

948  {
949  $this->checkPermission('read');
950  $this->activateTabs('content','id_content_view');
951 
952  include_once './Modules/WebResource/classes/class.ilWebResourceLinkTableGUI.php';
953  $table = new ilWebResourceLinkTableGUI($this,'showLinks');
954  $table->parse();
955 
956  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.webr_view.html','Modules/WebResource');
957  $this->showToolbar('ACTION_BUTTONS');
958  $this->tpl->setVariable('LINK_TABLE',$table->getHTML());
959  }
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 1001 of file class.ilObjLinkResourceGUI.php.

References ilObject2GUI\checkPermissionBool().

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

1002  {
1003  if(!$this->checkPermissionBool('write'))
1004  {
1005  return;
1006  }
1007 
1008  include_once './Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
1009  $tool = new ilToolbarGUI();
1010  $tool->setFormAction($this->ctrl->getFormAction($this));
1011  $tool->addButton(
1012  $this->lng->txt('webr_add'),
1013  $this->ctrl->getLinkTarget($this,'addLink')
1014  );
1015 
1016  $this->tpl->setVariable($a_tpl_var,$tool->getHTML());
1017  return;
1018  }
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
+ 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 965 of file class.ilObjLinkResourceGUI.php.

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

Referenced by view().

966  {
967  $this->checkPermission('write');
968  $this->activateTabs('content','id_content_ordering');
969 
970  include_once './Modules/WebResource/classes/class.ilWebResourceLinkTableGUI.php';
971  $table = new ilWebResourceLinkTableGUI($this,'sort',true);
972  $table->parse();
973 
974  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.webr_view.html','Modules/WebResource');
975  $this->showToolbar('ACTION_BUTTONS');
976  $this->tpl->setVariable('LINK_TABLE',$table->getHTML());
977  }
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 855 of file class.ilObjLinkResourceGUI.php.

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

Referenced by editLinks().

856  {
857  global $ilCtrl;
858 
859  $_REQUEST['view_mode'] = $_GET['view_mode'] = (int) $_GET['switch_mode'];
860  $this->view();
861  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
+ 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 320 of file class.ilObjLinkResourceGUI.php.

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

321  {
322  global $ilCtrl;
323 
324  $this->initFormLink(self::LINK_MOD_EDIT);
325  if($this->checkLinkInput(self::LINK_MOD_EDIT,$this->object->getId(),(int) $_REQUEST['link_id']))
326  {
327  $this->link->setLinkId((int) $_REQUEST['link_id']);
328  $this->link->update();
329  if(ilParameterAppender::_isEnabled() and is_object($this->dynamic))
330  {
331  $this->dynamic->add((int) $_REQUEST['link_id']);
332  }
333 
334  if($this->isContainerMetaDataRequired())
335  {
336  $this->object->setTitle($this->form->getInput('tit'));
337  $this->object->setDescription($this->form->getInput('des'));
338  $this->object->update();
339  }
340 
341  ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
342  $ilCtrl->redirect($this,'view');
343  }
344  ilUtil::sendFailure($this->lng->txt('err_check_input'));
345  $this->form->setValuesByPost();
346  $this->tpl->setContent($this->form->getHTML());
347  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
checkLinkInput($a_mode, $a_webr_id=0, $a_link_id=0)
Check input after creating a new link.
global $ilCtrl
Definition: ilias.php:18
isContainerMetaDataRequired()
Check if a new container title is required Necessary if there is more than one link.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Create new PHPExcel object
obj_idprivate
initFormLink($a_mode)
Show create/edit single link.
static _isEnabled()
Check if dynamic parameters are enabled.
+ Here is the call graph for this function:

◆ updateLinks()

ilObjLinkResourceGUI::updateLinks ( )
protected

Update all visible links.

Returns

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

References $_POST, ilObjectGUI\$data, $ilCtrl, $orig, activateTabs(), array, ilObject2GUI\checkPermission(), isContainerMetaDataRequired(), ilLinkInputGUI\isInternalLink(), ilLinkResourceItems\lookupItem(), object, ilUtil\sendFailure(), ilUtil\sendSuccess(), ilParameterAppender\setName(), and ilUtil\stripSlashes().

456  {
457  global $ilCtrl;
458 
459  $this->checkPermission('write');
460  $this->activateTabs('content','');
461 
462  if(!is_array($_POST['ids']))
463  {
464  ilUtil::sendFailure($this->lng->txt('select_one'),TRUE);
465  $ilCtrl->redirect($this,'view');
466  }
467 
468  // Validate
469  $invalid = array();
470  foreach($_POST['ids'] as $link_id)
471  {
472  $data = $_POST['links'][$link_id];
473 
474  // handle internal links
475  if($_POST['tar_'.$link_id.'_ajax_type'] &&
476  $_POST['tar_'.$link_id.'_ajax_id'])
477  {
478  $data['tar'] = $_POST['links'][$link_id]['tar'] =
479  $_POST['tar_'.$link_id.'_ajax_type'].'|'.
480  $_POST['tar_'.$link_id.'_ajax_id'];
481  }
482 
483 
484  if(!strlen($data['tit']))
485  {
486  $invalid[] = $link_id;
487  continue;
488  }
489  if(!strlen($data['tar']))
490  {
491  $invalid[] = $link_id;
492  continue;
493  }
494  if($data['nam'] and !$data['val'])
495  {
496  $invalid[] = $link_id;
497  continue;
498  }
499  if(!$data['nam'] and $data['val'])
500  {
501  $invalid[] = $link_id;
502  continue;
503  }
504  }
505 
506  if(count($invalid))
507  {
508  ilUtil::sendFailure($this->lng->txt('err_check_input'));
509  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.webr_manage.html','Modules/WebResource');
510 
511  include_once './Modules/WebResource/classes/class.ilWebResourceEditableLinkTableGUI.php';
512  $table = new ilWebResourceEditableLinkTableGUI($this,'view');
513  $table->setInvalidLinks($invalid);
514  $table->parseSelectedLinks($_POST['ids']);
515  $table->updateFromPost();
516  $this->tpl->setVariable('TABLE_LINKS',$table->getHTML());
517  return false;
518  }
519 
520  include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
521  $links = new ilLinkResourceItems($this->object->getId());
522 
523  // Save Settings
524  include_once './Services/Form/classes/class.ilFormPropertyGUI.php';
525  include_once './Services/Form/classes/class.ilLinkInputGUI.php';
526  foreach($_POST['ids'] as $link_id)
527  {
528  $data = $_POST['links'][$link_id];
529 
530  $orig = ilLinkResourceItems::lookupItem($this->object->getId(),$link_id);
531 
532  $links->setLinkId($link_id);
533  $links->setTitle(ilUtil::stripSlashes($data['tit']));
534  $links->setDescription(ilUtil::stripSlashes($data['des']));
535  $links->setTarget(str_replace('"', '', ilUtil::stripSlashes($data['tar'])));
536  $links->setActiveStatus((int) $data['act']);
537  $links->setDisableCheckStatus((int) $data['che']);
538  $links->setLastCheckDate($orig['last_check']);
539  $links->setValidStatus((int) $data['vali']);
540  $links->setInternal(ilLinkInputGUI::isInternalLink($data['tar']));
541  $links->update();
542 
543  if(strlen($data['nam']) and $data['val'])
544  {
545  $param = new ilParameterAppender($this->object->getId());
546  $param->setName(ilUtil::stripSlashes($data['nam']));
547  $param->setValue((int) $data['val']);
548  $param->add($link_id);
549  }
550 
551  if($this->isContainerMetaDataRequired())
552  {
553  $this->object->setTitle(ilUtil::stripSlashes($data['tit']));
554  $this->object->setDescription(ilUtil::stripSlashes($data['des']));
555  $this->object->update();
556  }
557 
558  // TODO: Dynamic parameters
559  }
560 
561  ilUtil::sendSuccess($this->lng->txt('settings_saved'),TRUE);
562  $ilCtrl->redirect($this,'view');
563  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
global $ilCtrl
Definition: ilias.php:18
static isInternalLink($a_value)
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
isContainerMetaDataRequired()
Check if a new container title is required Necessary if there is more than one link.
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Create new PHPExcel object
obj_idprivate
Class ilObjLinkResourceGUI.
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 878 of file class.ilObjLinkResourceGUI.php.

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

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

879  {
880  global $ilErr, $ilTabs;
881 
882  $ilTabs->activateTab("id_content");
883 
884  $this->checkPermission('read');
885 
886  if (strtolower($_GET["baseClass"]) == "iladministrationgui")
887  {
888  parent::view();
889  return true;
890  }
891  else
892  {
893  switch((int) $_REQUEST['view_mode'])
894  {
895  case self::VIEW_MODE_MANAGE:
896  $this->manage();
897  break;
898 
899  case self::VIEW_MODE_SORT:
900  // #14638
901  include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
903  {
904  $this->sort();
905  break;
906  }
907  // fallthrough
908 
909  default:
910  $this->showLinks();
911  break;
912  }
913  }
914  $GLOBALS['tpl']->setPermanentLink($this->object->getType(),$this->object->getRefId());
915  return true;
916  }
global $ilErr
Definition: raiseError.php:16
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
$_GET["client_id"]
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
showLinks()
Show all active links.
Create new PHPExcel object
obj_idprivate
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.

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