Removed install code from UserList
This commit is contained in:
parent
c15681bd17
commit
9446ed4e32
1 changed files with 0 additions and 200 deletions
|
|
@ -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|
|
||||
<tmpl_if session.var.adminOn>
|
||||
<p><tmpl_var controls></p>
|
||||
</tmpl_if>
|
||||
|
||||
<tmpl_if displayTitle>
|
||||
<h1><tmpl_var title></h1>
|
||||
</tmpl_if>
|
||||
<tmpl_if description>
|
||||
<tmpl_var description><p />
|
||||
</tmpl_if>
|
||||
|
||||
<tmpl_if alphabetSearch_loop>
|
||||
<tmpl_loop alphabetSearch_loop>
|
||||
<tmpl_if alphabetSearch_loop_hasResults>
|
||||
<a href="<tmpl_var alphabetSearch_loop_searchURL>"><tmpl_var alphabetSearch_loop_label></a>
|
||||
<tmpl_else>
|
||||
<tmpl_var alphabetSearch_loop_label>
|
||||
</tmpl_if><tmpl_unless __LAST__> | </tmpl_unless>
|
||||
</tmpl_loop>
|
||||
</tmpl_if><br />
|
||||
<br />
|
||||
|
||||
Search with one keyword in one or more fields that the user can select <br />
|
||||
<tmpl_var searchFormHeader>
|
||||
<tmpl_var limitSearch>
|
||||
<tmpl_var searchFormQuery_form><br />
|
||||
<tmpl_var includeInSearch_lastName_checkBox> <tmpl_var profileField_lastName_label> <br />
|
||||
<tmpl_var includeInSearch_email_checkBox> <tmpl_var profileField_email_label> <br />
|
||||
<tmpl_var searchFormSubmit>
|
||||
<tmpl_var searchFormFooter><br />
|
||||
<br />
|
||||
|
||||
Search with one keyword in one or more fields that are defined by hidden form fields<br />
|
||||
<tmpl_var searchFormHeader>
|
||||
<tmpl_var searchFormQuery_form>
|
||||
<tmpl_var limitSearch>
|
||||
<tmpl_var includeInSearch_lastName_hidden>
|
||||
<tmpl_var includeInSearch_email_hidden>
|
||||
<tmpl_var searchFormSubmit>
|
||||
<tmpl_var searchFormFooter><br />
|
||||
<br />
|
||||
|
||||
Search with multiple keywords<br />
|
||||
<tmpl_var searchFormHeader>
|
||||
^International('searchFormTypeSelect label','Asset_UserList');<tmpl_var searchFormTypeSelect><br />
|
||||
<tmpl_var profileField_lastName_label>: <tmpl_var search_lastName_text><br />
|
||||
<tmpl_var profileField_email_label> (exact): <tmpl_var searchExact_email_text><br />
|
||||
<tmpl_var searchFormSubmit>
|
||||
<tmpl_var searchFormFooter><br />
|
||||
<br />
|
||||
|
||||
<table cellpadding="1" cellspacing="1" border="0" width="100%">
|
||||
<tr>
|
||||
<tmpl_if session.var.adminOn>
|
||||
<td class="tableData">Id</td>
|
||||
</tmpl_if>
|
||||
|
||||
<td class="tableData">Username</td>
|
||||
|
||||
<td class="tableData">
|
||||
<a href="<tmpl_var profileField_firstName_sortByURL>"><tmpl_var profileField_firstName_label></td>
|
||||
<td class="tableData">
|
||||
<a href="<tmpl_var profileField_lastName_sortByURL>"><tmpl_var profileField_lastName_label></td>
|
||||
<td class="tableData">
|
||||
<a href="<tmpl_var profileField_email_sortByURL>"><tmpl_var profileField_email_label></td>
|
||||
|
||||
</tr>
|
||||
<tmpl_if user_loop>
|
||||
<tmpl_loop user_loop>
|
||||
<tr>
|
||||
|
||||
<tmpl_if session.var.adminOn>
|
||||
<td class="tableData"> <tmpl_var user_id></td>
|
||||
</tmpl_if>
|
||||
<td class="tableData"> <tmpl_var user_name></td>
|
||||
|
||||
<td class="tableData"> <tmpl_var user_profile_fistName_value></td>
|
||||
<td class="tableData"> <tmpl_var user_profile_lastName_value></td>
|
||||
|
||||
<td class="tableData">
|
||||
<tmpl_if profile_emailNotPublic>
|
||||
^International('Email not public message','Asset_UserList');
|
||||
<tmpl_else>
|
||||
<tmpl_var user_profile_email_value>
|
||||
</tmpl_if>
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
</tmpl_loop>
|
||||
<tmpl_else>
|
||||
<tr><td>^International('No users message','Asset_UserList');</td></tr>
|
||||
</tmpl_if>
|
||||
|
||||
</table>
|
||||
<tmpl_if multiplePages>
|
||||
<div class="pagination">
|
||||
<tmpl_var previousPage> · <tmpl_var pageList> · <tmpl_var nextPage>
|
||||
</div>
|
||||
</tmpl_if>
|
||||
|,
|
||||
|
||||
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue