Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Item12730: initial checkin of new list management and bookmarking wid…
…get called "listy" git-svn-id: http://svn.foswiki.org/trunk/ListyPlugin@17722 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
- Loading branch information
MichaelDaum
authored and
MichaelDaum
committed
May 28, 2014
0 parents
commit ff6023b
Showing
13 changed files
with
2,123 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
%META:TOPICINFO{author="ProjectContributor" comment="reprev" date="1394206737" format="1.1" reprev="2" version="2"}% | ||
---+!! %TOPIC% | ||
%SHORTDESCRIPTION% | ||
|
||
%TOC% | ||
|
||
---++ Usage | ||
|
||
---++ Examples | ||
|
||
---++ Installation Instructions | ||
|
||
%$INSTALL_INSTRUCTIONS% | ||
|
||
---++ Info | ||
<!-- | ||
* Set SHORTDESCRIPTION = %$SHORTDESCRIPTION% | ||
--> | ||
|
||
| Author(s): | Michael Daum| | ||
| Copyright: | © 2011-2014 Michael Daum http://michaeldaumconsulting.com | | ||
| License: | [[http://www.gnu.org/licenses/gpl.html][GPL (Gnu General Public License)]] | | ||
| Release: | %$RELEASE% | | ||
| Version: | %$VERSION% | | ||
| Change History: | <!-- versions below in reverse order --> | | ||
| 24 Jan 2014: | renamed from <nop>BookmarksPlugin to ListyPlugin | | ||
| Dependencies: | %$DEPENDENCIES% | | ||
| Home page: | Foswiki:Extensions/%TOPIC% | | ||
| Support: | Foswiki:Support/%TOPIC% | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
# Plugin for Foswiki - The Free and Open Source Wiki, http://foswiki.org/ | ||
# | ||
# ListyPlugin is Copyright (C) 2011 Michael Daum http://michaeldaumconsulting.com | ||
# | ||
# This program is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU General Public License | ||
# as published by the Free Software Foundation; either version 2 | ||
# of the License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details, published at | ||
# http://www.gnu.org/copyleft/gpl.html | ||
|
||
package Foswiki::Plugins::ListyPlugin; | ||
|
||
use strict; | ||
use warnings; | ||
|
||
=begin TML | ||
---+ package ListyPlugin | ||
=cut | ||
|
||
use Foswiki::Func (); | ||
use Foswiki::Plugins (); | ||
use Foswiki::Contrib::JsonRpcContrib (); | ||
|
||
our $VERSION = '0.99'; | ||
our $RELEASE = '0.99'; | ||
our $SHORTDESCRIPTION = 'Fancy list manager'; | ||
our $NO_PREFS_IN_TOPIC = 1; | ||
our $core; | ||
|
||
|
||
=begin TML | ||
---++ initPlugin($topic, $web, $user) -> $boolean | ||
=cut | ||
|
||
sub initPlugin { | ||
|
||
Foswiki::Func::registerTagHandler('LISTY', \&LISTY); | ||
|
||
Foswiki::Contrib::JsonRpcContrib::registerMethod("ListyPlugin", "saveListyItem", sub { | ||
my $session = shift; | ||
return getCore($session)->jsonRpcSaveListyItem(@_); | ||
}); | ||
|
||
Foswiki::Contrib::JsonRpcContrib::registerMethod("ListyPlugin", "deleteListyItem", sub { | ||
my $session = shift; | ||
return getCore($session)->jsonRpcDeleteListyItem(@_); | ||
}); | ||
|
||
Foswiki::Contrib::JsonRpcContrib::registerMethod("ListyPlugin", "saveListy", sub { | ||
my $session = shift; | ||
return getCore($session)->jsonRpcSaveListy(@_); | ||
}); | ||
|
||
if ($Foswiki::Plugins::VERSION > 2.0) { | ||
my $metaDataName = $Foswiki::cfg{ListyPlugin}{MetaData} || 'LISTY'; | ||
Foswiki::Meta::registerMETA($metaDataName, alias => lc($metaDataName), many => 1); | ||
} | ||
|
||
|
||
return 1; | ||
} | ||
|
||
=begin TML | ||
---++ finishPlugin() | ||
=cut | ||
|
||
sub finishPlugin { | ||
undef $core; | ||
} | ||
|
||
=begin TML | ||
---++ getCore() | ||
=cut | ||
|
||
sub getCore { | ||
my $session = shift; | ||
|
||
unless (defined $core) { | ||
require Foswiki::Plugins::ListyPlugin::Core; | ||
$core = new Foswiki::Plugins::ListyPlugin::Core($session); | ||
} else { | ||
$core->init($session); | ||
} | ||
|
||
return $core; | ||
} | ||
|
||
=begin TML | ||
---++ LISTY($session, $params, $theTopic, $theWeb) -> $string | ||
stub for LISTY to initiate the core before handling the macro | ||
=cut | ||
|
||
sub LISTY { | ||
my $session = shift; | ||
return getCore($session)->LISTY(@_); | ||
} | ||
|
||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# ---+ Extensions | ||
# ---++ ListyPlugin | ||
# ---+++ Meta data name | ||
# **STRING EXPERT** | ||
# ID of the meta data to hold listy data, defaults to LISTY. | ||
# WARNING: old listies won't be accessible if you change the ID here after having used ListyPlugin for some time. | ||
$Foswiki::cfg{ListyPlugin}{MetaData} = 'LISTY'; | ||
|
||
1; |
Oops, something went wrong.