ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilPageContentUsage Class Reference

Saves usages of page content elements in pages. More...

+ Collaboration diagram for ilPageContentUsage:

Public Member Functions

 getUsages ($a_pc_type, $a_pc_id, $a_incl_hist=true)
 Get usages.
 getUsagesOfPage ($a_usage_id, $a_usage_type, $a_hist_nr=0, $a_all_hist_nrs=false, $a_lang="-")
 Get page content usages for page.

Static Public Member Functions

static saveUsage ($a_pc_type, $a_pc_id, $a_usage_type, $a_usage_id, $a_usage_hist_nr=0, $a_lang="-")
 Save usages.
static deleteAllUsages ($a_pc_type, $a_usage_type, $a_usage_id, $a_usage_hist_nr=0, $a_lang="-")
 Delete all usages.

Detailed Description

Saves usages of page content elements in pages.

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

Definition at line 12 of file class.ilPageContentUsage.php.

Member Function Documentation

static ilPageContentUsage::deleteAllUsages (   $a_pc_type,
  $a_usage_type,
  $a_usage_id,
  $a_usage_hist_nr = 0,
  $a_lang = "-" 
)
static

Delete all usages.

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

References $ilDB.

Referenced by ilPCSkills\beforePageDelete(), ilPCContentInclude\beforePageDelete(), ilPCContentInclude\saveContentIncludeUsage(), and ilPCSkills\saveSkillUsage().

{
global $ilDB;
$and_hist = ($a_usage_hist_nr !== false)
? " AND usage_hist_nr = ".$ilDB->quote((int) $a_usage_hist_nr, "integer")
: "";
$ilDB->manipulate($q = "DELETE FROM page_pc_usage WHERE usage_type = ".
$ilDB->quote($a_usage_type, "text").
" AND usage_id = ".$ilDB->quote((int) $a_usage_id, "integer").
" AND usage_lang = ".$ilDB->quote($a_usage_lang, "text").
$and_hist.
" AND pc_type = ".$ilDB->quote($a_pc_type, "text"));
}

+ Here is the caller graph for this function:

ilPageContentUsage::getUsages (   $a_pc_type,
  $a_pc_id,
  $a_incl_hist = true 
)

Get usages.

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

References $ilDB.

Referenced by ilObjMediaPoolGUI\confirmRemove().

{
global $ilDB;
$q = "SELECT * FROM page_pc_usage ".
" WHERE pc_type = ".$ilDB->quote($a_pc_type, "text").
" AND pc_id = ".$ilDB->quote($a_pc_id, "integer");
if (!$a_incl_hist)
{
$q.= " AND usage_hist_nr = ".$ilDB->quote(0, "integer");
}
$set = $ilDB->query($q);
$usages = array();
while ($rec = $ilDB->fetchAssoc($set))
{
$usages[] = $rec;
}
return $usages;
}

+ Here is the caller graph for this function:

ilPageContentUsage::getUsagesOfPage (   $a_usage_id,
  $a_usage_type,
  $a_hist_nr = 0,
  $a_all_hist_nrs = false,
  $a_lang = "-" 
)

Get page content usages for page.

Parameters
@return

Definition at line 81 of file class.ilPageContentUsage.php.

References $ilDB.

Referenced by ilCOPageHTMLExport\collectPageElements(), and ilObjContentObject\exportHTMLPages().

{
global $ilDB;
if (!$a_all_hist_nrs)
{
$hist_str = " AND usage_hist_nr = ".$ilDB->quote($a_hist_nr, "integer");
}
$set = $ilDB->query("SELECT pc_type, pc_id FROM page_pc_usage WHERE ".
" usage_id = ".$ilDB->quote($a_usage_id, "integer")." AND ".
" usage_lang = ".$ilDB->quote($a_lang, "text")." AND ".
" usage_type = ".$ilDB->quote($a_usage_type, "text").
$hist_str
);
$usages = array();
while ($rec = $ilDB->fetchAssoc($set))
{
$usages[$rec["pc_type"].":".$rec["pc_id"]] = array(
"type" => $rec["pc_type"],
"id" => $rec["pc_id"]
);
}
return $usages;
}

+ Here is the caller graph for this function:

static ilPageContentUsage::saveUsage (   $a_pc_type,
  $a_pc_id,
  $a_usage_type,
  $a_usage_id,
  $a_usage_hist_nr = 0,
  $a_lang = "-" 
)
static

Save usages.

Definition at line 17 of file class.ilPageContentUsage.php.

References $ilDB.

Referenced by ilPCContentInclude\saveContentIncludeUsage(), and ilPCSkills\saveSkillUsage().

{
global $ilDB;
$ilDB->replace("page_pc_usage", array (
"pc_type" => array("text", $a_pc_type),
"pc_id" => array("integer", (int) $a_pc_id),
"usage_type" => array("text", $a_usage_type),
"usage_id" => array("integer", (int) $a_usage_id),
"usage_lang" => array("text", $a_lang),
"usage_hist_nr" => array("integer", (int) $a_usage_hist_nr)
),array());
}

+ Here is the caller graph for this function:


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