Textrinum is expandable by Plugins

Currently there are 5 defined interfaces, which can interfere with a plugin. These are specified through attributes in the file "meta.xml.php".

Structure of the file "meta.xml.php"

Plug-ins are in the website folder "plugins". A plugin should have at least the following basic structure / folder structure:

Plugin name / conf / meta.xml.php

Under plugins/ pluginname /* resides all the files belonging to the functionality.

The file "meta.xml.php" is an XML file containing the information about the plugin. Structure of the file "meta.xml.php":

<?xml version="1.0" encoding="utf-8"?>
<!-- <?php die(); ?>-->
<textrinum_plugin>
<name> Pluginname </name>
<version> 0.9.1 </version>
<license><![CDATA[ license ]]></license>
<author><![CDATA[ Copyright holder ]]></author>
<webpage><![CDATA[ http://www.yourdomain.com ]]></webpage>
<description><![CDATA[ description ]]></description>
<interfaces>
<interface
type="standard_execution"
include_file=""
function=""
class=""
/>
<interface
type="page_execution"
include_file=""
function=""
class=""
/>
<interface
type="search_execution"
include_file=""
function=""
class=""
/>
<interface
type="htmleditor_images_execution"
html_file=""
/>
<interface
type="htmleditor_links_execution"
html_file=""
/>
</interfaces>
</textrinum_plugin>

The attribute "include_file" refers to the PHP file to be included - relative to the plugin folder. Example: include_file = "action.php" is "plugins / pluginname / action.php.

The attribute "function" denotes the function to be performed. Example: In action.php the function "foo" is situated. The attributes are therefore: include_file = "action.php" function="foo".

The attribute "class" means the instantiation of classes. Example: In action.php the class "Foo" is situated. The attributes are therefore: include_file = "action.php" class = "Foo".

  1. "standard_execution" is executed everytime (index.php).
  2. "page_execution" is executed when a page is loaded (index.php), but must be specified in its configuration for each page separately.
  3. "search_execution"is executed whenever a query is signaled. The plugin should, if it holds up data, search them and provide the results to the main process.
  4. "htmleditor_images_execution" offers a way to plug a user interface to the "insert image" dialog in the HTML / WYSIWYG - editor.
    The attribute "html_file" refers to the HTML file for Issuing - relative to the plugin folder.
  5. "htmleditor_links_execution" offers a way to plug a user interface to the "insert link" dialog in the HTML / WYSIWYG - editor.
    The attribute "html_file" refers to the HTML file for Issuing - relative to the plugin folder.

Configuration

If a file "plugins / plugin name / configuration.php" exists, it is called from the page or default configuration dialog.

Default parameters for functions and classes

To a function or constructor will be passed references to variables containing the essential parts of the contents of a page/ site.

These are at:

"standard_execution" -> $site, $page, $template

"page_execution" -> $site, $page, $template

"search_execution" -> $earchString, $results


For example the corresponding function would look like:

 function foo (& $site, & $page, & $template) ( 
$page [ 'main_content'] = '<h1> Hello World </ h1>'. $page [ 'main_content'];
)
// search_execution
 function testSearch($search, &$results){ //everything is optional $item['ID'] = PAGE_ID; $item['LANG'] = DEFAULT_LANGUAGE; $item['TITLE'] = 'TestSearch works'; $item['LAST_CHANGED'] = time(); $item['URL'] = 'plugins/'.basename(dirname(__FILE__)).'/hello_search.htm'; $item['GET_VARS']['first'] = 'hello'; $item['GET_VARS']['second'] = 'search'; $item['TARGET'] = '_blank'; $item['SEARCHMATCH'] = 'just a demo and test'; $results[] = $item; }

Example, the corresponding class (PHP4 -compatible) would look like:

 class Foo ( 
function Foo (& $site, & $page, & $template) (
$page [ 'main_content'] = '<h1> Hello World </ h1>'. $page [ 'main_content'];
)
)

// search_execution
class TestSearch {
function TestSearch($search, &$results){ //everything is optional $item['ID'] = PAGE_ID; $item['LANG'] = DEFAULT_LANGUAGE; $item['TITLE'] = 'TestSearch works'; $item['LAST_CHANGED'] = time(); $item['URL'] = 'plugins/'.basename(dirname(__FILE__)).'/hello_search.htm'; $item['GET_VARS']['first'] = 'hello'; $item['GET_VARS']['second'] = 'search'; $item['TARGET'] = '_blank'; $item['SEARCHMATCH'] = 'just a demo and test'; $results[] = $item; }
}