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

Source for file data.dropdown.php

Documentation is available at data.dropdown.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: StarRider starrrider@sourceforge.net
  17. // +----------------------------------------------------------------------+
  18. // $id: data.dropdown.php,v 1.8 2005/07/14 09:03:36 starrider Exp $
  19.  
  20. /**
  21.  * Initialization
  22.  */
  23. global $gLibertySystem;
  24. define( 'PLUGIN_GUID_DATADROPDOWN', 'datadropdown' );
  25. $pluginParams = array (
  26.     'tag' => 'DD',
  27.     'auto_activate' => FALSE,
  28.     'requires_pair' => TRUE,
  29.     'load_function' => 'data_dropdown',
  30.     'title' => 'DropDown',
  31.     'help_page' => 'DataPluginDropDown',
  32.     'description' => tra("This plugin creates a expandable box of text. All text should be entered between the ") . "{DD} " . tra("blocks."),
  33.     'help_function' => 'data_dropdown_help',
  34.     'syntax' => "{DD title= width= }" . tra("Text in the Drop-Down box.") . "{DD}",
  35.     'plugin_type' => DATA_PLUGIN
  36. );
  37. $gLibertySystem->registerPlugin( PLUGIN_GUID_DATADROPDOWN, $pluginParams );
  38. $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATADROPDOWN );
  39.  
  40. /**
  41.  * Help Function
  42.  */
  43. function data_dropdown_help() {
  44.     $help =
  45.         '<table class="data help">'
  46.             .'<tr>'
  47.                 .'<th>' . tra( "Key" ) . '</th>'
  48.                 .'<th>' . tra( "Type" ) . '</th>'
  49.                 .'<th>' . tra( "Comments" ) . '</th>'
  50.             .'</tr>'
  51.             .'<tr class="odd">'
  52.                 .'<td>title</td>'
  53.                 .'<td>' . tra( "string") . '<br />' . tra("(optional)") . '</td>'
  54.                 .'<td>' . tra( 'String used as the link to Expand / Contract the text box. <br />The Default = <strong>"For More Information"</strong></td>')
  55.             .'</tr>'
  56.             .'<tr class="even">'
  57.                 .'<td>width</td>'
  58.                 .'<td>' . tra( "numeric") . '<br />' . tra("(optional)") . '</td>'
  59.                 .'<td>' . tra( "Controls the width of the title area in pixels. This is a percentage value but the % character should not be added.<br />The Default = ") . '<strong>20</strong></td>'
  60.             .'</tr>'
  61.         .'</table>'
  62.         . tra("Example: ") . '{DD}' . tra("Text in the Drop-Down box.") . '{DD}<br />'
  63.         . tra("Example: ") . "{DD title='" . tra("Explaining the Lines #1 #3 &amp; #7'} Text in the Drop-Down box") . '{DD}';
  64.     return $help;
  65. }
  66.  
  67. /**
  68. * Load Function
  69. */
  70. function data_dropdown($data, $params) {
  71.     extract ($params, EXTR_SKIP);
  72.     $title = (isset($title)) ? $title : tra( 'For More Information, click me.' );
  73.     $id = 'dropdown'.(microtime() * 1000000);
  74.     $ret =     '<div style="text-align:center;font-weight:bold;">'
  75.                 .'<a title="Click to Expand or Contract" href="javascript:flip(\''.$id.'\')">'.$title.'</a>'
  76.             .'</div>'
  77.             .'<div class="help box" style="display:none" id="'.$id.'">'.$data.'</div>';
  78.     return $ret;
  79. }
  80. ?>

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