Changeset 3450
- Timestamp:
- 04/15/09 17:38:37 (3 years ago)
- Location:
- trunk/RenderListPlugin
- Files:
-
- 2 edited
-
data/System/RenderListPlugin.txt (modified) (3 diffs)
-
lib/Foswiki/Plugins/RenderListPlugin.pm (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/RenderListPlugin/data/System/RenderListPlugin.txt
r3047 r3450 2 2 ---+ Render List Plugin 3 3 4 Render bullet lists in a variety of formats 4 <!-- 5 * Set SHORTDESCRIPTION = Render bullet lists in a variety of formats 6 --> 7 %SHORTDESCRIPTION% 5 8 6 9 ---++ Syntax Rules … … 320 323 </td></tr></table> 321 324 322 ---++ <nop>%TOPIC% Settings 323 324 Plugin settings are stored as [[%SYSTEMWEB%.PreferenceSettings][preference settings]]. To reference a plugin setting write ==%<nop><plugin>_<setting>%==, i.e. ==%<nop>RENDERPLUGIN_SHORTDESCRIPTION%== 325 326 * One line description, is shown in the %SYSTEMWEB%.TextFormattingRules topic: 327 * Set SHORTDESCRIPTION = Render bullet lists in a variety of formats 328 329 * Debug plugin: (See output in =data/debug.txt=) 330 * Set DEBUG = 0 331 332 * Themes are named =<SOMETHING>_THEME= and contain a comma delimited list of render type with parameters: 333 * Set THREAD_THEME = tree, 1 334 * Set HOME_THEME = icon, 1, 16, 16, %ATTACHURL%/empty.gif, %ATTACHURL%/dot_udr.gif, %ATTACHURL%/dot_ud.gif, %ATTACHURL%/dot_ur.gif, %ATTACHURL%/home.gif 335 * Set ORG_THEME = icon, 0, 16, 16, %ATTACHURL%/empty.gif, %ATTACHURL%/dot_udr.gif, %ATTACHURL%/dot_ud.gif, %ATTACHURL%/dot_ur.gif, %ATTACHURL%/home.gif 336 * Set GROUP_THEME = icon, 0, 16, 16, %ATTACHURL%/empty.gif, %ATTACHURL%/dot_udr.gif, %ATTACHURL%/dot_ud.gif, %ATTACHURL%/dot_ur.gif, %ATTACHURL%/group.gif 337 * Set EMAIL_THEME = icon, 0, 16, 16, %ATTACHURL%/empty.gif, %ATTACHURL%/dot_udr.gif, %ATTACHURL%/dot_ud.gif, %ATTACHURL%/dot_ur.gif, %ATTACHURL%/email.gif 338 * Set TREND_THEME = icon, 0, 16, 16, %ATTACHURL%/empty.gif, %ATTACHURL%/dot_udr.gif, %ATTACHURL%/dot_ud.gif, %ATTACHURL%/dot_ur.gif, %ATTACHURL%/trend.gif 339 * Set FILE_THEME = icon, 0, 16, 16, %ATTACHURL%/empty.gif, %ATTACHURL%/dot_udr.gif, %ATTACHURL%/dot_ud.gif, %ATTACHURL%/dot_ur.gif, %ATTACHURL%/file.gif 325 ---++ Themes 326 Themes are defined by setting a [[%SYSTEMWEB%.PreferenceSettings][preference]] called =RENDERLISTPLUGIN_<SOMETHING>_THEME= (for example, =RENDERLISTPLUGIN_THREAD_THEME= ) and contain a comma-delimited list of render type and parameters. The default themes are: 327 | *Theme* | *Render type* | 328 | THREAD | tree, 1 | 329 | HOME | icon, 1, 16, 16, %ATTACHURL%/empty.gif, %ATTACHURL%/dot_udr.gif, %ATTACHURL%/dot_ud.gif, %ATTACHURL%/dot_ur.gif, %ATTACHURL%/home.gif | 330 | ORG | icon, 0, 16, 16, %ATTACHURL%/empty.gif, %ATTACHURL%/dot_udr.gif, %ATTACHURL%/dot_ud.gif, %ATTACHURL%/dot_ur.gif, %ATTACHURL%/home.gif | 331 | GROUP | icon, 0, 16, 16, %ATTACHURL%/empty.gif, %ATTACHURL%/dot_udr.gif, %ATTACHURL%/dot_ud.gif, %ATTACHURL%/dot_ur.gif, %ATTACHURL%/group.gif | 332 | EMAIL | icon, 0, 16, 16, %ATTACHURL%/empty.gif, %ATTACHURL%/dot_udr.gif, %ATTACHURL%/dot_ud.gif, %ATTACHURL%/dot_ur.gif, %ATTACHURL%/email.gif | 333 | TREND | icon, 0, 16, 16, %ATTACHURL%/empty.gif, %ATTACHURL%/dot_udr.gif, %ATTACHURL%/dot_ud.gif, %ATTACHURL%/dot_ur.gif, %ATTACHURL%/trend.gif | 334 | FILE | icon, 0, 16, 16, %ATTACHURL%/empty.gif, %ATTACHURL%/dot_udr.gif, %ATTACHURL%/dot_ud.gif, %ATTACHURL%/dot_ur.gif, %ATTACHURL%/file.gif | 340 335 341 336 ---++ Plugin Installation Instructions 342 343 *Note:* You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the Foswiki server. 344 345 * Download the ZIP file from the Plugin Home (see below) 346 * Unzip ==%TOPIC%.zip== in your Foswiki installation directory. Content: 347 | *File:* | *Description:* | 348 | ==data/System/%TOPIC%.txt== | Plugin topic | 349 | ==data/System/%TOPIC%.txt,v== | Plugin topic repository | 350 | ==lib/Foswiki/Plugins/%TOPIC%.pm== | Plugin Perl module | 351 | ==pub/System/%TOPIC%/*.gif== | Image files for themes | 352 * Run the [[%SCRIPTURL%/configure%SCRIPTSUFFIX%][configure]] script to enable the Plugin 337 %$INSTALL_INSTRUCTIONS% 353 338 * Test if the installation was successful: See if above examples work 354 339 355 340 ---++ Plugin Info 356 341 357 | Copyright: | Copyright (C) 2006-2007 Peter Thoeny, peter@thoeny.org and TWiki 358 Contributors; 2008 Foswiki Contributors | 342 | Copyright: | Copyright (C) 2006-2007 Peter Thoeny, peter@thoeny.org and TWiki Contributors; 2008 Foswiki Contributors | 359 343 | License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) | 360 344 | Plugin Version: | 16 Dec 2008 (2.1) | 361 345 | Change History: | <!-- versions below in reverse order --> | 346 | 15 Apr 2009: | 2.2: Crawford Currie. Moved default themes out of plugin topic for efficiency. | 362 347 | 16 Dec 2008: | 2.1: Kenneth Lavrsen. Foswiki version | 363 348 | 15 Jan 2008: | 2.0: Kenneth Lavrsen. No more reporting warnings in the error log when a render list starts at deeper level than 1 | … … 374 359 | 05 Dec 2003: | Fixed rendering issue with IE; added EMAIL_THEME | 375 360 | 02 Dec 2003: | Initial version | 376 | CPAN Dependencies: | none |377 | Other Dependencies: | none |378 | Perl Version: | 5.008 |379 361 | Plugin Home: | http://foswiki.org/Extensions/%TOPIC% | 380 362 | Support: | http://foswiki.org/Support/%TOPIC% | -
trunk/RenderListPlugin/lib/Foswiki/Plugins/RenderListPlugin.pm
r1408 r3450 23 23 # ========================= 24 24 use vars qw( 25 $web $topic $user $installWeb $VERSION $RELEASE $pluginName26 $ debug $pubUrl $attachUrl25 $web $topic $user $installWeb 26 $pubUrl $attachUrl 27 27 ); 28 28 29 $VERSION = '$Rev: 16234 $'; 30 $RELEASE = '2.1'; 31 $pluginName = 'RenderListPlugin'; # Name of this Plugin 29 our $VERSION = '$Rev: 16234 $'; 30 our $RELEASE = '2.1'; 31 our $pluginName = 'RenderListPlugin'; # Name of this Plugin 32 our $NO_PREFS_IN_TOPIC = 1; 33 our $SHORTDESCRIPTION = 'Render bullet lists in a variety of formats'; 34 35 our %defaultThemes = ( 36 THREAD => 'tree, 1', 37 HOME => 'icon, 1, 16, 16, %ATTACHURL%/empty.gif, %ATTACHURL%/dot_udr.gif, %ATTACHURL%/dot_ud.gif, %ATTACHURL%/dot_ur.gif, %ATTACHURL%/home.gif', 38 ORG => 'icon, 0, 16, 16, %ATTACHURL%/empty.gif, %ATTACHURL%/dot_udr.gif, %ATTACHURL%/dot_ud.gif, %ATTACHURL%/dot_ur.gif, %ATTACHURL%/home.gif', 39 GROUP => 'icon, 0, 16, 16, %ATTACHURL%/empty.gif, %ATTACHURL%/dot_udr.gif, %ATTACHURL%/dot_ud.gif, %ATTACHURL%/dot_ur.gif, %ATTACHURL%/group.gif', 40 EMAIL => 'icon, 0, 16, 16, %ATTACHURL%/empty.gif, %ATTACHURL%/dot_udr.gif, %ATTACHURL%/dot_ud.gif, %ATTACHURL%/dot_ur.gif, %ATTACHURL%/email.gif', 41 TREND => 'icon, 0, 16, 16, %ATTACHURL%/empty.gif, %ATTACHURL%/dot_udr.gif, %ATTACHURL%/dot_ud.gif, %ATTACHURL%/dot_ur.gif, %ATTACHURL%/trend.gif', 42 FILE => 'icon, 0, 16, 16, %ATTACHURL%/empty.gif, %ATTACHURL%/dot_udr.gif, %ATTACHURL%/dot_ud.gif, %ATTACHURL%/dot_ur.gif, %ATTACHURL%/file.gif', 43 ); 32 44 33 45 # ========================= … … 42 54 } 43 55 44 # Get plugin debug flag45 $debug = Foswiki::Func::getPreferencesFlag( "\U$pluginName\E_DEBUG" );46 47 56 # one time initialization 48 57 $pubUrl = Foswiki::Func::getUrlHost() . Foswiki::Func::getPubUrlPath(); … … 50 59 51 60 # Plugin correctly initialized 52 Foswiki::Func::writeDebug( "- Foswiki::Plugins::${pluginName}::initPlugin( $web.$topic ) is OK" ) if $debug;53 61 return 1; 54 62 } … … 58 66 { 59 67 ### my ( $text, $web ) = @_; # do not uncomment, use $_[0], $_[1] instead 60 61 Foswiki::Func::writeDebug( "- ${pluginName}::startRenderingHandler( $_[1] )" ) if $debug;62 68 63 69 # This handler is called by getRenderedVersion just before the line loop … … 86 92 my $theme = &Foswiki::Func::extractNameValuePair( $theAttr, "theme" ) || 87 93 &Foswiki::Func::extractNameValuePair( $theAttr ); 88 $theme = "RENDERLISTPLUGIN_" . uc( $theme ) . "_THEME"; 89 $theme = &Foswiki::Func::getPreferencesValue( $theme ) || "unrecognized theme type"; 94 $theme = uc($theme || ''); 95 if (defined $defaultThemes{$theme}) { 96 $theme = $defaultThemes{$theme}; 97 } else { 98 $theme = "RENDERLISTPLUGIN_${theme}_THEME"; 99 $theme = &Foswiki::Func::getPreferencesValue( $theme ) 100 || "unrecognized theme type"; 101 } 90 102 my ( $type, $params ) = split( /, */, $theme, 2 ); 91 103 $type = lc( $type );
Note: See TracChangeset
for help on using the changeset viewer.
