Differences from version 4 to 5



@@ -1,196 +1,18 @@

-{maketoc}
-! Introduction
-In this Tutorial - I will try to explain the basics questions about all Liberty Plugins. I'll answer the Basic Questions - What / Where / How & Why. This Tutorial does go get Technical - the contents of a simple Liberty Plugin is displayed. The underlying Sectioning within a Liberty Plugin / what each does / and how they interact is explained. What this Tutorial __Does Not Do__ - is Provide an easy Step-by-Step Methodology for Creating a Liberty Plugin. The ((Tutorial - Liberty Plugins II)) page does all of that and a __Lot__ more.
+! ))WARNING((
+This is a proposal page for the ))HideText(( Data Plugin. Any information given here is subject to change without notification. The ))HideText(( Plugin does __Not Exist__ at this time.
 
-! Should I be Reading This?
-This Tutorial is provided primarilly for Site Administrators and Developers or anyone wanting to add functionallity to a bitweaver Powered Site. A User on a bitweaver Powered Site would gain a little knowledge from reading the Heading __"How is a Plugin used?"__.
+! __))NOTICE((__
+The Plugin described on this page has been completed! I used a different name for it and I added a lot more functionallity than this page describes. It's name is __))SpyText((__ and you can get a peek at it in operation on the ((DataPluginSpyText)) help page. [http://www.bitweaver.org/StarRider|StarRider]
 
-! So what is a Liberty Plugin? And why do you keep saying Liberty anyway - isn't Plugin enough?
-There are all kinds of Plugins. Every Package that is added to __bitweaver__ incorporates (as an Application Framework) has it's own definition of what a Plugin is / what it does / and where it is used. There are even three different types of Plugins that belong to the ((LibertyPackage)). They are:
-* Liberty Data Plugins - What this tutorial is all about.
-* Liberty Format Plugins - Used to handle different types of data.
-* Liberty Storage Plugins - Used to store the data in different ways.
-
-In this Tutorial - saying __"Liberty Plugins"__ means Liberty Data Plugins. These Plugins that can be used in any Package that uses the Liberty Storage System - and that includes: the Wiki / UserPages / Blogs / and - well - nearly everything bitweaver.
-
-! Adding Functionallity? How can a Liberty Plugin do that?
-Easy! Here is the situation. You are updating a page - and when your finished you look at it and say "Not Bad - but I wish I had some ))EyeCandy(( to make this more noticable". If you were doing things the old fashioned way using pure HTML pages - there are thousands of different things that could be easilly added to give you exactly the effect you want - if you have the skill to add it. Wiki page are not like a pure HTML pages - but anything that works in an HTML can be placed in a Plugin and will work in a Wiki page.
-The Plugin __"))EyeCandy(( ))NeonText((" (ECNT)__ Plugin is a very good example. It was written for two reasons:
-# I renamed a finished a Proposed Plugin ((PluginProposal-HideText)) and wanted some ))EyeCandy(( to make a __Notice - It's Done__ statement.
-# I decided to create the second Tutorial ((Tutorial - Liberty Plugins II)) and needed a good example for it.
-__Note:__ The Plugin __"))EyeCandy(( ))NeonText((" (ECNT)__ applies a Neon Lighting Effect (an age old technique of attracting attention) to a string. A DHTML Script file from [http://www.dynamicdrive.com] was used as the source.
-Of course - not everything is as simple as this - but sometimes the simple things are the most rewarding.
-
-! Well I'm impressed. I not a Geek or a Computer Guru though.
-Liberty Plugins can be fairly simple or as complex as you want to them to be. They provide a good place for a beginners to play and learn. At the minimum - all that is required is a little knowledge of HTML / the PHP language / and the ability to look things up.
-
-^::__The Plugin "Comment" will be used as an example throughout this Tutorial.__::^
-
-! What does this Plugin do?
-The Comment Plugin is the simplest Plugin imaginable. All it does is - well - nothing. By doing "nothing" though - it allow text to be stored in a page that is not displayed or processed in any way.
-! So how is a Plugin used?
-The Comment Plugin (unlike most Plugins) operates on the text encased between a pair of Code Blocks. A Code Block is the name of the Plugin within a pair of curly brackets “{“ and “}” like this: ~123~))COMMENT(( ~125~
-~123~))COMMENT(( ~125~ The Text Inside the Block ~123~COMMENT~125~
-In this case - the Comment Plugin prevents the text from being displayed.
-
-To make Plugins more functional, additional information (parameters) can be passed to it. The parameters are added to the first code block in the form of parameter_name=’value’. Each Plugin defines the names of the parameters and what is expected. Most Plugins accept multiple parameters – which are separated by a space character.
-__Please Note:__ The 'Value' does not always have to be encased in quotes. A single number (123456) / single words like TRUE / FALSE / or ))KeyWords(( (defined by the plugin) do not require quotation. __Strings Do__! Any text that contains whitespaces or non-alphanumeric characters is considered to be a String and __Has__ to be quoted. The quote character can be either a single quote or a double quote (characters ' or ").
-__Note 2:__ Capitolization is not manditory. ~123~))COMMENT(( ~125~ = ~123~comment ~125~ / and / ))PARAMETER_NAME(( = ))Prameter_Name(( = ))parameter_name((.
-! Where do I find these Plugins?
-The best way to become fluent with the Liberty Plugins is to use them. A complete listing of all Active Plugins can be found at the bottom of the page while editing a Page. Look for the __Plugin Help__ tab. Selecting “More Details” shows the Plugins Parameters are and what they do. It will also show an example or two.
-The Files are stored in the Liberty/Plugins directory. The files use a strict file naming convention that must be adhered to. For our Example Plugin, the filename is “data.example.php”.
-
-! Show me a Plugin then.
-{CODE source=php num=on }<?php
-// $Id: data.comment.php,v 1.1.2.3 2005/07/16 03:52:25 starrrider Exp $
-/**
- * assigned_modules
- *
- * @author StarRider <starrrider@sourceforge.net>
- * @version $Revision: 1.1.2.3 $
- * @package liberty
- * @subpackage plugins_data
- * @copyright Copyright (c) 2004, bitweaver.org
- * All Rights Reserved. See copyright.txt for details and a complete list of authors.
- * @license Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
- */
-/******************
- * Initialization *
- ******************/
-global $gLibertySystem;
-define( 'PLUGIN_GUID_COMMENT', 'comment' );
-global $gLibertySystem;
-$pluginParams = array ( 'tag' => 'COMMENT',
- 'auto_activate' => TRUE,
- 'requires_pair' => TRUE,
- 'load_function' => 'data_comment',
- 'title' => 'Comment',
- 'help_page' => 'DataPluginComment',
- 'description' => tra("This plugin allows Comments (Text that will not be displayed) to be added to a page."),
- 'help_function' => 'data__comment_help',
- 'syntax' => "{COMMENT}Data Not Displayed{COMMENT}",
- 'plugin_type' => DATA_PLUGIN
-);
-$gLibertySystem->registerPlugin( PLUGIN_GUID_COMMENT, $pluginParams );
-$gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_COMMENT );
-/*****************
- * Help Function *
- *****************/
-function data_comment_help() {
- $help =
- '<table class="data help">'
- .'<tr>'
- .'<th>' . tra( "Key" ) . '</th>'
- .'<th>' . tra( "Type" ) . '</th>'
- .'<th>' . tra( "Comments" ) . '</th>'
- .'</tr>'
- .'<tr class="odd">'
- .'<td>' . tra("This plugin uses no parameters. Anything located between the two")
- . ' <strong>{COMMENT}</strong> ' . tra("Blocks is not displayed.") . '</td>'
- .'</tr>'
- .'</table>'
- . tra("Example: ") . "{COMMENT}" . tra("Everything in here is not displayed.") . "{COMMENT}";
- return $help;
-}
-/****************
-* Load Function *
- ****************/
-function data_comment($data, $params) {
- return ' ';
-}
-?>
-That's all there is to it. You should be able to see why I said the Plugin does nothing. The Load Function returns a single space character. You should also be able to see the 4 basic sections in the Plugin. Each of these will be explained below. They are:__
-# Copyright
-# Initialization
-# Help Function
-# Load Function__
-!! Copyright
-Hay - with a name like that - what else did you expect?
-{CODE source=php num=on }{CODE source=php num=on }<?php
-// $Id: data.comment.php,v 1.1.2.3 2005/07/16 03:52:25 starrrider Exp $
-/**
- * assigned_modules
- *
- * @author StarRider <starrrider@sourceforge.net>
- * @version $Revision: 1.1.2.3 $
- * @package liberty
- * @subpackage plugins_data
- * @copyright Copyright (c) 2004, bitweaver.org
- * All Rights Reserved. See copyright.txt for details and a complete list of authors.
- * @license Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
- */{CODE}
- The Copyright Section does do a little more than just provide Copyright data. It is an integral part of our Documentation Effort. We are using the Doxygen Documentation System to help us build our API Documentation. For more information - please read ((APIDocumentation))
-{DD title='Line 1' }__<?php__ - tells the Browser that the code is php{DD}
-{DD title='Line 2' }Line 2 will be changed by the CVS Revision System each time the file is Commited. In this case - starrrider made the Commit at 03:52 (3:52 AM) on July 7, 2005 - it also gives the name of the file. None of this needs to be changed when creating a new Plugin.{DD}
-{DD title='Overview' }Most of this section contains variables that are supplied to Doxygen System and never need to be edited. The only one that needs to be edited when creating a __New Plugin__ is the __author__. In this case that is __"Me"__ and I always include my ))SourceForge(( email address. All the rest of the variables are never changing or will be change automatically ( __$Id:__ and __version__).{DD}
-!! Initialization
-This is where Globals and Defines are kept. It is also where the GUID is defined and then Registered with the Liberty System
-{CODE source=php num=on }/******************
- * Initialization *
- ******************/
-global $gLibertySystem;
-define( 'PLUGIN_GUID_COMMENT', 'comment' );
-global $gLibertySystem;
-$pluginParams = array ( 'tag' => 'COMMENT',
- 'auto_activate' => TRUE,
- 'requires_pair' => TRUE,
- 'load_function' => 'data_comment',
- 'title' => 'Comment',
- 'help_page' => 'DataPluginComment',
- 'description' => tra("This plugin allows Comments (Text that will not be displayed) to be added to a page."),
- 'help_function' => 'data__comment_help',
- 'syntax' => "{COMMENT}Data Not Displayed{COMMENT}",
- 'plugin_type' => DATA_PLUGIN
-);
-$gLibertySystem->registerPlugin( PLUGIN_GUID_COMMENT, $pluginParams );
-$gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_COMMENT );{CODE}
-This entire section is __Mandantory__ and only the values should be changed.
-
-{DD title='The Comments'}When creating a new Plugin - each of the Comments (both upper & lower case) should be changed to the name of your new Plugin. The Capitolization should remain as it is. Capitolized "Comments" (Lines 5, 18, & 19) relate to the GUID / While Lines 7 & 15 are described below.{DD}
-{DD title='tag'}The value given here dontrols what the user will have to enter to make your function operate. Most of the __tag__ should be the same as the name given to the Plugin. When the name is unweldy because of it's length - we can shorten it to whatever is desired. The plugin ))DropDown(( as an example was shortened to 'DD' because I expected it to be used a lot - it creates the expandable box you looking at.{DD}
-{DD title='auto_activate'}Plugins can be turned off in bitweaver. A default value can be provided by specifing __TRUE__ or __FALSE__ here. This gives you the ability to turn a plugin off when you know there are problems with it.{DD}
-{DD title='requires_pair'}This controls how the Plugin operates. When __TRUE__ all of the information needed by the Plugin is contained in a single Code Block. Plugins like __))AddTabs((__ and __))AgentInfo((__ operate with this model. When it is __FALSE__ - 2 Code Blocks are needed (the first to start the Plugin running and the second to end it). Normally - this type of Plugin operates on the Data located between the Code Blocks. Both __Comment__ and __))DropDown__ operate with this model.{DD}
-{DD title='load_function'}This specifies the name of the function that does all the work and is called by bitweaver. I normally use a name like 'data_X' where X is the name of the plugin. __Note__ Be sure to actually give the __Load Function__ the same name. Please don't laugh - I've made that mistake. In some editors it's hard to see if there are 1 or 2 underline character.{DD}
-{DD title='title'}This is an "Unofficial" name for the Plugin that is only used by Help routine. If the name of your Plugin is __"))AardvarkAreCute(("__ and you specified the __Tag__ to __))AAC((__ then the __Ttitle__ should probably be __"Aardvark Are Cute (AAC)"__. The latter provides a visual clue to the users shouldn't be able to miss.{DD}
-{DD title='help_page'}Every Plugin should have a Help Page on bitweaver. The value given ends up as a URL - so while viewing the limited Help provided by the __Help Function__ - the user can click a button and launch a new browser window to that page. For those of us who create the Plugins - it's not quite that simple. On the bitweaver site - all of the Plugin Help Pages are named __))DataPluginX((__ where __X__ is the name of the plugin. When your Plugin is finished and you are ready to Commit it - visit ((DataPlugins)) and add the name of the Plugin to the list of Plugins. Make sure you provide the name of the page you specified here. Once the page is saved - create the Help Page and give plenty of examples how it is used. I like using the page snippets that I have already created while testing the Plugin. Look at the ((DataPluginSpyText|Spy Text Help Page)) to see what I mean.{DD}
-{DD title='description'}This should have been named __provide_a_very_brief_description__ because that is all that is needed here. Just a fast blurb to remind the user what this Plugin does.{DD}
-{DD title='help_function'}This specifies the name of the function that is called by bitweaver's Help Routines. I normally use a name like 'data_X_help' where X is the name of your plugin. __Note:__ Be sure to actually give the __Load Function__ the same name. Please don't laugh - I've made that mistake and at times it's hard to figure out why the stupid thing just isn't working. In some editors it's hard to see if there are 1 or 2 underline character.{DD}
-
-{DD title='syntax'}This should provide the __Tag__ and show all of the parameter names. e value given here {DD}
+! Introduction
+The idea behind this plugin is that when added - Text encapsulated by the Plugin would be Visible to Specific Users / or to a Group of Users. To anyone else - there would be no indication that there might be something hidden on the page. The text would __Not be rendered by Smarty__ so it would never make it to the browser - i.e. View by Page Source would find nothing.
 
-{DD title='plugin_type'}This will always be __DATA_PLUGIN__ and should not be changed.{DD}
+! So What Would It Do ?
+Compare the Current User's Name to a parameter containg UserName / or see if the Current User is in one of the Groups specified by a parameter containg GroupNames. If valid - the text would be displayed / if not - it would not.
 
-!! The Help Function
-Help - how can it provide Help? . . . Oh yeah - there was that listing of Plugins at the bottom of the of the page in the editor. So that means that - each Plugin provides the data that is displayed by the bitweaver.
-{CODE source=php num=on }/*****************
- * Help Function *
- *****************/
-function data_comment_help() {
- $help =
- '<table class="data help">'
- .'<tr>'
- .'<th>' . tra( "Key" ) . '</th>'
- .'<th>' . tra( "Type" ) . '</th>'
- .'<th>' . tra( "Comments" ) . '</th>'
- .'</tr>'
- .'<tr class="odd">'
- .'<td>' . tra("This plugin uses no parameters. Anything located between the two")
- . ' <strong>{COMMENT}</strong> ' . tra("Blocks is not displayed.") . '</td>'
- .'</tr>'
- .'</table>'
- . tra("Example: ") . "{COMMENT}" . tra("Everything in here is not displayed.") . "{COMMENT}";
- return $help;
-}{CODE}
-{DD title='Line 4'}The name of the Help Function __Must__ match the name supplied in the Initialization Section's
-__'help_function'__{DD}
-__NOTE:__ As the creator of a plugin - you get to decide what how much information it provides. This Tutorial provides some Guidelines - but it is your responsibility to give your users the information they are going to need - so take pride in your accomplishment and explain it.
+! How Would This Plugin be used ?
+Several ideas come to mind.
+* A Group of Users could make changes to a page - visible only to themselves - for colaborative editing & approval - before making them visible to the general public
+* Hidden Messages in Pages or Blogs - (Meet me tonigh for - whatever)
 
-!! The Load Function
-Each Plugin has 4 basic sections. They are:
-{CODE source=php num=on }/****************
-* Load Function *
- ****************/
-function data_comment($data, $params) {
- return ' ';
-}{CODE}
 
Page History
Date/CommentUserIPVersion
14 Jul 2005 (10:17 UTC)
Rollback to version 3 by StarRider
Lee LaMont Bell Jr.68.95.137.1235
Current • Source
Lee LaMont Bell Jr.68.95.129.254
View • Compare • Difference • Source
Lee LaMont Bell Jr.68.95.137.1233
View • Compare • Difference • Source
Lee LaMont Bell Jr.68.95.137.1722
View • Compare • Difference • Source
Lee LaMont Bell Jr.68.95.137.1721
View • Compare • Difference • Source