Cleaning up the admin interface.
This commit is contained in:
parent
cd807bd9eb
commit
e8bab4e22b
3 changed files with 148 additions and 166 deletions
|
|
@ -55,8 +55,8 @@ sub _submenu {
|
||||||
tie %menu, 'Tie::IxHash';
|
tie %menu, 'Tie::IxHash';
|
||||||
%menu = %{$_[1]};
|
%menu = %{$_[1]};
|
||||||
if (($session{form}{op} eq "editHelp" && $session{form}{hid} ne "new") || $session{form}{op} eq "deleteHelp") {
|
if (($session{form}{op} eq "editHelp" && $session{form}{hid} ne "new") || $session{form}{op} eq "deleteHelp") {
|
||||||
$menu(WebGUI::URL::page('op=editHelpIndex&hid='.$session{form}{hid}) = "Edit this help.";
|
$menu{WebGUI::URL::page('op=editHelpIndex&hid='.$session{form}{hid})} = "Edit this help.";
|
||||||
$menu(WebGUI::URL::page('op=deleteHelpIndex&hid='.$session{form}{hid}) = "Delete this help.";
|
$menu{WebGUI::URL::page('op=deleteHelpIndex&hid='.$session{form}{hid})} = "Delete this help.";
|
||||||
}
|
}
|
||||||
$menu{WebGUI::URL::page('op=viewHelpIndex')} = WebGUI::International::get(13);
|
$menu{WebGUI::URL::page('op=viewHelpIndex')} = WebGUI::International::get(13);
|
||||||
return menuWrapper($_[0],\%menu);
|
return menuWrapper($_[0],\%menu);
|
||||||
|
|
@ -189,7 +189,7 @@ sub www_exportHelp {
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_manageHelp {
|
sub www_manageHelp {
|
||||||
my ($sth, @help, $output);
|
my ($sth, @help, $output);
|
||||||
return "" unless (WebGUI::Privilege::isInGroup(3)) {
|
return "" unless (WebGUI::Privilege::isInGroup(3));
|
||||||
$output = '<h1>Manage Help</h1>';
|
$output = '<h1>Manage Help</h1>';
|
||||||
$output .= 'This interface is for WebGUI developers only. If you\'re not a developer, leave this alone. Also,
|
$output .= 'This interface is for WebGUI developers only. If you\'re not a developer, leave this alone. Also,
|
||||||
this interface works <b>ONLY</b> under MySQL and is not supported by Plain Black under any
|
this interface works <b>ONLY</b> under MySQL and is not supported by Plain Black under any
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ use WebGUI::HTMLForm;
|
||||||
use WebGUI::Icon;
|
use WebGUI::Icon;
|
||||||
use WebGUI::International;
|
use WebGUI::International;
|
||||||
use WebGUI::Mail;
|
use WebGUI::Mail;
|
||||||
|
use WebGUI::Operation::Shared;
|
||||||
use WebGUI::Paginator;
|
use WebGUI::Paginator;
|
||||||
use WebGUI::Session;
|
use WebGUI::Session;
|
||||||
use WebGUI::SQL;
|
use WebGUI::SQL;
|
||||||
|
|
@ -55,21 +56,20 @@ sub _export {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub _submenu {
|
sub _submenu {
|
||||||
my ($output);
|
my (%menu);
|
||||||
$output = '<table width="100%"><tr>';
|
tie %menu, 'Tie::IxHash';
|
||||||
$output .= '<td valign="top" class="content">'.$_[0].'</td>';
|
|
||||||
$output .= '<td valign="top" class="tableMenu" nowrap="1">';
|
|
||||||
if ($session{form}{lid} == 1) {
|
if ($session{form}{lid} == 1) {
|
||||||
$output .= '<li><a href="'.WebGUI::URL::page('op=addInternationalMessage&lid=1').'">Add new message.</a>';
|
$menu{WebGUI::URL::page('op=addInternationalMessage&lid=1')} = "Add new message.";
|
||||||
}
|
}
|
||||||
$output .= '<li><a href="'.WebGUI::URL::page('op=listInternationalMessages&lid='.$session{form}{lid}).'">'.WebGUI::International::get(594).'</a>';
|
if ($session{form}{lid} ne "") {
|
||||||
$output .= '<li><a href="'.WebGUI::URL::page('op=editLanguage&lid='.$session{form}{lid}).'">'.WebGUI::International::get(598).'</a>';
|
$menu{WebGUI::URL::page('op=listInternationalMessages&lid='.$session{form}{lid})} =
|
||||||
$output .= '<li><a href="'.WebGUI::URL::page('op=exportTranslation&lid='.$session{form}{lid}).'">'.WebGUI::International::get(718).'</a>';
|
WebGUI::International::get(594);
|
||||||
$output .= '<li><a href="'.WebGUI::URL::page('op=submitTranslation&lid='.$session{form}{lid}).'">'.WebGUI::International::get(593).'</a>';
|
$menu{WebGUI::URL::page('op=editLanguage&lid='.$session{form}{lid})} = WebGUI::International::get(598);
|
||||||
$output .= '<li><a href="'.WebGUI::URL::page('op=listLanguages').'">'.WebGUI::International::get(585).'</a>';
|
$menu{WebGUI::URL::page('op=exportTranslation&lid='.$session{form}{lid})} = WebGUI::International::get(718);
|
||||||
$output .= '<li><a href="'.WebGUI::URL::page().'">'.WebGUI::International::get(493).'</a>';
|
$menu{WebGUI::URL::page('op=submitTranslation&lid='.$session{form}{lid})} = WebGUI::International::get(593);
|
||||||
$output .= '</td></tr></table>';
|
}
|
||||||
return $output;
|
$menu{WebGUI::URL::page('op=listLanguages')} = WebGUI::International::get(585);
|
||||||
|
return menuWrapper($_[0],\%menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
@ -121,23 +121,19 @@ sub www_deleteLanguage {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_deleteLanguageConfirm {
|
sub www_deleteLanguageConfirm {
|
||||||
if ($session{form}{lid} < 1000 && $session{form}{lid} > 0) {
|
return WebGUI::Privilege::adminOnly() unless (WebGUI::Privilege::isInGroup(3));
|
||||||
return WebGUI::Privilege::vitalComponent();
|
return WebGUI::Privilege::vitalComponent() if ($session{form}{lid} < 1000 && $session{form}{lid} > 0);
|
||||||
} elsif (WebGUI::Privilege::isInGroup(3)) {
|
|
||||||
WebGUI::SQL->write("delete from language where languageId=".$session{form}{lid});
|
WebGUI::SQL->write("delete from language where languageId=".$session{form}{lid});
|
||||||
WebGUI::SQL->write("delete from international where languageId=".$session{form}{lid});
|
WebGUI::SQL->write("delete from international where languageId=".$session{form}{lid});
|
||||||
WebGUI::SQL->write("delete from help where languageId=".$session{form}{lid});
|
WebGUI::SQL->write("delete from help where languageId=".$session{form}{lid});
|
||||||
WebGUI::SQL->write("delete from userProfileData where fieldName='language' and fieldData=".$session{form}{lid});
|
WebGUI::SQL->write("delete from userProfileData where fieldName='language' and fieldData=".$session{form}{lid});
|
||||||
return www_listLanguages();
|
return www_listLanguages();
|
||||||
} else {
|
|
||||||
return WebGUI::Privilege::adminOnly();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_editInternationalMessage {
|
sub www_editInternationalMessage {
|
||||||
my ($output, $message, $f, $language);
|
my ($output, $message, $f, $language);
|
||||||
if (WebGUI::Privilege::isInGroup(3)) {
|
return WebGUI::Privilege::adminOnly() unless (WebGUI::Privilege::isInGroup(3));
|
||||||
($language) = WebGUI::SQL->quickArray("select language from language where languageId=".$session{form}{lid});
|
($language) = WebGUI::SQL->quickArray("select language from language where languageId=".$session{form}{lid});
|
||||||
$output = '<h1>'.WebGUI::International::get(597).'</h1>';
|
$output = '<h1>'.WebGUI::International::get(597).'</h1>';
|
||||||
$f = WebGUI::HTMLForm->new;
|
$f = WebGUI::HTMLForm->new;
|
||||||
|
|
@ -157,14 +153,11 @@ sub www_editInternationalMessage {
|
||||||
$f->readOnly($message,"English");
|
$f->readOnly($message,"English");
|
||||||
$output .= $f->print;
|
$output .= $f->print;
|
||||||
return _submenu($output);
|
return _submenu($output);
|
||||||
} else {
|
|
||||||
return WebGUI::Privilege::adminOnly();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_editInternationalMessageSave {
|
sub www_editInternationalMessageSave {
|
||||||
if (WebGUI::Privilege::isInGroup(3)) {
|
return WebGUI::Privilege::adminOnly() unless (WebGUI::Privilege::isInGroup(3));
|
||||||
if ($session{form}{status} eq "missing") {
|
if ($session{form}{status} eq "missing") {
|
||||||
WebGUI::SQL->write("insert into international (message,namespace,languageId,internationalId,lastUpdated)
|
WebGUI::SQL->write("insert into international (message,namespace,languageId,internationalId,lastUpdated)
|
||||||
values (".quote($session{form}{message}).",".quote($session{form}{namespace})
|
values (".quote($session{form}{message}).",".quote($session{form}{namespace})
|
||||||
|
|
@ -175,9 +168,6 @@ sub www_editInternationalMessageSave {
|
||||||
and languageId=".$session{form}{lid}." and internationalId=".$session{form}{iid});
|
and languageId=".$session{form}{lid}." and internationalId=".$session{form}{iid});
|
||||||
}
|
}
|
||||||
return www_listInternationalMessages();
|
return www_listInternationalMessages();
|
||||||
} else {
|
|
||||||
return WebGUI::Privilege::adminOnly();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
@ -216,7 +206,7 @@ sub www_editLanguage {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_editLanguageSave {
|
sub www_editLanguageSave {
|
||||||
if (WebGUI::Privilege::isInGroup(3)) {
|
return WebGUI::Privilege::adminOnly() unless (WebGUI::Privilege::isInGroup(3));
|
||||||
if ($session{form}{lid} eq "new") {
|
if ($session{form}{lid} eq "new") {
|
||||||
$session{form}{lid} = getNextId("languageId");
|
$session{form}{lid} = getNextId("languageId");
|
||||||
WebGUI::SQL->write("insert into language (languageId) values ($session{form}{lid})");
|
WebGUI::SQL->write("insert into language (languageId) values ($session{form}{lid})");
|
||||||
|
|
@ -225,9 +215,6 @@ sub www_editLanguageSave {
|
||||||
characterSet=".quote($session{form}{characterSet}).", toolbar=".quote($session{form}{toolbar})."
|
characterSet=".quote($session{form}{characterSet}).", toolbar=".quote($session{form}{toolbar})."
|
||||||
where languageId=".$session{form}{lid});
|
where languageId=".$session{form}{lid});
|
||||||
return www_editLanguage();
|
return www_editLanguage();
|
||||||
} else {
|
|
||||||
return WebGUI::Privilege::adminOnly();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
@ -238,9 +225,9 @@ sub www_exportTranslation {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_listInternationalMessages {
|
sub www_listInternationalMessages {
|
||||||
|
return WebGUI::Privilege::adminOnly() unless (WebGUI::Privilege::isInGroup(3));
|
||||||
my ($output, $sth, $key, $p, $search, $status,%data, %list, $deprecated, $i, $missing, @row, $f, $outOfDate, $ok);
|
my ($output, $sth, $key, $p, $search, $status,%data, %list, $deprecated, $i, $missing, @row, $f, $outOfDate, $ok);
|
||||||
tie %data, 'Tie::CPHash';
|
tie %data, 'Tie::CPHash';
|
||||||
if (WebGUI::Privilege::isInGroup(3)) {
|
|
||||||
%data = WebGUI::SQL->quickHash("select language from language where languageId=".$session{form}{lid});
|
%data = WebGUI::SQL->quickHash("select language from language where languageId=".$session{form}{lid});
|
||||||
$missing = '<b>'.WebGUI::International::get(596).'</b>';
|
$missing = '<b>'.WebGUI::International::get(596).'</b>';
|
||||||
$outOfDate = '<b>'.WebGUI::International::get(719).'</b>';
|
$outOfDate = '<b>'.WebGUI::International::get(719).'</b>';
|
||||||
|
|
@ -313,16 +300,13 @@ sub www_listInternationalMessages {
|
||||||
$output .= '</table>';
|
$output .= '</table>';
|
||||||
$output .= $p->getBarTraditional($session{form}{pn});
|
$output .= $p->getBarTraditional($session{form}{pn});
|
||||||
return _submenu($output);
|
return _submenu($output);
|
||||||
} else {
|
|
||||||
return WebGUI::Privilege::adminOnly();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_listLanguages {
|
sub www_listLanguages {
|
||||||
my ($output, $sth, %data);
|
my ($output, $sth, %data);
|
||||||
tie %data, 'Tie::CPHash';
|
tie %data, 'Tie::CPHash';
|
||||||
if (WebGUI::Privilege::isInGroup(3)) {
|
return WebGUI::Privilege::adminOnly() unless (WebGUI::Privilege::isInGroup(3));
|
||||||
$output = '<h1>'.WebGUI::International::get(586).'</h1>';
|
$output = '<h1>'.WebGUI::International::get(586).'</h1>';
|
||||||
$output .= '<a href="'.WebGUI::URL::page('op=editLanguage&lid=new').'">'.WebGUI::International::get(584).'</a>';
|
$output .= '<a href="'.WebGUI::URL::page('op=editLanguage&lid=new').'">'.WebGUI::International::get(584).'</a>';
|
||||||
$output .= '<p>';
|
$output .= '<p>';
|
||||||
|
|
@ -333,10 +317,7 @@ sub www_listLanguages {
|
||||||
.' '.$data{language}.'<br>';
|
.' '.$data{language}.'<br>';
|
||||||
}
|
}
|
||||||
$sth->finish;
|
$sth->finish;
|
||||||
return $output;
|
return _submenu($output);
|
||||||
} else {
|
|
||||||
return WebGUI::Privilege::adminOnly();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -64,9 +64,9 @@ use WebGUI::Node ();
|
||||||
use WebGUI::Operation ();
|
use WebGUI::Operation ();
|
||||||
use WebGUI::Operation::Account ();
|
use WebGUI::Operation::Account ();
|
||||||
use WebGUI::Operation::Admin ();
|
use WebGUI::Operation::Admin ();
|
||||||
|
use WebGUI::Operation::Collateral ();
|
||||||
use WebGUI::Operation::Group ();
|
use WebGUI::Operation::Group ();
|
||||||
use WebGUI::Operation::Help ();
|
use WebGUI::Operation::Help ();
|
||||||
use WebGUI::Operation::Image ();
|
|
||||||
use WebGUI::Operation::International ();
|
use WebGUI::Operation::International ();
|
||||||
use WebGUI::Operation::Package ();
|
use WebGUI::Operation::Package ();
|
||||||
use WebGUI::Operation::Page ();
|
use WebGUI::Operation::Page ();
|
||||||
|
|
@ -74,6 +74,7 @@ use WebGUI::Operation::ProfileSettings ();
|
||||||
use WebGUI::Operation::Root ();
|
use WebGUI::Operation::Root ();
|
||||||
use WebGUI::Operation::Search ();
|
use WebGUI::Operation::Search ();
|
||||||
use WebGUI::Operation::Settings ();
|
use WebGUI::Operation::Settings ();
|
||||||
|
use WebGUI::Operation::Shared ();
|
||||||
use WebGUI::Operation::Statistics ();
|
use WebGUI::Operation::Statistics ();
|
||||||
use WebGUI::Operation::Style ();
|
use WebGUI::Operation::Style ();
|
||||||
use WebGUI::Operation::Template ();
|
use WebGUI::Operation::Template ();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue