Source for file CMS3_StandartOutputHandler.php
Documentation is available at CMS3_StandartOutputHandler.php
// CMS3 - A Three Content Management System.
// Copyright (C) 2007 Jop... (Jonas F. Jensen).
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*This file defines CMS3_StandartOutputHandler
* @package StandartOutputHandler
* @author Jonas F. Jensen <jopsen@gmail.com>
* @copyright 2007 Jonas F. Jensen.
* @license http://www.gnu.org/licenses/gpl.txt
* class CMS3_StandartOutputHandler, a very simple OutputHandler; no configuration available only static template and sitemap.
protected $Title =
"Untitled";
*Sets the complete unique identifier.
*@param string Idenfitifer Complete unique identifier.
* @param CMS3_System Owner The CMS3_System that owns this plugin, gives the plugin ability to get data from
//Just save a handle for now
* Gets the pluginID of the plugin.
return "StandartOutputHandler";
* Data provided by use of this method may be left out if the OutputHandler wishes
* to print something else the HTML, therefor don't add important information
* @param string line A line you wish to add to the header.
} // end of member function SetTitle
* Set the body if the page, read parameter documentation.
* Embedments may be included in the body, they shall be formatted as follows: [[EMBED|<identifier>|EMBED]], where <identifier> is the identifier returned from the IEmbedable.
* @param string body Body of the page, or description of a channel.
* @param array List Parse a list, use this feature if you wish to parse a list. This will also
* enable to OutputHandler to print a feed. This parameter is optional, if set the
* first parameter will define the description of the channel, and every body and
* title in this array will define an entry.
* [[title,body],[title,body],...]
public function SetBody( $body, $List =
null ) {
} // end of member function SetBody
* Print the content, should also be called from GetPage().
public function Parse() {
$Content =
$this->GetContent(); // Get the content first, since embedments and header extensions from embedments are parsed here as well.
//Generating sitemap from Ilinkable
$iLinks =
$this->Owner->GetImplementations("ILinkable");
foreach($iLinks as $iLink)
foreach($iLink->GetLinks() as $LinkEntry)
$Template =
str_replace("<!--SITEMAP-->",$SiteMap ,$Template);
$Template =
str_replace("<!--CONTENT-->",$Content ,$Template);
} // end of member function Parse
$Text =
"<a href=\"" .
$Entry[1] .
"\">" .
$Entry[0] .
"</a><br />\n";
foreach($Entry[2] as $SubEntry)
//Do only add this one time
$Text .=
"<blockquote>\n";
//Do only add this if there were any subentries
$Text .=
"</blockquote>";
*Gets content ready to be printed
*This does not include header, only the body content.
*@return string Content ready for print
foreach($this->BodyList as $key =>
$value){
*Gets the header extension
*@return string Lines to be added to the header
* Diable the OutputHandler, do this if you wish to print binary data.
// end of member function Disable
* Gets to original identifier specified as <Namespace>/<PluginID>.<ext>
* Do this if you wish to extraxt the extention and parse manually.
// end of member function GetIdentifier
* Print an error code, if you use this method no other methods will be available.
* This method will print all 4xx and 5xx error codes specified in the RFC 2616, and some of the codes specified in the WebDAV extension.
* NOTE: This mehtod postes a soft error code in HTML, this may be improved later on.
* @param string msg The message you wish to print
* @param int code The error code you wish to print eg. 404.
//Call parent,since the print error implementation is placed there
I know this isn't needed since the parent implement all the logic, so it should be needed...
} // end of member function PrintError
*Finds and replaces all embedments, in a given string
*Currently not working since support for embeds isn't implemented yet.
*@param string Content The string you wish to clear of embedments
*@return string Content where all embedments have been included.
//Only if there's embedments
if(sizeof($Exploded = explode("[[EMBED|",$Content)) > 0)
$Top = sizeof($Exploded);
for($i = 0; $i < $Top; $i += 2){
$Output .= $Exploded[$i];
$data = explode("|EMBED]]",$Exploded[$i +1] );
$EmbedmentsOutputHandler = $this->Owner->GetEmbedment($data[0]);
$Output .= $EmbedmentsOutputHandler->GetContent();
$this->ExtentHeader($EmbedmentsOutputHandler->GetHeader());
} // end of CMS3_HTMLOutputHandler
Documentation generated on Mon, 30 Apr 2007 01:59:09 +0200 by phpDocumentor 1.3.1