ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilSCORM2004PageLayout Class Reference

Class ilSCORM2004PageLayout. More...

+ Collaboration diagram for ilSCORM2004PageLayout:

Public Member Functions

 __construct ($a_id)
 
 getXMLContent ()
 
 getPreview ()
 
 getTitle ()
 
 getId ()
 

Static Public Member Functions

static activeLayouts ()
 

Data Fields

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

Protected Attributes

 $db
 

Private Member Functions

 generatePreview ()
 

Detailed Description

Class ilSCORM2004PageLayout.

Class for SCORM 2004 Page Layouts

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

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

Constructor & Destructor Documentation

◆ __construct()

ilSCORM2004PageLayout::__construct (   $a_id)

Definition at line 47 of file class.ilSCORM2004PageLayout.php.

References $DIC.

48  {
49  global $DIC;
50 
51  $this->db = $DIC->database();
52  $this->layout_id = $a_id;
53  }
global $DIC
Definition: saml.php:7

Member Function Documentation

◆ activeLayouts()

static ilSCORM2004PageLayout::activeLayouts ( )
static

Definition at line 100 of file class.ilSCORM2004PageLayout.php.

References $DIC, $ilDB, $query, $result, and $row.

101  {
102  global $DIC;
103 
104  $ilDB = $DIC->database();
105  $arr_layouts = array();
106  $query = "SELECT * FROM page_layout WHERE (active=1) ORDER BY title ";
107  $result = $ilDB->query($query);
108  while ($row = $ilDB->fetchAssoc($result)) {
109  array_push($arr_layouts, new ilSCORM2004PageLayout($row['layout_id']));
110  }
111  return $arr_layouts;
112  }
$result
global $DIC
Definition: saml.php:7
$query
$row
Class ilSCORM2004PageLayout.
global $ilDB

◆ generatePreview()

ilSCORM2004PageLayout::generatePreview ( )
private

Definition at line 93 of file class.ilSCORM2004PageLayout.php.

94  {
95 
96  //toimplement...generate Preview from XML
97  }

◆ getId()

ilSCORM2004PageLayout::getId ( )

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

References $layout_id.

◆ getPreview()

ilSCORM2004PageLayout::getPreview ( )

Definition at line 66 of file class.ilSCORM2004PageLayout.php.

67  {
68  //just returns manually created previews at the moment
69  return self::SEQ_TEMPLATE_DIR . "/" . $this->layout_id . ".png";
70  }

◆ getTitle()

ilSCORM2004PageLayout::getTitle ( )

Definition at line 73 of file class.ilSCORM2004PageLayout.php.

References $db, $ilDB, $r, and $row.

74  {
75  $ilDB = $this->db;
76 
77  $r = $ilDB->queryF(
78  'SELECT title FROM page_layout WHERE layout_id = %s',
79  array('integer'),
80  array($this->layout_id)
81  );
82  $row = $ilDB->fetchAssoc($r);
83 
84  return $row['title'];
85  }
$r
Definition: example_031.php:79
$row
global $ilDB

◆ getXMLContent()

ilSCORM2004PageLayout::getXMLContent ( )

Definition at line 56 of file class.ilSCORM2004PageLayout.php.

References $db, $ilDB, $r, $row, and ilDBConstants\FETCHMODE_ASSOC.

57  {
58  $ilDB = $this->db;
59  $r = $ilDB->query("SELECT content FROM page_layout WHERE layout_id=" .
60  $ilDB->quote($this->layout_id));
62  return $row['content'];
63  }
$r
Definition: example_031.php:79
$row
global $ilDB

Field Documentation

◆ $db

ilSCORM2004PageLayout::$db
protected

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

Referenced by getTitle(), and getXMLContent().

◆ $layout_id

ilSCORM2004PageLayout::$layout_id = null

Definition at line 45 of file class.ilSCORM2004PageLayout.php.

Referenced by getId().

◆ SEQ_TEMPLATE_DIR

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

Definition at line 43 of file class.ilSCORM2004PageLayout.php.


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