ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjLinkResourceGUI Class Reference

Class ilObjLinkResourceGUI. More...

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

Public Member Functions

 getType ()
 Functions that must be overwritten.
 executeCommand ()
 execute command
 save ()
 Save new object public.
 editLink ()
 Edit a single link.
 updateLink ()
 Save after editing.
 addLink ()
 Add an additional link.
 saveAddLink ()
 Save form data.
 view ()
 View object.
 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
 infoScreenForward ()
 show information screen
 history ()
 formatInvalidLinkArray (Array $row)
 saveLinkCheck ()
 refreshLinkCheck ()
 __initLinkChecker ()
 setTabs ()
 get tabs public
 __prepareOutput ()
 __setLocator ()
 callDirectLink ()
 callLink ()
 _goto ($a_target, $a_additional=null)
- Public Member Functions inherited from ilObject2GUI
 __construct ($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
 Constructor.
 delete ()
 Display delete confirmation form (repository/workspace switch)
 confirmedDelete ()
 Delete objects (repository/workspace switch)
 getHTML ()
 withReferences ()
 Final/Private declaration of unchanged parent methods.
 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
 getCreationMode ()
 get creation mode
 isVisible ()
 trash ()
 undelete ()
 cancelDelete ()
 removeFromSystem ()
 cloneAll ()
 create ()
 Deleted in ilObject.
 edit ()
 update ()
 cancel ()
 importFile ()
 Import.
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public.
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
 cancelDeleteObject ()
 cancel deletion of object
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 createObject ()
 create new object form
 cancelCreation ()
 cancel create action and go back to repository parent
 saveObject ()
 save object
 editObject ()
 edit object
 updateObject ()
 updates object entry in object_data
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g.
 isVisible ($a_ref_id, $a_type)
 viewObject ()
 list childs of current object
 deleteObject ($a_error=false)
 Display deletion confirmation screen.
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI.

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
- 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)
 Init object creation form.
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook.
 settings ()
 Edit settings Title, Description, Sorting.
 saveSettings ()
 Save container settings.
 initFormSettings ()
 Show settings form.
 deleteParameter ()
 Delete a dynamic parameter.
 deleteParameterForm ()
 updateLinks ()
 Update all visible links.
 setValuesFromLink ($a_link_id)
 Set form values from link.
 checkLinkInput ($a_mode, $a_webr_id=0, $a_link_id=0)
 Check input after creating a new link.
 initFormLink ($a_mode)
 Show create/edit single link.
 isContainerMetaDataRequired ()
 Check if a new container title is required Necessary if there is more than one link.
 switchViewMode ()
 Switch between "View" "Manage" and "Sort".
 editLinks ()
 Start with manage mode.
 manage ()
 Manage links.
 showLinks ()
 Show all active links.
 sort ()
 Sort web links.
 saveSorting ()
 Save nmanual sorting.
 showToolbar ($a_tpl_var)
 Show toolbar.
 confirmDeleteLink ()
 Show delete confirmation screen.
 deleteLinks ()
 Delete links.
 deactivateLink ()
 Deactivate links.
 linkChecker ()
 Show link validation.
 activateTabs ($a_active_tab, $a_active_subtab= '')
 Activate tab and subtabs.
 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.
 assignObject ()
 create object instance as internal property (repository/workspace switch)
 getAccessHandler ()
 Get access handler.
 setLocator ()
 set Locator
 deleteConfirmation ()
 Display delete confirmation form (workspace specific)
 deleteConfirmedObjects ()
 Delete objects (workspace specific)
 prepareOutput ()
 prepare output
 setTitleAndDescription ()
 called by prepare output
 showUpperIcon ()
 omitLocator ($a_omit=true)
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g.
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command
 getCenterColumnHTML ()
 Get center column.
 getRightColumnHTML ()
 Display right column.
 setColumnSettings ($column_gui)
 May be overwritten in subclasses.
 checkPermission ($a_perm, $a_cmd="")
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu)
 redirectToRefId ()
 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.
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 searchCloneSource ()
 buildCloneSelect ($existing_objs)
 addAdminLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 getReturnLocation ()
 Deprecated functions.
 setReturnLocation ()
 showActions ()
 getTitlesByRefId ()
 getTabs ()
 __showButton ()
 hitsperpageObject ()
 __initTableGUI ()
 __setTableGUIBasicData ()
 __showClipboardTable ()
 addLocatorItems ()
 Functions to be overwritten.
 initCreationForms ($a_new_type)
 Init creation froms.
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position.
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
 Check permission.
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu.
 redrawHeaderAction ()
 Updating icons after ajax call.
 getPermanentLinkWidget ($a_append=null, $a_center=false)
- Protected Member Functions inherited from ilObjectGUI
 insertHeaderAction ($a_list_gui)
 Insert header action into main template.
 addHeaderAction ()
 Add header action menu.
 redrawHeaderActionObject ()
 Ajax call: redraw action header only.
 setAdminTabs ()
 set admin tabs public
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion)
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types.
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates.
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen.
 initEditForm ()
 Init object edit form.
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form.
 getEditFormValues ()
 Get values for edit form.
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields.
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object.
 afterUpdate ()
 Post (successful) object update hook.
 initImportForm ($a_new_type)
 Init object import form.
 importFileObject ($parent_id=null)
 Import.
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook.
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g.
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste
 getTabs (&$tabs_gui)
 get tabs abstract method.
 __showButton ($a_cmd, $a_text, $a_target= '')
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table
 __showClipboardTable ($a_result_set, $a_from="")
 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
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error.

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root.
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root.
- Protected Attributes inherited from ilObject2GUI
 $object_id
 $node_id
 $creation_forms = array()
 $id_type = array()
 $parent_id
 $access_handler

Detailed Description

Member Function Documentation

ilObjLinkResourceGUI::__initLinkChecker ( )

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

Referenced by linkChecker(), and refreshLinkCheck().

{
global $ilDB;
include_once './Services/LinkChecker/classes/class.ilLinkChecker.php';
$this->link_checker_obj =& new ilLinkChecker($ilDB,false);
$this->link_checker_obj->setObjId($this->object->getId());
return true;
}

+ Here is the caller graph for this function:

ilObjLinkResourceGUI::__prepareOutput ( )

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

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

Referenced by executeCommand().

