ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilContainerSortingSettings Class Reference
+ Collaboration diagram for ilContainerSortingSettings:

Public Member Functions

 __construct ($a_obj_id)
 Constructor.
 _isManualSortingEnabled ($a_obj_id)
 is manual sorting enabled
 getSortMode ()
 get sort mode
 setSortMode ($a_mode)
 set sort mode
 update ()
 Update.
 save ()
 save settings

Static Public Member Functions

static _lookupSortMode ($a_obj_id)
 lookup sort mode
static _cloneSettings ($a_old_id, $a_new_id)
 Clone settings.

Protected Attributes

 $obj_id
 $sort_mode
 $db

Private Member Functions

 read ()
 read settings

Detailed Description

Definition at line 33 of file class.ilContainerSortingSettings.php.

Constructor & Destructor Documentation

ilContainerSortingSettings::__construct (   $a_obj_id)

Constructor.

public

Parameters

Definition at line 47 of file class.ilContainerSortingSettings.php.

References read().

{
global $ilDB;
$this->obj_id = $a_obj_id;
$this->db = $ilDB;
$this->read();
}

+ Here is the call graph for this function:

Member Function Documentation

static ilContainerSortingSettings::_cloneSettings (   $a_old_id,
  $a_new_id 
)
static

Clone settings.

public

Parameters
intorig obj_id @þaram int new obj_id

Definition at line 111 of file class.ilContainerSortingSettings.php.

References $ilLog, and $res.

{
global $ilLog;
global $ilDB;
$query = "SELECT sort_mode FROM container_sorting_settings ".
"WHERE obj_id = ".$ilDB->quote($a_old_id)." ";
$res = $ilDB->query($query);
while($row = $res->fetchRow())
{
$query = "REPLACE INTO container_sorting_settings ".
"SET obj_id = ".$ilDB->quote($a_new_id).", ".
"sort_mode = ".$ilDB->quote($row[0])." ";
$ilDB->query($query);
}
return true;
}
ilContainerSortingSettings::_isManualSortingEnabled (   $a_obj_id)

is manual sorting enabled

public

Parameters
intobj_id

Definition at line 97 of file class.ilContainerSortingSettings.php.

References _lookupSortMode(), and ilContainer\SORT_MANUAL.

Referenced by ilContainerSorting\read().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilContainerSortingSettings::_lookupSortMode (   $a_obj_id)
static

lookup sort mode

public

Parameters
intobj_id

Definition at line 65 of file class.ilContainerSortingSettings.php.

References $ref_id, $res, ilObject\_getAllReferences(), ilObject\_lookupObjId(), DB_FETCHMODE_OBJECT, and ilContainer\SORT_TITLE.

Referenced by _isManualSortingEnabled(), ilContainerGUI\addStandardRow(), ilObjFolder\read(), ilContainerSorting\read(), ilObjGroup\read(), and ilContainer\read().

{
global $tree;
global $ilDB;
$ref_ids = ilObject::_getAllReferences($a_obj_id);
$ref_id = current($ref_ids);
if($course_ref_id = $tree->checkForParentType($ref_id,'crs'))
{
$a_obj_id = ilObject::_lookupObjId($course_ref_id);
}
$query = "SELECT * FROM container_sorting_settings ".
"WHERE obj_id = ".$ilDB->quote($a_obj_id)." ";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->sort_mode;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilContainerSortingSettings::getSortMode ( )

get sort mode

public

Definition at line 136 of file class.ilContainerSortingSettings.php.

{
return $this->sort_mode ? $this->sort_mode : 0;
}
ilContainerSortingSettings::read ( )
private

read settings

private

Parameters

Definition at line 188 of file class.ilContainerSortingSettings.php.

References $res, and DB_FETCHMODE_OBJECT.

Referenced by __construct().

{
if(!$this->obj_id)
{
return true;
}
$query = "SELECT * FROM container_sorting_settings ".
"WHERE obj_id = ".$this->db->quote($this->obj_id)." ";
$res = $this->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->sort_mode = $row->sort_mode;
}
}

+ Here is the caller graph for this function:

ilContainerSortingSettings::save ( )

save settings

public

Definition at line 173 of file class.ilContainerSortingSettings.php.

{
$query = "INSERT INTO container_sorting_settings ".
"SET obj_id = ".$this->db->quote($this->obj_id).", ".
"sort_mode = ".$this->db->quote($this->sort_mode)." ";
$this->db->query($query);
}
ilContainerSortingSettings::setSortMode (   $a_mode)

set sort mode

public

Parameters
intMODE_TITLE | MODE_MANUAL | MODE_ACTIVATION

Definition at line 148 of file class.ilContainerSortingSettings.php.

Referenced by ilContainer\cloneObject(), ilObjCategoryGUI\saveObject(), ilObjRootFolderGUI\updateObject(), and ilObjCategoryGUI\updateObject().

{
$this->sort_mode = (int) $a_mode;
}

+ Here is the caller graph for this function:

ilContainerSortingSettings::update ( )

Update.

public

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

{
$query = "REPLACE INTO container_sorting_settings ".
"SET obj_id = ".$this->db->quote($this->obj_id).", ".
"sort_mode = ".$this->db->quote($this->sort_mode)." ";
$this->db->query($query);
}

Field Documentation

ilContainerSortingSettings::$db
protected

Definition at line 38 of file class.ilContainerSortingSettings.php.

ilContainerSortingSettings::$obj_id
protected

Definition at line 35 of file class.ilContainerSortingSettings.php.

ilContainerSortingSettings::$sort_mode
protected

Definition at line 36 of file class.ilContainerSortingSettings.php.


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