liberty
[ class tree: liberty ] [ index: liberty ] [ all elements ]

Source for file data.copyright.php

Documentation is available at data.copyright.php

  1. <?php
  2. /**
  3.  * @version  $Revision$
  4.  * @package  liberty
  5.  * @subpackage plugins_data
  6.  */
  7. // +----------------------------------------------------------------------+
  8. // | Copyright (c) 2004, bitweaver.org
  9. // +----------------------------------------------------------------------+
  10. // | All Rights Reserved. See below for details and a complete list of authors.
  11. // | Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details
  12. // |
  13. // | For comments, please use phpdocu.sourceforge.net documentation standards!!!
  14. // | -> see http://phpdocu.sourceforge.net/
  15. // +----------------------------------------------------------------------+
  16. // | Author (TikiWiki): Ricardo Gladwell <axonrg@users.sourceforge.net>
  17. // | Reworked for Bitweaver (& Undoubtedly Screwed-Up)
  18. // | by: StarRider <starrrider@users.sourceforge.net>
  19. // +----------------------------------------------------------------------+
  20. // $Id$
  21.  
  22. /**
  23.  * definitions
  24.  */
  25. global $gBitSystem;
  26. if( ( $gBitSystem->isPackageActive'wiki' ) ) && $gBitSystem->isFeatureActive'wiki_copyrights' ) ) ) // Do not include this Plugin if this Package and Feature are not active
  27.  
  28. define'PLUGIN_GUID_DATACOPYRIGHT''datacopyright' );
  29. global $gLibertySystem;
  30. $pluginParams array (
  31.     'tag' => 'COPYRIGHT',
  32.     'auto_activate' => FALSE,
  33.     'requires_pair' => FALSE,
  34.     'load_function' => 'data_copyright',
  35.     'title' => 'CopyRight',
  36.     'help_page' => 'DataPluginCopyRight',
  37.     'description' => tra("This plugin is used to insert CopyRight notices."),
  38.     'help_function' => 'data_copyright_help',
  39.     'syntax' => "{COPYRIGHT title= year= authors= }",
  40.     'plugin_type' => DATA_PLUGIN
  41. );
  42. $gLibertySystem->registerPluginPLUGIN_GUID_DATACOPYRIGHT$pluginParams );
  43. $gLibertySystem->registerDataTag$pluginParams['tag']PLUGIN_GUID_DATACOPYRIGHT );
  44.  
  45. // Help Function
  46. function data_copyright_help({
  47.     $help =
  48.         '<table class="data help">'
  49.             .'<tr>'
  50.                 .'<th>' tra"Key" '</th>'
  51.                 .'<th>' tra"Type" '</th>'
  52.                 .'<th>' tra"Comments" '</th>'
  53.             .'</tr>'
  54.             .'<tr class="odd">'
  55.                 .'<td>title</td>'
  56.                 .'<td>' tra"string"'<br />' tra"(optional)"'</td>'
  57.                 .'<td>' tra"The Title of the Publication. There is no default."'</td>'
  58.             .'</tr>'
  59.             .'<tr class="even">'
  60.                 .'<td>year</td>'
  61.                 .'<td>' tra"string"'<br />' tra"(optional)"'</td>'
  62.                 .'<td>' tra"The Year of the Publication. There is no default."'</td>'
  63.             .'</tr>'
  64.             .'<tr class="odd">'
  65.                 .'<td>authors</td>'
  66.                 .'<td>' tra"string"'<br />' tra"(optional)"'</td>'
  67.                 .'<td>' tra"The Authors of the Publication. There is no default."'</td>'
  68.             .'</tr>'
  69.         .'</table>'
  70.         . tra("Example: ""{COPYRIGHT title='The Tiki Way' year='May 10, 2004' authors='StarRider' }";
  71.     return $help;
  72. }
  73.  
  74. // Load Function
  75. function data_copyright($data$params// Pre-Clyde Changes
  76. // This plugin did not use any parameters - The keywords ~Title~ ~year~ and ~authors~ were inbeded in $data like this
  77. // {COPYRIGHT()}~title~The Tiki Way~year~May 10, 2004~authors~StarRider{COPYRIGHT}
  78. // Changed this to use Parameters instead
  79. // Added testing to maintain Pre-Clyde compatability
  80. // The next 2 lines allow access to the $pluginParams given above and may be removed when no longer needed
  81.     global $gLibertySystem;
  82.     $pluginParams $gLibertySystem->mPlugins[PLUGIN_GUID_DATACOPYRIGHT];
  83.     extract ($paramsEXTR_SKIP);
  84.     // This maintains Pre-Clyde Parameters
  85.     if !empty$data) ) // The problem with this is that $authors HAS to be the last key-word
  86.         $pos1 strposstrtolower($data)'~title~'7;
  87.         $pos2 strposstrtolower($data)'~'$pos1 );
  88.         $title substr$data$pos1$pos2-$pos1);
  89.         $pos1 strposstrtolower($data)'~year~'6;
  90.         $pos2 strposstrtolower($data)'~'$pos1 );
  91.         $year substr$data$pos1$pos2-$pos1);
  92.         $pos1 strposstrtolower($data)'~authors~'9;
  93.         $pos2 strlen($data$pos1;
  94.         $authors substr$data$pos1$pos2);
  95.     else {
  96.         $title = isset$title$title ' ';
  97.         $year = isset$year$year ' ';
  98.         $authors = isset$authors$authors ' ';
  99.     }
  100.     $ret 'The plugin <strong>"' $pluginParams['tag''"</strong> has not been completed as yet. ';
  101.     return $ret;
  102. }
  103. }
  104. ?>

Documentation generated on Wed, 29 Jul 2015 13:56:18 +0000 by phpDocumentor 1.5.0-lsces