{
// output objects
$this->tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
$this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
// output locator
$this->__setLocator();
// output message
if ($this->message)
{
ilUtil::sendInfo($this->message);
}
// display infopanel if something happened
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjLinkResourceGUI::__setLocator ( )

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

References $_GET, $ilCtrl, ilObjectGUI\$lng, $row, ilObject2GUI\$tree, and ilUtil\getImagePath().

Referenced by __prepareOutput().

{
global $tree;
global $lng, $ilCtrl;
$this->tpl->addBlockFile("LOCATOR", "locator", "tpl.locator.html", "Services/Locator");
$counter = 0;
//$this->tpl->touchBlock('locator_separator');
//$this->tpl->touchBlock('locator_item');
foreach ($tree->getPathFull($this->object->getRefId()) as $key => $row)
{
//if ($row["child"] == $tree->getRootId())
//{
// continue;
//}
if($counter++)
{
$this->tpl->touchBlock('locator_separator_prefix');
}
if ($row["child"] > 0)
{
$this->tpl->setCurrentBlock("locator_img");
$this->tpl->setVariable("IMG_SRC",
ilUtil::getImagePath("icon_".$row["type"]."_s.png"));
$this->tpl->setVariable("IMG_ALT",
$lng->txt("obj_".$type));
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock("locator_item");
if($row["type"] == 'webr')
{
$this->tpl->setVariable("ITEM",$this->object->getTitle());
$this->tpl->setVariable("LINK_ITEM",$this->ctrl->getLinkTarget($this));
}
elseif ($row["child"] != $tree->getRootId())
{
$ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $row["child"]);
$this->tpl->setVariable("ITEM", $row["title"]);
$this->tpl->setVariable("LINK_ITEM",
$ilCtrl->getLinkTargetByClass("ilrepositorygui", ""));
}
else
{
$ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $row["child"]);
$this->tpl->setVariable("ITEM", $this->lng->txt("repository"));
$this->tpl->setVariable("LINK_ITEM",
$ilCtrl->getLinkTargetByClass("ilrepositorygui", ""));
}
$ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
$this->tpl->parseCurrentBlock();
}
$this->tpl->setVariable("TXT_LOCATOR",$this->lng->txt("locator"));
$this->tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

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

{
global $ilAccess, $ilErr, $lng;
if($a_additional && substr($a_additional, -3) == "wsp")
{
$_GET["baseClass"] = "ilsharedresourceGUI";
$_GET["wsp_id"] = $a_target;
include("ilias.php");
}
// Will be replaced in future releases by ilAccess::checkAccess()
if ($ilAccess->checkAccess("read", "", $a_target))
{
ilUtil::redirect("ilias.php?baseClass=ilLinkResourceHandlerGUI&ref_id=$a_target");
}
else
{
// to do: force flat view
if ($ilAccess->checkAccess("visible", "", $a_target))
{
ilUtil::redirect("ilias.php?baseClass=ilLinkResourceHandlerGUI&ref_id=".$a_target."&cmd=infoScreen");
}
else
{
if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
{
ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
}
}
}
$ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
}

+ Here is the call graph for this function:

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

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

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

{
global $ilCtrl, $ilTabs, $lng;
switch($a_active_tab)
{
case 'content':
if($this->checkPermissionBool('write'))
{
$this->lng->loadLanguageModule('cntr');
$this->ctrl->setParameter($this,'switch_mode',self::VIEW_MODE_VIEW);
$ilTabs->addSubTab('id_content_view',
$lng->txt('view'),
$this->ctrl->getLinkTarget($this,'switchViewMode')
);
$this->ctrl->setParameter($this,'switch_mode',self::VIEW_MODE_MANAGE);
$ilTabs->addSubTab('id_content_manage',
$lng->txt('cntr_manage'),
$this->ctrl->getLinkTarget($this,'switchViewMode')
);
include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
include_once './Services/Container/classes/class.ilContainer.php';
if((ilLinkResourceItems::lookupNumberOfLinks($this->object->getId()) > 1)
{
$this->ctrl->setParameter($this,'switch_mode',self::VIEW_MODE_SORT);
$ilTabs->addSubTab('id_content_ordering',
$this->lng->txt('cntr_ordering'),
$this->ctrl->getLinkTarget($this,'switchViewMode')
);
}
$ilCtrl->clearParameters($this);
$ilTabs->activateSubTab($a_active_subtab);
}
}
$ilTabs->activateTab('id_content');
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjLinkResourceGUI::addLink ( )

Add an additional link.

Returns

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

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

{
$this->checkPermission('write');
$this->activateTabs('content','id_content_view');
$this->initFormLink(self::LINK_MOD_ADD);
$this->tpl->setContent($this->form->getHTML());
}

+ Here is the call graph for this function:

ilObjLinkResourceGUI::afterSave ( ilObject  $a_new_object)
protected

Post (successful) object creation hook.

Parameters
ilObject$a_new_object

Reimplemented from ilObjectGUI.

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

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

{
// Save link
$this->link->setLinkResourceId($a_new_object->getId());
$link_id = $this->link->add();
$this->link->updateValid(true);
ilUtil::sendSuccess($this->lng->txt('webr_link_added'));
// personal workspace
if($this->id_type == self::WORKSPACE_NODE_ID)
{
$this->ctrl->redirect($this, "editLinks");
}
// repository
else
{
ilUtil::redirect("ilias.php?baseClass=ilLinkResourceHandlerGUI&ref_id=".
$a_new_object->getRefId()."&cmd=switchViewMode&switch_mode=2");
}
}

+ Here is the call graph for this function:

ilObjLinkResourceGUI::callDirectLink ( )

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

References ilObjectGUI\$obj_id, ilParameterAppender\_append(), ilLinkResourceItems\_getFirstLink(), ilLink\_getStaticLink(), ilParameterAppender\_isEnabled(), ilLinkResourceItems\_isSingular(), ilLinkInputGUI\isInternalLink(), and redirectToLink().

{
$obj_id = $this->object->getId();
include_once("./Services/Link/classes/class.ilLink.php");
include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
{
// #15647 - handle internal links
include_once "Services/Form/classes/class.ilFormPropertyGUI.php";
include_once "Services/Form/classes/class.ilLinkInputGUI.php";
if(ilLinkInputGUI::isInternalLink($url["target"]))
{
// #10612
$parts = explode("|", $url["target"]);
if ($parts[0] == "page")
{
$parts[0] = "pg";
}
if ($parts[0] == "term")
{
$parts[0] = "git";
}
$url["target"] = ilLink::_getStaticLink($parts[1], $parts[0]);
}
include_once './Modules/WebResource/classes/class.ilParameterAppender.php';
{
}
$this->redirectToLink($this->ref_id, $obj_id, $url["target"]);
}
}

+ Here is the call graph for this function:

ilObjLinkResourceGUI::callLink ( )

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

References $_REQUEST, ilObjectGUI\$obj_id, ilParameterAppender\_append(), ilLink\_getStaticLink(), ilParameterAppender\_isEnabled(), ilLinkInputGUI\isInternalLink(), and redirectToLink().

{
if($_REQUEST["link_id"])
{
$obj_id = $this->object->getId();
include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
$item = $items->getItem($_REQUEST["link_id"]);
if($item["target"])
{
// #15647 - handle internal links
include_once "Services/Form/classes/class.ilFormPropertyGUI.php";
include_once "Services/Form/classes/class.ilLinkInputGUI.php";
if(ilLinkInputGUI::isInternalLink($item["target"]))
{
$parts = explode("|", $item["target"]);
if ($parts[0] == "page")
{
$parts[0] = "pg";
}
include_once("./Services/Link/classes/class.ilLink.php");
$item["target"] = ilLink::_getStaticLink($parts[1], $parts[0]);
if ($parts[0] == "term")
{
$parts[0] = "git";
$item["target"] =
$parts[0],
true,
"&target=git_".$parts[1]);
}
}
include_once './Modules/WebResource/classes/class.ilParameterAppender.php';
{
}
//var_dump($item); exit;
$this->redirectToLink($this->ref_id, $obj_id, $item["target"]);
}
}
}

+ Here is the call graph for this function:

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

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

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

{
$valid = $this->form->checkInput();
include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
$this->link = new ilLinkResourceItems($a_webr_id);
$this->link->setTarget(str_replace('"', '', ilUtil::stripSlashes($this->form->getInput('tar'))));
$this->link->setTitle($this->form->getInput('tit'));
$this->link->setDescription($this->form->getInput('des'));
$this->link->setDisableCheckStatus($this->form->getInput('che'));
if($a_mode == self::LINK_MOD_CREATE)
{
$this->link->setActiveStatus(true);
}
else
{
$this->link->setActiveStatus($this->form->getInput('act'));
}
if($a_mode == self::LINK_MOD_EDIT)
{
$this->link->setValidStatus($this->form->getInput('vali'));
}
else
{
$this->link->setValidStatus(true);
}
{
return $valid;
}
$this->dynamic = new ilParameterAppender($a_webr_id);
$this->dynamic->setName($this->form->getInput('nam'));
$this->dynamic->setValue($this->form->getInput('val'));
if(!$this->dynamic->validate())
{
switch($this->dynamic->getErrorCode())
{
$this->form->getItemByPostVar('nam')->setAlert($this->lng->txt('links_no_name_given'));
return false;
$this->form->getItemByPostVar('val')->setAlert($this->lng->txt('links_no_value_given'));
return false;
// Nothing entered => no error
return $valid;
}
$this->dynamic = null;
}
return $valid;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjLinkResourceGUI::confirmDeleteLink ( )
protected

Show delete confirmation screen.

Returns

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

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

{
$this->checkPermission('write');
$this->activateTabs('content','id_content_view');
$link_ids = array();
if(is_array($_POST['link_ids']))
{
$link_ids =$_POST['link_ids'];
}
elseif(isset($_GET['link_id']))
{
$link_ids = array($_GET['link_id']);
}
if(!count($link_ids) > 0)
{
ilUtil::sendFailure($this->lng->txt('select_one'));
$this->view();
return false;
}
include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
$links = new ilLinkResourceItems($this->object->getId());
include_once 'Services/Utilities/classes/class.ilConfirmationGUI.php';
$confirm = new ilConfirmationGUI();
$confirm->setFormAction($this->ctrl->getFormAction($this,'view'));
$confirm->setHeaderText($this->lng->txt('webr_sure_delete_items'));
$confirm->setConfirm($this->lng->txt('delete'), 'deleteLinks');
$confirm->setCancel($this->lng->txt('cancel'), 'view');
foreach($link_ids as $link_id)
{
$link = $links->getItem($link_id);
$confirm->addItem('link_ids[]', $link_id,$link['title']);
}
$this->tpl->setContent($confirm->getHTML());
}

+ Here is the call graph for this function:

ilObjLinkResourceGUI::deactivateLink ( )
protected

Deactivate links.

Returns

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

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

{
global $ilCtrl;
$this->checkPermission('write');
include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
$links = new ilLinkResourceItems($this->object->getId());
if(!$_GET['link_id'])
{
ilUtil::sendFailure($this->lng->txt('select_one'),true);
$ilCtrl->redirect($this,'view');
}
$links->setLinkId((int) $_GET['link_id']);
$links->updateActive(false);
ilUtil::sendSuccess($this->lng->txt('webr_inactive_success'),true);
$ilCtrl->redirect($this,'view');
}

+ Here is the call graph for this function:

ilObjLinkResourceGUI::deleteLinks ( )
protected

Delete links.

Returns

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

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

{
global $ilCtrl;
$this->checkPermission('write');
include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
$links = new ilLinkResourceItems($this->object->getId());
foreach($_POST['link_ids'] as $link_id)
{
$links->delete($link_id);
}
ilUtil::sendSuccess($this->lng->txt('webr_deleted_items'),true);
$ilCtrl->redirect($this,'view');
}

+ Here is the call graph for this function:

ilObjLinkResourceGUI::deleteParameter ( )
protected

Delete a dynamic parameter.

Returns

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

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

{
global $ilCtrl;
$this->checkPermission('write');
$this->ctrl->setParameter($this,'link_id',(int) $_GET['link_id']);
if(!isset($_GET['param_id']))
{
ilUtil::sendFailure($this->lng->txt('select_one'),TRUE);
$ilCtrl->redirect($this,'view');
}
include_once './Modules/WebResource/classes/class.ilParameterAppender.php';
$param = new ilParameterAppender($this->object->getId());
$param->delete((int) $_GET['param_id']);
ilUtil::sendSuccess($this->lng->txt('links_parameter_deleted'),true);
$ilCtrl->redirect($this,'editLinks');
}

+ Here is the call graph for this function:

ilObjLinkResourceGUI::deleteParameterForm ( )
protected

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

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

{
global $ilCtrl;
$this->checkPermission('write');
if(!isset($_GET['param_id']))
{
ilUtil::sendFailure($this->lng->txt('select_one'),TRUE);
$ilCtrl->redirect($this,'view');
}
include_once './Modules/WebResource/classes/class.ilParameterAppender.php';
$param = new ilParameterAppender($this->object->getId());
$param->delete((int) $_GET['param_id']);
ilUtil::sendSuccess($this->lng->txt('links_parameter_deleted'),true);
$ilCtrl->redirect($this,'view');
}

+ Here is the call graph for this function:

ilObjLinkResourceGUI::editLink ( )

Edit a single link.

Returns

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

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

{
global $ilCtrl;
$this->checkPermission('write');
$this->activateTabs('content','id_content_view');
if(!(int) $_GET['link_id'])
{
ilUtil::sendFailure($this->lng->txt('select_one'),true);
$ilCtrl->redirect($this,'view');
}
$this->initFormLink(self::LINK_MOD_EDIT);
$this->setValuesFromLink((int) $_GET['link_id']);
$this->tpl->setContent($this->form->getHTML());
}

+ Here is the call graph for this function:

ilObjLinkResourceGUI::editLinks ( )
protected

Start with manage mode.

Returns

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

References $_GET, switchViewMode(), and VIEW_MODE_MANAGE.

{
$_GET['switch_mode'] = self::VIEW_MODE_MANAGE;
$this->switchViewMode();
}

+ Here is the call graph for this function:

ilObjLinkResourceGUI::executeCommand ( )

execute command

Reimplemented from ilObject2GUI.

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

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

{
global $ilCtrl, $ilTabs, $ilErr, $ilAccess;
//if($this->ctrl->getTargetScript() == 'link_resources.php')
if($_GET["baseClass"] == 'ilLinkResourceHandlerGUI')
{
$_GET['view_mode'] = isset($_GET['switch_mode']) ? $_GET['switch_mode'] : $_GET['view_mode'];
$ilCtrl->saveParameter($this, 'view_mode');
$this->__prepareOutput();
}
$this->lng->loadLanguageModule("webr");
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
switch($next_class)
{
case "ilinfoscreengui":
$this->infoScreenForward(); // forwards command
break;
case 'ilmdeditorgui':
if(!$ilAccess->checkAccess('write','',$this->object->getRefId()))
{
$ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->WARNING);
}
$this->prepareOutput();
$ilTabs->activateTab('id_meta_data');
include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
$md_gui =& new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType());
$md_gui->addObserver($this->object,'MDUpdateListener','General');
$this->ctrl->forwardCommand($md_gui);
break;
case 'ilpermissiongui':
$this->prepareOutput();
$ilTabs->activateTab('id_permissions');
include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
$perm_gui =& new ilPermissionGUI($this);
$ret =& $this->ctrl->forwardCommand($perm_gui);
break;
case 'ilobjectcopygui':
$this->prepareOutput();
include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
$cp = new ilObjectCopyGUI($this);
$cp->setType('webr');
$this->ctrl->forwardCommand($cp);
break;
case 'ilexportgui':
$this->prepareOutput();
$this->tabs_gui->setTabActive('export');
include_once './Services/Export/classes/class.ilExportGUI.php';
$exp = new ilExportGUI($this);
$exp->addFormat('xml');
$this->ctrl->forwardCommand($exp);
break;
case "ilcommonactiondispatchergui":
include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
$this->ctrl->forwardCommand($gui);
break;
case "ilpropertyformgui":
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$this->initFormLink(self::LINK_MOD_EDIT);
$this->ctrl->forwardCommand($this->form);
break;
case "ilinternallinkgui":
$this->lng->loadLanguageModule("content");
require_once("./Modules/LearningModule/classes/class.ilInternalLinkGUI.php");
$link_gui = new ilInternalLinkGUI("RepositoryItem", 0);
$link_gui->filterLinkType("PageObject");
$link_gui->filterLinkType("GlossaryItem");
$link_gui->filterLinkType("RepositoryItem");
$link_gui->setFilterWhiteList(true);
$link_gui->setMode("asynch");
$ilCtrl->forwardCommand($link_gui);
break;
default:
if(!$cmd)
{
$this->ctrl->setCmd("view");
}
}
if(!$this->getCreationMode())
{
// Fill meta header tags
include_once('Services/MetaData/classes/class.ilMDUtils.php');
ilMDUtils::_fillHTMLMetaTags($this->object->getId(),$this->object->getId(),'webr');
$this->addHeaderAction();
}
return true;
}

+ Here is the call graph for this function:

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

Implements ilLinkCheckerGUIRowHandling.

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

References ilObjectGUI\$actions, and $row.

{
$this->object->items_obj->readItem($row['page_id']);
$row['title'] = $this->object->items_obj->getTitle();
require_once 'Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php';
$actions->setSelectionHeaderClass('small');
$actions->setItemLinkClass('xsmall');
$actions->setListTitle($this->lng->txt('actions'));
$actions->setId($row['page_id']);
$this->ctrl->setParameter($this, 'link_id', $row['page_id']);
$actions->addItem(
$this->lng->txt('edit'),
'',
$this->ctrl->getLinkTarget($this, 'editLink')
);
$this->ctrl->clearParameters($this);
$row['action_html'] = $actions->getHTML();
return $row;
}
ilObjLinkResourceGUI::getType ( )

Functions that must be overwritten.

Reimplemented from ilObject2GUI.

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

{
return "webr";
}
ilObjLinkResourceGUI::history ( )

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

References $_GET, ilObject2GUI\checkPermission(), and ilHistoryGUI\getHistoryTable().

{
global $ilTabs;
$this->checkPermission('write');
$ilTabs->activateTab('id_history');
include_once("./Services/History/classes/class.ilHistoryGUI.php");
$hist_gui =& new ilHistoryGUI($this->object->getId());
$hist_html = $hist_gui->getHistoryTable(array("ref_id" => $_GET["ref_id"],
"cmd" => "history",
"cmdClass" =>$_GET["cmdClass"],
"cmdNode" =>$_GET["cmdNode"]));
$this->tpl->setVariable("ADM_CONTENT", $hist_html);
}

+ Here is the call graph for this function:

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

References infoScreenForward().

{
$this->ctrl->setCmd("showSummary");
$this->ctrl->setCmdClass("ilinfoscreengui");
}

+ Here is the call graph for this function:

ilObjLinkResourceGUI::infoScreenForward ( )

show information screen

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

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

Referenced by executeCommand(), and infoScreen().

{
global $ilTabs;
$this->checkPermission('visible');
$ilTabs->activateTab('id_info');
include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
$info = new ilInfoScreenGUI($this);
$info->enablePrivateNotes();
// standard meta data
$info->addMetaDataSections($this->object->getId(),0, $this->object->getType());
if($this->id_type == self::WORKSPACE_NODE_ID)
{
$info->addProperty($this->lng->txt("perma_link"), $this->getPermanentLinkWidget());
}
// forward the command
$this->ctrl->forwardCommand($info);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjLinkResourceGUI::initCreateForm (   $a_new_type)
protected

Init object creation form.

Parameters
string$a_new_type
Returns
ilPropertyFormGUI

Reimplemented from ilObjectGUI.

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

References initFormLink().

{
$this->initFormLink(self::LINK_MOD_CREATE);
return $this->form;
}

+ Here is the call graph for this function:

ilObjLinkResourceGUI::initFormLink (   $a_mode)
protected

Show create/edit single link.

Parameters
intform mode
Returns

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

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

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

{
global $ilTabs;
$ilTabs->activateTab("id_content");
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$this->form = new ilPropertyFormGUI();
switch($a_mode)
{
case self::LINK_MOD_CREATE:
// Header
$this->ctrl->setParameter($this,'new_type','webr');
$this->form->setTitle($this->lng->txt('webr_new_link'));
$this->form->setTableWidth('600px');
// Buttons
$this->form->addCommandButton('save', $this->lng->txt('webr_add'));
$this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
break;
case self::LINK_MOD_ADD:
// Header
$this->form->setTitle($this->lng->txt('webr_new_link'));
// Buttons
$this->form->addCommandButton('saveAddLink', $this->lng->txt('webr_add'));
$this->form->addCommandButton('view', $this->lng->txt('cancel'));
break;
case self::LINK_MOD_EDIT:
// Header
$this->ctrl->setParameter($this,'link_id',(int) $_REQUEST['link_id']);
$this->form->setTitle($this->lng->txt('webr_edit'));
// Buttons
$this->form->addCommandButton('updateLink', $this->lng->txt('save'));
$this->form->addCommandButton('view', $this->lng->txt('cancel'));
break;
}
$this->form->setFormAction($this->ctrl->getFormAction($this));
if($a_mode == self::LINK_MOD_ADD and $this->isContainerMetaDataRequired())
{
ilUtil::sendInfo($this->lng->txt('webr_container_info'));
$this->form->setTitle($this->lng->txt('webr_edit_list'));
// List Title
$title = new ilTextInputGUI($this->lng->txt('webr_list_title'),'lti');
$title->setRequired(true);
$title->setSize(40);
$title->setMaxLength(127);
$this->form->addItem($title);
// List Description
$desc = new ilTextAreaInputGUI($this->lng->txt('webr_list_desc'),'tde');
$desc->setRows(3);
$desc->setCols(40);
$this->form->addItem($desc);
// Addtional section
$sect = new ilFormSectionHeaderGUI();
$sect->setTitle($this->lng->txt('webr_add'));
$this->form->addItem($sect);
}
// Target
/*
$tar = new ilTextInputGUI($this->lng->txt('webr_link_target'),'tar');
$tar->setValue("http://");
$tar->setSize(40);
$tar->setMaxLength(500);
*/
include_once 'Services/Form/classes/class.ilLinkInputGUI.php';
$tar = new ilLinkInputGUI($this->lng->txt('webr_link_target'),'tar');
$tar->setInternalLinkFilterTypes(array("PageObject", "GlossaryItem", "RepositoryItem"));
$tar->setRequired(true);
$this->form->addItem($tar);
// Title
$tit = new ilTextInputGUI($this->lng->txt('webr_link_title'),'tit');
$tit->setRequired(true);
$tit->setSize(40);
$tit->setMaxLength(127);
$this->form->addItem($tit);
// Description
$des = new ilTextAreaInputGUI($this->lng->txt('description'),'des');
$des->setRows(3);
$des->setCols(40);
$this->form->addItem($des);
if($a_mode != self::LINK_MOD_CREATE)
{
// Active
$act = new ilCheckboxInputGUI($this->lng->txt('active'),'act');
$act->setChecked(true);
$act->setValue(1);
$this->form->addItem($act);
// Check
$che = new ilCheckboxInputGUI($this->lng->txt('webr_disable_check'),'che');
$che->setValue(1);
$this->form->addItem($che);
}
// Valid
if($a_mode == self::LINK_MOD_EDIT)
{
$val = new ilCheckboxInputGUI($this->lng->txt('valid'),'vali');
$this->form->addItem($val);
}
if(ilParameterAppender::_isEnabled() && $a_mode != self::LINK_MOD_CREATE)
{
$dyn = new ilNonEditableValueGUI($this->lng->txt('links_dyn_parameter'));
$dyn->setInfo($this->lng->txt('links_dynamic_info'));
if(count($links = ilParameterAppender::_getParams((int) $_GET['link_id'])))
{
$ex = new ilCustomInputGUI($this->lng->txt('links_existing_params'),'ex');
$dyn->addSubItem($ex);
foreach($links as $id => $link)
{
$p = new ilCustomInputGUI();
$ptpl = new ilTemplate('tpl.link_dyn_param_edit.html',true,true,'Modules/WebResource');
$ptpl->setVariable('INFO_TXT',ilParameterAppender::parameterToInfo($link['name'], $link['value']));
$this->ctrl->setParameter($this,'param_id',$id);
$ptpl->setVariable('LINK_DEL',$this->ctrl->getLinkTarget($this,'deleteParameterForm'));
$ptpl->setVariable('LINK_TXT',$this->lng->txt('delete'));
$p->setHtml($ptpl->get());
$dyn->addSubItem($p);
}
}
// Existing parameters
// New parameter
if($a_mode != self::LINK_MOD_CREATE)
{
#$new = new ilCustomInputGUI($this->lng->txt('links_add_param'),'');
#$dyn->addSubItem($new);
}
// Dynyamic name
$nam = new ilTextInputGUI($this->lng->txt('links_name'),'nam');
$nam->setSize(12);
$nam->setMaxLength(128);
$dyn->addSubItem($nam);
// Dynamic value
$val = new ilSelectInputGUI($this->lng->txt('links_value'),'val');
$val->setValue(0);
$dyn->addSubItem($val);
$this->form->addItem($dyn);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjLinkResourceGUI::initFormSettings ( )
protected

Show settings form.

Returns

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

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

Referenced by saveSettings(), and settings().

{
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($this->ctrl->getFormAction($this,'saveSettings'));
$this->form->setTitle($this->lng->txt('webr_edit_settings'));
// Title
$tit = new ilTextInputGUI($this->lng->txt('webr_list_title'),'tit');
$tit->setValue($this->object->getTitle());
$tit->setRequired(true);
$tit->setSize(40);
$tit->setMaxLength(127);
$this->form->addItem($tit);
// Description
$des = new ilTextAreaInputGUI($this->lng->txt('webr_list_desc'),'des');
$des->setValue($this->object->getDescription());
$des->setCols(40);
$des->setRows(3);
$this->form->addItem($des);
// Sorting
include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
include_once './Services/Container/classes/class.ilContainer.php';
$sor = new ilRadioGroupInputGUI($this->lng->txt('webr_sorting'),'sor');
$sor->setRequired(true);
include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
$sor->setValue(ilContainerSortingSettings::_lookupSortMode($this->object->getId()));
$opt = new ilRadioOption(
$this->lng->txt('webr_sort_title'),
);
$sor->addOption($opt);
$opm = new ilRadioOption(
$this->lng->txt('webr_sort_manual'),
);
$sor->addOption($opm);
$this->form->addItem($sor);
$this->form->addCommandButton('saveSettings', $this->lng->txt('save'));
$this->form->addCommandButton('view', $this->lng->txt('cancel'));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjLinkResourceGUI::isContainerMetaDataRequired ( )
protected

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

Returns

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

References ilLinkResourceItems\lookupNumberOfLinks().

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

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjLinkResourceGUI::linkChecker ( )
protected

Show link validation.

Returns

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

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

Referenced by refreshLinkCheck(), and saveLinkCheck().

{
global $ilias, $ilUser, $tpl, $ilTabs;
$this->checkPermission('write');
$ilTabs->activateTab('id_link_check');
$this->object->initLinkResourceItemsObject();
require_once './Services/LinkChecker/classes/class.ilLinkCheckerTableGUI.php';
$toolbar = new ilToolbarGUI();
if((bool)$ilias->getSetting('cron_web_resource_check'))
{
include_once './Services/LinkChecker/classes/class.ilLinkCheckNotify.php';
include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$chb = new ilCheckboxInputGUI($this->lng->txt('link_check_message_a'), 'link_check_message');
$chb->setValue(1);
$chb->setChecked((bool)ilLinkCheckNotify::_getNotifyStatus($ilUser->getId(), $this->object->getId()));
$chb->setOptionTitle($this->lng->txt('link_check_message_b'));
$toolbar->addInputItem($chb);
$toolbar->addFormButton($this->lng->txt('save'), 'saveLinkCheck');
$toolbar->setFormAction($this->ctrl->getLinkTarget($this, 'saveLinkCheck'));
}
$tgui = new ilLinkCheckerTableGUI($this, 'linkChecker');
$tgui->setLinkChecker($this->link_checker_obj)
->setRowHandler($this)
->setRefreshButton($this->lng->txt('refresh'), 'refreshLinkCheck');
return $tpl->setContent($tgui->prepareHTML()->getHTML().$toolbar->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjLinkResourceGUI::manage ( )
protected

Manage links.

Returns

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

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

Referenced by view().

{
$this->checkPermission('write');
$this->activateTabs('content','id_content_manage');
$this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.webr_manage.html','Modules/WebResource');
$this->showToolbar('ACTION_BUTTONS');
include_once './Modules/WebResource/classes/class.ilWebResourceEditableLinkTableGUI.php';
$table = new ilWebResourceEditableLinkTableGUI($this,'view');
$table->parse();
include_once './Modules/LearningModule/classes/class.ilInternalLinkGUI.php';
$this->tpl->addJavaScript("Modules/WebResource/js/intLink.js");
$this->tpl->addJavascript("Services/Form/js/Form.js");
$this->tpl->setVariable('TABLE_LINKS',$table->getHTML().$js);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

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

Referenced by callDirectLink(), and callLink().

{
global $ilUser;
if($a_url)
{
require_once('Services/Tracking/classes/class.ilChangeEvent.php');
ilChangeEvent::_recordReadEvent("webr", $a_ref_id, $a_obj_id,
$ilUser->getId());
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjLinkResourceGUI::refreshLinkCheck ( )

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

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

{
if(!$this->link_checker_obj->checkPear())
{
ilUtil::sendFailure($this->lng->txt('missing_pear_library'));
$this->linkChecker();
return false;
}
$this->object->initLinkResourceItemsObject();
// Set all link to valid. After check invalid links will be set to invalid
$this->object->items_obj->updateValidByCheck();
foreach($this->link_checker_obj->checkWebResourceLinks() as $invalid)
{
$this->object->items_obj->readItem($invalid['page_id']);
$this->object->items_obj->setActiveStatus(false);
$this->object->items_obj->setValidStatus(false);
$this->object->items_obj->update(false);
}
$this->object->items_obj->updateLastCheck();
ilUtil::sendSuccess($this->lng->txt('link_checker_refreshed'));
$this->linkChecker();
return true;
}

+ Here is the call graph for this function:

ilObjLinkResourceGUI::save ( )

Save new object public.

Reimplemented from ilObject2GUI.

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

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

{
global $ilCtrl;
$this->initFormLink(self::LINK_MOD_CREATE);
if($this->checkLinkInput(self::LINK_MOD_CREATE,0,0))
{
// Save new object
$_POST['title'] = $_POST['tit'];
$_POST['desc'] = $_POST['des'];
}
else
{
// Data incomplete or invalid
ilUtil::sendFailure($this->lng->txt('err_check_input'));
$this->form->setValuesByPost();
$this->tpl->setContent($this->form->getHTML());
}
}

+ Here is the call graph for this function:

ilObjLinkResourceGUI::saveAddLink ( )

Save form data.

Returns

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

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

{
global $ilCtrl;
$this->checkPermission('write');
$this->initFormLink(self::LINK_MOD_ADD);
if($this->checkLinkInput(self::LINK_MOD_ADD,$this->object->getId(),0))
{
{
// Save list data
$this->object->setTitle($this->form->getInput('lti'));
$this->object->setDescription($this->form->getInput('tde'));
$this->object->update();
}
// Save Link
$link_id = $this->link->add();
$this->link->updateValid(true);
// Dynamic parameters
if(ilParameterAppender::_isEnabled() and is_object($this->dynamic))
{
$this->dynamic->add($link_id);
}
ilUtil::sendSuccess($this->lng->txt('webr_link_added'),true);
$ilCtrl->redirect($this,'view');
}
// Error handling
ilUtil::sendFailure($this->lng->txt('err_check_input'));
$this->form->setValuesByPost();
$this->activateTabs('content','id_content_view');
$this->tpl->setContent($this->form->getHTML());
}

+ Here is the call graph for this function:

ilObjLinkResourceGUI::saveLinkCheck ( )

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

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

{
global $ilDB,$ilUser;
include_once './Services/LinkChecker/classes/class.ilLinkCheckNotify.php';
$link_check_notify =& new ilLinkCheckNotify($ilDB);
$link_check_notify->setUserId($ilUser->getId());
$link_check_notify->setObjId($this->object->getId());
if($_POST['link_check_message'])
{
ilUtil::sendSuccess($this->lng->txt('link_check_message_enabled'));
$link_check_notify->addNotifier();
}
else
{
ilUtil::sendSuccess($this->lng->txt('link_check_message_disabled'));
$link_check_notify->deleteNotifier();
}
$this->linkChecker();
return true;
}

+ Here is the call graph for this function:

ilObjLinkResourceGUI::saveSettings ( )
protected

Save container settings.

Returns

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

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

{
global $ilTabs;
$this->checkPermission('write');
$ilTabs->activateTab('id_settings');
$this->initFormSettings();
if($this->form->checkInput())
{
$this->object->setTitle($this->form->getInput('tit'));
$this->object->setDescription($this->form->getInput('des'));
$this->object->update();
include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
$sort = new ilContainerSortingSettings($this->object->getId());
$sort->setSortMode($this->form->getInput('sor'));
$sort->update();
ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
$this->ctrl->redirect($this,'settings');
}
$this->form->setValuesByPost();
ilUtil::sendFailure($this->lng->txt('err_check_input'));
$this->tpl->setContent($this->form->getHTML());
}

+ Here is the call graph for this function:

ilObjLinkResourceGUI::saveSorting ( )
protected

Save nmanual sorting.

Returns

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

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

{
$this->checkPermission('write');
include_once './Services/Container/classes/class.ilContainerSorting.php';
$sort = ilContainerSorting::_getInstance($this->object->getId());
$sort->savePost((array) $_POST['position']);
ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
$this->view();
}

+ Here is the call graph for this function:

ilObjLinkResourceGUI::setTabs ( )

get tabs public

Reimplemented from ilObject2GUI.

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

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

{
global $ilTabs, $lng, $ilHelp;
$ilHelp->setScreenIdComponent("webr");
if ($this->checkPermissionBool('read'))
{
$ilTabs->addTab("id_content",
$lng->txt("content"),
$this->ctrl->getLinkTarget($this, "view"));
}
if ($this->checkPermissionBool('visible'))
{
$ilTabs->addTab("id_info",
$lng->txt("info_short"),
$this->ctrl->getLinkTarget($this, "infoScreen"));
}
if($this->checkPermissionBool('write') and !$this->getCreationMode())
{
include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
if(ilLinkResourceItems::lookupNumberOfLinks($this->object->getId()) > 1)
{
$ilTabs->addTab("id_settings",
$lng->txt("settings"),
$this->ctrl->getLinkTarget($this, "settings"));
}
}
if ($this->checkPermissionBool('write'))
{
$ilTabs->addTab("id_history",
$lng->txt("history"),
$this->ctrl->getLinkTarget($this, "history"));
}
if ($this->checkPermissionBool('write'))
{
// Check if pear library is available
if(@include_once('HTTP/Request.php'))
{
$ilTabs->addTab("id_link_check",
$lng->txt("link_check"),
$this->ctrl->getLinkTarget($this, "linkChecker"));
}
}
if ($this->checkPermissionBool('write'))
{
$ilTabs->addTab("id_meta_data",
$lng->txt("meta_data"),
$this->ctrl->getLinkTargetByClass('ilmdeditorgui','listSection'));
}
if($this->checkPermissionBool('write'))
{
$ilTabs->addTab(
'export',
$this->lng->txt('export'),
$this->ctrl->getLinkTargetByClass('ilexportgui','')
);
}
// will add permission tab if needed
}

+ Here is the call graph for this function:

ilObjLinkResourceGUI::settings ( )
protected

Edit settings Title, Description, Sorting.

Returns

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

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

{
global $ilTabs;
$this->checkPermission('write');
$ilTabs->activateTab('id_settings');
$this->initFormSettings();
$this->tpl->setContent($this->form->getHTML());
}

+ Here is the call graph for this function:

ilObjLinkResourceGUI::setValuesFromLink (   $a_link_id)
protected

Set form values from link.

Parameters
object$a_link_id
Returns

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

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

Referenced by editLink().

{
include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
$link = new ilLinkResourceItems($this->object->getId());
$values = $link->getItem($a_link_id);
{
}
$this->form->setValuesByArray(
array(
'tit' => $values['title'],
'tar' => $values['target'],
'des' => $values['description'],
'act' => (int) $values['active'],
'che' => (int) $values['disable_check'],
'vali' => (int) $values['valid']
)
);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjLinkResourceGUI::showLinks ( )
protected

Show all active links.

Returns

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

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

Referenced by view().

{
$this->checkPermission('read');
$this->activateTabs('content','id_content_view');
include_once './Modules/WebResource/classes/class.ilWebResourceLinkTableGUI.php';
$table = new ilWebResourceLinkTableGUI($this,'showLinks');
$table->parse();
$this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.webr_view.html','Modules/WebResource');
$this->showToolbar('ACTION_BUTTONS');
$this->tpl->setVariable('LINK_TABLE',$table->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjLinkResourceGUI::showToolbar (   $a_tpl_var)
protected

Show toolbar.

Parameters
string$a_tpl_varName of template variable
Returns

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

References ilObject2GUI\checkPermissionBool().

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

{
if(!$this->checkPermissionBool('write'))
{
return;
}
include_once './Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
$tool = new ilToolbarGUI();
$tool->setFormAction($this->ctrl->getFormAction($this));
$tool->addButton(
$this->lng->txt('webr_add'),
$this->ctrl->getLinkTarget($this,'addLink')
);
$this->tpl->setVariable($a_tpl_var,$tool->getHTML());
return;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjLinkResourceGUI::sort ( )
protected

Sort web links.

Returns

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

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

Referenced by view().

{
$this->checkPermission('write');
$this->activateTabs('content','id_content_ordering');
include_once './Modules/WebResource/classes/class.ilWebResourceLinkTableGUI.php';
$table = new ilWebResourceLinkTableGUI($this,'sort',true);
$table->parse();
$this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.webr_view.html','Modules/WebResource');
$this->showToolbar('ACTION_BUTTONS');
$this->tpl->setVariable('LINK_TABLE',$table->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjLinkResourceGUI::switchViewMode ( )
protected

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

Returns

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

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

Referenced by editLinks().

{
global $ilCtrl;
$_REQUEST['view_mode'] = $_GET['view_mode'] = (int) $_GET['switch_mode'];
$this->view();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjLinkResourceGUI::updateLink ( )

Save after editing.

Returns

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

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

{
global $ilCtrl;
$this->initFormLink(self::LINK_MOD_EDIT);
if($this->checkLinkInput(self::LINK_MOD_EDIT,$this->object->getId(),(int) $_REQUEST['link_id']))
{
$this->link->setLinkId((int) $_REQUEST['link_id']);
$this->link->update();
if(ilParameterAppender::_isEnabled() and is_object($this->dynamic))
{
$this->dynamic->add((int) $_REQUEST['link_id']);
}
{
$this->object->setTitle($this->form->getInput('tit'));
$this->object->setDescription($this->form->getInput('des'));
$this->object->update();
}
ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
$ilCtrl->redirect($this,'view');
}
ilUtil::sendFailure($this->lng->txt('err_check_input'));
$this->form->setValuesByPost();
$this->tpl->setContent($this->form->getHTML());
}

+ Here is the call graph for this function:

ilObjLinkResourceGUI::updateLinks ( )
protected

Update all visible links.

Returns

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

References $_POST, ilObjectGUI\$data, $ilCtrl, activateTabs(), ilObject2GUI\checkPermission(), isContainerMetaDataRequired(), ilUtil\sendFailure(), ilUtil\sendSuccess(), ilParameterAppender\setName(), and ilUtil\stripSlashes().

{
global $ilCtrl;
$this->checkPermission('write');
$this->activateTabs('content','');
if(!is_array($_POST['ids']))
{
ilUtil::sendFailure($this->lng->txt('select_one'),TRUE);
$ilCtrl->redirect($this,'view');
}
// Validate
$invalid = array();
foreach($_POST['ids'] as $link_id)
{
$data = $_POST['links'][$link_id];
// handle internal links
if($_POST['tar_'.$link_id.'_ajax_type'] &&
$_POST['tar_'.$link_id.'_ajax_id'])
{
$data['tar'] = $_POST['links'][$link_id]['tar'] =
$_POST['tar_'.$link_id.'_ajax_type'].'|'.
$_POST['tar_'.$link_id.'_ajax_id'];
}
if(!strlen($data['tit']))
{
$invalid[] = $link_id;
continue;
}
if(!strlen($data['tar']))
{
$invalid[] = $link_id;
continue;
}
if($data['nam'] and !$data['val'])
{
$invalid[] = $link_id;
continue;
}
if(!$data['nam'] and $data['val'])
{
$invalid[] = $link_id;
continue;
}
}
if(count($invalid))
{
ilUtil::sendFailure($this->lng->txt('err_check_input'));
$this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.webr_manage.html','Modules/WebResource');
include_once './Modules/WebResource/classes/class.ilWebResourceEditableLinkTableGUI.php';
$table = new ilWebResourceEditableLinkTableGUI($this,'view');
$table->setInvalidLinks($invalid);
$table->parseSelectedLinks($_POST['ids']);
$table->updateFromPost();
$this->tpl->setVariable('TABLE_LINKS',$table->getHTML());
return false;
}
include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
$links = new ilLinkResourceItems($this->object->getId());
// Save Settings
foreach($_POST['ids'] as $link_id)
{
$data = $_POST['links'][$link_id];
$links->setLinkId($link_id);
$links->setTitle(ilUtil::stripSlashes($data['tit']));
$links->setDescription(ilUtil::stripSlashes($data['des']));
$links->setTarget(str_replace('"', '', ilUtil::stripSlashes($data['tar'])));
$links->setActiveStatus((int) $data['act']);
$links->setDisableCheckStatus((int) $data['che']);
$links->setValidStatus((int) $data['vali']);
$links->update();
if(strlen($data['nam']) and $data['val'])
{
$param = new ilParameterAppender($this->object->getId());
$param->setName(ilUtil::stripSlashes($data['nam']));
$param->setValue((int) $data['val']);
$param->add($link_id);
}
{
$this->object->setTitle(ilUtil::stripSlashes($data['tit']));
$this->object->setDescription(ilUtil::stripSlashes($data['des']));
$this->object->update();
}
// TODO: Dynamic parameters
}
ilUtil::sendSuccess($this->lng->txt('settings_saved'),TRUE);
$ilCtrl->redirect($this,'view');
}

+ Here is the call graph for this function:

ilObjLinkResourceGUI::view ( )

View object.

Returns

Reimplemented from ilObject2GUI.

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

References $_GET, $_REQUEST, $ilErr, ilObject2GUI\checkPermission(), manage(), showLinks(), and sort().

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

{
global $ilErr, $ilTabs;
$ilTabs->activateTab("id_content");
$this->checkPermission('read');
if (strtolower($_GET["baseClass"]) == "iladministrationgui")
{
return true;
}
else
{
switch((int) $_REQUEST['view_mode'])
{
case self::VIEW_MODE_MANAGE:
$this->manage();
break;
case self::VIEW_MODE_SORT:
$this->sort();
break;
default:
$this->showLinks();
break;
}
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

const ilObjLinkResourceGUI::LINK_MOD_ADD = 3

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

const ilObjLinkResourceGUI::LINK_MOD_CREATE = 1

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

const ilObjLinkResourceGUI::LINK_MOD_EDIT = 2

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

const ilObjLinkResourceGUI::VIEW_MODE_MANAGE = 2

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

Referenced by editLinks().

const ilObjLinkResourceGUI::VIEW_MODE_SORT = 3

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

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: