ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilPageLayout Class Reference

Class ilPageLayout. More...

+ Collaboration diagram for ilPageLayout:

Public Member Functions

 ilPageLayout ($a_id=null)
 getActive ()
 getDescription ()
 setDescription ($a_description)
 getTitle ()
 setTitle ($a_title)
 getId ()
 activate ($a_setting=true)
 delete ($a_setting=true)
 update ()
 readObject ()
 getXMLContent ()
 getPreview ()

Static Public Member Functions

static getLayoutsAsArray ($a_active=0)
 Static access functions.
static getLayouts ($a_active=false)
static activeLayouts ()

Data Fields

const SEQ_TEMPLATE_DIR = './Modules/Scorm2004/templates/editor/page_layouts_temp/thumbnails'
 $layout_id = null
 $title = null
 $description = null
 $active = null

Private Member Functions

 getXSLPath ()
 generatePreview ()

Detailed Description

Class ilPageLayout.

Class for Page Layouts

Author
Hendrik Holtmann holtm.nosp@m.ann@.nosp@m.me.co.nosp@m.m
Version
$Id$

Definition at line 14 of file class.ilPageLayout.php.

Member Function Documentation

ilPageLayout::activate (   $a_setting = true)

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

References $ilDB, and $query.

{
global $ilias, $ilDB;
$query = "UPDATE page_layout SET active=".$ilDB->quote($a_setting, "integer").
" WHERE layout_id =".$ilDB->quote($this->layout_id, "integer");
$result = $ilDB->manipulate($query);
}
static ilPageLayout::activeLayouts ( )
static

Definition at line 191 of file class.ilPageLayout.php.

References getLayouts().

Referenced by ilObjSCORM2004LearningModuleGUI\insertTemplateGUI().

{
return self::getLayouts(true);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPageLayout::delete (   $a_setting = true)

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

References $ilDB, and $query.

{
global $ilias, $ilDB;
$query = "DELETE FROM page_layout WHERE layout_id =".$ilDB->quote($this->layout_id, "integer");
$result = $ilDB->manipulate($query);
}
ilPageLayout::generatePreview ( )
private

Definition at line 124 of file class.ilPageLayout.php.

References $error, $path, $res, DOMXML_LOAD_PARSING, domxml_open_mem(), getXMLContent(), getXSLPath(), xpath_eval(), xpath_new_context(), xslt_create(), xslt_error(), xslt_free(), and xslt_process().

Referenced by getPreview().

{
$xml = $this->getXMLContent();
$xpc = xpath_new_context($dom);
$path = "////PlaceHolder";
$res =& xpath_eval($xpc, $path);
foreach ($res->nodeset as $item){
$height = $item->get_attribute("Height");
$height = eregi_replace("px","",$height);
$height=$height/10;
$item->set_attribute("Height",$height."px");
}
$xsl = file_get_contents($this->getXSLPath());
$xml = $dom->dump_mem(0, "UTF-8");
$args = array( '/_xml' => $xml, '/_xsl' => $xsl );
$xh = xslt_create();
$output = xslt_process($xh, "arg:/_xml", "arg:/_xsl", NULL, $args, NULL);
xslt_error($xh);
xslt_free($xh);
return $output;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPageLayout::getActive ( )

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

References $active.

{
return $this->active;
}
ilPageLayout::getDescription ( )

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

References $description.

{
}
ilPageLayout::getId ( )

Definition at line 69 of file class.ilPageLayout.php.

References $layout_id.

{
}
static ilPageLayout::getLayouts (   $a_active = false)
static

Definition at line 175 of file class.ilPageLayout.php.

References $ilDB, $query, $row, DB_FETCHMODE_ASSOC, and ilPageLayout().

Referenced by activeLayouts(), and ilObjStyleSettingsGUI\createPgGUIObject().

{
global $ilDB;
$arr_layouts = array();
$add="";
if ($a_active) {
$add ="WHERE (active=1)";
}
$query = "SELECT layout_id FROM page_layout $add ORDER BY title ";
$result = $ilDB->query($query);
while($row = $result->fetchRow(DB_FETCHMODE_ASSOC))
{
array_push($arr_layouts,new ilPageLayout($row['layout_id']));
}
return $arr_layouts;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilPageLayout::getLayoutsAsArray (   $a_active = 0)
static

Static access functions.

Definition at line 158 of file class.ilPageLayout.php.

References $active, $ilDB, $query, $row, and DB_FETCHMODE_ASSOC.

Referenced by ilPageLayoutTableGUI\getPageLayouts().

{
global $ilDB;
$arr_layouts = array();
if ($active!=0) {
$add ="WHERE (active=1)";
}
$query = "SELECT * FROM page_layout $add ORDER BY title ";
$result = $ilDB->query($query);
while($row = $result->fetchRow(DB_FETCHMODE_ASSOC))
{
array_push($arr_layouts,$row);
}
return $arr_layouts;
}

+ Here is the caller graph for this function:

ilPageLayout::getPreview ( )

Definition at line 115 of file class.ilPageLayout.php.

References generatePreview().

{
return $this->generatePreview();
}

+ Here is the call graph for this function:

ilPageLayout::getTitle ( )

Definition at line 61 of file class.ilPageLayout.php.

References $title.

{
return $this->title;
}
ilPageLayout::getXMLContent ( )

Definition at line 106 of file class.ilPageLayout.php.

References $ilDB, $row, and DB_FETCHMODE_ASSOC.

Referenced by generatePreview().

{
global $ilias, $ilDB;
$r = $ilias->db->query("SELECT content FROM page_object WHERE parent_type='stys' AND page_id=".
$ilDB->quote($this->layout_id));
$row = $r->fetchRow(DB_FETCHMODE_ASSOC);
return $row['content'];
}

+ Here is the caller graph for this function:

ilPageLayout::getXSLPath ( )
private

Definition at line 120 of file class.ilPageLayout.php.

Referenced by generatePreview().

{
return "./Services/Style/xml/layout2html.xsl";
}

+ Here is the caller graph for this function:

ilPageLayout::ilPageLayout (   $a_id = null)

Definition at line 24 of file class.ilPageLayout.php.

References $ilDB.

Referenced by getLayouts().

{
global $ilias, $ilDB;
//create new instance
if ($a_id == null) {
$this->layout_id = $ilDB->nextId("page_layout");
$ilDB->insert("page_layout", array(
"layout_id" => array("integer", $this->layout_id),
"active" => array("integer", 0),
"title" => array("text", ""),
"content" => array("clob", ""),
"description" => array("text", "")
));
//$query = "INSERT INTO page_layout(active) values (0);";
//$result = $ilDB->query($query);
//$query = "SELECT LAST_INSERT_ID() as id";
//$res = $ilDB->query($query);
//$row = $res->fetchRow(DB_FETCHMODE_OBJECT);
//$this->layout_id = $row->id;
$this->active = false;
}
else {
$this->layout_id = $a_id;
}
}

+ Here is the caller graph for this function:

ilPageLayout::readObject ( )

Definition at line 96 of file class.ilPageLayout.php.

References $ilDB, $query, and $row.

{
global $ilias, $ilDB;
$query = "SELECT * FROM page_layout WHERE layout_id =".$ilDB->quote($this->layout_id, "integer");
$result = $ilDB->query($query);
$row = $ilDB->fetchAssoc($result);
$this->title=$row['title'];
$this->description=$row['description'];
$this->active=$row['active'];
}
ilPageLayout::setDescription (   $a_description)

Definition at line 57 of file class.ilPageLayout.php.

{
$this->description = $a_description;
}
ilPageLayout::setTitle (   $a_title)

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

{
$this->title = $a_title;
}
ilPageLayout::update ( )

Definition at line 87 of file class.ilPageLayout.php.

References $ilDB, and $query.

{
global $ilias, $ilDB;
$query = "UPDATE page_layout SET title=".$ilDB->quote($this->title, "text").
",description =".$ilDB->quote($this->description, "text").
",active =".$ilDB->quote($this->active, "integer").
" WHERE layout_id =".$ilDB->quote($this->layout_id, "integer");
$result = $ilDB->manipulate($query);
}

Field Documentation

ilPageLayout::$active = null

Definition at line 22 of file class.ilPageLayout.php.

Referenced by getActive(), and getLayoutsAsArray().

ilPageLayout::$description = null

Definition at line 21 of file class.ilPageLayout.php.

Referenced by getDescription().

ilPageLayout::$layout_id = null

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

Referenced by getId().

ilPageLayout::$title = null

Definition at line 20 of file class.ilPageLayout.php.

Referenced by getTitle().

const ilPageLayout::SEQ_TEMPLATE_DIR = './Modules/Scorm2004/templates/editor/page_layouts_temp/thumbnails'

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


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