ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilLinkResourceItems Class Reference

Class ilObjLinkResourceGUI. More...

+ Collaboration diagram for ilLinkResourceItems:

Public Member Functions

 ilLinkResourceItems ($webr_id)
 Constructor public.
 setLinkResourceRefId ($a_ref_id)
 getLinkResourceRefId ()
 setLinkResourceId ($a_id)
 getLinkResourceId ()
 setLinkId ($a_id)
 getLinkId ()
 setTitle ($a_title)
 getTitle ()
 setDescription ($a_description)
 getDescription ()
 setTarget ($a_target)
 getTarget ()
 setActiveStatus ($a_status)
 getActiveStatus ()
 setDisableCheckStatus ($a_status)
 getDisableCheckStatus ()
 __setCreateDate ($a_date)
 getCreateDate ()
 __setLastUpdateDate ($a_date)
 getLastUpdateDate ()
 setLastCheckDate ($a_date)
 getLastCheckDate ()
 setValidStatus ($a_status)
 getValidStatus ()
 cloneItems ($a_new_id)
 Copy web resource items.
 delete ($a_item_id, $a_update_history=true)
 update ($a_update_history=true)
 updateValid ($a_status)
 updateActive ($a_status)
 updateDisableCheck ($a_status)
 updateLastCheck ($a_offset=0)
 updateValidByCheck ($a_offset=0)
 add ($a_update_history=true)
 readItem ($a_link_id)
 getItem ($a_link_id)
 getAllItems ()
 sortItems ($a_items)
 Sort items (sorting mode depends on sorting setting)
 getActivatedItems ()
 getCheckItems ($a_offset=0)
 _deleteAll ($webr_id)
 validate ()
 Validate required settings.
 toXML (ilXmlWriter $writer)
 Write link XML.

Static Public Member Functions

static lookupItem ($a_webr_id, $a_link_id)
static getAllItemIds ($a_webr_id)
 Get all link ids.
static _isSingular ($a_webr_id)
 Check whether there is only one active link in the web resource.
static lookupNumberOfLinks ($a_webr_id)
 Get number of assigned links.
static _getFirstLink ($a_webr_id)
 Get first link item Check before with _isSingular() if there is more or less than one.

Detailed Description

Class ilObjLinkResourceGUI.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
Id:
class.ilLinkResourceItems.php 40106 2013-02-25 11:39:34Z smeyer

Definition at line 15 of file class.ilLinkResourceItems.php.

Member Function Documentation

ilLinkResourceItems::__setCreateDate (   $a_date)

Definition at line 125 of file class.ilLinkResourceItems.php.

Referenced by add(), and readItem().

{
$this->c_date = $a_date;
}

+ Here is the caller graph for this function:

ilLinkResourceItems::__setLastUpdateDate (   $a_date)

Definition at line 134 of file class.ilLinkResourceItems.php.

Referenced by add(), readItem(), and update().

{
$this->m_date = $a_date;
}

+ Here is the caller graph for this function:

ilLinkResourceItems::_deleteAll (   $webr_id)

Definition at line 549 of file class.ilLinkResourceItems.php.

References $ilDB.

Referenced by ilObjLinkResource\delete().

{
global $ilDB;
$ilDB->manipulate("DELETE FROM webr_items WHERE webr_id = ".$ilDB->quote($webr_id ,'integer'));
return true;
}

+ Here is the caller graph for this function:

static ilLinkResourceItems::_getFirstLink (   $a_webr_id)
static

Get first link item Check before with _isSingular() if there is more or less than one.

Parameters
int$a_webr_idobject id of web resource
Returns
array link item data

Definition at line 599 of file class.ilLinkResourceItems.php.

References $ilDB.

Referenced by ilObjLinkResourceListGUI\__readLink(), ilObjLinkResourceGUI\callDirectLink(), and ilObjLinkResource\MDUpdateListener().

{
global $ilDB;
include_once("./Modules/WebResource/classes/class.ilObjLinkResourceAccess.php");
}

+ Here is the caller graph for this function:

static ilLinkResourceItems::_isSingular (   $a_webr_id)
static

