ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilDBUpdate3136 Class Reference

Update class for step 3136. More...

+ Collaboration diagram for ilDBUpdate3136:

Public Member Functions

 addStyleClass ($a_class, $a_type, $a_tag, $a_parameters="", $a_hide=0)
 Add style class.

Static Public Member Functions

static copyStyleClass ($a_orig_class, $a_class, $a_type, $a_tag, $a_hide=0)
 Create style class GlossaryLink, link, IntLink.

Detailed Description

Update class for step 3136.

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

Definition at line 11 of file class.ilDBUpdate3136.php.

Member Function Documentation

ilDBUpdate3136::addStyleClass (   $a_class,
  $a_type,
  $a_tag,
  $a_parameters = "",
  $a_hide = 0 
)

Add style class.

Parameters
@return

Definition at line 71 of file class.ilDBUpdate3136.php.

{
global $ilDB;
if ($a_parameters == "")
{
$a_parameters = array();
}
$set = $ilDB->query("SELECT * FROM object_data WHERE type = 'sty'");
while ($rec = $ilDB->fetchAssoc($set)) // all styles
{
$set2 = $ilDB->query("SELECT * FROM style_char WHERE ".
"style_id = ".$ilDB->quote($rec["obj_id"], "integer")." AND ".
"characteristic = ".$ilDB->quote($a_class, "text")." AND ".
"type = ".$ilDB->quote($a_type, "text"));
if (!$ilDB->fetchAssoc($set2))
{
$q = "INSERT INTO style_char (style_id, type, characteristic, hide)".
" VALUES (".
$ilDB->quote($rec["obj_id"], "integer").",".
$ilDB->quote($a_type, "text").",".
$ilDB->quote($a_class, "text").",".
$ilDB->quote($a_hide, "integer").")";
$ilDB->manipulate($q);
foreach ($a_parameters as $k => $v)
{
$spid = $ilDB->nextId("style_parameter");
$q = "INSERT INTO style_parameter (id, style_id, type, class, tag, parameter, value)".
" VALUES (".
$ilDB->quote($spid, "integer").",".
$ilDB->quote($rec["obj_id"], "integer").",".
$ilDB->quote($a_type, "text").",".
$ilDB->quote($a_class, "text").",".
$ilDB->quote($a_tag, "text").",".
$ilDB->quote($k, "text").",".
$ilDB->quote($v, "text").
")";
$ilDB->manipulate($q);
}
}
}
}
static ilDBUpdate3136::copyStyleClass (   $a_orig_class,
  $a_class,
  $a_type,
  $a_tag,
  $a_hide = 0 
)
static

Create style class GlossaryLink, link, IntLink.

Parameters
@return

Definition at line 19 of file class.ilDBUpdate3136.php.

{
global $ilDB;
$set = $ilDB->query("SELECT * FROM object_data WHERE type = 'sty'");
while ($rec = $ilDB->fetchAssoc($set)) // all styles
{
$set2 = $ilDB->query("SELECT * FROM style_char WHERE ".
"style_id = ".$ilDB->quote($rec["obj_id"], "integer")." AND ".
"characteristic = ".$ilDB->quote($a_class, "text")." AND ".
"type = ".$ilDB->quote($a_type, "text"));
if (!$ilDB->fetchAssoc($set2))
{
$q = "INSERT INTO style_char (style_id, type, characteristic, hide)".
" VALUES (".
$ilDB->quote($rec["obj_id"], "integer").",".
$ilDB->quote($a_type, "text").",".
$ilDB->quote($a_class, "text").",".
$ilDB->quote($a_hide, "integer").")";
$ilDB->manipulate($q);
$set3 = $ilDB->query("SELECT * FROM style_parameter WHERE ".
"style_id = ".$ilDB->quote($rec["obj_id"], "integer")." AND ".
"type = ".$ilDB->quote($a_type, "text")." AND ".
"class = ".$ilDB->quote($a_orig_class, "text")." AND ".
"tag = ".$ilDB->quote($a_tag, "text")
);
while ($rec3 = $ilDB->fetchAssoc($set3)) // copy parameters
{
$spid = $ilDB->nextId("style_parameter");
$q = "INSERT INTO style_parameter (id, style_id, type, class, tag, parameter, value)".
" VALUES (".
$ilDB->quote($spid, "integer").",".
$ilDB->quote($rec["obj_id"], "integer").",".
$ilDB->quote($rec3["type"], "text").",".
$ilDB->quote($a_class, "text").",".
$ilDB->quote($a_tag, "text").",".
$ilDB->quote($rec3["parameter"], "text").",".
$ilDB->quote($rec3["value"], "text").
")";
$ilDB->manipulate($q);
}
}
}
}

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