ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilParameterAppender Class Reference

Class ilParameterAppender. More...

+ Collaboration diagram for ilParameterAppender:

Public Member Functions

 ilParameterAppender ($webr_id)
 Constructor public.
 getErrorCode ()
 getObjId ()
 setName ($a_name)
 getName ()
 setValue ($a_value)
 getValue ()
 validate ()
 add ($a_link_id)
 delete ($a_param_id)
 _isEnabled ()
_append (&$a_link_data)
 _getParams ($a_link_id)
 _deleteAll ($a_webr_id)
 _getOptionSelect ()

Data Fields

 $webr_id = null
 $db = null
 $err = null

Detailed Description

Class ilParameterAppender.

Author
Stefan Meyer smeye.nosp@m.r@da.nosp@m.tabay.nosp@m..de
Version
Id:
class.ilParameterAppender.php 15697 2008-01-08 20:04:33Z hschottm

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

Member Function Documentation

& ilParameterAppender::_append ( $a_link_data)

Definition at line 152 of file class.ilParameterAppender.php.

References _getParams(), LINKS_LOGIN, LINKS_SESSION_ID, and LINKS_USER_ID.

Referenced by ilObjLinkResourceListGUI\__readLink(), and ilObjLinkResourceGUI\listItemsObject().

{
global $ilUser;
if(!is_array($a_link_data))
{
return false;
}
if(count($params = ilParameterAppender::_getParams($a_link_data['link_id'])))
{
// Check for prefix
foreach($params as $param_data)
{
if(!strpos($a_link_data['target'],'?'))
{
$a_link_data['target'] .= "?";
}
else
{
$a_link_data['target'] .= "&";
}
$a_link_data['target'] .= ($param_data['name']."=");
switch($param_data['value'])
{
$a_link_data['target'] .= (urlencode($ilUser->getLogin()));
break;
$a_link_data['target'] .= (session_id());
break;
$a_link_data['target'] .= ($ilUser->getId());
break;
}
}
}
return $a_link_data;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilParameterAppender::_deleteAll (   $a_webr_id)

Definition at line 208 of file class.ilParameterAppender.php.

{
global $ilDB;
$ilDB->query("DELETE FROM webr_params WHERE webr_id = ".
$ilDB->quote((int) $a_webr_id));
return true;
}
ilParameterAppender::_getOptionSelect ( )

Definition at line 218 of file class.ilParameterAppender.php.

References $lng, LINKS_LOGIN, LINKS_SESSION_ID, and LINKS_USER_ID.

Referenced by ilObjLinkResourceGUI\editItemObject(), and ilObjLinkResourceGUI\showAddItemObject().

{
global $lng;
return array(0 => $lng->txt('links_select_one'),
LINKS_USER_ID => $lng->txt('links_user_id'),
LINKS_LOGIN => $lng->txt('links_user_name'),
LINKS_SESSION_ID => $lng->txt('links_session_id'));
}

+ Here is the caller graph for this function:

ilParameterAppender::_getParams (   $a_link_id)

Definition at line 193 of file class.ilParameterAppender.php.

References $res, and DB_FETCHMODE_OBJECT.

Referenced by _append(), ilLinkResourceItems\cloneItems(), ilObjLinkResourceGUI\editItemObject(), and ilObjLinkResourceGUI\editItemsObject().

{
global $ilDB;
$res = $ilDB->query("SELECT * FROM webr_params WHERE link_id = ".
$ilDB->quote((int) $a_link_id));
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$params[$row->param_id]['name'] = $row->name;
$params[$row->param_id]['value'] = $row->value;
}
return count($params) ? $params : array();
}

+ Here is the caller graph for this function:

ilParameterAppender::_isEnabled ( )
ilParameterAppender::add (   $a_link_id)

Definition at line 110 of file class.ilParameterAppender.php.

References getName(), getObjId(), and getValue().

{
global $ilDB;
if(!$a_link_id)
{
return false;
}
if(!strlen($this->getName() or !strlen($this->getValue())))
{
return false;
}
$query = "INSERT INTO webr_params ".
"SET webr_id = ".$ilDB->quote($this->getObjId()).", ".
"link_id = ".$ilDB->quote($a_link_id).", ".
"name = ".$ilDB->quote($this->getName()).", ".
"value = ".$ilDB->quote($this->getValue());
$this->db->query($query);
return $this->db->getLastInsertId();
}

+ Here is the call graph for this function:

ilParameterAppender::delete (   $a_param_id)

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

References getObjId().

Referenced by ilObjLinkResourceGUI\deleteParameterObject().

{
global $ilDB;
$this->db->query("DELETE FROM webr_params WHERE param_id = ".
$ilDB->quote((int) $a_param_id)." AND webr_id = ".$ilDB->quote($this->getObjId()));
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilParameterAppender::getErrorCode ( )

Definition at line 61 of file class.ilParameterAppender.php.

References $err.

{
return $this->err;
}
ilParameterAppender::getName ( )

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

Referenced by add(), and validate().

{
return $this->name;
}

+ Here is the caller graph for this function:

ilParameterAppender::getObjId ( )

Definition at line 67 of file class.ilParameterAppender.php.

References $webr_id.

Referenced by add(), and delete().

{
}

+ Here is the caller graph for this function:

ilParameterAppender::getValue ( )

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

Referenced by add(), and validate().

{
return $this->value;
}

+ Here is the caller graph for this function:

ilParameterAppender::ilParameterAppender (   $webr_id)

Constructor public.

Definition at line 53 of file class.ilParameterAppender.php.

References $webr_id.

{
global $ilDB;
$this->webr_id = $webr_id;
$this->db =& $ilDB;
}
ilParameterAppender::setName (   $a_name)

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

Referenced by ilObjLinkResourceGUI\addItemObject(), and ilObjLinkResourceGUI\updateItemObject().

{
$this->name = $a_name;
}

+ Here is the caller graph for this function:

ilParameterAppender::setValue (   $a_value)

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

{
$this->value = $a_value;
}
ilParameterAppender::validate ( )

Definition at line 89 of file class.ilParameterAppender.php.

References getName(), getValue(), LINKS_ERR_NO_NAME, LINKS_ERR_NO_NAME_VALUE, and LINKS_ERR_NO_VALUE.

{
if(!strlen($this->getName()) and !$this->getValue())
{
return false;
}
if(!strlen($this->getName()))
{
$this->err = LINKS_ERR_NO_NAME;
return false;
}
if(!$this->getValue())
{
$this->err = LINKS_ERR_NO_VALUE;
return false;
}
return true;
}

+ Here is the call graph for this function:

Field Documentation

ilParameterAppender::$db = null

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

ilParameterAppender::$err = null

Definition at line 46 of file class.ilParameterAppender.php.

Referenced by getErrorCode().

ilParameterAppender::$webr_id = null

Definition at line 43 of file class.ilParameterAppender.php.

Referenced by getObjId(), and ilParameterAppender().


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