ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilBlockSetting Class Reference

Block Setting class. More...

+ Collaboration diagram for ilBlockSetting:

Public Member Functions

 preloadPDBlockSettings ()
 Preload pd info.

Static Public Member Functions

static _lookup ($a_type, $a_setting, $a_user=0, $a_block_id=0)
 Lookup setting from database.
static _write ($a_type, $a_setting, $a_value, $a_user=0, $a_block_id=0)
 Write setting to database.
static _lookupDetailLevel ($a_type, $a_user=0, $a_block_id=0)
 Lookup detail level.
static _writeDetailLevel ($a_type, $a_value, $a_user=0, $a_block_id=0)
 Write detail level to database.
static _lookupNr ($a_type, $a_user=0, $a_block_id=0)
 Lookup number.
static _writeNumber ($a_type, $a_value, $a_user=0, $a_block_id=0)
 Write number to database.
static _lookupSide ($a_type, $a_user=0, $a_block_id=0)
 Lookup side.
static _writeSide ($a_type, $a_value, $a_user=0, $a_block_id=0)
 Write side to database.
static _deleteSettingsOfUser ($a_user)
 Delete block settings of user.
static _deleteSettingsOfBlock ($a_block_id, $a_block_type)
 Delete block settings of block.

Static Public Attributes

static $setting = array()
static $pd_preloaded = false

Detailed Description

Block Setting class.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 31 of file class.ilBlockSetting.php.

Member Function Documentation

static ilBlockSetting::_deleteSettingsOfBlock (   $a_block_id,
  $a_block_type 
)
static

Delete block settings of block.

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

References $ilDB.

Referenced by ilObjExternalFeed\delete(), and ilObject\delete().

{
global $ilDB;
if ($a_block_id > 0)
{
$ilDB->manipulate("DELETE FROM il_block_setting WHERE block_id = ".
$ilDB->quote($a_block_id, "integer").
" AND type = ".$ilDB->quote($a_block_type, "text"));
}
}

+ Here is the caller graph for this function:

static ilBlockSetting::_deleteSettingsOfUser (   $a_user)
static

Delete block settings of user.

Definition at line 209 of file class.ilBlockSetting.php.

References $ilDB.

Referenced by ilObjUser\delete().

{
global $ilDB;
if ($a_user > 0)
{
$ilDB->manipulate("DELETE FROM il_block_setting WHERE user_id = ".
$ilDB->quote($a_user, "integer"));
}
}

+ Here is the caller graph for this function:

static ilBlockSetting::_lookup (   $a_type,
  $a_setting,
  $a_user = 0,
  $a_block_id = 0 
)
static

Lookup setting from database.

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

References $ilDB.

Referenced by ilNewsItem\_getDefaultVisibilityForRefId(), _lookupDetailLevel(), _lookupNr(), _lookupSide(), ilNewsItem\_lookupUserPDPeriod(), ilNewsForContextTableGUI\fillRow(), ilPDNewsTableGUI\fillRow(), ilNewsForContextBlockGUI\getHTML(), ilNewsItem\getNewsForRefId(), ilNewsForContextBlockGUI\handleView(), ilObjectFeedWriter\ilObjectFeedWriter(), ilNewsForContextBlockGUI\initSettingsForm(), ilObjMediaCastGUI\initSettingsForm(), ilObjMediaCastGUI\listItemsObject(), ilNewsItem\queryNewsForContext(), ilNewsItem\queryNewsForMultipleContexts(), and ilNewsForContextBlockGUI\showNews().

{
global $ilDB;
$key = $a_type.":".$a_setting.":".$a_user.":".$a_block_id;
if (isset(self::$setting[$key]))
{
return self::$setting[$key];
}
$set = $ilDB->query(sprintf("SELECT value FROM il_block_setting WHERE type = %s ".
"AND user_id = %s AND setting = %s AND block_id = %s",
$ilDB->quote($a_type, "text"),
$ilDB->quote($a_user, "integer"),
$ilDB->quote($a_setting, "text"),
$ilDB->quote($a_block_id, "integer")));
if ($rec = $ilDB->fetchAssoc($set))
{
self::$setting[$key] = $rec["value"];
return $rec["value"];
}
else
{
self::$setting[$key] = false;
return false;
}
}

+ Here is the caller graph for this function:

static ilBlockSetting::_lookupDetailLevel (   $a_type,
  $a_user = 0,
  $a_block_id = 0 
)
static

Lookup detail level.

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

References _lookup().

Referenced by ilColumnGUI\addHiddenBlockSelector(), ilBlockGUI\handleDetailLevel(), ilColumnGUI\moveBlock(), and ilColumnGUI\showBlocks().

