WeakWiki


lib\modules.library.php

WeakWiki (WeakWiki Module support library: modules.library.php) Copyright (C) 2010 Alexander Lang 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 3 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, see . Project Home: http://weakwiki.robnet.wmweb.at/ Contact: robbiblubber@robnet.wmweb.at



/********************************************************************************
WeakWiki (WeakWiki Module support library: modules.library.php)
Copyright (C) 2010 Alexander Lang

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 3 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, see .

Project Home: http://weakwiki.robnet.wmweb.at/
Contact:      robbiblubber@robnet.wmweb.at
********************************************************************************/



/** Module is not to be applied on wiki text.									*/
define('MOD_MODE_NO_PARSE', 0);

/** Module is to be applied on unparsed wiki text.								*/
define('MOD_MODE_BEFORE_PARSE', 2);

/** Module is to be applied on parsed wiki text.								*/
define('MOD_MODE_AFTER_PARSE', 4);

/** Module is called in link parse process.										*/
define('MOD_MODE_PARSE', 8);

/** Module is called in link parse process.										*/
define('MOD_MODE_PARSE_LINKS', 16);




/** This is the base class for extension modules.								*/
abstract class __Module
{
	/** Returns the module name.
		@return		Module name.												*/
	public abstract function getName();
	
	/** Returns the module version.
		@return		Module name.												*/
	public abstract function getVersion();
	
	/** Returns a description of the module.
		@return		Module description.											*/
	public function getDescription()
	{
		return "";
	}
	
	/** Returns a detail page for the module.
		@return		Module detail page.											*/
	public function getDetails()
	{
		return "";
	}
	
	/** Returns the module's parse mode.
		@return		Parse mode.													*/
	public function getParseMode()
	{
		return MOD_MODE_NO_PARSE;
	}
	
	/** Method is called before text is parsed.
		@param $input	Unparsed text.
		@return		Parsed text.												*/
	public function beforeParse($input)
	{
		return $input;
	}
	
	/** Method is called when text is parsed.
		@param $input	Unparsed text.
		@return		Parsed text.												*/
	public function parse($input)
	{
		return $input;
	}
	
	/** Method is called after text is parsed.
		@param $input	Unparsed text.
		@return		Parsed text.												*/
	public function afterParse($input)
	{
		return $input;
	}
	
	/** Method is called when parsing links.
		@param $input	Unparsed text.
		@return		Parsed text.												*/
	public function parseLink($input)
	{
		return $input;
	}
	
	/** Returns links to add to main menu.
		@return		Main menu links.											*/
	public function addToMainMenu()
	{
		return "";
	}
	
	/** Returns links to add to page menu.
		@return		Main menu links.											*/
	public function addToPageMenu()
	{
		return "";
	}
	
	/** Adequately reacts to a module query.
		@return		TRUE when module processes the query, otherwise FALSE.		*/
	public function run()
	{
		return false;
	}
}

?>

WeakWiki