Check whether there is only one active link in the web resource.

In this case this link is shown in a new browser window

Parameters
int$a_webr_idobject id of web resource
Returns
boolean success status

Definition at line 566 of file class.ilLinkResourceItems.php.

References $ilDB, and $res.

Referenced by ilObjLinkResourceListGUI\__checkDirectLink(), and ilObjLinkResourceGUI\callDirectLink().

{
global $ilDB;
$res = $ilDB->query("SELECT * FROM webr_items WHERE webr_id = ".$ilDB->quote($a_webr_id ,'integer')." AND active = '1'");
return $res->numRows() == 1 ? true : false;
}

+ Here is the caller graph for this function:

ilLinkResourceItems::add (   $a_update_history = true)

Definition at line 343 of file class.ilLinkResourceItems.php.

References $ilDB, $query, $res, __setCreateDate(), __setLastUpdateDate(), ilHistory\_createEntry(), getActiveStatus(), getCreateDate(), getDescription(), getDisableCheckStatus(), getLastUpdateDate(), getLinkResourceId(), getTarget(), getTitle(), getValidStatus(), and setLinkId().

{
global $ilDB;
$this->__setLastUpdateDate(time());
$this->__setCreateDate(time());
$next_id = $ilDB->nextId('webr_items');
$query = "INSERT INTO webr_items (link_id,title,description,target,active,disable_check,".
"last_update,create_date,webr_id,valid) ".
"VALUES( ".
$ilDB->quote($next_id ,'integer').", ".
$ilDB->quote($this->getTitle() ,'text').", ".
$ilDB->quote($this->getDescription() ,'text').", ".
$ilDB->quote($this->getTarget() ,'text').", ".
$ilDB->quote($this->getActiveStatus() ,'integer').", ".
$ilDB->quote($this->getDisableCheckStatus() ,'integer').", ".
$ilDB->quote($this->getLastUpdateDate() ,'integer').", ".
$ilDB->quote($this->getCreateDate() ,'integer').", ".
$ilDB->quote($this->getLinkResourceId() ,'integer').", ".
$ilDB->quote($this->getValidStatus(),'integer'). ' '.
")";
$res = $ilDB->manipulate($query);
$link_id = $next_id;
$this->setLinkId($link_id);
if($a_update_history)
{
include_once("classes/class.ilHistory.php");
$this->getTitle());
}
return $link_id;
}

+ Here is the call graph for this function:

ilLinkResourceItems::cloneItems (   $a_new_id)

Copy web resource items.

public

Parameters
intobj_id of new object

Definition at line 166 of file class.ilLinkResourceItems.php.

References $data, ilParameterAppender\_getParams(), getAllItems(), getLinkResourceId(), and ilLinkResourceItems().

{
include_once 'Modules/WebResource/classes/class.ilParameterAppender.php';
$appender = new ilParameterAppender($this->getLinkResourceId());
foreach($this->getAllItems() as $item)
{
$new_item = new ilLinkResourceItems($a_new_id);
$new_item->setTitle($item['title']);
$new_item->setDescription($item['description']);
$new_item->setTarget($item['target']);
$new_item->setActiveStatus($item['active']);
$new_item->setDisableCheckStatus($item['disable_check']);
$new_item->setLastCheckDate($item['last_check']);
$new_item->setValidStatus($item['valid']);
$new_item->add(true);
// Add parameters
foreach(ilParameterAppender::_getParams($item['link_id']) as $param_id => $data)
{
$appender->setName($data['name']);
$appender->setValue($data['value']);
$appender->add($new_item->getLinkId());
}
unset($new_item);
}
return true;
}

+ Here is the call graph for this function:

ilLinkResourceItems::delete (   $a_item_id,
  $a_update_history = true 
)

Definition at line 196 of file class.ilLinkResourceItems.php.

References $ilDB, $query, $res, ilHistory\_createEntry(), getItem(), and getLinkResourceId().

Referenced by ilObjLinkResourceGUI\deleteLinks().

