Skip to content
This repository has been archived by the owner on May 31, 2020. It is now read-only.

Plugins

9er edited this page Oct 7, 2010 · 2 revisions

plugin-file

The plugin-files should be located in inc/plugins/ and will be included automatically, if the file extension is “.php” (to disable a plugin you can change the file extension). A plugin-file contains the plugin-class and a command to add it as a new Object to $PLUGINS.

raw plugin-file:

<?php

class SomePlugin {
  
  function getBody($main) {
    // uses information from database ($main) to create html-formatted page-content
  }
  
  function getHead($main) {
    // (uses information from database ($main)) to create stuff for <head> of the html-document
  }
  
  function getMain($post) {
    // uses $_POST from the editor to build the data that goes into <main>
  }
  
  function getEditor() {
    // returns html-form to edit this type of page
  }
}

// add plugin-object for plugin-type
$PLUGINS["plugin-type"] = new SomePlugin();

?>
Clone this wiki locally