ILIAS  Release_4_0_x_branch Revision 61816
 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

 __construct ()
 Constructor public.
 executeCommand ()
 execute command
 createObject ()
 Overwritten to offer object cloning.
 saveObject ()
 Save new object public.
 editLinkObject ()
 Edit a single link.
 updateLinkObject ()
 Save after editing.
 addLinkObject ()
 Add an additional link.
 saveAddLinkObject ()
 Save form data.
 viewObject ()
 View object.
 infoScreenObject ()
 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
 infoScreen ()
 show information screen
 historyObject ()
 saveLinkCheckObject ()
 refreshLinkCheckObject ()
 __initLinkChecker ()
 getTabs ($tabs_gui)
 get tabs public
 __prepareOutput ()
 __setHeader ()
 __setLocator ()
 _goto ($a_target)
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public.
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not)
 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
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder
 getHTML ()
 undeleteObject ()
 Get objects back from trash.
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
 cancelDeleteObject ()
 cancel deletion of object
 removeFromSystemObject ()
 remove objects from trash bin and all entries therefore every object needs a specific deleteObject() method
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 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)
 deleteObject ($a_error=false)
 Display deletion confirmation screen.
 trashObject ()
 Show trash content of object.
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI.
 copyWizardHasOptions ($a_mode)
 Check if there is any modules specific option.

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

Protected Member Functions

 settingsObject ()
 Edit settings Title, Description, Sorting.
 saveSettingsObject ()
 Save container settings.
 initFormSettings ()
 Show settings form.
 deleteParameterObject ()
 Delete a dynamic parameter.
 deleteParameterFormObject ()
 updateLinksObject ()
 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.
 switchViewModeObject ()
 Switch between "View" "Manage" and "Sort".
 editLinksObject ()
 Start with manage mode.
 manageObject ()
 Manage links.
 showLinksObject ()
 Show all active links.
 sortObject ()
 Sort web links.
 saveSortingObject ()
 Save nmanual sorting.
 showToolbar ($a_tpl_var)
 Show toolbar.
 confirmDeleteLinkObject ()
 Show delete confirmation screen.
 deleteLinksObject ()
 Delete links.
 deactivateLinkObject ()
 Deactivate links.
 linkCheckerObject ()
 Show link validation.
 activateTabs ($a_active_tab, $a_active_subtab= '')
 Activate tab and subtabs.
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 prepareOutput ()
 prepare output
 setTitleAndDescription ()
 called by prepare output
 showUpperIcon ()
 setTabs ()
 set admin tabs public
 setAdminTabs ()
 set admin tabs public
 setLocator ()
 set Locator
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 omitLocator ($a_omit=true)
 addAdminLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 displayEditForm ($fields)
 display edit form (usually called by editObject)
 afterUpdate ()
 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
 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
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu)
 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= '')
 hitsperpageObject ()
__initTableGUI ()
 __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
 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)
 Add an object search in case the number of existing objects is too big to offer a selection list.
 searchCloneSourceObject ()
 Search clone source by title.
 buildCloneSelect ($existing_objs)
 Build a select box for clonable objects (permission write)
 getCenterColumnHTML ()
 Get center column.
 getRightColumnHTML ()
 Display right column.
 setColumnSettings ($column_gui)
 May be overwritten in subclasses.
 checkPermission ($a_perm, $a_cmd="")

Detailed Description

Constructor & Destructor Documentation

ilObjLinkResourceGUI::__construct ( )

Constructor public.

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

References $_GET, and $ilCtrl.

{
global $ilCtrl;
$this->type = "webr";
parent::__construct('',(int) $_GET['ref_id'],true,false);
// CONTROL OPTIONS
$this->ctrl = $ilCtrl;
$this->ctrl->saveParameter($this,array("ref_id","cmdClass"));
$this->lng->loadLanguageModule('webr');
}

Member Function Documentation

ilObjLinkResourceGUI::__initLinkChecker ( )

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

References $ilDB.

Referenced by linkCheckerObject(), and refreshLinkCheckObject().