{
global $ilDB;
$item = $this->getItem($a_item_id);
$query = "DELETE FROM webr_items ".
"WHERE webr_id = ".$ilDB->quote($this->getLinkResourceId() ,'integer')." ".
"AND link_id = ".$ilDB->quote($a_item_id ,'integer');
$res = $ilDB->manipulate($query);
if($a_update_history)
{
include_once("classes/class.ilHistory.php");
$item['title']);
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLinkResourceItems::getActivatedItems ( )

Definition at line 516 of file class.ilLinkResourceItems.php.

References getAllItems().

{
foreach($this->getAllItems() as $id => $item_data)
{
if($item_data['active'])
{
$active_items[$id] = $item_data;
}
}
return $active_items ? $active_items : array();
}

+ Here is the call graph for this function:

ilLinkResourceItems::getActiveStatus ( )

Definition at line 112 of file class.ilLinkResourceItems.php.

Referenced by add(), and update().

{
return (bool) $this->status;
}

+ Here is the caller graph for this function:

static ilLinkResourceItems::getAllItemIds (   $a_webr_id)
static

Get all link ids.

Parameters
int$a_webr_id
Returns

Definition at line 434 of file class.ilLinkResourceItems.php.

References $ilDB, $query, $res, $row, and DB_FETCHMODE_ASSOC.

{
global $ilDB;
$query = "SELECT link_id FROM webr_items ".
"WHERE webr_id = ".$ilDB->quote($a_webr_id ,'integer');
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_ASSOC))
{
$link_ids[] = $row['link_id'];
}
return (array) $link_ids;
}
ilLinkResourceItems::getAllItems ( )

Definition at line 448 of file class.ilLinkResourceItems.php.

References $ilDB, $query, $res, $row, DB_FETCHMODE_OBJECT, and getLinkResourceId().

Referenced by cloneItems(), getActivatedItems(), and getCheckItems().

{
global $ilDB;
$query = "SELECT * FROM webr_items ".
"WHERE webr_id = ".$ilDB->quote($this->getLinkResourceId() ,'integer');
$res = $this->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$items[$row->link_id]['title'] = $row->title;
$items[$row->link_id]['description'] = $row->description;
$items[$row->link_id]['target'] = $row->target;
$items[$row->link_id]['active'] = (bool) $row->active;
$items[$row->link_id]['disable_check'] = $row->disable_check;
$items[$row->link_id]['create_date'] = $row->create_date;
$items[$row->link_id]['last_update'] = $row->last_update;
$items[$row->link_id]['last_check'] = $row->last_check;
$items[$row->link_id]['valid'] = $row->valid;
$items[$row->link_id]['link_id'] = $row->link_id;
}
return $items ? $items : array();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLinkResourceItems::getCheckItems (   $a_offset = 0)

Definition at line 528 of file class.ilLinkResourceItems.php.

References getAllItems().

{
$period = $a_offset ? $a_offset : 0;
$time = time() - $period;
foreach($this->getAllItems() as $id => $item_data)
{
if(!$item_data['disable_check'])
{
if(!$item_data['last_check'] or $item_data['last_check'] < $time)
{
$check_items[$id] = $item_data;
}
}
}
return $check_items ? $check_items : array();
}

+ Here is the call graph for this function:

ilLinkResourceItems::getCreateDate ( )

Definition at line 129 of file class.ilLinkResourceItems.php.

Referenced by add().

{
return $this->c_date;
}

+ Here is the caller graph for this function:

ilLinkResourceItems::getDescription ( )

Definition at line 96 of file class.ilLinkResourceItems.php.

Referenced by add(), and update().

{
return $this->description;
}

+ Here is the caller graph for this function:

ilLinkResourceItems::getDisableCheckStatus ( )

Definition at line 120 of file class.ilLinkResourceItems.php.

Referenced by add(), and update().

{
return (bool) $this->check;
}

+ Here is the caller graph for this function:

ilLinkResourceItems::getItem (   $a_link_id)

Definition at line 404 of file class.ilLinkResourceItems.php.

References $ilDB, $query, $res, $row, DB_FETCHMODE_OBJECT, and getLinkResourceId().

Referenced by delete(), and ilObjLinkResourceGUI\setValuesFromLink().