{
$detail = ilBlockSetting::_lookup($a_type, "detail", $a_user, $a_block_id);
if ($detail === false) // return a level of 2 (standard value)
{ // if record does not exist
return 2;
}
else
{
return $detail;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilBlockSetting::_lookupNr (   $a_type,
  $a_user = 0,
  $a_block_id = 0 
)
static

Lookup number.

Definition at line 169 of file class.ilBlockSetting.php.

References _lookup().

Referenced by ilColumnGUI\determineBlocks().

{
$nr = ilBlockSetting::_lookup($a_type, "nr", $a_user, $a_block_id);
return $nr;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilBlockSetting::_lookupSide (   $a_type,
  $a_user = 0,
  $a_block_id = 0 
)
static

Lookup side.

Definition at line 189 of file class.ilBlockSetting.php.

References _lookup().

Referenced by ilColumnGUI\determineBlocks().

{
$side = ilBlockSetting::_lookup($a_type, "side", $a_user, $a_block_id);
return $side;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilBlockSetting::_write (   $a_type,
  $a_setting,
  $a_value,
  $a_user = 0,
  $a_block_id = 0 
)
static

Write setting to database.

Definition at line 121 of file class.ilBlockSetting.php.

References $ilDB.

Referenced by _writeDetailLevel(), _writeNumber(), _writeSide(), ilObjFile\createProperties(), ilObjForum\createSettings(), ilNewsForContextBlockGUI\hideNotifications(), ilPDNewsBlockGUI\saveSettings(), ilNewsForContextBlockGUI\saveSettings(), ilObjMediaCastGUI\saveSettingsObject(), and ilNewsForContextBlockGUI\showNotifications().

{
global $ilDB;
$ilDB->manipulate(sprintf("DELETE FROM il_block_setting WHERE type = %s AND user_id = %s AND block_id = %s AND setting = %s",
$ilDB->quote($a_type, "text"),
$ilDB->quote($a_user, "integer"),
$ilDB->quote((int) $a_block_id, "integer"),
$ilDB->quote($a_setting, "text")));
$ilDB->manipulate(sprintf("INSERT INTO il_block_setting (type, user_id, setting, block_id, value) VALUES (%s,%s,%s,%s,%s)",
$ilDB->quote($a_type, "text"),
$ilDB->quote($a_user, "integer"),
$ilDB->quote($a_setting, "text"),
$ilDB->quote((int) $a_block_id, "integer"),
$ilDB->quote($a_value, "text")));
}

+ Here is the caller graph for this function:

static ilBlockSetting::_writeDetailLevel (   $a_type,
  $a_value,
  $a_user = 0,
  $a_block_id = 0 
)
static

Write detail level to database.

Definition at line 160 of file class.ilBlockSetting.php.

References _write().

Referenced by ilColumnGUI\activateBlock(), and ilBlockGUI\handleDetailLevel().

{
ilBlockSetting::_write($a_type, "detail", $a_value, $a_user, $a_block_id);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilBlockSetting::_writeNumber (   $a_type,
  $a_value,
  $a_user = 0,
  $a_block_id = 0 
)
static

Write number to database.

Definition at line 180 of file class.ilBlockSetting.php.

References _write().

Referenced by ilColumnGUI\moveBlock().

{
ilBlockSetting::_write($a_type, "nr", $a_value, $a_user, $a_block_id);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilBlockSetting::_writeSide (   $a_type,
  $a_value,
  $a_user = 0,
  $a_block_id = 0 
)
static

Write side to database.

Definition at line 200 of file class.ilBlockSetting.php.

References _write().

Referenced by ilColumnGUI\moveBlock().

{
ilBlockSetting::_write($a_type, "side", $a_value, $a_user, $a_block_id);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilBlockSetting::preloadPDBlockSettings ( )

Preload pd info.

Parameters
@return

Definition at line 74 of file class.ilBlockSetting.php.

References $ilDB.

Referenced by ilPersonalDesktopGUI\show().

{
global $ilDB, $ilUser;
if (!self::$pd_preloaded)
{
$blocks = array("pdbookm", "pdcal", "pdfeedb", "pditems",
"pdmail", "pdnews", "pdnotes", "pdsysmess", "pdtag", "pdusers");
$settings = array("detail", "nr", "side");
$user_id = $ilUser->getId();
foreach ($blocks as $b)
{
foreach ($settings as $s)
{
$key = $b.":".$s.":".$user_id.":0";
if ($s == "detail")
{
self::$setting[$key] = 2;
}
else
{
self::$setting[$key] = false;
}
}
}
$set = $ilDB->query($q = "SELECT type, setting, value FROM il_block_setting WHERE ".
" user_id = ".$ilDB->quote($user_id, "integer").
" AND ".$ilDB->in("type", $blocks, false, "text").
" AND ".$ilDB->in("setting", $settings, false, "text")
);
while ($rec = $ilDB->fetchAssoc($set))
{
$key = $rec["type"].":".$rec["setting"].":".$user_id.":0";
self::$setting[$key] = $rec["value"];
}
self::$pd_preloaded = true;
}
}

+ Here is the caller graph for this function:

Field Documentation

ilBlockSetting::$pd_preloaded = false
static

Definition at line 34 of file class.ilBlockSetting.php.

ilBlockSetting::$setting = array()
static

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


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