{
global $ilDB;
include_once './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 1389 of file class.ilObjLinkResourceGUI.php.

References __setHeader(), __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
// set header
$this->__setHeader();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjLinkResourceGUI::__setHeader ( )

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

References ilUtil\getImagePath(), and getTabs().

Referenced by __prepareOutput().

{
include_once './classes/class.ilTabsGUI.php';
$this->tpl->setCurrentBlock("header_image");
$this->tpl->setVariable("IMG_HEADER", ilUtil::getImagePath("icon_webr_b.gif"));
$this->tpl->parseCurrentBlock();
$this->tpl->setVariable("HEADER",$this->object->getTitle());
$this->tpl->setVariable("H_DESCRIPTION",$this->object->getDescription());
#$tabs_gui =& new ilTabsGUI();
$this->getTabs($this->tabs_gui);
// output tabs
#$this->tpl->setVariable("TABS", $tabs_gui->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjLinkResourceGUI::__setLocator ( )

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

References $key, ilObjectGUI\$lng, $row, ilObjectGUI\$tree, elseif(), and ilUtil\getImagePath().

Referenced by __prepareOutput().

{
global $tree;
global $ilias_locator, $lng;
$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.gif"));
$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())
{
$this->tpl->setVariable("ITEM", $row["title"]);
$this->tpl->setVariable("LINK_ITEM","./repository.php?ref_id=".$row["child"]);
}
else
{
$this->tpl->setVariable("ITEM", $this->lng->txt("repository"));
$this->tpl->setVariable("LINK_ITEM","./repository.php?ref_id=".$row["child"]);
}
$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)

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

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

{
global $ilAccess, $ilErr, $lng;
// 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))
{
$_GET["cmd"] = "frameset";
$_GET["target"] = "";
$_GET["ref_id"] = ROOT_FOLDER_ID;
ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
include("repository.php");
}
}
}
$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 1276 of file class.ilObjLinkResourceGUI.php.

References $ilCtrl, ilLinkResourceItems\lookupNumberOfLinks(), ilContainerSortingSettings\readSortMode(), and ilContainer\SORT_MANUAL.

Referenced by addLinkObject(), confirmDeleteLinkObject(), editLinkObject(), manageObject(), saveAddLinkObject(), showLinksObject(), sortObject(), and updateLinksObject().