{
global $ilDB;
$query = "SELECT * FROM webr_items ".
"WHERE webr_id = ".$ilDB->quote($this->getLinkResourceId() ,'integer')." ".
"AND link_id = ".$ilDB->quote($a_link_id ,'integer');
$res = $this->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$item['title'] = $row->title;
$item['description'] = $row->description;
$item['target'] = $row->target;
$item['active'] = (bool) $row->active;
$item['disable_check'] = $row->disable_check;
$item['create_date'] = $row->create_date;
$item['last_update'] = $row->last_update;
$item['last_check'] = $row->last_check;
$item['valid'] = $row->valid;
$item['link_id'] = $row->link_id;
}
return $item ? $item : array();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLinkResourceItems::getLastCheckDate ( )

Definition at line 146 of file class.ilLinkResourceItems.php.

Referenced by update().

{
return $this->last_check;
}

+ Here is the caller graph for this function:

ilLinkResourceItems::getLastUpdateDate ( )

Definition at line 138 of file class.ilLinkResourceItems.php.

Referenced by add(), and update().

{
return $this->m_date;
}

+ Here is the caller graph for this function:

ilLinkResourceItems::getLinkId ( )

Definition at line 80 of file class.ilLinkResourceItems.php.

Referenced by update(), updateActive(), updateDisableCheck(), and updateValid().

{
return $this->id;
}

+ Here is the caller graph for this function:

ilLinkResourceItems::getLinkResourceId ( )

Definition at line 72 of file class.ilLinkResourceItems.php.

Referenced by add(), cloneItems(), delete(), getAllItems(), getItem(), sortItems(), toXML(), update(), updateLastCheck(), and updateValidByCheck().

{
return $this->webr_id;
}

+ Here is the caller graph for this function:

ilLinkResourceItems::getLinkResourceRefId ( )

Definition at line 64 of file class.ilLinkResourceItems.php.

{
return $this->webr_ref_id;
}
ilLinkResourceItems::getTarget ( )

Definition at line 104 of file class.ilLinkResourceItems.php.

Referenced by add(), update(), and validate().

{
return $this->target;
}

+ Here is the caller graph for this function:

ilLinkResourceItems::getTitle ( )

Definition at line 88 of file class.ilLinkResourceItems.php.

References $title.

Referenced by add(), update(), and validate().

{
return $this->title;
}

+ Here is the caller graph for this function:

ilLinkResourceItems::getValidStatus ( )

Definition at line 154 of file class.ilLinkResourceItems.php.

References $valid.

Referenced by add(), and update().

{
return (bool) $this->valid;
}

+ Here is the caller graph for this function:

ilLinkResourceItems::ilLinkResourceItems (   $webr_id)

Constructor public.

Definition at line 21 of file class.ilLinkResourceItems.php.

References $ilDB.

Referenced by cloneItems().

{
global $ilDB;
$this->webr_ref_id = 0;
$this->webr_id = $webr_id;
$this->db =& $ilDB;
}

+ Here is the caller graph for this function:

static ilLinkResourceItems::lookupItem (   $a_webr_id,
  $a_link_id 
)
static

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

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilObjLinkResourceSubItemListGUI\getHTML(), and toXML().

{
global $ilDB;
$query = "SELECT * FROM webr_items ".
"WHERE webr_id = ".$ilDB->quote($a_webr_id ,'integer')." ".
"AND link_id = ".$ilDB->quote($a_link_id ,'integer');
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$item['title'] = $row->title;
$item['description'] = $row->description;
$item['target'] = $row->target;
$item['active'] = (bool) $row->active;
$item['disable_check'] = $row->disable_check;
$item['create_date'] = $row->create_date;
$item['last_update'] = $row->last_update;
$item['last_check'] = $row->last_check;
$item['valid'] = $row->valid;
$item['link_id'] = $row->link_id;
}
return $item ? $item : array();
}

+ Here is the caller graph for this function:

static ilLinkResourceItems::lookupNumberOfLinks (   $a_webr_id)
static

Get number of assigned links.

Parameters
int$a_webr_id
Returns

