Public Member Functions | Data Fields

ilXHTMLPage Class Reference
[Services/XHTMLPage]

XHTML Page class. More...

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.
 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.killing@gmx.de>
Version:
Id:
class.ilXHTMLPage.php 11790 2006-08-06 17:02:20Z akill

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


Member Function Documentation

ilXHTMLPage::clear (  ) 

Clear page.

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

References getId(), and setContent().

        {
                global $ilDB;
                
                if ($this->getId() > 0)
                {
                        $ilDB->query("UPDATE xhtml_page SET ".
                                " save_content = content ".
                                " WHERE id = ".$ilDB->quote($this->getId()));
                        $ilDB->query("UPDATE xhtml_page SET ".
                                " content = ".$ilDB->quote("").
                                " WHERE id = ".$ilDB->quote($this->getId()));
                        $this->setContent("");
                }
        }

Here is the call graph for this function:

ilXHTMLPage::getContent (  ) 

Get content of page.

Returns:
string page content

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

        {
                return $this->content;
        }

ilXHTMLPage::getId (  ) 

Get page ID.

Returns:
int page ID

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

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_id page ID

Definition at line 46 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 98 of file class.ilXHTMLPage.php.

References $set, and setContent().

Referenced by ilXHTMLPage().

        {
                global $ilDB;
                
                $set = $ilDB->query("SELECT * FROM xhtml_page WHERE id = ".
                        $ilDB->quote($this->getId()));
                if ($rec = $set->fetchRow(DB_FETCHMODE_ASSOC))
                {
                        $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 113 of file class.ilXHTMLPage.php.

References getId(), and setId().

        {
                global $ilDB;
                
                if ($this->getId() > 0)
                {
                        $ilDB->query("UPDATE xhtml_page SET ".
                                " save_content = content ".
                                " WHERE id = ".$ilDB->quote($this->getId()));
                        $ilDB->query("UPDATE xhtml_page SET ".
                                "content = ".$ilDB->quote($this->getContent()).
                                " WHERE id = ".$ilDB->quote($this->getId()));
                }
                else
                {
                        $ilDB->query("INSERT INTO xhtml_page (content) VALUES ".
                                "(".$ilDB->quote($this->getContent()).")");
                        $this->setId($ilDB->getLastInsertId());
                }
        }

Here is the call graph for this function:

ilXHTMLPage::setContent ( a_content  ) 

Set content of page.

Parameters:
string $a_content page content

Definition at line 90 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_id page ID

Definition at line 70 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 137 of file class.ilXHTMLPage.php.

References getId().

        {
                global $ilDB;
                
                if ($this->getId() > 0)
                {
                        $ilDB->query("UPDATE xhtml_page SET ".
                                " content = save_content ".
                                " WHERE id = ".$ilDB->quote($this->getId()));
                        $ilDB->query("UPDATE xhtml_page SET ".
                                " save_content = ".$ilDB->quote($this->getContent()).
                                " WHERE id = ".$ilDB->quote($this->getId()));
                }
        }

Here is the call graph for this function:


Field Documentation

ilXHTMLPage::$content = ""

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

ilXHTMLPage::$id = 0

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


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