{
global $ilAccess,$ilCtrl;
switch($a_active_tab)
{
case 'content':
if($ilAccess->checkAccess('write','',$this->object->getRefId()))
{
$this->lng->loadLanguageModule('cntr');
$this->ctrl->setParameter($this,'switch_mode',self::VIEW_MODE_VIEW);
$this->tabs_gui->addSubTabTarget(
'view',
$this->ctrl->getLinkTarget($this,'switchViewMode')
);
$this->ctrl->setParameter($this,'switch_mode',self::VIEW_MODE_MANAGE);
$this->tabs_gui->addSubTabTarget(
'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);
$this->tabs_gui->addSubTabTarget(
'cntr_ordering',
$this->ctrl->getLinkTarget($this,'switchViewMode')
);
}
$ilCtrl->clearParameters($this);
$this->tabs_gui->setSubTabActive($a_active_subtab);
}
}
$this->tabs_gui->setTabActive('content');
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjLinkResourceGUI::addLinkObject ( )

Add an additional link.

Returns

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

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

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

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

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

Referenced by saveAddLinkObject(), saveObject(), and updateLinkObject().

{
$valid = $this->form->checkInput();
include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
$this->link = new ilLinkResourceItems($a_webr_id);
$this->link->setTarget($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'));
$this->link->setActiveStatus($this->form->getInput('act'));
if($a_mode == self::LINK_MOD_EDIT)
{
$this->link->setValidStatus($this->form->getInput('val'));
}
{
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::confirmDeleteLinkObject ( )
protected

Show delete confirmation screen.

Returns

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

References $_GET, $_POST, activateTabs(), ilObjectGUI\checkPermission(), ilUtil\sendFailure(), and viewObject().

{
$this->checkPermission('write');
$this->activateTabs('content','view');
$link_ids = is_array($_POST['link_ids']) ?
$_POST['link_ids'] :
array($_GET['link_id']);
if(!$link_ids)
{
ilUtil::sendFailure($this->lng->txt('select_one'));
$this->viewObject();
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::createObject ( )

Overwritten to offer object cloning.

public

Parameters

Reimplemented from ilObjectGUI.

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

References ilObjectGUI\fillCloneTemplate(), and initFormLink().

Referenced by saveObject().

{
$this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.webr_create.html','Modules/WebResource');
$this->initFormLink(self::LINK_MOD_CREATE);
$this->tpl->setVariable('LINK_FORM',$this->form->getHTML());
$this->fillCloneTemplate('CLONE_WIZARD',$_REQUEST['new_type']);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjLinkResourceGUI::deactivateLinkObject ( )
protected

Deactivate links.

Returns

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

References $_GET, $ilCtrl, ilObjectGUI\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::deleteLinksObject ( )
protected

Delete links.

Returns

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

References $_POST, $ilCtrl, ilObjectGUI\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::deleteParameterFormObject ( )
protected

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

References $_GET, $ilCtrl, $param, ilObjectGUI\checkPermission(), 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::deleteParameterObject ( )
protected

Delete a dynamic parameter.

Returns

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

References $_GET, $ilCtrl, $param, ilObjectGUI\checkPermission(), 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,'editLink');
}

+ Here is the call graph for this function:

ilObjLinkResourceGUI::editLinkObject ( )

Edit a single link.

Returns

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

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

{
global $ilCtrl;
$this->checkPermission('write');
$this->activateTabs('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::editLinksObject ( )
protected

Start with manage mode.

Returns

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

References $_GET, switchViewModeObject(), and VIEW_MODE_MANAGE.

{
$_GET['switch_mode'] = self::VIEW_MODE_MANAGE;
}

+ Here is the call graph for this function:

ilObjLinkResourceGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

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

References $_GET, $cmd, $ilCtrl, $ret, __prepareOutput(), ilMDUtils\_fillHTMLMetaTags(), ilMDEditorGUI\addObserver(), ilObjectGUI\getCreationMode(), infoScreen(), and ilObjectGUI\prepareOutput().

{
global $rbacsystem,$ilCtrl;
//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();
}
if (strtolower($_GET["baseClass"]) == "iladministrationgui" ||
$this->getCreationMode() == true)
{
$this->prepareOutput();
}
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
switch($next_class)
{
case "ilinfoscreengui":
$this->infoScreen(); // forwards command
break;
case 'ilmdeditorgui':
$this->tabs_gui->setTabActive('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->tabs_gui->setTabActive('perm_settings');
include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
$perm_gui =& new ilPermissionGUI($this);
$ret =& $this->ctrl->forwardCommand($perm_gui);
break;
case 'ilobjectcopygui':
include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
$cp = new ilObjectCopyGUI($this);
$cp->setType('webr');
$this->ctrl->forwardCommand($cp);
break;
default:
if(!$cmd)
{
$cmd = "view";
}
$cmd .= "Object";
$this->$cmd();
break;
}
if(!$this->getCreationMode())
{
// Fill meta header tags
include_once('Services/MetaData/classes/class.ilMDUtils.php');
ilMDUtils::_fillHTMLMetaTags($this->object->getId(),$this->object->getId(),'webr');
}
return true;
}

+ Here is the call graph for this function:

ilObjLinkResourceGUI::getTabs (   $tabs_gui)

get tabs public

Parameters
objecttabs gui object

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

References ilObjectGUI\getCreationMode(), and ilLinkResourceItems\lookupNumberOfLinks().

Referenced by __setHeader().

{
global $rbacreview,$ilAccess;
if ($ilAccess->checkAccess('read','',$this->object->getRefId()))
{
$tabs_gui->addTarget(
"content",
$this->ctrl->getLinkTarget($this, "view"), array("", "view")
);
}
if ($ilAccess->checkAccess('visible','',$this->ref_id))
{
$tabs_gui->addTarget(
"info_short",
$this->ctrl->getLinkTarget($this,'infoScreen')
);
}
if($ilAccess->checkAccess('write','',$this->object->getRefId()) and !$this->getCreationMode())
{
include_once './Modules/WebResource/classes/class.ilLinkResourceItems.php';
if(ilLinkResourceItems::lookupNumberOfLinks($this->object->getId()) > 1)
{
$tabs_gui->addTarget(
'settings',
$this->ctrl->getLinkTarget($this,'settings')
);
}
}
if ($ilAccess->checkAccess('write','',$this->object->getRefId()))
{
$tabs_gui->addTarget("meta_data",
$this->ctrl->getLinkTargetByClass('ilmdeditorgui','listSection'),
"", 'ilmdeditorgui');
}
if ($ilAccess->checkAccess('write','',$this->object->getRefId()))
{
$tabs_gui->addTarget("history",
$this->ctrl->getLinkTarget($this, "history"), "history", get_class($this));
}
if ($ilAccess->checkAccess('write','',$this->object->getRefId()))
{
// Check if pear library is available
if(@include_once('HTTP/Request.php'))
{
$tabs_gui->addTarget("link_check",
$this->ctrl->getLinkTarget($this, "linkChecker"),
array("linkChecker", "refreshLinkCheck"), get_class($this));
}
}
if ($ilAccess->checkAccess('edit_permission','',$this->object->getRefId()))
{
$tabs_gui->addTarget("perm_settings",
$this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjLinkResourceGUI::historyObject ( )

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

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

{
$this->checkPermission('write');
$this->tabs_gui->setTabActive('history');
include_once("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 ( )

show information screen

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

References ilObjectGUI\checkPermission().

Referenced by executeCommand(), and infoScreenObject().

{
global $ilAccess;
$this->checkPermission('visible');
$this->tabs_gui->setTabActive('info_short');
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());
// forward the command
$this->ctrl->forwardCommand($info);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjLinkResourceGUI::infoScreenObject ( )

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

References infoScreen().

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

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

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

Referenced by addLinkObject(), createObject(), editLinkObject(), saveAddLinkObject(), saveObject(), and updateLinkObject().

{
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('60%');
// 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->setRequired(true);
$tar->setSize(40);
$tar->setMaxLength(500);
$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);
// 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);
}
{
$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_EDIT)
{
#$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 255 of file class.ilObjLinkResourceGUI.php.

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

Referenced by saveSettingsObject(), and settingsObject().

{
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::readSortMode($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 807 of file class.ilObjLinkResourceGUI.php.

References ilLinkResourceItems\lookupNumberOfLinks().

Referenced by initFormLink(), saveAddLinkObject(), updateLinkObject(), and updateLinksObject().

{
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::linkCheckerObject ( )
protected

Show link validation.

Returns

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

References ilObjectGUI\$ilias, __initLinkChecker(), ilLinkCheckNotify\_getNotifyStatus(), ilObjectGUI\checkPermission(), ilDatePresentation\formatDate(), ilUtil\formCheckbox(), ilUtil\getImagePath(), IL_CAL_UNIX, and ilUtil\switchColor().

Referenced by refreshLinkCheckObject(), and saveLinkCheckObject().

{
global $ilias,$ilUser;
$this->checkPermission('write');
$this->tabs_gui->setTabActive('link_check');
$this->object->initLinkResourceItemsObject();
$invalid_links = $this->link_checker_obj->getInvalidLinksFromDB();
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.link_check.html",'Modules/WebResource');
if($last_access = $this->link_checker_obj->getLastCheckTimestamp())
{
$this->tpl->setCurrentBlock("LAST_MODIFIED");
$this->tpl->setVariable("AS_OF",$this->lng->txt('last_change').": ");
$this->tpl->setVariable('LAST_CHECK',ilDatePresentation::formatDate(new ilDateTime($last_access,IL_CAL_UNIX)));
$this->tpl->parseCurrentBlock();
}
$this->tpl->setVariable("F_ACTION",$this->ctrl->getFormAction($this, 'linkChecker'));
$this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_webr.gif'));
$this->tpl->setVariable("ALT_IMG",$this->lng->txt('obj_webr'));
$this->tpl->setVariable("TITLE",$this->object->getTitle().' ('.$this->lng->txt('link_check').')');
$this->tpl->setVariable("PAGE_TITLE",$this->lng->txt('title'));
$this->tpl->setVariable("URL",$this->lng->txt('url'));
$this->tpl->setVariable("OPTIONS",$this->lng->txt('edit'));
if(!count($invalid_links))
{
$this->tpl->setCurrentBlock("no_invalid");
$this->tpl->setVariable("TXT_NO_INVALID",$this->lng->txt('no_invalid_links'));
$this->tpl->parseCurrentBlock();
}
else
{
$counter = 0;
foreach($invalid_links as $invalid)
{
$this->object->items_obj->readItem($invalid['page_id']);
$this->tpl->setCurrentBlock("invalid_row");
$this->tpl->setVariable("ROW_COLOR",ilUtil::switchColor(++$counter,'tblrow1','tblrow2'));
$this->tpl->setVariable("ROW_PAGE_TITLE",$this->object->items_obj->getTitle());
$this->tpl->setVariable("ROW_URL",$invalid['url']);
// EDIT IMAGE
$this->ctrl->setParameter($this,'link_id',$invalid['page_id']);
$this->tpl->setVariable("ROW_EDIT_LINK",$this->ctrl->getLinkTarget($this,'editLink'));
$this->tpl->setVariable("ROW_IMG",ilUtil::getImagePath('icon_pencil.gif'));
$this->tpl->setVariable("ROW_ALT_IMG",$this->lng->txt('edit'));
$this->tpl->parseCurrentBlock();
}
}
if((bool) $ilias->getSetting('cron_web_resource_check'))
{
include_once './classes/class.ilLinkCheckNotify.php';
// Show message block
$this->tpl->setCurrentBlock("MESSAGE_BLOCK");
$this->tpl->setVariable("INFO_MESSAGE",$this->lng->txt('link_check_message_a'));
$this->tpl->setVariable("CHECK_MESSAGE",ilUtil::formCheckbox(
ilLinkCheckNotify::_getNotifyStatus($ilUser->getId(),$this->object->getId()),
'link_check_message',
1));
$this->tpl->setVariable("INFO_MESSAGE_LONG",$this->lng->txt('link_check_message_b'));
$this->tpl->parseCurrentBlock();
// Show save button
$this->tpl->setCurrentBlock("CRON_ENABLED");
$this->tpl->setVariable("DOWNRIGHT_IMG",ilUtil::getImagePath('arrow_downright.gif'));
$this->tpl->setVariable("BTN_SUBMIT_LINK_CHECK",$this->lng->txt('save'));
$this->tpl->parseCurrentBlock();
}
$this->tpl->setVariable("BTN_REFRESH",$this->lng->txt('refresh'));
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjLinkResourceGUI::manageObject ( )
protected

Manage links.

Returns

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

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

Referenced by viewObject().

{
$this->checkPermission('write');
$this->activateTabs('content','cntr_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();
$this->tpl->setVariable('TABLE_LINKS',$table->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjLinkResourceGUI::refreshLinkCheckObject ( )

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

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

{
if(!$this->link_checker_obj->checkPear())
{
ilUtil::sendFailure($this->lng->txt('missing_pear_library'));
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'));
return true;
}

+ Here is the call graph for this function:

ilObjLinkResourceGUI::saveAddLinkObject ( )

Save form data.

Returns

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

References $ilCtrl, ilParameterAppender\_isEnabled(), activateTabs(), checkLinkInput(), ilObjectGUI\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('lde'));
$this->object->update();
}
// Save Link
$link_id = $this->link->add();
// 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','view');
$this->tpl->setContent($this->form->getHTML());
}

+ Here is the call graph for this function:

ilObjLinkResourceGUI::saveLinkCheckObject ( )

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

References $_POST, $ilDB, linkCheckerObject(), and ilUtil\sendSuccess().

{
global $ilDB,$ilUser;
include_once './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();
}
return true;
}

+ Here is the call graph for this function:

ilObjLinkResourceGUI::saveObject ( )

Save new object public.

Reimplemented from ilObjectGUI.

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

References $_POST, $ilCtrl, ilParameterAppender\_isEnabled(), checkLinkInput(), createObject(), ilObjectGUI\fillCloneTemplate(), initFormLink(), ilUtil\redirect(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

{
global $ilCtrl;
$this->initFormLink(self::LINK_MOD_CREATE);
if($this->checkLinkInput(self::LINK_MOD_CREATE,0,0))
{
// Save new object
$_POST['Fobject']['title'] = $_POST['tit'];
$_POST['Fobject']['desc'] = $_POST['des'];
$link_list = parent::saveObject();
// Save link
$this->link->setLinkResourceId($link_list->getId());
$link_id = $this->link->add();
// Dynamic params
if(ilParameterAppender::_isEnabled() and is_object($this->dynamic))
{
$this->dynamic->setObjId($link_list->getId());
$this->dynamic->add($link_id);
}
ilUtil::sendSuccess($this->lng->txt('webr_link_added'));
ilUtil::redirect("ilias.php?baseClass=ilLinkResourceHandlerGUI&ref_id=".
$link_list->getRefId()."&cmd=view");
return true;
}
// Data incomplete or invalid
ilUtil::sendFailure($this->lng->txt('err_check_input'));
$this->form->setValuesByPost();
$this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.webr_create.html','Modules/WebResource');
$this->tpl->setVariable('LINK_FORM',$this->form->getHTML());
$this->fillCloneTemplate('CLONE_WIZARD',$_REQUEST['new_type']);
return false;
if ($_POST["Fobject"]["title"] == "")
{
ilUtil::sendFailure($this->lng->txt('please_enter_title'));
$this->createObject();
return false;
}
}

+ Here is the call graph for this function:

ilObjLinkResourceGUI::saveSettingsObject ( )
protected

Save container settings.

Returns

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

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

{
$this->checkPermission('write');
$this->tabs_gui->setTabActive('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::saveSortingObject ( )
protected

Save nmanual sorting.

Returns

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

References $_POST, ilContainerSorting\_getInstance(), ilObjectGUI\checkPermission(), ilUtil\sendSuccess(), and viewObject().

{
$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->viewObject();
}

+ Here is the call graph for this function:

ilObjLinkResourceGUI::settingsObject ( )
protected

Edit settings Title, Description, Sorting.

Returns

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

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

{
$this->checkPermission('write');
$this->tabs_gui->setTabActive('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 563 of file class.ilObjLinkResourceGUI.php.

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

Referenced by editLinkObject().

{
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::showLinksObject ( )
protected

Show all active links.

Returns

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

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

Referenced by viewObject().

{
$this->checkPermission('read');
$this->activateTabs('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 948 of file class.ilObjLinkResourceGUI.php.

Referenced by manageObject(), showLinksObject(), and sortObject().

{
global $ilAccess;
if(!$ilAccess->checkAccess('write','',$this->object->getRefId()))
{
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 caller graph for this function:

ilObjLinkResourceGUI::sortObject ( )
protected

Sort web links.

Returns

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

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

Referenced by viewObject().

{
$this->checkPermission('write');
$this->activateTabs('content','cntr_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::switchViewModeObject ( )
protected

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

Returns

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

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

Referenced by editLinksObject().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjLinkResourceGUI::updateLinkObject ( )

Save after editing.

Returns

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

References $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::updateLinksObject ( )
protected

Update all visible links.

Returns

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

References $_POST, ilObjectGUI\$data, $ilCtrl, $param, activateTabs(), ilObjectGUI\checkPermission(), isContainerMetaDataRequired(), ilUtil\sendFailure(), ilUtil\sendSuccess(), 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];
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(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::viewObject ( )

View object.

Returns

Reimplemented from ilObjectGUI.

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

References $_GET, $ilErr, ilObjectGUI\checkPermission(), manageObject(), showLinksObject(), and sortObject().

Referenced by confirmDeleteLinkObject(), saveSortingObject(), and switchViewModeObject().

{
global $ilAccess,$ilErr;
$this->checkPermission('read');
if (strtolower($_GET["baseClass"]) == "iladministrationgui")
{
return true;
}
else
{
switch((int) $_REQUEST['view_mode'])
{
case self::VIEW_MODE_MANAGE:
$this->manageObject();
break;
case self::VIEW_MODE_SORT:
$this->sortObject();
break;
default:
$this->showLinksObject();
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 46 of file class.ilObjLinkResourceGUI.php.

const ilObjLinkResourceGUI::LINK_MOD_CREATE = 1

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

const ilObjLinkResourceGUI::LINK_MOD_EDIT = 2

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

const ilObjLinkResourceGUI::VIEW_MODE_MANAGE = 2

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

Referenced by editLinksObject().

const ilObjLinkResourceGUI::VIEW_MODE_SORT = 3

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

const ilObjLinkResourceGUI::VIEW_MODE_VIEW = 1

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


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