ILIAS  Release_4_2_x_branch Revision 61807
 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
 delete ()
 Delete setting.

Static Public Member Functions

static _readSortMode ($a_obj_id)
static _lookupSortMode ($a_obj_id)
 lookup sort mode
static lookupSortModeFromParentContainer ($a_obj_id)
 Lookup sort mode from parent container.
static _cloneSettings ($a_old_id, $a_new_id)
 Clone settings.
static sortModeToString ($a_sort_mode)
 get String representation of sort mode

Protected Attributes

 $obj_id
 $sort_mode
 $db

Private Member Functions

 read ()
 read settings

Detailed Description

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

Constructor & Destructor Documentation

ilContainerSortingSettings::__construct (   $a_obj_id)

Constructor.

public

Parameters

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

References $ilDB, and 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 157 of file class.ilContainerSortingSettings.php.

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

{
global $ilLog;
global $ilDB;
$query = "SELECT sort_mode FROM container_sorting_set ".
"WHERE obj_id = ".$ilDB->quote($a_old_id ,'integer')." ";
$res = $ilDB->query($query);
while($row = $res->fetchRow())
{
$query = "DELETE FROM container_sorting_set ".
"WHERE obj_id = ".$ilDB->quote($a_new_id)." ";
$ilDB->manipulate($query);
$query = "INSERT INTO container_sorting_set (obj_id,sort_mode) ".
"VALUES( ".
$ilDB->quote($a_new_id ,'integer').", ".
$ilDB->quote($row[0] ,'integer')." ".
")";
$ilDB->manipulate($query);
}
return true;
}
ilContainerSortingSettings::_isManualSortingEnabled (   $a_obj_id)

is manual sorting enabled

public

Parameters
intobj_id

Definition at line 143 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 83 of file class.ilContainerSortingSettings.php.

References $ilDB, $query, $res, $row, DB_FETCHMODE_OBJECT, lookupSortModeFromParentContainer(), and ilContainer\SORT_INHERIT.

Referenced by ilCourseItems\__sort(), _isManualSortingEnabled(), ilObjLinkResourceGUI\activateTabs(), ilContainerGUI\addStandardRow(), ilObjLinkResourceGUI\initFormSettings(), ilWebResourceLinkTableGUI\initSorting(), ilObjFolder\read(), ilContainerSorting\read(), ilObjGroup\read(), ilContainer\read(), ilLinkResourceItems\sortItems(), and ilObjLinkResource\toXML().

{
global $tree, $ilDB, $objDefinition;
// Try to read from table
$query = "SELECT * FROM container_sorting_set ".
"WHERE obj_id = ".$ilDB->quote($a_obj_id ,'integer')." ";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
if($row->sort_mode != ilContainer::SORT_INHERIT)
{
return $row->sort_mode;
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilContainerSortingSettings::_readSortMode (   $a_obj_id)
static

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

References $ilDB, $query, $res, $row, DB_FETCHMODE_OBJECT, and ilContainer\SORT_INHERIT.

Referenced by ilObjGroupGUI\initForm().

{
global $ilDB;
$query = "SELECT * FROM container_sorting_set ".
"WHERE obj_id = ".$ilDB->quote($a_obj_id ,'integer')." ";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->sort_mode;
}
}

+ Here is the caller graph for this function:

ilContainerSortingSettings::delete ( )

Delete setting.

Returns

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

References $ilDB, and $query.

{
global $ilDB;
$query = 'DELETE FROM container_sorting_set WHERE obj_id = '.$ilDB->quote($this->obj_id,'integer');
$ilDB->query($query);
}
ilContainerSortingSettings::getSortMode ( )

get sort mode

public

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

Referenced by ilObjFolderGUI\getEditFormCustomValues().

{
return $this->sort_mode ? $this->sort_mode : 0;
}

+ Here is the caller graph for this function:

static ilContainerSortingSettings::lookupSortModeFromParentContainer (   $a_obj_id)
static

Lookup sort mode from parent container.

Parameters
object$a_obj_id
Returns

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

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

Referenced by _lookupSortMode(), ilObjFolderGUI\initEditCustomForm(), and ilObjGroupGUI\initForm().

{
global $tree, $ilDB, $objDefinition;
if(!$objDefinition->isContainer(ilObject::_lookupType($a_obj_id)))
{
}
$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_set ".
"WHERE obj_id = ".$ilDB->quote($a_obj_id ,'integer')." ";
$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::read ( )
private

read settings

private

Parameters

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

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

Referenced by __construct().

{
if(!$this->obj_id)
{
return true;
}
$query = "SELECT * FROM container_sorting_set ".
"WHERE obj_id = ".$this->db->quote($this->obj_id ,'integer')." ";
$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 227 of file class.ilContainerSortingSettings.php.

References $ilDB, $query, and $res.

Referenced by update().

{
global $ilDB;
$query = "INSERT INTO container_sorting_set (obj_id,sort_mode) ".
"VALUES ( ".
$this->db->quote($this->obj_id ,'integer').", ".
$this->db->quote($this->sort_mode ,'integer')." ".
")";
$res = $ilDB->manipulate($query);
}

+ Here is the caller graph for this function:

ilContainerSortingSettings::setSortMode (   $a_mode)

set sort mode

public

Parameters
intMODE_TITLE | MODE_MANUAL | MODE_ACTIVATION

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

Referenced by ilObjCategoryGUI\afterSave(), ilContainer\cloneObject(), ilObjGroupGUI\saveObject(), ilObjLinkResourceGUI\saveSettings(), ilObjFolderGUI\updateCustom(), ilObjRootFolderGUI\updateObject(), ilObjGroupGUI\updateObject(), and ilObjCategoryGUI\updateObject().

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

+ Here is the caller graph for this function:

static ilContainerSortingSettings::sortModeToString (   $a_sort_mode)
static

get String representation of sort mode

Parameters
int$a_sort_mode
Returns

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

References $lng, ilContainer\SORT_ACTIVATION, ilContainer\SORT_MANUAL, and ilContainer\SORT_TITLE.

Referenced by ilObjFolderGUI\initEditCustomForm().

{
global $lng;
$lng->loadLanguageModule('crs');
switch($a_sort_mode)
{
return $lng->txt('crs_sort_activation');
return $lng->txt('crs_sort_manual');
return $lng->txt('crs_sort_title');
}
return '';
}

+ Here is the caller graph for this function:

ilContainerSortingSettings::update ( )

Update.

public

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

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

{
global $ilDB;
$query = "DELETE FROM container_sorting_set ".
"WHERE obj_id = ".$ilDB->quote($this->obj_id,'integer');
$res = $ilDB->manipulate($query);
$this->save();
}

+ Here is the call graph for this function:

Field Documentation

ilContainerSortingSettings::$db
protected

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

ilContainerSortingSettings::$obj_id
protected

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

ilContainerSortingSettings::$sort_mode
protected

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


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