Definition at line 580 of file class.ilLinkResourceItems.php.

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilObjLinkResourceGUI\activateTabs(), ilObjLinkResourceGUI\isContainerMetaDataRequired(), ilObjLinkResource\MDUpdateListener(), and ilObjLinkResourceGUI\setTabs().

{
global $ilDB;
$query = "SELECT COUNT(*) num FROM webr_items ".
"WHERE webr_id = ".$ilDB->quote($a_webr_id,'integer');
$res = $ilDB->query($query);
return $row->num;
}

+ Here is the caller graph for this function:

ilLinkResourceItems::readItem (   $a_link_id)

Definition at line 379 of file class.ilLinkResourceItems.php.

References $ilDB, $query, $res, $row, __setCreateDate(), __setLastUpdateDate(), DB_FETCHMODE_OBJECT, setActiveStatus(), setDescription(), setDisableCheckStatus(), setLastCheckDate(), setLinkId(), setTarget(), setTitle(), and setValidStatus().

{
global $ilDB;
$query = "SELECT * FROM webr_items ".
"WHERE link_id = ".$ilDB->quote($a_link_id ,'integer');
$res = $this->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->setTitle($row->title);
$this->setDescription($row->description);
$this->setTarget($row->target);
$this->setActiveStatus($row->active);
$this->setDisableCheckStatus($row->disable_check);
$this->__setCreateDate($row->create_date);
$this->__setLastUpdateDate($row->last_update);
$this->setLastCheckDate($row->last_check);
$this->setValidStatus($row->valid);
$this->setLinkId($row->link_id);
}
return true;
}

+ Here is the call graph for this function:

ilLinkResourceItems::setActiveStatus (   $a_status)

Definition at line 108 of file class.ilLinkResourceItems.php.

Referenced by readItem().

{
$this->status = (int) $a_status;
}

+ Here is the caller graph for this function:

ilLinkResourceItems::setDescription (   $a_description)

Definition at line 92 of file class.ilLinkResourceItems.php.

Referenced by readItem().

{
$this->description = $a_description;
}

+ Here is the caller graph for this function:

ilLinkResourceItems::setDisableCheckStatus (   $a_status)

Definition at line 116 of file class.ilLinkResourceItems.php.

Referenced by readItem().

{
$this->check = (int) $a_status;
}

+ Here is the caller graph for this function:

ilLinkResourceItems::setLastCheckDate (   $a_date)

Definition at line 142 of file class.ilLinkResourceItems.php.

Referenced by readItem().

{
$this->last_check = $a_date;
}

+ Here is the caller graph for this function:

ilLinkResourceItems::setLinkId (   $a_id)

Definition at line 76 of file class.ilLinkResourceItems.php.

Referenced by add(), and readItem().

{
$this->id = $a_id;
}

+ Here is the caller graph for this function:

ilLinkResourceItems::setLinkResourceId (   $a_id)

Definition at line 68 of file class.ilLinkResourceItems.php.

{
$this->webr_id = $a_id;
}
ilLinkResourceItems::setLinkResourceRefId (   $a_ref_id)

Definition at line 60 of file class.ilLinkResourceItems.php.

{
$this->webr_ref_id = $a_ref_id;
}
ilLinkResourceItems::setTarget (   $a_target)

Definition at line 100 of file class.ilLinkResourceItems.php.

Referenced by readItem().

{
$this->target = $a_target;
}

+ Here is the caller graph for this function:

ilLinkResourceItems::setTitle (   $a_title)

Definition at line 84 of file class.ilLinkResourceItems.php.

Referenced by readItem().

{
$this->title = $a_title;
}

+ Here is the caller graph for this function:

ilLinkResourceItems::setValidStatus (   $a_status)

Definition at line 150 of file class.ilLinkResourceItems.php.

Referenced by readItem().

{
$this->valid = (int) $a_status;
}

+ Here is the caller graph for this function:

ilLinkResourceItems::sortItems (   $a_items)

Sort items (sorting mode depends on sorting setting)

Parameters
object$a_items
Returns

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

References ilContainerSortingSettings\_lookupSortMode(), getLinkResourceId(), ilContainerSorting\lookupPositions(), ilContainer\SORT_MANUAL, ilContainer\SORT_TITLE, and ilUtil\sortArray().

