WebGUI 1.3.1 release
This commit is contained in:
parent
5687f5ee66
commit
6cf30b32bd
13 changed files with 69 additions and 83 deletions
|
|
@ -18,7 +18,7 @@ use WebGUI::Session;
|
|||
sub process {
|
||||
my (@files, $file, $cmd, $output);
|
||||
$output = $_[0];
|
||||
opendir (DIR,"../lib/WebGUI/Macro") or WebGUI::ErrorHandler::fatalError("Can't open macro directory!");
|
||||
opendir (DIR,$session{config}{webguiRoot}."/lib/WebGUI/Macro") or WebGUI::ErrorHandler::fatalError("Can't open macro directory!");
|
||||
@files = readdir(DIR);
|
||||
foreach $file (@files) {
|
||||
if ($file ne "." && $file ne ".." && $file =~ /\.pm/) {
|
||||
|
|
@ -31,7 +31,7 @@ sub process {
|
|||
}
|
||||
closedir(DIR);
|
||||
#---script url---
|
||||
# slash hash to go last because it is also used as the end character.
|
||||
# slash has to go last because it is also used as the end character for configurable widgets
|
||||
if ($output =~ /\^\//) {
|
||||
$output =~ s/\^\//$session{env}{SCRIPT_NAME}/g;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,14 +31,15 @@ sub www_viewHelp {
|
|||
$output .= '<p><b>See Also:';
|
||||
$sth = WebGUI::SQL->read("select helpId, action, object from help where object='$help{object}' and action<>'$help{action}' order by action",$session{dbh});
|
||||
while (@data = $sth->array) {
|
||||
$output .= ' <a href="'.$session{page}{url}.'?op=viewHelp&hid='.$data[0].'">'.$data[1].' '.$data[2].'</a>';
|
||||
$output .= ' <a href="'.$session{page}{url}.'?op=viewHelp&hid='.$data[0].'">'.$data[1].' '.$data[2].'</a> ·';
|
||||
}
|
||||
$sth->finish;
|
||||
$sth = WebGUI::SQL->read("select helpId, action, object from help where helpId in ($help{seeAlso}) order by action",$session{dbh});
|
||||
while (@data = $sth->array) {
|
||||
$output .= ' <a href="'.$session{page}{url}.'?op=viewHelp&hid='.$data[0].'">'.$data[1].' '.$data[2].'</a>';
|
||||
$output .= ' <a href="'.$session{page}{url}.'?op=viewHelp&hid='.$data[0].'">'.$data[1].' '.$data[2].'</a> ·';
|
||||
}
|
||||
$sth->finish;
|
||||
$output .= ' <a href="'.$session{page}{url}.'?op=viewHelpIndex">Help Index</a>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -233,9 +233,11 @@ sub www_movePageUp {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_pastePage {
|
||||
my ($output);
|
||||
my ($output, $nextSeq);
|
||||
($nextSeq) = WebGUI::SQL->quickArray("select max(sequenceNumber)+1 from page where parentId=$session{page}{pageId}",$session{dbh});
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
WebGUI::SQL->write("update page set parentId=$session{page}{pageId} where pageId=$session{form}{pageId}",$session{dbh});
|
||||
WebGUI::SQL->write("update page set parentId=$session{page}{pageId}, sequenceNumber='$nextSeq' where pageId=$session{form}{pageId}",$session{dbh});
|
||||
_reorderPages($session{page}{pageId});
|
||||
return "";
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
|
|||
|
|
@ -102,7 +102,8 @@ sub open {
|
|||
tie %USER, 'Tie::CPHash';
|
||||
tie %VARS, 'Tie::CPHash';
|
||||
tie %PAGE, 'Tie::CPHash';
|
||||
$config = new Data::Config '../etc/WebGUI.conf';
|
||||
$CONFIG{webguiRoot} = $_[0];
|
||||
$config = new Data::Config $CONFIG{webguiRoot}.'/etc/WebGUI.conf';
|
||||
foreach ($config->param) {
|
||||
$CONFIG{$_} = $config->param($_);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,9 @@ sub widgetName {
|
|||
sub www_add {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=23"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Add Article</h1><form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=23"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>Add '.widgetName().'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("widget","Article");
|
||||
$output .= WebGUI::Form::hidden("func","addSave");
|
||||
$output .= '<table>';
|
||||
|
|
@ -99,7 +101,9 @@ sub www_edit {
|
|||
tie %article, 'Tie::CPHash';
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
%article = WebGUI::SQL->quickHash("select * from widget,Article where widget.widgetId=Article.widgetId and widget.widgetId=$session{form}{wid}",$session{dbh});
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=24"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Edit Article</h1><form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=24"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>Edit '.widgetName().'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
$output .= WebGUI::Form::hidden("func","editSave");
|
||||
$output .= '<table>';
|
||||
|
|
|
|||
|
|
@ -34,7 +34,9 @@ sub widgetName {
|
|||
sub www_add {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=20"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Add SQL Report</h1><form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=20"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>Add '.widgetName().'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("widget","SQLReport");
|
||||
$output .= WebGUI::Form::hidden("func","addSave");
|
||||
$output .= '<table>';
|
||||
|
|
@ -75,7 +77,9 @@ sub www_edit {
|
|||
tie %data, 'Tie::CPHash';
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
%data = WebGUI::SQL->quickHash("select * from widget,SQLReport where widget.widgetId=$session{form}{wid} and widget.widgetId=SQLReport.widgetId",$session{dbh});
|
||||
$output = '<h1>Edit SQL Report</h1><form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=22"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>Edit '.widgetName().'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
$output .= WebGUI::Form::hidden("func","editSave");
|
||||
$output .= '<table>';
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ package WebGUI::Widget::SyndicatedContent;
|
|||
|
||||
use strict;
|
||||
use Tie::CPHash;
|
||||
use WebGUI::DateTime;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
|
|
@ -79,7 +80,7 @@ sub www_edit {
|
|||
$output .= '<tr><td class="formDescription">URL to RSS File</td><td>'.WebGUI::Form::text("rssUrl",20,2048,$data{rssUrl}).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit("save").'</td></tr>';
|
||||
$output .= '<tr><td><br></td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Last Fetched</td><td>'.WebGUI::DateTime($data{lastFetched},"%m/%d/%y %h:%n%p").'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Last Fetched</td><td>'.WebGUI::DateTime::epochToHuman($data{lastFetched},"%m/%d/%y %h:%n%p").'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">Current Content</td><td>'.$data{content}.'</td></tr>';
|
||||
$output .= '</table></form>';
|
||||
return $output;
|
||||
|
|
@ -104,7 +105,7 @@ sub www_view {
|
|||
my (%data, $output, $widgetId);
|
||||
tie %data, 'Tie::CPHash';
|
||||
$widgetId = shift;
|
||||
%data = WebGUI::SQL->quickHash("select * from widget,SyndicatedContent where widget.widgetId=$widgetId",$session{dbh});
|
||||
%data = WebGUI::SQL->quickHash("select * from widget,SyndicatedContent where widget.widgetId=SyndicatedContent.widgetId and widget.widgetId=$widgetId",$session{dbh});
|
||||
if (defined %data) {
|
||||
if ($data{displayTitle} == 1) {
|
||||
$output = "<h1>".$data{title}."</h1>";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue