Source for file CMS3_Help.php
Documentation is available at CMS3_Help.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_Help
* @author Jonas F. Jensen <jopsen@gmail.com>
* @copyright 2007 Jonas F. Jensen.
* @license http://www.gnu.org/licenses/gpl.txt
*The Help plugin displays help pages exposed with CMS3_Help_IProvidesHelp
//ISystemCallback implementation
* Handles a callback from ajax application.
* @param string data Data attached to this callback
print
"<h1>CMS3 / " .
$Title .
"</h1>" .
$Content;
print
"The requested data could not be found.";
//Implementation of ProvidesEditor
* @param IEmbedmentOutputHandler EmbedmentOutputHandler Outputhandler the content MUST be parse to.
* @param string Identifier String at the end of the URL
* @return IEmbedmentOutputHandler
public function &ModifyContent($Identifier =
null, &$EmbedmentOutputHandler){
//Load content from files
$ProvidesHelp =
$this->Owner->GetImplementations("CMS3_Help_IProvidesHelp");
foreach($ProvidesHelp as $Help){
//Resolve identifier, if any
if(!is_null($Identifier) &&
$Identifier !=
""){
$Content =
"<h1>CMS3 / " .
$Title .
"</h1>" .
$Content;
//If no identifier resolved, no content is set... just load something default
$Content =
"<h1>CMS3 / Help</h1><p>Welcome to the CMS3 systems help plugin, this plugin will help you read help-pages provided by other plugins. In ordinary words you can browse system end-user documentation using the TreeView to the left.</p>";
//Parse dynamic content to template
$EmbedmentOutputHandler->ExtentHeader($Head);
$EmbedmentOutputHandler->SetBody($Body);
//TODO resolve Identifier: Title: CMS3 / PluginID / Subject / Subsubject /...
return $EmbedmentOutputHandler;
* Gets an absolute address of an icon for this plugin
return $this->Owner->GetCMS3URL() .
"bin/Help/help-browser.png";
//Custom protected help function
*Parse a list of entries into HTML TreeNodes
*@param array Entries List of entries to parse
*@param string Parent Identifier used by ResolveIdentifier
*@return string HTML/dojo representation of TreeNodes
foreach($Entries as $Entry){
$Output .=
"<div dojoType='TreeNode' title='" .
$Entry[0] .
"' object='" .
$this->Owner->GetCMS3URL() .
"System/Callback/Help" .
$Parent .
"/" .
$Entry[0] .
"'>";
$Output .=
$this->ParseTreeNodes($Entry[2], $Parent .
"/" .
$Entry[0]);
*Gets the content of a help page from its identifier
*@param string Identifier for the information you wish to retrive
*@param array Entries List of entries to search, defaults all help pages available
*@return string Content related the identifier, returns false if nothing was found within the searched entries
//If not set, get all entries available
$ProvidesHelp =
$this->Owner->GetImplementations("CMS3_Help_IProvidesHelp");
//Foreach plugin that provides help
foreach($ProvidesHelp as $Help){
foreach($TLA as $TLEntry){
//Join top level arrays to one
foreach($Entries as $Entry){
//If the entry is what we're looking for
if($Entry[0] ==
$Identifier){
//Check if it's owner of the one we're looking for
$IArray =
explode("/", $Identifier, 2);
if($Entry[0] ==
$IArray[0]){
//If not already returned return false
//Implementation of IPlugin
* Gets the pluginID of the plugin.
Documentation generated on Mon, 30 Apr 2007 01:59:04 +0200 by phpDocumentor 1.3.1