diff --git a/lib/WebGUI/Asset/Wobject/UserList.pm b/lib/WebGUI/Asset/Wobject/UserList.pm index 0ca105b5b..6eb8cd3a3 100644 --- a/lib/WebGUI/Asset/Wobject/UserList.pm +++ b/lib/WebGUI/Asset/Wobject/UserList.pm @@ -578,206 +578,6 @@ sub view { my $out = $self->processTemplate(\%var,$self->get("templateId")); return $out; } -# Everything below here is to make it easier to install your custom -# wobject, but has nothing to do with wobjects in general -# ------------------------------------------------------------------- -# cd /data/WebGUI/lib -# perl -MWebGUI::Asset::Wobject::NewWobject -e install www.example.com.conf [ /path/to/WebGUI ] -# - or - -# perl -MWebGUI::Asset::Wobject::NewWobject -e uninstall www.example.com.conf [ /path/to/WebGUI ] -# ------------------------------------------------------------------- - - -use base 'Exporter'; -our @EXPORT = qw(install uninstall); -use WebGUI::Session; - -#------------------------------------------------------------------- -sub install { - my $config = $ARGV[0]; - my $home = $ARGV[1] || "/data/WebGUI"; - die "usage: perl -MWebGUI::Asset::Wobject::UserList -e install www.example.com.conf\n" unless ($home && -$config); - print "Installing asset.\n"; - my $session = WebGUI::Session->open($home, $config); - $session->config->addToArray("assets","WebGUI::Asset::Wobject::NewWobject"); - $session->db->write("create table UserList ( - assetId varchar(22) not null, - revisionDate bigint(20), - templateId varchar(22), - showGroupId varchar(22), - hideGroupId varchar(22), - usersPerPage int(11), - alphabet text, - alphabetSearchField varchar(128), - showOnlyVisibleAsNamed int(11), - sortBy varchar(128), - sortOrder varchar(4), - overridePublicEmail int(11), - overridePublicProfile int(11), - PRIMARY KEY (`assetId`,`revisionDate`) - )"); - my $import = WebGUI::Asset->getImportNode($session); - - $import->addChild({ - - className=>"WebGUI::Asset::Template", - - template=>q| - -

-
- - -

-
- -

- - - - - - - - - | - -
-
- -Search with one keyword in one or more fields that the user can select
- - -
-
-
- -
-
- -Search with one keyword in one or more fields that are defined by hidden form fields
- - - - - - -
-
- -Search with multiple keywords
- -^International('searchFormTypeSelect label','Asset_UserList');
-:
- (exact):
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
IdUsername - - -
- -^International('Email not public message','Asset_UserList'); - - - -
^International('No users message','Asset_UserList');
- -

-
-|, - - ownerUserId=>'3', - - groupIdView=>'7', - - groupIdEdit=>'12', - - title=>"Default UserList", - - menuTitle=>"Default UserList", - - url=>"templates/userlist", - - namespace=>"UserList" - - },'UserListTmpl0000001'); - - my $versionTag = WebGUI::VersionTag->getWorking($session); - $versionTag->set({name=>"Install UserList Template"}); - $versionTag->commit; - - $session->var->end; - $session->close; - print "Done. Please restart Apache.\n"; -} -#------------------------------------------------------------------- -sub uninstall { - my $config = $ARGV[0]; - my $home = $ARGV[1] || "/data/WebGUI"; - die "usage: perl -MWebGUI::Asset::Wobject::UserList -e uninstall www.example.com.conf\n" unless ($home && -$config); - print "Uninstalling asset.\n"; - my $session = WebGUI::Session->open($home, $config); - $session->config->deleteFromArray("assets","WebGUI::Asset::Wobject::UserList"); - my $rs = $session->db->read("select assetId from asset where -className='WebGUI::Asset::Wobject::UserList'"); - while (my ($id) = $rs->array) { - my $asset = WebGUI::Asset->new($session, $id, "WebGUI::Asset::Wobject::UserList"); - $asset->purge if defined $asset; - } - - $rs = $session->db->read("select distinct(assetId) from template where namespace='UserList'"); - - while (my ($id) = $rs->array) { - my $asset = WebGUI::Asset->new($session, $id, "WebGUI::Asset::Template"); - $asset->purge if defined $asset; - } - - $session->db->write("drop table UserList"); - $session->var->end; - $session->close; - print "Done. Please restart Apache.\n"; -} 1;