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

XHTML Page class. More...

+ Collaboration diagram for ilXHTMLPage:

Public Member Functions

 ilXHTMLPage ($a_id=0)
 Constructor.
 getId ()
 Get page ID.
 setId ($a_id)
 Set page ID.
 getContent ()
 Get content of page.
 setContent ($a_content)
 Set content of page.
 read ()
 Read page data from database.
 _lookupContent ($a_id)
 Lookup Content.
 _lookupSavedContent ($a_id)
 Lookup Saved Content.
 save ()
 Save the page.
 undo ()
 Undo last change.
 clear ()
 Clear page.

Data Fields

 $id = 0
 $content = ""

Detailed Description

XHTML Page class.

Should be used to store XHTML pages created by tiny (e.g. for ategories).

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
Id:
class.ilXHTMLPage.php 20152 2009-06-08 18:41:37Z akill

Definition at line 16 of file class.ilXHTMLPage.php.

Member Function Documentation

ilXHTMLPage::_lookupContent (   $a_id)

Lookup Content.

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

References $ilDB.

Referenced by save(), ilXHTMLPageTest\testSetGetSettings(), and undo().

{
global $ilDB;
$set = $ilDB->query("SELECT content FROM xhtml_page WHERE id = ".
$ilDB->quote($a_id, "integer"));
if ($rec = $ilDB->fetchAssoc($set))
{
return $rec["content"];
}
}

+ Here is the caller graph for this function:

ilXHTMLPage::_lookupSavedContent (   $a_id)

Lookup Saved Content.

Definition at line 108 of file class.ilXHTMLPage.php.

References $ilDB.

Referenced by ilXHTMLPageTest\testSetGetSettings(), and undo().

{
global $ilDB;
$set = $ilDB->query("SELECT save_content FROM xhtml_page WHERE id = ".
$ilDB->quote($a_id, "integer"));
if ($rec = $ilDB->fetchAssoc($set))
{
return $rec["save_content"];
}
}

+ Here is the caller graph for this function:

ilXHTMLPage::clear ( )

Clear page.

Definition at line 170 of file class.ilXHTMLPage.php.

References $ilDB, getId(), save(), and setContent().

{
global $ilDB;
if ($this->getId() > 0)
{
$this->setContent("");
$this->save();
}
}

+ Here is the call graph for this function:

ilXHTMLPage::getContent ( )

Get content of page.

Returns
string page content

Definition at line 60 of file class.ilXHTMLPage.php.

References $content.

Referenced by save().

{
}

+ Here is the caller graph for this function:

ilXHTMLPage::getId ( )

Get page ID.

Returns
int page ID

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

References $id.

Referenced by clear(), save(), and undo().

{
return $this->id;
}

+ Here is the caller graph for this function:

ilXHTMLPage::ilXHTMLPage (   $a_id = 0)

Constructor.

Parameters
int$a_idpage ID

Definition at line 26 of file class.ilXHTMLPage.php.

References read(), and setId().

{
if ($a_id > 0)
{
$this->setId($a_id);
$this->read();
}
}

+ Here is the call graph for this function:

ilXHTMLPage::read ( )

Read page data from database.

Definition at line 78 of file class.ilXHTMLPage.php.

References $ilDB, and setContent().

Referenced by ilXHTMLPage().

{
global $ilDB;
$set = $ilDB->query("SELECT * FROM xhtml_page WHERE id = ".
$ilDB->quote($this->getId(), "integer"));
if ($rec = $ilDB->fetchAssoc($set))
{
$this->setContent($rec["content"]);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilXHTMLPage::save ( )

Save the page.

Definition at line 123 of file class.ilXHTMLPage.php.

References $ilDB, _lookupContent(), getContent(), getId(), and setId().

Referenced by clear().

{
global $ilDB;
if ($this->getId() > 0)
{
$old_content = ilXHTMLPage::_lookupContent($this->getId());
$ilDB->update("xhtml_page", array(
"content" => array("clob", $this->getContent()),
"save_content" => array("clob", $old_content)
), array (
"id" => array("integer", $this->getId())
));
}
else
{
$this->setId($ilDB->nextId("xhtml_page"));
$ilDB->insert("xhtml_page", array(
"id" => array("integer", $this->getId()),
"content" => array("clob", $this->getContent())
));
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilXHTMLPage::setContent (   $a_content)

Set content of page.

Parameters
string$a_contentpage content

Definition at line 70 of file class.ilXHTMLPage.php.

Referenced by clear(), and read().

{
$this->content = $a_content;
}

+ Here is the caller graph for this function:

ilXHTMLPage::setId (   $a_id)

Set page ID.

Parameters
int$a_idpage ID

Definition at line 50 of file class.ilXHTMLPage.php.

Referenced by ilXHTMLPage(), and save().

{
$this->id = $a_id;
}

+ Here is the caller graph for this function:

ilXHTMLPage::undo ( )

Undo last change.

Definition at line 150 of file class.ilXHTMLPage.php.

References $content, $ilDB, _lookupContent(), _lookupSavedContent(), and getId().

{
global $ilDB;
if ($this->getId() > 0)
{
$save_content = ilXHTMLPage::_lookupSavedContent($this->getId());
$ilDB->update("xhtml_page", array(
"content" => array("clob", $save_content),
"save_content" => array("clob", $content)
), array (
"id" => array("integer", $this->getId())
));
}
}

+ Here is the call graph for this function:

Field Documentation

ilXHTMLPage::$content = ""

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

Referenced by getContent(), and undo().

ilXHTMLPage::$id = 0

Definition at line 18 of file class.ilXHTMLPage.php.

Referenced by getId().


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