{
include_once './Services/Container/classes/class.ilContainer.php';
include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
{
$a_items = ilUtil::sortArray($a_items, 'title','asc',false,true);
return $a_items;
}
{
include_once './Services/Container/classes/class.ilContainerSorting.php';
foreach($a_items as $link_id => $item)
{
if(isset($pos[$link_id]))
{
$sorted[$link_id] = $item;
$sorted[$link_id]['position'] = $pos[$link_id];
}
else
{
$unsorted[$link_id] = $item;
}
}
$sorted = ilUtil::sortArray((array) $sorted, 'position','asc',true,true);
$unsorted = ilUtil::sortArray((array) $unsorted, 'title','asc',false,true);
$a_items = (array) $sorted + (array) $unsorted;
return $a_items;
}
return $a_items;
}

+ Here is the call graph for this function:

ilLinkResourceItems::toXML ( ilXmlWriter  $writer)

Write link XML.

Parameters
ilXmlWriter$writer
Returns

Definition at line 622 of file class.ilLinkResourceItems.php.

References ilParameterAppender\_getParams(), getLinkResourceId(), LINKS_LOGIN, LINKS_MATRICULATION, LINKS_USER_ID, lookupItem(), ilXmlWriter\xmlElement(), ilXmlWriter\xmlEndTag(), and ilXmlWriter\xmlStartTag().

{
foreach(self::getAllItemIds($this->getLinkResourceId()) as $link_id)
{
$link = self::lookupItem($this->getLinkResourceId(), $link_id);
$writer->xmlStartTag(
'WebLink',
array(
'id' => $link['link_id'],
'active' => $link['active'] ? 1 : 0,
'valid' => $link['valid'] ? 1 : 0,
'disableValidation' => $link['disable_check'] ? 1 : 0,
# 'action' => 'Delete'
)
);
$writer->xmlElement('Title',array(),$link['title']);
$writer->xmlElement('Description',array(),$link['description']);
$writer->xmlElement('Target',array(),$link['target']);
// Dynamic parameters
include_once './Modules/WebResource/classes/class.ilParameterAppender.php';
foreach(ilParameterAppender::_getParams($link_id) as $param_id => $param)
{
$value = '';
switch($param['value'])
{
$value = 'userId';
break;
$value = 'userName';
break;
$value = 'matriculation';
break;
}
if(!$value)
{
// Fix for deprecated LINKS_SESSION
continue;
}
$writer->xmlElement(
'DynamicParameter',
array(
'id' => $param_id,
'name' => $param['name'],
'type' => $value
)
);
}
$writer->xmlEndTag('WebLink');
}
return true;
}

+ Here is the call graph for this function:

ilLinkResourceItems::update (   $a_update_history = true)

Definition at line 217 of file class.ilLinkResourceItems.php.

References $ilDB, $query, $res, __setLastUpdateDate(), ilHistory\_createEntry(), getActiveStatus(), getDescription(), getDisableCheckStatus(), getLastCheckDate(), getLastUpdateDate(), getLinkId(), getLinkResourceId(), getTarget(), getTitle(), and getValidStatus().

{
global $ilDB;
if(!$this->getLinkId())
{
return false;
}
$this->__setLastUpdateDate(time());
$query = "UPDATE webr_items ".
"SET title = ".$ilDB->quote($this->getTitle() ,'text').", ".
"description = ".$ilDB->quote($this->getDescription() ,'text').", ".
"target = ".$ilDB->quote($this->getTarget() ,'text').", ".
"active = ".$ilDB->quote($this->getActiveStatus() ,'integer').", ".
"valid = ".$ilDB->quote($this->getValidStatus() ,'integer').", ".
"disable_check = ".$ilDB->quote($this->getDisableCheckStatus() ,'integer').", ".
"last_update = ".$ilDB->quote($this->getLastUpdateDate() ,'integer').", ".
"last_check = ".$ilDB->quote($this->getLastCheckDate() ,'integer')." ".
"WHERE link_id = ".$ilDB->quote($this->getLinkId() ,'integer')." ".
"AND webr_id = ".$ilDB->quote($this->getLinkResourceId() ,'integer');
$res = $ilDB->manipulate($query);
if($a_update_history)
{
include_once("classes/class.ilHistory.php");
$this->getTitle());
}
return true;
}

+ Here is the call graph for this function:

ilLinkResourceItems::updateActive (   $a_status)

Definition at line 262 of file class.ilLinkResourceItems.php.

References $ilDB, $query, and getLinkId().

{
global $ilDB;
$query = "UPDATE webr_items ".
"SET active = ".$ilDB->quote($a_status ,'integer')." ".
"WHERE link_id = ".$ilDB->quote($this->getLinkId() ,'integer');
$this->db->query($query);
return true;
}

+ Here is the call graph for this function:

ilLinkResourceItems::updateDisableCheck (   $a_status)

Definition at line 274 of file class.ilLinkResourceItems.php.

References $ilDB, $query, $res, and getLinkId().

{
global $ilDB;
$query = "UPDATE webr_items ".
"SET disable_check = ".$ilDB->quote($a_status ,'integer')." ".
"WHERE link_id = ".$ilDB->quote($this->getLinkId() ,'integer');
$res = $ilDB->manipulate($query);
return true;
}

+ Here is the call graph for this function:

ilLinkResourceItems::updateLastCheck (   $a_offset = 0)

Definition at line 286 of file class.ilLinkResourceItems.php.

References $ilDB, $query, $res, and getLinkResourceId().

{
global $ilDB;
if($a_offset)
{
$period = $a_offset ? $a_offset : 0;
$time = time() - $period;
$query = "UPDATE webr_items ".
"SET last_check = ".$ilDB->quote(time() ,'integer')." ".
"WHERE webr_id = ".$ilDB->quote($this->getLinkResourceId() ,'integer')." ".
"AND disable_check = '0' ".
"AND last_check < ".$ilDB->quote($time ,'integer');
$res = $ilDB->manipulate($query);
}
else
{
$query = "UPDATE webr_items ".
"SET last_check = ".$ilDB->quote(time() ,'integer')." ".
"WHERE webr_id = ".$ilDB->quote($this->getLinkResourceId() ,'integer')." ".
"AND disable_check = '0' ";
$res = $ilDB->manipulate($query);
}
return true;
}

+ Here is the call graph for this function:

ilLinkResourceItems::updateValid (   $a_status)

Definition at line 250 of file class.ilLinkResourceItems.php.

References $ilDB, $query, $res, and getLinkId().

{
global $ilDB;
$query = "UPDATE webr_items ".
"SET valid = ".$ilDB->quote($a_status ,'integer')." ".
"WHERE link_id = ".$ilDB->quote($this->getLinkId() ,'integer');
$res = $ilDB->manipulate($query);
return true;
}

+ Here is the call graph for this function:

ilLinkResourceItems::updateValidByCheck (   $a_offset = 0)

Definition at line 314 of file class.ilLinkResourceItems.php.

References $ilDB, $query, $res, and getLinkResourceId().

{
global $ilDB;
if($a_offset)
{
$period = $a_offset ? $a_offset : 0;
$time = time() - $period;
$query = "UPDATE webr_items ".
"SET valid = '1' ".
"WHERE disable_check = '0' ".
"AND webr_id = ".$ilDB->quote($this->getLinkResourceId() ,'integer')." ".
"AND last_check < ".$ilDB->quote($time ,'integer');
$res = $ilDB->manipulate($query);
}
else
{
$query = "UPDATE webr_items ".
"SET valid = '1' ".
"WHERE disable_check = '0' ".
"AND webr_id = ".$ilDB->quote($this->getLinkResourceId() ,'integer');
$res = $ilDB->manipulate($query);
}
return true;
}

+ Here is the call graph for this function:

ilLinkResourceItems::validate ( )

Validate required settings.

Returns

Definition at line 611 of file class.ilLinkResourceItems.php.

References getTarget(), and getTitle().

{
return $this->getTarget() and $this->getTitle();
}

+ Here is the call graph for this function:


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