WebGUI 2.3.0 release
This commit is contained in:
parent
794b4a319c
commit
d2a9e59fab
36 changed files with 2715 additions and 1425 deletions
1684
docs/create.sql
1684
docs/create.sql
File diff suppressed because one or more lines are too long
|
|
@ -4,4 +4,5 @@ WebGUI Core...........................JT Smith / Plain Black Software
|
|||
German Translation....................Mattias Kunkel / WERU AG
|
||||
Perl..................................Larry Wall / O'Reilly
|
||||
Data::Config..........................Sébastien Aperghis-Tramoni
|
||||
IE Rich Edit..........................Brattli
|
||||
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
781
docs/upgrade_2.2.0-2.3.0.sql
Normal file
781
docs/upgrade_2.2.0-2.3.0.sql
Normal file
File diff suppressed because one or more lines are too long
BIN
extras/become.gif
Normal file
BIN
extras/become.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 966 B |
|
|
@ -6,19 +6,13 @@ var L_INSERT_TEXT = "Insert";
|
|||
var L_LINKIMGBORDER_TEXT = "Display a border around the image link";
|
||||
var L_LINKSELECT_TEXT = "Select a community page: ";
|
||||
var L_LINKSELECTPAGE_TEXT = "Select Page";
|
||||
var L_LINKWEB_TEXT = "or type in a URL to a page on the Web: ";
|
||||
var L_PUTITLEBGCOLOR_TEXT = "Set the Background Color";
|
||||
var L_PUTITLEFONTFACE_TEXT = "Set the Font Style";
|
||||
var L_PUTITLEFONTSIZE_TEXT = "Set The Font Size";
|
||||
var L_PUTITLEIMAGE_TEXT = "Insert/ Edit Image";
|
||||
var L_PUTITLELINK_TEXT = "Insert/ Edit a link";
|
||||
var L_PUTITLENEWTABLE_TEXT = "Create/ Edit Table";
|
||||
var L_PUTITLEPARAGRAPHSTYLE_TEXT = "Set the Paragraph Style";
|
||||
var L_PUTITLETEXTCOLOR_TEXT = "Set the Text Color";
|
||||
var L_STYLEFORMATTED_TEXT = "Preformatted";
|
||||
var L_STYLEHEADING_TEXT = "Heading ";
|
||||
var L_STYLENORMAL_TEXT = "Normal";
|
||||
var L_STYLESAMPLE_TEXT = "Sample Text";
|
||||
var L_LINKWEB_TEXT = "Type in a URL below:";
|
||||
var L_PUTITLEFONTFACE_TEXT = "Font Family...";
|
||||
var L_PUTITLEFONTSIZE_TEXT = "Font Size...";
|
||||
var L_PUTITLELINK_TEXT = "Link...";
|
||||
var L_PUTITLENEWTABLE_TEXT = "Table...";
|
||||
var L_PUTITLETEXTCOLOR_TEXT = "Font Color...";
|
||||
var L_STYLESAMPLE_TEXT = "ABC abc 123";
|
||||
var L_TABLEBG_TEXT = "Background";
|
||||
var L_TABLEBORDERS_TEXT = "Borders";
|
||||
var L_TABLEINPUTBGCOLOR_TEXT = "Background Color: ";
|
||||
|
|
@ -35,20 +29,19 @@ var L_TABLEINSERTROW_TEXT = "Insert Row";
|
|||
var L_TABLEINSERTCELL_TEXT = "Insert Column";
|
||||
var L_TABLEINSERT_TEXT = "Insert Table";
|
||||
var L_TABLEUPDATE_TEXT = "Update Table";
|
||||
var L_TABLENEW_TEXT = "New Table";
|
||||
var L_TABLENEW_TEXT = "Create Table";
|
||||
var L_TABLEEDIT_TEXT = "Edit Table";
|
||||
var L_TIPB_TEXT = "Bold";
|
||||
var L_TIPBGCOLOR_TEXT = "Background Color";
|
||||
var L_TIPCJ_TEXT = "Center Justify";
|
||||
var L_TIPCOPY_TEXT = "Copy Text";
|
||||
var L_TIPCUT_TEXT = "Cut Text";
|
||||
var L_TIPDINDENT_TEXT = "Decrease Indent";
|
||||
var L_TIPFGCOLOR_TEXT = "Text Color";
|
||||
var L_TIPDONE_TEXT = "Click here when finished editing!";
|
||||
var L_TIPFGCOLOR_TEXT = "Font Color";
|
||||
var L_TIPFSIZE_TEXT = "Font Size";
|
||||
var L_TIPFSTYLE_TEXT = "Font Style";
|
||||
var L_TIPFSTYLE_TEXT = "Font Family";
|
||||
var L_TIPI_TEXT = "Italic";
|
||||
var L_TIPIINDENT_TEXT = "Increase Indent";
|
||||
var L_TIPLINE_TEXT = "Insert Line";
|
||||
var L_TIPLINE_TEXT = "Horizontal Rule";
|
||||
var L_TIPLINK_TEXT = "Insert Link";
|
||||
var L_TIPLJ_TEXT = "Left Justify";
|
||||
var L_TIPOL_TEXT = "Numbered List";
|
||||
|
|
@ -59,8 +52,8 @@ var L_TIPTABLE_TEXT = "Insert Table";
|
|||
var L_TIPU_TEXT = "Underline";
|
||||
var L_TIPUL_TEXT = "Bulleted List";
|
||||
var L_MODETITLE_TEXT = "Advanced HTML Mode";
|
||||
var L_MODETITLE_TEXT = "Use HTML to create your page.";
|
||||
var L_MODEDESC_TEXT = " - Edit the HTML formatting commands directly.";
|
||||
var L_MODETITLE_TEXT = "Click here to edit the HTML directly.";
|
||||
var L_MODEDESC_TEXT = "";
|
||||
var L_CUSTOMFONT_TEXT = "Other Font...";
|
||||
var L_CUSTOMFONTENTRY_TEXT = "Enter the name of your font:";
|
||||
var L_SAMPLEFONTENTRY_TEXT = "Arial, Geneva, Sans-serif";
|
||||
|
|
@ -96,20 +89,20 @@ function _CFont(szDef,szText,bSymbol) {
|
|||
return new Array(szDef,szText,bSymbol);
|
||||
};
|
||||
defaultFonts = new Array();
|
||||
defaultFonts[0] = _CFont(L_FONTARIALDEF_TEXT, L_FONTARIAL_TEXT, false);
|
||||
defaultFonts[1] = _CFont(L_FONTARIALBLACKDEF_TEXT, L_FONTARIALBLACK_TEXT, false);
|
||||
defaultFonts[2] = _CFont(L_FONTVERDANADEF_TEXT, L_FONTVERDANA_TEXT, false);
|
||||
defaultFonts[3] = _CFont(L_FONTTIMESNEWROMANDEF_TEXT, L_FONTTIMESNEWROMAN_TEXT, false);
|
||||
defaultFonts[4] = _CFont(L_GARAMONDDEF_TEXT,L_GARAMOND_TEXT, false);
|
||||
defaultFonts[5] = _CFont(L_LUCIDAHANDDEF_TEXT,L_LUCIDAHAND_TEXT, false);
|
||||
defaultFonts[6] = _CFont(L_FONTCOURIERNEWDEF_TEXT, L_FONTCOURIERNEW_TEXT, false);
|
||||
defaultFonts[0] = _CFont(L_FONTARIALDEF_TEXT, L_FONTARIAL_TEXT, true);
|
||||
defaultFonts[1] = _CFont(L_FONTARIALBLACKDEF_TEXT, L_FONTARIALBLACK_TEXT, true);
|
||||
defaultFonts[2] = _CFont(L_FONTVERDANADEF_TEXT, L_FONTVERDANA_TEXT, true);
|
||||
defaultFonts[3] = _CFont(L_FONTTIMESNEWROMANDEF_TEXT, L_FONTTIMESNEWROMAN_TEXT, true);
|
||||
defaultFonts[4] = _CFont(L_GARAMONDDEF_TEXT,L_GARAMOND_TEXT, true);
|
||||
defaultFonts[5] = _CFont(L_LUCIDAHANDDEF_TEXT,L_LUCIDAHAND_TEXT, true);
|
||||
defaultFonts[6] = _CFont(L_FONTCOURIERNEWDEF_TEXT, L_FONTCOURIERNEW_TEXT, true);
|
||||
defaultFonts[7] = _CFont(L_WEBDINGSDEF_TEXT, L_WEBDINGS_TEXT, true);
|
||||
defaultFonts[8] = _CFont(L_WINGDINGSDEF_TEXT, L_WINGDINGS_TEXT, true);
|
||||
// Width of each toolbar button
|
||||
// Entry 5-8 are specify "Paragraph","Font Style", and "Font Size" respectively
|
||||
// Update widths if localized
|
||||
var L_TOOLBARGIF_TEXT = "toolbar.gif";
|
||||
var aSizes = new Array(25,25,25,7,80,76,71,7,25,25,25,8,25,25,25,8,25,25,25,25,8,25,25,25,8,25,25);
|
||||
var aSizes = new Array(25,25,8,25,25,25,8,25,25,8,25,25,25,8,25,25,25,8,50);
|
||||
function setHTML(szHTML)
|
||||
{
|
||||
if (g_state.bMode)
|
||||
|
|
@ -325,7 +318,7 @@ function _initEditor() {
|
|||
g_state = new _CState()
|
||||
window.onresize = _setSize
|
||||
var sz = ""
|
||||
sz += ""+ "<STYLE>"+ ".DataBound{border:1 solid #999999;margin:1;font-family:Courier;background:#F1F1F1}\n"+ ".textMode {border-top: 1px black solid;font: 10pt courier}\n.NOBORDER TD {border:1px gray solid}"+ "BODY {border: 1px white solid;border-top: none;}"+ "</STYLE>"+ "<BODY ONCONTEXTMENU=\"return false\">"+ "<DIV></DIV>"+ "</BODY>"
|
||||
sz += ""+ "<STYLE>"+ ".DataBound{border:1 solid #999999;margin:1;font-family:Courier;background:#F1F1F1}\n"+ ".textMode {border-top: 1px black solid;font: 10pt courier}\n.NOBORDER TD {border:1px gray solid}"+ "BODY {border: 1px white solid;border-top: none;}"+ "</STYLE>"+ "<BODY ONCONTEXTMENU=\"return false\">"+ "<DIV>"+window.opener.formObj.value+"</DIV>"+ "</BODY>"
|
||||
_CPopup_Init()
|
||||
idEditbox.document.designMode = "on"
|
||||
idEditbox.document.open("text/html","replace")
|
||||
|
|
@ -389,9 +382,9 @@ if (parent.RTEButton) parent.RTEButton(self, el.id)
|
|||
}
|
||||
function _drawToolbar()
|
||||
{
|
||||
var aIds = new Array("cut","copy","paste","bar1","formatblock","fontstyle","fontsize","bar2","bold","italic","underline","bar3","left","center","right","bar4","orderedlist","unorderedlist","outdent","indent","bar5","line","link","table","bar6","bgcolor","textcolor")
|
||||
var aTips = new Array(L_TIPCUT_TEXT,L_TIPCOPY_TEXT,L_TIPPASTE_TEXT,"",L_TIPP_TEXT,L_TIPFSTYLE_TEXT,L_TIPFSIZE_TEXT,"",L_TIPB_TEXT,L_TIPI_TEXT,L_TIPU_TEXT,"",L_TIPLJ_TEXT,L_TIPCJ_TEXT,L_TIPRJ_TEXT,"",L_TIPOL_TEXT,L_TIPUL_TEXT,L_TIPDINDENT_TEXT,L_TIPIINDENT_TEXT,"",L_TIPLINE_TEXT,L_TIPLINK_TEXT,L_TIPTABLE_TEXT,"",L_TIPBGCOLOR_TEXT,L_TIPFGCOLOR_TEXT)
|
||||
var aCommand = new Array("_Format('cut')","_Format('copy')","_Format('paste')",null,"_CPopup_Show('formatblock')","_CPopup_Show('font')","_CPopup_Show('fontsize')",null,"_Format('bold')","_Format('italic')","_Format('underline')",null,"_Format('Justify','Left')","_Format('Justify','Center')","_Format('Justify','Right')",null,"_Format('insertorderedlist')","_Format('insertunorderedlist')","_Format('outdent')","_Format('indent')",null,"_Format('InsertHorizontalRule')","_CPopup_Show('Link')","_CPopup_Show('Table')",null,"_CPopup_Show('BackColor')","_CPopup_Show('ForeColor')")
|
||||
var aIds = new Array("bold","italic","bar3","left","center","right","bar4","orderedlist","unorderedlist","bar5","line","link","table","bar6","textcolor","fontstyle","fontsize","bar7","done")
|
||||
var aTips = new Array(L_TIPB_TEXT,L_TIPI_TEXT,"",L_TIPLJ_TEXT,L_TIPCJ_TEXT,L_TIPRJ_TEXT,"",L_TIPOL_TEXT,L_TIPUL_TEXT,"",L_TIPLINE_TEXT,L_TIPLINK_TEXT,L_TIPTABLE_TEXT,"",L_TIPFGCOLOR_TEXT,L_TIPFSTYLE_TEXT,L_TIPFSIZE_TEXT,"",L_TIPDONE_TEXT)
|
||||
var aCommand = new Array("_Format('bold')","_Format('italic')",null,"_Format('Justify','Left')","_Format('Justify','Center')","_Format('Justify','Right')",null,"_Format('insertorderedlist')","_Format('insertunorderedlist')",null,"_Format('InsertHorizontalRule')","_CPopup_Show('Link')","_CPopup_Show('Table')",null,"_CPopup_Show('ForeColor')","_CPopup_Show('font')","_CPopup_Show('fontsize')",null,"doneEditing()")
|
||||
var sz = "<DIV ID=idStandardBar><NOBR>", iLeft=0, iHeight=24
|
||||
for (var i = 0 ; i < aSizes.length; i++)
|
||||
{
|
||||
|
|
@ -515,23 +508,21 @@ window.onload = _initEditor
|
|||
<TR ID=tbTopBar><TD ID=tbUpLeft></TD><TD COLSPAN=2 ID=tbUpMiddle></TD><TD ID=tbUpRight></TD></TR>
|
||||
<TR><TD ID=tbMidLeft></TD>
|
||||
<TD ID=tbContents><SCRIPT>_drawToolbar()</SCRIPT></TD></form>
|
||||
<TD ID=tbButtons ALIGN=right><input type="button" onClick="sendContentAndClose();" value="done" style="font-size: 8pt;"></TD><TD ID=tbMidRight></TD>
|
||||
<TD ID=tbButtons ALIGN=right></TD><TD ID=tbMidRight></TD>
|
||||
</TR>
|
||||
<TR ID=tbbottomBar><TD ID=tbLowLeft></TD><TD COLSPAN=2 ID=tbLowMiddle></TD><TD ID=tbLowRight></TD></TR>
|
||||
</TABLE>
|
||||
<IFRAME NAME="idPopup" STYLE="HEIGHT: 200px; LEFT: 25px; MARGIN-TOP: 8px; POSITION: absolute; VISIBILITY: hidden; WIDTH: 200px; Z-INDEX: -1"></IFRAME>
|
||||
<IFRAME ID="EditBox" NAME="idEditbox" WIDTH="100%" HEIGHT="100%" ONFOCUS="_CPopup_Hide()"></IFRAME>
|
||||
<DIV ID="tbmode" style="visibility : hidden;"><SCRIPT>_drawModeSelect()</SCRIPT></DIV>
|
||||
<DIV ID="tbmode" style="visibility: hidden;"><SCRIPT>_drawModeSelect()</SCRIPT></DIV>
|
||||
</DIV>
|
||||
<script language="JavaScript">
|
||||
function sendContentAndClose() {
|
||||
function doneEditing() {
|
||||
window.blur();
|
||||
window.opener.focus();
|
||||
window.opener.setContent("<div style='background-color:" +getBGColor() + "'>"+getHTML()+"</div>");
|
||||
window.opener.setContent(getHTML());
|
||||
window.close();
|
||||
}
|
||||
appendHTML(window.opener.formObj.value);
|
||||
//idEditbox.document.body.innerHTML=window.opener.formObj.value;
|
||||
</script>
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
|
|
|||
|
|
@ -205,8 +205,9 @@ sz += ""
|
|||
+ "STYLE=\"margin:0pt;padding:0pt\""
|
||||
+ ">"
|
||||
+ "<FONT FACE=\"" + defaultFonts[i][0] + "\">"
|
||||
+ defaultFonts[i][1]
|
||||
+ "</FONT>"
|
||||
+ "ABC abc 123"
|
||||
// + defaultFonts[i][1]
|
||||
+ "</FONT> "
|
||||
+ (defaultFonts[i][2] ? ("(" + defaultFonts[i][1] + ")") : "")
|
||||
+ "</TD>"
|
||||
+ "</TR>"
|
||||
|
|
@ -573,8 +574,10 @@ if (g_state.aLinks.length>0)
|
|||
sz += ""
|
||||
+ "<TR>"
|
||||
+ "<TD>"
|
||||
/*
|
||||
+ L_LINKSELECT_TEXT
|
||||
+ "<SELECT ID=pageList ONCHANGE=\"parent._CLinkPopupRenderer__UpdateURL(this.document,this[this.selectedIndex].value)\">"
|
||||
|
||||
+ "<OPTION VALUE=''>"
|
||||
+ "=="
|
||||
+ L_LINKSELECTPAGE_TEXT
|
||||
|
|
@ -590,6 +593,7 @@ sz += ""
|
|||
+ "</OPTION>"
|
||||
}
|
||||
sz += "</SELECT>"
|
||||
*/
|
||||
}
|
||||
var arTypes = new Array("http","ftp","mailto")
|
||||
var arText = new Array("http://","ftp://","mailto:")
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 4.1 KiB |
|
|
@ -1,5 +1,5 @@
|
|||
package WebGUI;
|
||||
our $VERSION = "2.2.0";
|
||||
our $VERSION = "2.3.0";
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
|
|
@ -63,7 +63,7 @@ sub _displayAdminBar {
|
|||
$session{page}{url}.'?op=viewStatistics'=>WebGUI::International::get(144)
|
||||
);
|
||||
}
|
||||
%hash = ( $session{page}{url}=>WebGUI::International::get(82),
|
||||
%hash = ( $session{page}{url}.'?'=>WebGUI::International::get(82),
|
||||
$session{page}{url}.'?op=switchOffAdmin'=>WebGUI::International::get(12),
|
||||
$session{page}{url}.'?op=viewHelpIndex'=>WebGUI::International::get(13),
|
||||
$session{page}{url}.'?op=viewPendingSubmissions'=>WebGUI::International::get(14),
|
||||
|
|
@ -170,3 +170,5 @@ sub page {
|
|||
|
||||
|
||||
1;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -132,7 +132,23 @@ sub humanToEpoch {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub setToEpoch {
|
||||
my @date = localtime(time());
|
||||
my ($month, $day, $year) = split(/\//,$_[0]);
|
||||
if (int($year) < 2038 && int($year) > 1900) {
|
||||
$year = int($year);
|
||||
} else {
|
||||
$year = $date[5]+1900;
|
||||
}
|
||||
if (int($month) < 13 && int($month) > 0) {
|
||||
$month = int($month);
|
||||
} else {
|
||||
$month = $date[4]++;
|
||||
}
|
||||
if (int($day) < 32 && int($day) > 0) {
|
||||
$day = int($day);
|
||||
} else {
|
||||
$day = $date[3];
|
||||
}
|
||||
return humanToEpoch($year.'-'.$month.'-'.$day.' 00:00:00');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ sub textArea {
|
|||
$rows = 5;
|
||||
}
|
||||
if ($htmlEdit > 0) {
|
||||
$output .= '<script language="JavaScript"> var formObj; var extrasDir="'.$session{setting}{lib}.'"; function openEditWindow(obj) { formObj = obj; /* if (navigator.userAgent.substr(navigator.userAgent.indexOf("MSIE")+5,1)>=5) window.open("'.$session{setting}{lib}.'/ieEdit.html","editWindow","width=500,height=400"); else */ window.open("'.$session{setting}{lib}.'/nonIeEdit.html","editWindow","width=450,height=240"); } function setContent(content) { formObj.value = content; } </script>';
|
||||
$output .= '<script language="JavaScript"> var formObj; var extrasDir="'.$session{setting}{lib}.'"; function openEditWindow(obj) { formObj = obj; if (navigator.userAgent.substr(navigator.userAgent.indexOf("MSIE")+5,1)>=5) window.open("'.$session{setting}{lib}.'/ieEdit.html","editWindow","width=490,height=400"); else window.open("'.$session{setting}{lib}.'/nonIeEdit.html","editWindow","width=450,height=240"); } function setContent(content) { formObj.value = content; } </script>';
|
||||
$output .= '<input type="button" onClick="openEditWindow(this.form.'.$name.')" value="'.WebGUI::International::get(171).'" style="font-size: 8pt;"><br>';
|
||||
}
|
||||
if ($wrap eq "") {
|
||||
|
|
|
|||
|
|
@ -18,20 +18,25 @@ my %international;
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub get {
|
||||
my ($output, $language);
|
||||
my ($output, $language, $namespace);
|
||||
if ($session{user}{language} ne "") {
|
||||
$language = $session{user}{language};
|
||||
} elsif ($_[1] ne "") {
|
||||
$language = $_[1];
|
||||
} elsif ($_[2] ne "") {
|
||||
$language = $_[2];
|
||||
} else {
|
||||
$language = "English";
|
||||
}
|
||||
if ($_[1] ne "") {
|
||||
$namespace = $_[1];
|
||||
} else {
|
||||
$namespace = "WebGUI";
|
||||
}
|
||||
if (defined $international{$language}{$_[0]}) { # a little caching never hurts =)
|
||||
$output = $international{$language}{$_[0]};
|
||||
} else {
|
||||
($output) = WebGUI::SQL->quickArray("select message from international where internationalId=$_[0] and language='$language'",$session{dbh});
|
||||
($output) = WebGUI::SQL->quickArray("select message from international where internationalId=$_[0] and namespace='$namespace' and language='$language'",$session{dbh});
|
||||
if ($output eq "" && $language ne "English") {
|
||||
$output = get($_[0],"English");
|
||||
$output = get($_[0],$namespace,"English");
|
||||
}
|
||||
}
|
||||
return $output;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package WebGUI::Macro::A_anyMenu;
|
||||
package WebGUI::Macro::S_specificMenuVertical;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
|
|
@ -21,19 +21,19 @@ sub process {
|
|||
my ($output, $temp, $pageTitle, $depth, @data);
|
||||
$output = $_[0];
|
||||
#---any page sub menu vertical---
|
||||
if ($output =~ /\^A(.*)\^\/A/) {
|
||||
if ($output =~ /\^S(.*)\^\/S/) {
|
||||
($pageTitle,$depth) = split(/,/,$1);
|
||||
if ($depth eq "") {
|
||||
$depth = 1;
|
||||
$depth = 0;
|
||||
}
|
||||
@data = WebGUI::SQL->quickArray("select pageId,title,urlizedTitle from page where urlizedTitle='$pageTitle'",$session{dbh});
|
||||
$temp = $pageTitle.'|'.$depth.'<span class="verticalMenu">';
|
||||
$temp = '<span class="verticalMenu">';
|
||||
if (defined $data[0] && WebGUI::Privilege::canViewPage($data[0])) {
|
||||
$temp .= '<a href="'.$session{env}{SCRIPT_URL}.'/'.$data[2].'">'.$data[1].'</a><br>';
|
||||
#$temp .= '<a href="'.$session{env}{SCRIPT_URL}.'/'.$data[2].'">'.$data[1].'</a><br>';
|
||||
$temp .= traversePageTree($data[0],1,$depth);
|
||||
}
|
||||
$temp .= '</span>';
|
||||
$output =~ s/\^A(.*)\^\/A/$temp/g;
|
||||
$output =~ s/\^S(.*)\^\/S/$temp/g;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
48
lib/WebGUI/Macro/s_specificMenuHorizontal.pm
Normal file
48
lib/WebGUI/Macro/s_specificMenuHorizontal.pm
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
package WebGUI::Macro::s_specificMenuHorizontal;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
#-------------------------------------------------------------------
|
||||
# Please read the legal notices (docs/legal.txt) and the license
|
||||
# (docs/license.txt) that came with this distribution before using
|
||||
# this software.
|
||||
#-------------------------------------------------------------------
|
||||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
use WebGUI::Macro::Shared;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my ($output, $temp, @data, $pageTitle, $parentId, $sth, $first);
|
||||
$output = $_[0];
|
||||
#---any page sub menu vertical---
|
||||
if ($output =~ /\^s(.*)\^\/s/) {
|
||||
$pageTitle = $1;
|
||||
$temp = '<span class="horizontalMenu">';
|
||||
$first = 1;
|
||||
($parentId) = WebGUI::SQL->quickArray("select pageId from page where urlizedTitle='$pageTitle'",$session{dbh});
|
||||
$sth = WebGUI::SQL->read("select title,urlizedTitle,pageId from page where parentId='$parentId' order by sequenceNumber",$session{dbh});
|
||||
while (@data = $sth->array) {
|
||||
if (WebGUI::Privilege::canViewPage($data[2])) {
|
||||
if ($first) {
|
||||
$first = 0;
|
||||
} else {
|
||||
$temp .= " · ";
|
||||
}
|
||||
$temp .= '<a class="horizontalMenu" href="'.$session{env}{SCRIPT_NAME}.'/'.$data[1].'">'.$data[0].'</a>';
|
||||
}
|
||||
}
|
||||
$sth->finish;
|
||||
$temp .= '</span>';
|
||||
$output =~ s/\^s(.*)\^\/s/$temp/g;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ use WebGUI::SQL;
|
|||
use WebGUI::Utility;
|
||||
|
||||
our @ISA = qw(Exporter);
|
||||
our @EXPORT = qw(&www_createAccount &www_deactivateAccount &www_deactivateAccountConfirm &www_displayAccount &www_displayLogin &www_login &www_logout &www_recoverPassword &www_recoverPasswordFinish &www_saveAccount &www_updateAccount);
|
||||
our @EXPORT = qw(&www_viewProfile &www_editProfile &www_editProfileSave &www_createAccount &www_deactivateAccount &www_deactivateAccountConfirm &www_displayAccount &www_displayLogin &www_login &www_logout &www_recoverPassword &www_recoverPasswordFinish &www_saveAccount &www_updateAccount);
|
||||
our %ldapStatusCode = ( 0=>'success (0)', 1=>'Operations Error (1)', 2=>'Protocol Error (2)', 3=>'Time Limit Exceeded (3)', 4=>'Size Limit Exceeded (4)', 5=>'Compare False (5)', 6=>'Compare True (6)', 7=>'Auth Method Not Supported (7)', 8=>'Strong Auth Required (8)', 9=>'Referral (10)', 11=>'Admin Limit Exceeded (11)', 12=>'Unavailable Critical Extension (12)', 13=>'Confidentiality Required (13)', 14=>'Sasl Bind In Progress (14)', 15=>'No Such Attribute (16)', 17=>'Undefined Attribute Type (17)', 18=>'Inappropriate Matching (18)', 19=>'Constraint Violation (19)', 20=>'Attribute Or Value Exists (20)', 21=>'Invalid Attribute Syntax (21)', 32=>'No Such Object (32)', 33=>'Alias Problem (33)', 34=>'Invalid DN Syntax (34)', 36=>'Alias Dereferencing Problem (36)', 48=>'Inappropriate Authentication (48)', 49=>'Invalid Credentials (49)', 50=>'Insufficient Access Rights (50)', 51=>'Busy (51)', 52=>'Unavailable (52)', 53=>'Unwilling To Perform (53)', 54=>'Loop Detect (54)', 64=>'Naming Violation (64)', 65=>'Object Class Violation (65)', 66=>'Not Allowed On Non Leaf (66)', 67=>'Not Allowed On RDN (67)', 68=>'Entry Already Exists (68)', 69=>'Object Class Mods Prohibited (69)', 71=>'Affects Multiple DSAs (71)', 80=>'other (80)');
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -41,7 +41,7 @@ sub _hasBadPassword {
|
|||
#-------------------------------------------------------------------
|
||||
sub _hasBadUsername {
|
||||
my ($otherUser);
|
||||
($otherUser) = WebGUI::SQL->quickArray("select username from users where lcase(username)=lcase('$_[0]')",$session{dbh});
|
||||
($otherUser) = WebGUI::SQL->quickArray("select username from users where username='$_[0]'",$session{dbh});
|
||||
if (($otherUser ne "" && $otherUser ne $session{user}{username}) || $_[0] eq "") {
|
||||
return 1;
|
||||
} else {
|
||||
|
|
@ -165,6 +165,8 @@ sub www_displayAccount {
|
|||
$output .= '<li><a href="'.$session{page}{url}.'?op=switchOnAdmin">'.WebGUI::International::get(63).'</a>';
|
||||
}
|
||||
}
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=editProfile">'.WebGUI::International::get(341).'</a>';
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=viewProfile&uid='.$session{user}{userId}.'">'.WebGUI::International::get(343).'</a>';
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=logout">'.WebGUI::International::get(64).'</a>';
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=deactivateAccount">'.WebGUI::International::get(65).'</a></ul></div>';
|
||||
} else {
|
||||
|
|
@ -200,6 +202,83 @@ sub www_displayLogin {
|
|||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_editProfile {
|
||||
my ($output, %gender, @array);
|
||||
%gender = ('male'=>WebGUI::International::get(339),'female'=>WebGUI::International::get(340));
|
||||
if ($session{user}{userId} != 1) {
|
||||
$output .= '<h1>'.WebGUI::International::get(338).'</h1>';
|
||||
$output .= '<form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= WebGUI::Form::hidden("op","editProfileSave");
|
||||
$output .= WebGUI::Form::hidden("uid",$session{user}{userId});
|
||||
$output .= '<table>';
|
||||
if ($session{setting}{profileName}) {
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(314).'</td><td>'.WebGUI::Form::text("firstName",20,50,$session{user}{firstName}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(315).'</td><td>'.WebGUI::Form::text("middleName",20,50,$session{user}{middleName}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(316).'</td><td>'.WebGUI::Form::text("lastName",20,50,$session{user}{lastName}).'</td></tr>';
|
||||
}
|
||||
if ($session{setting}{profileExtraContact}) {
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(317).'</td><td>'.WebGUI::Form::text("icq",20,30,$session{user}{icq}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(318).'</td><td>'.WebGUI::Form::text("aim",20,30,$session{user}{aim}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(319).'</td><td>'.WebGUI::Form::text("msnIM",20,30,$session{user}{msnIM}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(320).'</td><td>'.WebGUI::Form::text("yahooIM",20,30,$session{user}{yahooIM}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(321).'</td><td>'.WebGUI::Form::text("cellPhone",20,30,$session{user}{cellPhone}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(322).'</td><td>'.WebGUI::Form::text("pager",20,30,$session{user}{pager}).'</td></tr>';
|
||||
}
|
||||
if ($session{setting}{profileHome}) {
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(323).'</td><td>'.WebGUI::Form::text("homeAddress",20,128,$session{user}{homeAddress}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(324).'</td><td>'.WebGUI::Form::text("homeCity",20,30,$session{user}{homeCity}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(325).'</td><td>'.WebGUI::Form::text("homeState",20,30,$session{user}{homeState}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(326).'</td><td>'.WebGUI::Form::text("homeZip",20,15,$session{user}{homeZip}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(327).'</td><td>'.WebGUI::Form::text("homeCountry",20,30,$session{user}{homeCountry}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(328).'</td><td>'.WebGUI::Form::text("homePhone",20,30,$session{user}{homePhone}).'</td></tr>';
|
||||
}
|
||||
if ($session{setting}{profileWork}) {
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(329).'</td><td>'.WebGUI::Form::text("workAddress",20,128,$session{user}{workAddress}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(330).'</td><td>'.WebGUI::Form::text("workCity",20,30,$session{user}{workCity}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(331).'</td><td>'.WebGUI::Form::text("workState",20,30,$session{user}{workState}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(332).'</td><td>'.WebGUI::Form::text("workZip",20,15,$session{user}{workZip}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(333).'</td><td>'.WebGUI::Form::text("workCountry",20,30,$session{user}{workCountry}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(334).'</td><td>'.WebGUI::Form::text("workPhone",20,30,$session{user}{workPhone}).'</td></tr>';
|
||||
}
|
||||
if ($session{setting}{profileMisc}) {
|
||||
$array[0] = $session{user}{gender};
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(335).'</td><td>'.WebGUI::Form::selectList("gender",\%gender,\@array).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(336).'</td><td>'.WebGUI::Form::text("birthdate",20,30,$session{user}{birthdate}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(337).'</td><td>'.WebGUI::Form::text("homepage",20,2048,$session{user}{homepage}).'</td></tr>';
|
||||
}
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
|
||||
$output .= '</table>';
|
||||
$output .= '</form>';
|
||||
$output .= '<div class="accountOptions"><ul>';
|
||||
if (WebGUI::Privilege::isInGroup(3) || WebGUI::Privilege::isInGroup(4)) {
|
||||
if ($session{var}{adminOn}) {
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=switchOffAdmin">'.WebGUI::International::get(12).'</a>';
|
||||
} else {
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=switchOnAdmin">'.WebGUI::International::get(63).'</a>';
|
||||
}
|
||||
}
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=displayAccount">'.WebGUI::International::get(342).'</a>';
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=viewProfile&uid='.$session{user}{userId}.'">'.WebGUI::International::get(343).'</a>';
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=logout">'.WebGUI::International::get(64).'</a>';
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=deactivateAccount">'.WebGUI::International::get(65).'</a>';
|
||||
$output .= '</ul></div>';
|
||||
} else {
|
||||
$output .= www_displayLogin();
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_editProfileSave {
|
||||
if ($session{user}{userId} != 1) {
|
||||
WebGUI::SQL->write("update users set firstName=".quote($session{form}{firstName}).", middleName=".quote($session{form}{middleName}).", lastName=".quote($session{form}{lastName}).", icq=".quote($session{form}{icq}).", aim=".quote($session{form}{aim}).", msnIM=".quote($session{form}{msnIM}).", yahooIM=".quote($session{form}{yahooIM}).", homeAddress=".quote($session{form}{homeAddress}).", homeCity=".quote($session{form}{homeCity}).", homeState=".quote($session{form}{homeState}).", homeZip=".quote($session{form}{homeZip}).", homeCountry=".quote($session{form}{homeCountry}).", homePhone=".quote($session{form}{homePhone}).", workAddress=".quote($session{form}{workAddress}).", workCity=".quote($session{form}{workCity}).", workState=".quote($session{form}{workState}).", workZip=".quote($session{form}{workZip}).", workCountry=".quote($session{form}{workCountry}).", workPhone=".quote($session{form}{workPhone}).", cellPhone=".quote($session{form}{cellPhone}).", pager=".quote($session{form}{pager}).", gender=".quote($session{form}{gender}).", birthdate=".quote($session{form}{birthdate}).", homepage=".quote($session{form}{homepage})." where userId=".$session{form}{uid},$session{dbh});
|
||||
return www_displayAccount();
|
||||
} else {
|
||||
return www_displayLogin();
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_login {
|
||||
my ($uri, $port, $ldap, %args, $auth, $error, $uid,$pass,$authMethod, $ldapURL, $connectDN, $success);
|
||||
|
|
@ -389,5 +468,91 @@ sub www_updateAccount {
|
|||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_viewProfile {
|
||||
my ($output, %user);
|
||||
%user = WebGUI::SQL->quickHash("select * from users where userId='$session{form}{uid}'",$session{dbh});
|
||||
if ($user{username} eq "") {
|
||||
WebGUI::Privilege::notMember();
|
||||
} elsif ($session{user}{userId} != 1) {
|
||||
$output .= '<h1>'.WebGUI::International::get(347).' '.$user{username}.'</h1>';
|
||||
$output .= '<table>';
|
||||
if ($user{email} ne "") {
|
||||
$output .= '<tr><td class="tableHeader" valign="top">'.WebGUI::International::get(56).'</td><td class="tableData"><a href="mailto:'.$user{email}.'">'.$user{email}.'</a></td></tr>';
|
||||
}
|
||||
if ($session{setting}{profileName}) {
|
||||
if ($user{firstName} ne "") {
|
||||
$output .= '<tr><td class="tableHeader" valign="top">'.WebGUI::International::get(314).'</td><td class="tableData">'.$user{firstName}.' '.$user{middleName}.' '.$user{lastName}.'</td></tr>';
|
||||
}
|
||||
}
|
||||
if ($session{setting}{profileExtraContact}) {
|
||||
if ($user{icq} ne "") {
|
||||
$output .= '<tr><td class="tableHeader" valign="top">'.WebGUI::International::get(317).'</td><td class="tableData">'.$user{icq}.'</td></tr>';
|
||||
}
|
||||
if ($user{aim} ne "") {
|
||||
$output .= '<tr><td class="tableHeader" valign="top">'.WebGUI::International::get(318).'</td><td class="tableData">'.$user{aim}.'</td></tr>';
|
||||
}
|
||||
if ($user{msnIM} ne "") {
|
||||
$output .= '<tr><td class="tableHeader" valign="top">'.WebGUI::International::get(319).'</td><td class="tableData">'.$user{msnIM}.'</td></tr>';
|
||||
}
|
||||
if ($user{yahooIM} ne "") {
|
||||
$output .= '<tr><td class="tableHeader" valign="top">'.WebGUI::International::get(320).'</td><td class="tableData">'.$user{yahooIM}.'</td></tr>';
|
||||
}
|
||||
if ($user{cellPhone} ne "") {
|
||||
$output .= '<tr><td class="tableHeader" valign="top">'.WebGUI::International::get(321).'</td><td class="tableData">'.$user{cellPhone}.'</td></tr>';
|
||||
}
|
||||
if ($user{pager} ne "") {
|
||||
$output .= '<tr><td class="tableHeader" valign="top">'.WebGUI::International::get(322).'</td><td class="tableData">'.$user{pager}.'</td></tr>';
|
||||
}
|
||||
}
|
||||
if ($session{setting}{profileHome}) {
|
||||
if ($user{homeAddress} ne "") {
|
||||
$output .= '<tr><td class="tableHeader" valign="top">'.WebGUI::International::get(323).'</td><td class="tableData">'.$user{homeAddress}.'<br>'.$user{homeCity}.', '.$user{homeState}.' '.$user{homeZip}.' '.$user{homeCountry}.'</td></tr>';
|
||||
}
|
||||
if ($user{homePhone} ne "") {
|
||||
$output .= '<tr><td class="tableHeader" valign="top">'.WebGUI::International::get(328).'</td><td class="tableData">'.$user{homePhone}.'</td></tr>';
|
||||
}
|
||||
}
|
||||
if ($session{setting}{profileWork}) {
|
||||
if ($user{workAddress} ne "") {
|
||||
$output .= '<tr><td class="tableHeader" valign="top">'.WebGUI::International::get(329).'</td><td class="tableData">'.$user{workAddress}.'<br>'.$user{workCity}.', '.$user{workState}.' '.$user{workZip}.' '.$user{workCountry}.'</td></tr>';
|
||||
}
|
||||
if ($user{workPhone} ne "") {
|
||||
$output .= '<tr><td class="tableHeader" valign="top">'.WebGUI::International::get(334).'</td><td class="tableData">'.$user{workPhone}.'</td></tr>';
|
||||
}
|
||||
}
|
||||
if ($session{setting}{profileMisc}) {
|
||||
if ($user{gender} ne "") {
|
||||
$output .= '<tr><td class="tableHeader" valign="top">'.WebGUI::International::get(335).'</td><td class="tableData">'.$user{gender}.'</td></tr>';
|
||||
}
|
||||
if ($user{birthdate} ne "") {
|
||||
$output .= '<tr><td class="tableHeader" valign="top">'.WebGUI::International::get(336).'</td><td class="tableData">'.$user{birthdate}.'</td></tr>';
|
||||
}
|
||||
if ($user{homepage} ne "") {
|
||||
$output .= '<tr><td class="tableHeader" valign="top">'.WebGUI::International::get(337).'</td><td class="tableData"><a href="'.$user{homepage}.'">'.$user{homepage}.'</a></td></tr>';
|
||||
}
|
||||
}
|
||||
$output .= '</table>';
|
||||
if ($session{user}{userId} == $session{form}{uid}) {
|
||||
$output .= '<div class="accountOptions"><ul>';
|
||||
if (WebGUI::Privilege::isInGroup(3) || WebGUI::Privilege::isInGroup(4)) {
|
||||
if ($session{var}{adminOn}) {
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=switchOffAdmin">'.WebGUI::International::get(12).'</a>';
|
||||
} else {
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=switchOnAdmin">'.WebGUI::International::get(63).'</a>';
|
||||
}
|
||||
}
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=displayAccount">'.WebGUI::International::get(342).'</a>';
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=editProfile">'.WebGUI::International::get(341).'</a>';
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=logout">'.WebGUI::International::get(64).'</a>';
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=deactivateAccount">'.WebGUI::International::get(65).'</a>';
|
||||
$output .= '</ul></div>';
|
||||
}
|
||||
} else {
|
||||
$output .= WebGUI::Privilege::insufficient();
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ our @EXPORT = qw(&www_addGroup &www_addGroupSave &www_deleteGroup &www_deleteGro
|
|||
sub www_addGroup {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=17"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=17&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(83).'</h1>';
|
||||
$output .= '<form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= WebGUI::Form::hidden("op","addGroupSave");
|
||||
|
|
@ -61,7 +61,7 @@ sub www_deleteGroup {
|
|||
if ($session{form}{gid} < 26) {
|
||||
return WebGUI::Privilege::vitalComponent();
|
||||
} elsif (WebGUI::Privilege::isInGroup(3)) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=15"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=15&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(42).'</h1>';
|
||||
$output .= WebGUI::International::get(86).'<p>';
|
||||
$output .= '<div align="center"><a href="'.$session{page}{url}.'?op=deleteGroupConfirm&gid='.$session{form}{gid}.'">'.WebGUI::International::get(44).'</a>';
|
||||
|
|
@ -87,11 +87,11 @@ sub www_deleteGroupConfirm {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_editGroup {
|
||||
my ($output, $sth, %group, $user);
|
||||
my ($output, $sth, %group, @user);
|
||||
tie %group, 'Tie::CPHash';
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
%group = WebGUI::SQL->quickHash("select * from groups where groupId=$session{form}{gid}",$session{dbh});
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=17"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=17&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(87).'</h1>';
|
||||
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= WebGUI::Form::hidden("op","editGroupSave");
|
||||
|
|
@ -101,9 +101,9 @@ sub www_editGroup {
|
|||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(85).'</td><td>'.WebGUI::Form::textArea("description",$group{description}).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(88).'</td><td valign="top">';
|
||||
$sth = WebGUI::SQL->read("select users.username from users,groupings where groupings.groupId=$session{form}{gid} and groupings.userId=users.userId order by users.username",$session{dbh});
|
||||
while (($user) = $sth->array) {
|
||||
$output .= $user."<br>";
|
||||
$sth = WebGUI::SQL->read("select users.username,users.userId from users,groupings where groupings.groupId=$session{form}{gid} and groupings.userId=users.userId order by users.username",$session{dbh});
|
||||
while (@user = $sth->array) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=editUser&uid='.$user[1].'"><img src="'.$session{setting}{lib}.'/edit.gif" border=0></a> <a href="'.$session{page}{url}.'?op=viewProfile&uid='.$user[1].'">'.$user[0].'</a><br>';
|
||||
}
|
||||
$sth->finish;
|
||||
$output .= '<br></td></tr>';
|
||||
|
|
@ -130,7 +130,7 @@ sub www_listGroups {
|
|||
my ($output, $pn, $sth, @data, @row, $i, $itemsPerPage);
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
$itemsPerPage = 50;
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=10"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=10&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(89).'</h1>';
|
||||
$output .= '<div align="center"><a href="'.$session{page}{url}.'?op=addGroup">'.WebGUI::International::get(90).'</a></div>';
|
||||
$output .= '<table border=1 cellpadding=5 cellspacing=0 align="center">';
|
||||
|
|
|
|||
|
|
@ -23,21 +23,22 @@ our @EXPORT = qw(&www_viewHelp &www_viewHelpIndex);
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_viewHelp {
|
||||
my ($output, %help, @data, $sth);
|
||||
my ($output, %help, @data, $sth, %seeAlso);
|
||||
tie %help, 'Tie::CPHash';
|
||||
%help = WebGUI::SQL->quickHash("select * from help where helpId=$session{form}{hid}",$session{dbh});
|
||||
%help = WebGUI::SQL->quickHash("select * from help where helpId=$session{form}{hid} and namespace='$session{form}{namespace}' and language='$session{user}{language}'",$session{dbh});
|
||||
$output = '<h1>'.WebGUI::International::get(93).': '.$help{action}.' '.$help{object}.'</h1>';
|
||||
$help{body} =~ s/\n/\<br\>/g;
|
||||
$output .= $help{body};
|
||||
$output .= '<p><b>'.WebGUI::International::get(94).':';
|
||||
$sth = WebGUI::SQL->read("select helpId, action, object from help where object='$help{object}' and action<>'$help{action}' order by action",$session{dbh});
|
||||
$sth = WebGUI::SQL->read("select helpId, action, object, namespace from help where object='$help{object}' and action<>'$help{action}' and language='$session{user}{language}' 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].'&namespace='.$data[3].'">'.$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});
|
||||
$sth = WebGUI::SQL->read("select helpId, namespace from helpSeeAlso where seeAlsoId in ($help{seeAlso})",$session{dbh});
|
||||
while (@data = $sth->array) {
|
||||
$output .= ' <a href="'.$session{page}{url}.'?op=viewHelp&hid='.$data[0].'">'.$data[1].' '.$data[2].'</a>,';
|
||||
%seeAlso = WebGUI::SQL->quickHash("select helpId,namespace,action,object from help where helpId='$data[0]' and namespace='$data[1]' and language='$session{user}{language}'",$session{dbh});
|
||||
$output .= ' <a href="'.$session{page}{url}.'?op=viewHelp&hid='.$seeAlso{helpId}.'&namespace='.$seeAlso{namespace}.'">'.$seeAlso{action}.' '.$seeAlso{object}.'</a>,';
|
||||
}
|
||||
$sth->finish;
|
||||
$output .= ' <a href="'.$session{page}{url}.'?op=viewHelpIndex">'.WebGUI::International::get(95).'</a>';
|
||||
|
|
@ -49,23 +50,23 @@ sub www_viewHelpIndex {
|
|||
my ($sth, @data, $output, $previous);
|
||||
$output = '<h1>'.WebGUI::International::get(95).'</h1>';
|
||||
$output .= '<table width="100%"><tr><td valign="top"><b>'.WebGUI::International::get(96).'</b><p>';
|
||||
$sth = WebGUI::SQL->read("select helpId, action, object from help order by action,object",$session{dbh});
|
||||
$sth = WebGUI::SQL->read("select helpId, action, object, namespace from help where language='$session{user}{language}' order by action,object",$session{dbh});
|
||||
while (@data = $sth->array) {
|
||||
if ($data[1] ne $previous) {
|
||||
$output .= '<p><b>'.$data[1].'</b><br>';
|
||||
$previous = $data[1];
|
||||
}
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=viewHelp&hid='.$data[0].'">'.$data[2].'</a><br>';
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=viewHelp&hid='.$data[0].'&namespace='.$data[3].'">'.$data[2].'</a><br>';
|
||||
}
|
||||
$sth->finish;
|
||||
$output .= '</td><td valign="top"><b>'.WebGUI::International::get(97).'</b><p>';
|
||||
$sth = WebGUI::SQL->read("select helpId, object, action from help order by object,action",$session{dbh});
|
||||
$sth = WebGUI::SQL->read("select helpId, object, action, namespace from help where language='$session{user}{language}' order by object,action",$session{dbh});
|
||||
while (@data = $sth->array) {
|
||||
if ($data[1] ne $previous) {
|
||||
$output .= '<p><b>'.$data[1].'</b><br>';
|
||||
$previous = $data[1];
|
||||
}
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=viewHelp&hid='.$data[0].'">'.$data[2].'</a><br>';
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=viewHelp&hid='.$data[0].'&namespace='.$data[3].'">'.$data[2].'</a><br>';
|
||||
}
|
||||
$sth->finish;
|
||||
$output .= '</td></tr></table>';
|
||||
|
|
@ -73,3 +74,4 @@ sub www_viewHelpIndex {
|
|||
}
|
||||
|
||||
1;
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ sub _reorderPages {
|
|||
sub www_addPage {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(98).'</h1>';
|
||||
$output .= '<form method="post" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("op","addPageSave");
|
||||
|
|
@ -111,7 +111,7 @@ sub www_deletePage {
|
|||
if ($session{page}{pageId} < 26) {
|
||||
return WebGUI::Privilege::vitalComponent();
|
||||
} elsif (WebGUI::Privilege::canEditPage()) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=3"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=3&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(42).'</h1>';
|
||||
$output .= WebGUI::International::get(101).'<p>';
|
||||
$output .= '<div align="center"><a href="'.$session{page}{url}.'?op=deletePageConfirm">'.WebGUI::International::get(44).'</a>';
|
||||
|
|
@ -142,7 +142,7 @@ sub www_editPage {
|
|||
tie %hash, "Tie::IxHash";
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
%yesNo = ("0"=>"No", "1"=>"Yes");
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(102).'</h1>';
|
||||
$output .= '<form method="post" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("op","editPageSave");
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ use WebGUI::SQL;
|
|||
use WebGUI::Utility;
|
||||
|
||||
our @ISA = qw(Exporter);
|
||||
our @EXPORT = qw(&www_editAuthenticationSettings &www_editAuthenticationSettingsSave &www_editCompanyInformation &www_editCompanyInformationSave &www_editFileSettings &www_editFileSettingsSave &www_editMailSettings &www_editMailSettingsSave &www_editMiscSettings &www_editMiscSettingsSave &www_manageSettings);
|
||||
our @EXPORT = qw(&www_editProfileSettings &www_editProfileSettingsSave &www_editAuthenticationSettings &www_editAuthenticationSettingsSave &www_editCompanyInformation &www_editCompanyInformationSave &www_editFileSettings &www_editFileSettingsSave &www_editMailSettings &www_editMailSettingsSave &www_editMiscSettings &www_editMiscSettingsSave &www_manageSettings);
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_editAuthenticationSettings {
|
||||
|
|
@ -28,7 +28,7 @@ sub www_editAuthenticationSettings {
|
|||
%authMethod = ('WebGUI'=>'WebGUI', 'LDAP'=>'LDAP');
|
||||
%yesNo = ('yes'=>WebGUI::International::get(138), 'no'=>WebGUI::International::get(139));
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=2"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=2&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(117).'</h1>';
|
||||
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= WebGUI::Form::hidden("op","editAuthenticationSettingsSave");
|
||||
|
|
@ -72,7 +72,7 @@ sub www_editAuthenticationSettingsSave {
|
|||
sub www_editCompanyInformation {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=6"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=6&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(124).'</h1>';
|
||||
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= WebGUI::Form::hidden("op","editCompanyInformationSave");
|
||||
|
|
@ -105,7 +105,7 @@ sub www_editCompanyInformationSave {
|
|||
sub www_editFileSettings {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=11"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=11&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(128).'</h1>';
|
||||
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= WebGUI::Form::hidden("op","editFileSettingsSave");
|
||||
|
|
@ -140,7 +140,7 @@ sub www_editFileSettingsSave {
|
|||
sub www_editMailSettings {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=13"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=13&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(133).'</h1>';
|
||||
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= WebGUI::Form::hidden("op","editMailSettingsSave");
|
||||
|
|
@ -172,7 +172,7 @@ sub www_editMiscSettings {
|
|||
my ($output, @array, %notFoundPage);
|
||||
%notFoundPage = (1=>WebGUI::International::get(136), 4=>WebGUI::International::get(137));
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=24"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=24&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(140).'</h1>';
|
||||
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= WebGUI::Form::hidden("op","editMiscSettingsSave");
|
||||
|
|
@ -200,11 +200,54 @@ sub www_editMiscSettingsSave {
|
|||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_editProfileSettings {
|
||||
my ($output, @array, %yesNo);
|
||||
%yesNo = ('1'=>WebGUI::International::get(138), '0'=>WebGUI::International::get(139));
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=22&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(308).'</h1>';
|
||||
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= WebGUI::Form::hidden("op","editProfileSettingsSave");
|
||||
$output .= '<table>';
|
||||
$array[0] = $session{setting}{profileName};
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(309).'</td><td>'.WebGUI::Form::selectList("profileName",\%yesNo,\@array).'</td></tr>';
|
||||
$array[0] = $session{setting}{profileExtraContact};
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(310).'</td><td>'.WebGUI::Form::selectList("profileExtraContact",\%yesNo,\@array).'</td></tr>';
|
||||
$array[0] = $session{setting}{profileHome};
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(311).'</td><td>'.WebGUI::Form::selectList("profileHome",\%yesNo,\@array).'</td></tr>';
|
||||
$array[0] = $session{setting}{profileWork};
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(312).'</td><td>'.WebGUI::Form::selectList("profileWork",\%yesNo,\@array).'</td></tr>';
|
||||
$array[0] = $session{setting}{profileMisc};
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(313).'</td><td>'.WebGUI::Form::selectList("profileMisc",\%yesNo,\@array).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
|
||||
$output .= '</table>';
|
||||
$output .= '</form> ';
|
||||
} else {
|
||||
$output = WebGUI::Privilege::adminOnly();
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_editProfileSettingsSave {
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
WebGUI::SQL->write("update settings set value=".quote($session{form}{profileName})." where name='profileName'",$session{dbh});
|
||||
WebGUI::SQL->write("update settings set value=".quote($session{form}{profileExtraContact})." where name='profileExtraContact'",$session{dbh});
|
||||
WebGUI::SQL->write("update settings set value=".quote($session{form}{profileHome})." where name='profileHome'",$session{dbh});
|
||||
WebGUI::SQL->write("update settings set value=".quote($session{form}{profileWork})." where name='profileWork'",$session{dbh});
|
||||
WebGUI::SQL->write("update settings set value=".quote($session{form}{profileMisc})." where name='profileMisc'",$session{dbh});
|
||||
return www_manageSettings();
|
||||
} else {
|
||||
return WebGUI::Privilege::adminOnly();
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_manageSettings {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=12"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=12&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(143).'</h1>';
|
||||
$output .= '<ul>';
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=editAuthenticationSettings">'.WebGUI::International::get(117).'</a>';
|
||||
|
|
@ -212,6 +255,7 @@ sub www_manageSettings {
|
|||
$output .= '<li><a href="'.$session{page}{url}.'?op=editFileSettings">'.WebGUI::International::get(128).'</a>';
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=editMailSettings">'.WebGUI::International::get(133).'</a>';
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=editMiscSettings">'.WebGUI::International::get(140).'</a>';
|
||||
$output .= '<li><a href="'.$session{page}{url}.'?op=editProfileSettings">'.WebGUI::International::get(308).'</a>';
|
||||
$output .= '</ul>';
|
||||
} else {
|
||||
$output = WebGUI::Privilege::adminOnly();
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ our @EXPORT = qw(&www_viewStatistics);
|
|||
sub www_viewStatistics {
|
||||
my ($output, $data);
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=12"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=12&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(144).'</h1>';
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="tableHeader">'.WebGUI::International::get(145).'</td><td class="tableData">'.$WebGUI::VERSION.'</td></tr>';
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ our @EXPORT = qw(&www_copyStyle &www_addStyle &www_addStyleSave &www_deleteStyle
|
|||
sub www_addStyle {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=16"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=16&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(150).'</h1>';
|
||||
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= WebGUI::Form::hidden("op","addStyleSave");
|
||||
|
|
@ -75,7 +75,7 @@ sub www_deleteStyle {
|
|||
if ($session{form}{sid} < 26) {
|
||||
return WebGUI::Privilege::vitalComponent();
|
||||
} elsif (WebGUI::Privilege::isInGroup(3)) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=4"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>'.WebGUI::International::get(42).'</h1>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=4&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>'.WebGUI::International::get(42).'</h1>';
|
||||
$output .= WebGUI::International::get(155).'<p>';
|
||||
$output .= '<div align="center"><a href="'.$session{page}{url}.'?op=deleteStyleConfirm&sid='.$session{form}{sid}.'">'.WebGUI::International::get(44).'</a>';
|
||||
$output .= ' <a href="'.$session{page}{url}.'?op=listStyles">'.WebGUI::International::get(45).'</a></div>';
|
||||
|
|
@ -104,7 +104,7 @@ sub www_editStyle {
|
|||
tie %style, 'Tie::CPHash';
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
%style = WebGUI::SQL->quickHash("select * from style where styleId=$session{form}{sid}",$session{dbh});
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=16"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=16&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(156).'</h1>';
|
||||
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= WebGUI::Form::hidden("op","editStyleSave");
|
||||
|
|
@ -138,7 +138,7 @@ sub www_listStyles {
|
|||
my ($output, $pn, $sth, @data, @row, $i, $itemsPerPage);
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
$itemsPerPage = 50;
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=9"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=9&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(157).'</h1>';
|
||||
$output .= '<div align="center"><a href="'.$session{page}{url}.'?op=addStyle">'.WebGUI::International::get(158).'</a></div>';
|
||||
$output .= '<table border=1 cellpadding=5 cellspacing=0 align="center">';
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ sub _recursePageTree {
|
|||
sub www_purgeTrash {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=46"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>'.WebGUI::International::get(42).'</h1>';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=46&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>'.WebGUI::International::get(42).'</h1>';
|
||||
$output .= WebGUI::International::get(162).'<p>';
|
||||
$output .= '<div align="center"><a href="'.$session{page}{url}.'?op=purgeTrashConfirm">'.WebGUI::International::get(44).'</a>';
|
||||
$output .= ' <a href="'.$session{page}{url}.'">'.WebGUI::International::get(45).'</a></div>';
|
||||
|
|
|
|||
|
|
@ -22,13 +22,13 @@ use WebGUI::SQL;
|
|||
use WebGUI::Utility;
|
||||
|
||||
our @ISA = qw(Exporter);
|
||||
our @EXPORT = qw(&www_addUser &www_addUserSave &www_deleteUser &www_deleteUserConfirm &www_editUser &www_editUserSave &www_listUsers);
|
||||
our @EXPORT = qw(&www_becomeUser &www_addUser &www_addUserSave &www_deleteUser &www_deleteUserConfirm &www_editUser &www_editUserSave &www_listUsers);
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_addUser {
|
||||
my ($output, %hash, @array);
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=5"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=5&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(163).'</h1>';
|
||||
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= WebGUI::Form::hidden("op","addUserSave");
|
||||
|
|
@ -45,7 +45,8 @@ sub www_addUser {
|
|||
$array[0] = 2;
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(89).'</td><td>'.WebGUI::Form::selectList("groups",\%hash,\@array,5,1).'</td></tr>';
|
||||
%hash = WebGUI::SQL->buildHash("select distinct(language) from international",$session{dbh});
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(304).'</td><td>'.WebGUI::Form::selectList("language",\%hash).'</td></tr>';
|
||||
$array[0] = "English";
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(304).'</td><td>'.WebGUI::Form::selectList("language",\%hash,\@array).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
|
||||
$output .= '</table>';
|
||||
$output .= '</form> ';
|
||||
|
|
@ -73,13 +74,29 @@ sub www_addUserSave {
|
|||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_becomeUser {
|
||||
my ($cookieInfo, $output, $password);
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
($password) = WebGUI::SQL->quickArray("select identifier from users where userId='$session{form}{uid}'",$session{dbh});
|
||||
WebGUI::Session::end($session{var}{sessionId});
|
||||
$cookieInfo = $session{form}{uid}."|".crypt($password,"yJ");
|
||||
WebGUI::Session::start($cookieInfo);
|
||||
WebGUI::Session::setCookie("wgSession",$cookieInfo);
|
||||
$output = "";
|
||||
} else {
|
||||
$output = WebGUI::Privilege::adminOnly();
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_deleteUser {
|
||||
my ($output);
|
||||
if ($session{form}{uid} < 26) {
|
||||
return WebGUI::Privilege::vitalComponent();
|
||||
} elsif (WebGUI::Privilege::isInGroup(3)) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=7"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=7&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(42).'</h1>';
|
||||
$output .= WebGUI::International::get(167).'<p>';
|
||||
$output .= '<div align="center"><a href="'.$session{page}{url}.'?op=deleteUserConfirm&uid='.$session{form}{uid}.'">'.WebGUI::International::get(44).'</a>';
|
||||
|
|
@ -105,11 +122,12 @@ sub www_deleteUserConfirm {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_editUser {
|
||||
my ($output, %user, %hash, @array);
|
||||
my ($output, %user, %hash, @array, %gender);
|
||||
tie %hash, 'Tie::CPHash';
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
%gender = ('male'=>WebGUI::International::get(339),'female'=>WebGUI::International::get(340));
|
||||
%user = WebGUI::SQL->quickHash("select * from users where userId=$session{form}{uid}",$session{dbh});
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=5"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewHelp&hid=5&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(168).'</h1>';
|
||||
$output .= ' <form method="post" action="'.$session{page}{url}.'"> ';
|
||||
$output .= WebGUI::Form::hidden("op","editUserSave");
|
||||
|
|
@ -130,6 +148,31 @@ sub www_editUser {
|
|||
@array = [];
|
||||
$array[0] = $user{language};
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(304).'</td><td>'.WebGUI::Form::selectList("language",\%hash,\@array).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(314).'</td><td>'.WebGUI::Form::text("firstName",20,50,$user{firstName}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(315).'</td><td>'.WebGUI::Form::text("middleName",20,50,$user{middleName}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(316).'</td><td>'.WebGUI::Form::text("lastName",20,50,$user{lastName}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(317).'</td><td>'.WebGUI::Form::text("icq",20,30,$user{icq}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(318).'</td><td>'.WebGUI::Form::text("aim",20,30,$user{aim}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(319).'</td><td>'.WebGUI::Form::text("msnIM",20,30,$user{msnIM}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(320).'</td><td>'.WebGUI::Form::text("yahooIM",20,30,$user{yahooIM}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(321).'</td><td>'.WebGUI::Form::text("cellPhone",20,30,$user{cellPhone}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(322).'</td><td>'.WebGUI::Form::text("pager",20,30,$user{pager}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(323).'</td><td>'.WebGUI::Form::text("homeAddress",20,128,$user{homeAddress}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(324).'</td><td>'.WebGUI::Form::text("homeCity",20,30,$user{homeCity}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(325).'</td><td>'.WebGUI::Form::text("homeState",20,30,$user{homeState}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(326).'</td><td>'.WebGUI::Form::text("homeZip",20,15,$user{homeZip}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(327).'</td><td>'.WebGUI::Form::text("homeCountry",20,30,$user{homeCountry}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(328).'</td><td>'.WebGUI::Form::text("homePhone",20,30,$user{homePhone}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(329).'</td><td>'.WebGUI::Form::text("workAddress",20,128,$user{workAddress}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(330).'</td><td>'.WebGUI::Form::text("workCity",20,30,$user{workCity}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(331).'</td><td>'.WebGUI::Form::text("workState",20,30,$user{workState}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(332).'</td><td>'.WebGUI::Form::text("workZip",20,15,$user{workZip}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(333).'</td><td>'.WebGUI::Form::text("workCountry",20,30,$user{workCountry}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(334).'</td><td>'.WebGUI::Form::text("workPhone",20,30,$user{workPhone}).'</td></tr>';
|
||||
@array = ($user{gender});
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(335).'</td><td>'.WebGUI::Form::selectList("gender",\%gender,\@array).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(336).'</td><td>'.WebGUI::Form::text("birthdate",20,30,$user{birthdate}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription" valign="top">'.WebGUI::International::get(337).'</td><td>'.WebGUI::Form::text("homepage",20,2048,$user{homepage}).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
|
||||
$output .= '</table>';
|
||||
$output .= '</form> ';
|
||||
|
|
@ -148,7 +191,7 @@ sub www_editUserSave {
|
|||
$passwordStatement = ', identifier='.quote($encryptedPassword);
|
||||
}
|
||||
$encryptedPassword = Digest::MD5::md5_base64($session{form}{identifier1});
|
||||
WebGUI::SQL->write("update users set username=".quote($session{form}{username}).$passwordStatement.", authMethod=".quote($session{form}{authMethod}).", ldapURL=".quote($session{form}{ldapURL}).", connectDN=".quote($session{form}{connectDN}).", email=".quote($session{form}{email}).", language=".quote($session{form}{language})." where userId=".$session{form}{uid},$session{dbh});
|
||||
WebGUI::SQL->write("update users set username=".quote($session{form}{username}).$passwordStatement.", authMethod=".quote($session{form}{authMethod}).", ldapURL=".quote($session{form}{ldapURL}).", connectDN=".quote($session{form}{connectDN}).", email=".quote($session{form}{email}).", language=".quote($session{form}{language}).", firstName=".quote($session{form}{firstName}).", middleName=".quote($session{form}{middleName}).", lastName=".quote($session{form}{lastName}).", icq=".quote($session{form}{icq}).", aim=".quote($session{form}{aim}).", msnIM=".quote($session{form}{msnIM}).", yahooIM=".quote($session{form}{yahooIM}).", homeAddress=".quote($session{form}{homeAddress}).", homeCity=".quote($session{form}{homeCity}).", homeState=".quote($session{form}{homeState}).", homeZip=".quote($session{form}{homeZip}).", homeCountry=".quote($session{form}{homeCountry}).", homePhone=".quote($session{form}{homePhone}).", workAddress=".quote($session{form}{workAddress}).", workCity=".quote($session{form}{workCity}).", workState=".quote($session{form}{workState}).", workZip=".quote($session{form}{workZip}).", workCountry=".quote($session{form}{workCountry}).", workPhone=".quote($session{form}{workPhone}).", cellPhone=".quote($session{form}{cellPhone}).", pager=".quote($session{form}{pager}).", gender=".quote($session{form}{gender}).", birthdate=".quote($session{form}{birthdate}).", homepage=".quote($session{form}{homepage})." where userId=".$session{form}{uid},$session{dbh});
|
||||
WebGUI::SQL->write("delete from groupings where userId=$session{form}{uid}",$session{dbh});
|
||||
@groups = $session{cgi}->param('groups');
|
||||
foreach $gid (@groups) {
|
||||
|
|
@ -165,7 +208,7 @@ sub www_listUsers {
|
|||
my ($output, $sth, @data, @row, $pn, $i, $itemsPerPage, $search);
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
$itemsPerPage = 50;
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=8"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=8&namespace=WebGUI"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(149).'</h1>';
|
||||
$output .= '<table class="tableData" align="center" width="75%"><tr><td>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=addUser">'.WebGUI::International::get(169).'</a>';
|
||||
|
|
@ -180,9 +223,13 @@ sub www_listUsers {
|
|||
$output .= '<table border=1 cellpadding=5 cellspacing=0 align="center">';
|
||||
$sth = WebGUI::SQL->read("select userId,username,email from users where username<>'Reserved' $search order by username",$session{dbh});
|
||||
while (@data = $sth->array) {
|
||||
$row[$i] = '<tr class="tableData"><td><a href="'.$session{page}{url}.'?op=deleteUser&uid='.$data[0].'"><img src="'.$session{setting}{lib}.'/delete.gif" border=0></a><a href="'.$session{page}{url}.'?op=editUser&uid='.$data[0].'"><img src="'.$session{setting}{lib}.'/edit.gif" border=0></a></td>';
|
||||
#$row[$i] .= '<td><a href="'.$session{page}{url}.'?op=viewUserProfile&uid='.$data[0].'">'.$data[1].'</a></td>';
|
||||
$row[$i] .= '<td>'.$data[1].'</td>';
|
||||
$row[$i] = '<tr class="tableData"><td>';
|
||||
$row[$i] .= '<a href="'.$session{page}{url}.'?op=deleteUser&uid='.$data[0].'"><img src="'.$session{setting}{lib}.'/delete.gif" border=0></a>';
|
||||
$row[$i] .= '<a href="'.$session{page}{url}.'?op=editUser&uid='.$data[0].'"><img src="'.$session{setting}{lib}.'/edit.gif" border=0></a>';
|
||||
$row[$i] .= '<a href="'.$session{page}{url}.'?op=becomeUser&uid='.$data[0].'"><img src="'.$session{setting}{lib}.'/become.gif" border=0></a>';
|
||||
$row[$i] .= '</td>';
|
||||
$row[$i] .= '<td><a href="'.$session{page}{url}.'?op=viewProfile&uid='.$data[0].'">'.$data[1].'</a></td>';
|
||||
#$row[$i] .= '<td>'.$data[1].'</td>';
|
||||
$row[$i] .= '<td><a href="mailto:'.$data[2].'">'.$data[2].'</a></td></tr>';
|
||||
$i++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ sub canViewPage {
|
|||
sub insufficient {
|
||||
my ($output);
|
||||
$output = '<h1>'.WebGUI::International::get(37).'</h1>';
|
||||
$output .= WebGUI::International::get(37);
|
||||
$output .= WebGUI::International::get(38);
|
||||
$output .= '<p>';
|
||||
$output = WebGUI::Macro::process($output);
|
||||
return $output;
|
||||
|
|
@ -102,6 +102,15 @@ sub noAccess {
|
|||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub notMember {
|
||||
my ($output);
|
||||
$output = '<h1>'.WebGUI::International::get(345).'</h1>';
|
||||
$output .= WebGUI::International::get(346);
|
||||
$output .= '<p>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub vitalComponent {
|
||||
my ($output);
|
||||
|
|
@ -117,3 +126,4 @@ sub vitalComponent {
|
|||
|
||||
|
||||
1;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package WebGUI::Widget::Article;
|
||||
|
||||
our $namespace = "Article";
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -36,10 +38,10 @@ 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>';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(173).'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("widget","Article");
|
||||
$output .= WebGUI::Form::hidden("widget",$namespace);
|
||||
$output .= WebGUI::Form::hidden("func","addSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,30,'Article').'</td></tr>';
|
||||
|
|
@ -160,7 +162,7 @@ sub www_view {
|
|||
my (%data, @test, $output, $widgetId);
|
||||
tie %data, 'Tie::CPHash';
|
||||
$widgetId = shift;
|
||||
%data = WebGUI::SQL->quickHash("select widget.title, widget.displayTitle, widget.processMacros, Article.body, Article.image, Article.linkTitle, Article.linkURL, Article.attachment, Article.convertCarriageReturns from widget,Article where widget.widgetId='$widgetId' and widget.WidgetId=Article.widgetId and Article.startDate<".time()." and Article.endDate>".time()."",$session{dbh});
|
||||
%data = WebGUI::SQL->quickHash("select * from widget,Article where widget.widgetId='$widgetId' and widget.WidgetId=Article.widgetId and Article.startDate<".time()." and Article.endDate>".time()."",$session{dbh});
|
||||
if (defined %data) {
|
||||
if ($data{displayTitle} == 1) {
|
||||
$output = "<h1>".$data{title}."</h1>";
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package WebGUI::Widget::EventsCalendar;
|
||||
|
||||
our $namespace = "EventsCalendar";
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -23,7 +25,8 @@ use WebGUI::Widget;
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub purge {
|
||||
WebGUI::SQL->write("delete from event where widgetId=$_[0]",$_[1]);
|
||||
WebGUI::SQL->write("delete from EventsCalendar where widgetId=$_[0]",$_[1]);
|
||||
WebGUI::SQL->write("delete from EventsCalendar_event where widgetId=$_[0]",$_[1]);
|
||||
purgeWidget($_[0],$_[1]);
|
||||
}
|
||||
|
||||
|
|
@ -36,10 +39,10 @@ sub widgetName {
|
|||
sub www_add {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=38"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(188).'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("widget","EventsCalendar");
|
||||
$output .= WebGUI::Form::hidden("widget",$namespace);
|
||||
$output .= WebGUI::Form::hidden("func","addSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,30,'Events Calendar').'</td></tr>';
|
||||
|
|
@ -60,6 +63,7 @@ sub www_addSave {
|
|||
my ($widgetId);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$widgetId = create();
|
||||
WebGUI::SQL->write("insert into FAQ values ($widgetId)",$session{dbh});
|
||||
return "";
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -124,7 +128,7 @@ sub www_addEventSave {
|
|||
}
|
||||
$i = 0;
|
||||
while ($eventId[$i] > 0) {
|
||||
WebGUI::SQL->write("insert into event values ($eventId[$i], $session{form}{wid}, ".quote($session{form}{name}).", ".quote($session{form}{description}).", '".$startDate[$i]."', '".$endDate[$i]."', $recurringEventId)",$session{dbh});
|
||||
WebGUI::SQL->write("insert into EventsCalendar_event values ($eventId[$i], $session{form}{wid}, ".quote($session{form}{name}).", ".quote($session{form}{description}).", '".$startDate[$i]."', '".$endDate[$i]."', $recurringEventId)",$session{dbh});
|
||||
$i++;
|
||||
}
|
||||
return www_edit();
|
||||
|
|
@ -154,9 +158,9 @@ sub www_deleteEventConfirm {
|
|||
my ($output);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
if ($session{form}{rid} > 0) {
|
||||
WebGUI::SQL->write("delete from event where recurringEventId=$session{form}{rid}",$session{dbh});
|
||||
WebGUI::SQL->write("delete from EventsCalendar_event where recurringEventId=$session{form}{rid}",$session{dbh});
|
||||
} else {
|
||||
WebGUI::SQL->write("delete from event where eventId=$session{form}{eid}",$session{dbh});
|
||||
WebGUI::SQL->write("delete from EventsCalendar_event where eventId=$session{form}{eid}",$session{dbh});
|
||||
}
|
||||
return www_edit();
|
||||
} else {
|
||||
|
|
@ -170,7 +174,7 @@ sub www_edit {
|
|||
tie %data, 'Tie::CPHash';
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
%data = WebGUI::SQL->quickHash("select * from widget where widget.widgetId=$session{form}{wid}",$session{dbh});
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=38"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(197).'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
|
|
@ -184,7 +188,7 @@ sub www_edit {
|
|||
$output .= '</table></form>';
|
||||
$output .= '<p><a href="'.$session{page}{url}.'?func=addEvent&wid='.$session{form}{wid}.'">Add New Event</a><p>';
|
||||
$output .= '<table border=1 cellpadding=3 cellspacing=0>';
|
||||
$sth = WebGUI::SQL->read("select eventId, name, recurringEventId from event where widgetId='$session{form}{wid}' order by startDate",$session{dbh});
|
||||
$sth = WebGUI::SQL->read("select eventId, name, recurringEventId from EventsCalendar_event where widgetId='$session{form}{wid}' order by startDate",$session{dbh});
|
||||
while (@event = $sth->array) {
|
||||
$output .= '<tr><td><a href="'.$session{page}{url}.'?func=editEvent&wid='.$session{form}{wid}.'&eid='.$event[0].'"><img src="'.$session{setting}{lib}.'/edit.gif" border=0></a><a href="'.$session{page}{url}.'?func=deleteEvent&wid='.$session{form}{wid}.'&eid='.$event[0].'&rid='.$event[2].'"><img src="'.$session{setting}{lib}.'/delete.gif" border=0></a></td><td>'.$event[1].'</td></tr>';
|
||||
}
|
||||
|
|
@ -211,7 +215,7 @@ sub www_editEvent {
|
|||
my ($output, %event);
|
||||
tie %event, 'Tie::CPHash';
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
%event = WebGUI::SQL->quickHash("select * from event where eventId='$session{form}{eid}'",$session{dbh});
|
||||
%event = WebGUI::SQL->quickHash("select * from EventsCalendar_event where eventId='$session{form}{eid}'",$session{dbh});
|
||||
$output = '<h1>'.WebGUI::International::get(198).'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
|
|
@ -236,7 +240,7 @@ sub www_editEvent {
|
|||
sub www_editEventSave {
|
||||
my ($eventId);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
WebGUI::SQL->write("update event set name=".quote($session{form}{name}).", description=".quote($session{form}{description}).", startDate='".setToEpoch($session{form}{startDate})."', endDate='".setToEpoch($session{form}{endDate})."' where eventId=$session{form}{eid}",$session{dbh});
|
||||
WebGUI::SQL->write("update EventsCalendar_event set name=".quote($session{form}{name}).", description=".quote($session{form}{description}).", startDate='".setToEpoch($session{form}{startDate})."', endDate='".setToEpoch($session{form}{endDate})."' where eventId=$session{form}{eid}",$session{dbh});
|
||||
return www_edit();
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -245,7 +249,7 @@ sub www_editEventSave {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_view {
|
||||
my (%data, @event, $output, $widgetId, $sth);
|
||||
my (%data, @event, $output, $widgetId, $sth, $flag, @previous);
|
||||
tie %data, 'Tie::CPHash';
|
||||
$widgetId = shift;
|
||||
%data = WebGUI::SQL->quickHash("select * from widget where widget.widgetId='$widgetId'",$session{dbh});
|
||||
|
|
@ -256,14 +260,26 @@ sub www_view {
|
|||
if ($data{description} ne "") {
|
||||
$output .= $data{description}.'<p>';
|
||||
}
|
||||
$sth = WebGUI::SQL->read("select name, description, startDate, endDate from event where widgetId='$widgetId' and startDate>".(time()-86400)." order by startDate",$session{dbh});
|
||||
$sth = WebGUI::SQL->read("select name, description, startDate, endDate from EventsCalendar_event where widgetId='$widgetId' and endDate>".(time()-86400)." order by startDate,endDate",$session{dbh});
|
||||
while (@event = $sth->array) {
|
||||
$output .= "<b>".epochToHuman($event[2],"%c")." ".epochToHuman($event[2],"%D");
|
||||
if (epochToHuman($event[2],"%D") ne epochToHuman($event[3],"%D")) {
|
||||
$output .= "-".epochToHuman($event[3],"%D");
|
||||
unless ($event[2] == $previous[0] && $event[3] == $previous[1]) {
|
||||
$output .= "<b>".epochToHuman($event[2],"%c")." ".epochToHuman($event[2],"%D");
|
||||
if (epochToHuman($event[2],"%y") ne epochToHuman($event[3],"%y")) {
|
||||
$output .= ", ".epochToHuman($event[2],"%y");
|
||||
$flag = 1;
|
||||
}
|
||||
if ($flag || epochToHuman($event[2],"%c") ne epochToHuman($event[3],"%c")) {
|
||||
$output .= " - ".epochToHuman($event[3],"%c");
|
||||
$output .= " ".epochToHuman($event[3],"%D");
|
||||
} elsif (epochToHuman($event[2],"%D") ne epochToHuman($event[3],"%D")) {
|
||||
$output .= " - ".epochToHuman($event[3],"%D");
|
||||
}
|
||||
$flag = 0;
|
||||
$output .= ", ".epochToHuman($event[3],"%y");
|
||||
$output .= "</b>";
|
||||
$output .= "<hr size=1>";
|
||||
}
|
||||
$output .= ", ".epochToHuman($event[2],"%y")."</b>";
|
||||
$output .= "<hr size=1>";
|
||||
@previous = ($event[2],$event[3]);
|
||||
$output .= '<span class="eventTitle">'.$event[0].'</span>';
|
||||
if ($event[1] ne "") {
|
||||
$output .= ' - ';
|
||||
|
|
@ -282,7 +298,5 @@ sub www_view {
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
1;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package WebGUI::Widget::ExtraColumn;
|
||||
|
||||
our $namespace = "ExtraColumn";
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -34,10 +36,10 @@ sub widgetName {
|
|||
sub www_add {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=25"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(200).'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("widget","ExtraColumn");
|
||||
$output .= WebGUI::Form::hidden("widget",$namespace);
|
||||
$output .= WebGUI::Form::hidden("func","addSave");
|
||||
$output .= WebGUI::Form::hidden("title","column");
|
||||
$output .= '<table>';
|
||||
|
|
@ -71,7 +73,7 @@ sub www_edit {
|
|||
tie %data, 'Tie::CPHash';
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
%data = WebGUI::SQL->quickHash("select * from ExtraColumn where widgetId=$session{form}{wid}",$session{dbh});
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=25"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(204).'</h1>';
|
||||
$output .= '<form method="post" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package WebGUI::Widget::FAQ;
|
||||
|
||||
our $namespace = "FAQ";
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -23,9 +25,9 @@ use WebGUI::Widget;
|
|||
#-------------------------------------------------------------------
|
||||
sub _reorderQuestions {
|
||||
my ($sth, $i, $qid);
|
||||
$sth = WebGUI::SQL->read("select questionId from faqQuestion where widgetId=$_[0] order by sequenceNumber",$session{dbh});
|
||||
$sth = WebGUI::SQL->read("select questionId from FAQ_question where widgetId=$_[0] order by sequenceNumber",$session{dbh});
|
||||
while (($qid) = $sth->array) {
|
||||
WebGUI::SQL->write("update faqQuestion set sequenceNumber='$i' where questionId=$qid",$session{dbh});
|
||||
WebGUI::SQL->write("update FAQ_question set sequenceNumber='$i' where questionId=$qid",$session{dbh});
|
||||
$i++;
|
||||
}
|
||||
$sth->finish;
|
||||
|
|
@ -33,7 +35,8 @@ sub _reorderQuestions {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub purge {
|
||||
WebGUI::SQL->write("delete from faqQuestion where widgetId=$_[0]",$_[1]);
|
||||
WebGUI::SQL->write("delete from FAQ where widgetId=$_[0]",$_[1]);
|
||||
WebGUI::SQL->write("delete from FAQ_question where widgetId=$_[0]",$_[1]);
|
||||
purgeWidget($_[0],$_[1]);
|
||||
}
|
||||
|
||||
|
|
@ -46,10 +49,10 @@ sub widgetName {
|
|||
sub www_add {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=40"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output = '<h1>'.WebGUI::International::get(206).'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("widget","FAQ");
|
||||
$output .= WebGUI::Form::hidden("widget",$namespace);
|
||||
$output .= WebGUI::Form::hidden("func","addSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,30,'F.A.Q.').'</td></tr>';
|
||||
|
|
@ -70,6 +73,7 @@ sub www_addSave {
|
|||
my ($widgetId);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$widgetId = create();
|
||||
WebGUI::SQL->write("insert into FAQ values ($widgetId)",$session{dbh});
|
||||
return "";
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -100,9 +104,9 @@ sub www_addQuestion {
|
|||
sub www_addQuestionSave {
|
||||
my ($questionId, $nextSeq);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
($nextSeq) = WebGUI::SQL->quickArray("select max(sequenceNumber)+1 from faqQuestion where widgetId=$session{form}{wid}",$session{dbh});
|
||||
($nextSeq) = WebGUI::SQL->quickArray("select max(sequenceNumber)+1 from FAQ_question where widgetId=$session{form}{wid}",$session{dbh});
|
||||
$questionId = getNextId("questionId");
|
||||
WebGUI::SQL->write("insert into faqQuestion values ($session{form}{wid}, $questionId, ".quote($session{form}{question}).", ".quote($session{form}{answer}).", '$nextSeq')",$session{dbh});
|
||||
WebGUI::SQL->write("insert into FAQ_question values ($session{form}{wid}, $questionId, ".quote($session{form}{question}).", ".quote($session{form}{answer}).", '$nextSeq')",$session{dbh});
|
||||
return www_edit();
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -127,7 +131,7 @@ sub www_deleteQuestion {
|
|||
sub www_deleteQuestionConfirm {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
WebGUI::SQL->write("delete from faqQuestion where questionId=$session{form}{qid}",$session{dbh});
|
||||
WebGUI::SQL->write("delete from FAQ_question where questionId=$session{form}{qid}",$session{dbh});
|
||||
_reorderQuestions($session{form}{wid});
|
||||
return www_edit();
|
||||
} else {
|
||||
|
|
@ -141,7 +145,7 @@ sub www_edit {
|
|||
tie %data, 'Tie::CPHash';
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
%data = WebGUI::SQL->quickHash("select * from widget where widget.widgetId=$session{form}{wid}",$session{dbh});
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=40"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output = '<h1>'.WebGUI::International::get(211).'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
|
|
@ -155,7 +159,7 @@ sub www_edit {
|
|||
$output .= '</table></form>';
|
||||
$output .= '<p><a href="'.$session{page}{url}.'?func=addQuestion&wid='.$session{form}{wid}.'">'.WebGUI::International::get(212).'</a><p>';
|
||||
$output .= '<table border=1 cellpadding=3 cellspacing=0>';
|
||||
$sth = WebGUI::SQL->read("select questionId,question from faqQuestion where widgetId='$session{form}{wid}' order by sequenceNumber",$session{dbh});
|
||||
$sth = WebGUI::SQL->read("select questionId,question from FAQ_question where widgetId='$session{form}{wid}' order by sequenceNumber",$session{dbh});
|
||||
while (@question = $sth->array) {
|
||||
$output .= '<tr><td><a href="'.$session{page}{url}.'?func=editQuestion&wid='.$session{form}{wid}.'&qid='.$question[0].'"><img src="'.$session{setting}{lib}.'/edit.gif" border=0></a><a href="'.$session{page}{url}.'?func=deleteQuestion&wid='.$session{form}{wid}.'&qid='.$question[0].'"><img src="'.$session{setting}{lib}.'/delete.gif" border=0></a><a href="'.$session{page}{url}.'?func=moveQuestionUp&wid='.$session{form}{wid}.'&qid='.$question[0].'"><img src="'.$session{setting}{lib}.'/upArrow.gif" border=0></a><a href="'.$session{page}{url}.'?func=moveQuestionDown&wid='.$session{form}{wid}.'&qid='.$question[0].'"><img src="'.$session{setting}{lib}.'/downArrow.gif" border=0></a></td><td>'.$question[1].'</td></tr>';
|
||||
}
|
||||
|
|
@ -182,7 +186,7 @@ sub www_editQuestion {
|
|||
my ($output, %question);
|
||||
tie %question, 'Tie::CPHash';
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
%question = WebGUI::SQL->quickHash("select * from faqQuestion where questionId='$session{form}{qid}'",$session{dbh});
|
||||
%question = WebGUI::SQL->quickHash("select * from FAQ_question where questionId='$session{form}{qid}'",$session{dbh});
|
||||
$output = '<h1>'.WebGUI::International::get(213).'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
|
|
@ -203,7 +207,7 @@ sub www_editQuestion {
|
|||
#-------------------------------------------------------------------
|
||||
sub www_editQuestionSave {
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
WebGUI::SQL->write("update faqQuestion set question=".quote($session{form}{question}).", answer=".quote($session{form}{answer})." where questionId=$session{form}{qid}",$session{dbh});
|
||||
WebGUI::SQL->write("update FAQ_question set question=".quote($session{form}{question}).", answer=".quote($session{form}{answer})." where questionId=$session{form}{qid}",$session{dbh});
|
||||
return www_edit();
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -214,11 +218,11 @@ sub www_editQuestionSave {
|
|||
sub www_moveQuestionDown {
|
||||
my (@data, $thisSeq);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
($thisSeq) = WebGUI::SQL->quickArray("select sequenceNumber from faqQuestion where questionId=$session{form}{qid}",$session{dbh});
|
||||
@data = WebGUI::SQL->quickArray("select questionId from faqQuestion where widgetId=$session{form}{wid} and sequenceNumber=$thisSeq+1 group by widgetId",$session{dbh});
|
||||
($thisSeq) = WebGUI::SQL->quickArray("select sequenceNumber from FAQ_question where questionId=$session{form}{qid}",$session{dbh});
|
||||
@data = WebGUI::SQL->quickArray("select questionId from FAQ_question where widgetId=$session{form}{wid} and sequenceNumber=$thisSeq+1 group by widgetId",$session{dbh});
|
||||
if ($data[0] ne "") {
|
||||
WebGUI::SQL->write("update faqQuestion set sequenceNumber=sequenceNumber+1 where questionId=$session{form}{qid}",$session{dbh});
|
||||
WebGUI::SQL->write("update faqQuestion set sequenceNumber=sequenceNumber-1 where questionId=$data[0]",$session{dbh});
|
||||
WebGUI::SQL->write("update FAQ_question set sequenceNumber=sequenceNumber+1 where questionId=$session{form}{qid}",$session{dbh});
|
||||
WebGUI::SQL->write("update FAQ_question set sequenceNumber=sequenceNumber-1 where questionId=$data[0]",$session{dbh});
|
||||
}
|
||||
return www_edit();
|
||||
} else {
|
||||
|
|
@ -230,11 +234,11 @@ sub www_moveQuestionDown {
|
|||
sub www_moveQuestionUp {
|
||||
my (@data, $thisSeq);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
($thisSeq) = WebGUI::SQL->quickArray("select sequenceNumber from faqQuestion where questionId=$session{form}{qid}",$session{dbh});
|
||||
@data = WebGUI::SQL->quickArray("select questionId from faqQuestion where widgetId=$session{form}{wid} and sequenceNumber=$thisSeq-1 group by widgetId",$session{dbh});
|
||||
($thisSeq) = WebGUI::SQL->quickArray("select sequenceNumber from FAQ_question where questionId=$session{form}{qid}",$session{dbh});
|
||||
@data = WebGUI::SQL->quickArray("select questionId from FAQ_question where widgetId=$session{form}{wid} and sequenceNumber=$thisSeq-1 group by widgetId",$session{dbh});
|
||||
if ($data[0] ne "") {
|
||||
WebGUI::SQL->write("update faqQuestion set sequenceNumber=sequenceNumber-1 where questionId=$session{form}{qid}",$session{dbh});
|
||||
WebGUI::SQL->write("update faqQuestion set sequenceNumber=sequenceNumber+1 where questionId=$data[0]",$session{dbh});
|
||||
WebGUI::SQL->write("update FAQ_question set sequenceNumber=sequenceNumber-1 where questionId=$session{form}{qid}",$session{dbh});
|
||||
WebGUI::SQL->write("update FAQ_question set sequenceNumber=sequenceNumber+1 where questionId=$data[0]",$session{dbh});
|
||||
}
|
||||
return www_edit();
|
||||
} else {
|
||||
|
|
@ -256,7 +260,7 @@ sub www_view {
|
|||
$output .= $data{description};
|
||||
}
|
||||
$output .= '<ul>';
|
||||
$sth = WebGUI::SQL->read("select questionId,question,answer from faqQuestion where widgetId='$widgetId' order by sequenceNumber",$session{dbh});
|
||||
$sth = WebGUI::SQL->read("select questionId,question,answer from FAQ_question where widgetId='$widgetId' order by sequenceNumber",$session{dbh});
|
||||
while (@question = $sth->array) {
|
||||
$output .= '<li><a href="#'.$question[0].'">'.$question[1].'</a>';
|
||||
$qNa .= '<a name="'.$question[0].'"><span class="faqQuestion">'.$question[1].'</span></a><br>'.$question[2].'<p>';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package WebGUI::Widget::LinkList;
|
||||
|
||||
our $namespace = "LinkList";
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -23,9 +25,9 @@ use WebGUI::Widget;
|
|||
#-------------------------------------------------------------------
|
||||
sub _reorderLinks {
|
||||
my ($sth, $i, $lid);
|
||||
$sth = WebGUI::SQL->read("select linkId from link where widgetId=$_[0] order by sequenceNumber",$session{dbh});
|
||||
$sth = WebGUI::SQL->read("select linkId from LinkList_link where widgetId=$_[0] order by sequenceNumber",$session{dbh});
|
||||
while (($lid) = $sth->array) {
|
||||
WebGUI::SQL->write("update link set sequenceNumber='$i' where linkId=$lid",$session{dbh});
|
||||
WebGUI::SQL->write("update LinkList_link set sequenceNumber='$i' where linkId=$lid",$session{dbh});
|
||||
$i++;
|
||||
}
|
||||
$sth->finish;
|
||||
|
|
@ -33,7 +35,8 @@ sub _reorderLinks {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub purge {
|
||||
WebGUI::SQL->write("delete from link where widgetId=$_[0]",$_[1]);
|
||||
WebGUI::SQL->write("delete from LinkList where widgetId=$_[0]",$_[1]);
|
||||
WebGUI::SQL->write("delete from LinkList_link where widgetId=$_[0]",$_[1]);
|
||||
purgeWidget($_[0],$_[1]);
|
||||
}
|
||||
|
||||
|
|
@ -46,16 +49,19 @@ sub widgetName {
|
|||
sub www_add {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=34"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(219).'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("widget","LinkList");
|
||||
$output .= WebGUI::Form::hidden("widget",$namespace);
|
||||
$output .= WebGUI::Form::hidden("func","addSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,30,'Link List').'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(174).'</td><td>'.WebGUI::Form::checkbox("displayTitle",1,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(175).'</td><td>'.WebGUI::Form::checkbox("processMacros",1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(85).'</td><td>'.WebGUI::Form::textArea("description").'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(1,$namespace).'</td><td>'.WebGUI::Form::text("indent",20,2,0).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(2,$namespace).'</td><td>'.WebGUI::Form::text("lineSpacing",20,1,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(4,$namespace).'</td><td>'.WebGUI::Form::text("lineSpacing",20,1,'·').'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
|
||||
$output .= '</table></form>';
|
||||
return $output;
|
||||
|
|
@ -70,6 +76,7 @@ sub www_addSave {
|
|||
my ($widgetId);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$widgetId = create();
|
||||
WebGUI::SQL->write("insert into LinkList values ($widgetId, '$session{form}{indent}', '$session{form}{lineSpacing}', ".quote($session{form}{bullet}).")",$session{dbh});
|
||||
return "";
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -87,6 +94,7 @@ sub www_addLink {
|
|||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("name",20,30).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(216).'</td><td>'.WebGUI::Form::text("url",20,1024).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(3,$namespace).'</td><td>'.WebGUI::Form::checkbox("newWindow",1,1).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(85).'</td><td>'.WebGUI::Form::textArea("description",'',50,10).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
|
||||
$output .= '</table></form>';
|
||||
|
|
@ -101,9 +109,9 @@ sub www_addLink {
|
|||
sub www_addLinkSave {
|
||||
my ($linkId, $nextSeq);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
($nextSeq) = WebGUI::SQL->quickArray("select max(sequenceNumber)+1 from link where widgetId=$session{form}{wid}",$session{dbh});
|
||||
($nextSeq) = WebGUI::SQL->quickArray("select max(sequenceNumber)+1 from LinkList_link where widgetId=$session{form}{wid}",$session{dbh});
|
||||
$linkId = getNextId("linkId");
|
||||
WebGUI::SQL->write("insert into link values ($session{form}{wid}, $linkId, ".quote($session{form}{name}).", ".quote($session{form}{url}).", ".quote($session{form}{description}).", '$nextSeq')",$session{dbh});
|
||||
WebGUI::SQL->write("insert into LinkList_link values ($session{form}{wid}, $linkId, ".quote($session{form}{name}).", ".quote($session{form}{url}).", ".quote($session{form}{description}).", '$nextSeq', '$session{form}{newWindow}')",$session{dbh});
|
||||
return www_edit();
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -128,7 +136,7 @@ sub www_deleteLink {
|
|||
sub www_deleteLinkConfirm {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
WebGUI::SQL->write("delete from link where linkId=$session{form}{lid}",$session{dbh});
|
||||
WebGUI::SQL->write("delete from LinkList_link where linkId=$session{form}{lid}",$session{dbh});
|
||||
_reorderLinks($session{form}{wid});
|
||||
return www_edit();
|
||||
} else {
|
||||
|
|
@ -141,8 +149,8 @@ sub www_edit {
|
|||
my ($output, %data, @link, $sth);
|
||||
tie %data, 'Tie::CPHash';
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
%data = WebGUI::SQL->quickHash("select * from widget where widget.widgetId=$session{form}{wid}",$session{dbh});
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=34"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
%data = WebGUI::SQL->quickHash("select * from widget,LinkList where widget.widgetId=$session{form}{wid} and widget.widgetId=LinkList.widgetId",$session{dbh});
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(218).'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
|
|
@ -152,11 +160,14 @@ sub www_edit {
|
|||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(174).'</td><td>'.WebGUI::Form::checkbox("displayTitle",1,$data{displayTitle}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(175).'</td><td>'.WebGUI::Form::checkbox("processMacros",1,$data{processMacros}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(85).'</td><td>'.WebGUI::Form::textArea("description",$data{description}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(1,$namespace).'</td><td>'.WebGUI::Form::text("indent",20,2,$data{indent}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(2,$namespace).'</td><td>'.WebGUI::Form::text("lineSpacing",20,1,$data{lineSpacing}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(4,$namespace).'</td><td>'.WebGUI::Form::text("bullet",20,255,$data{bullet}).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
|
||||
$output .= '</table></form>';
|
||||
$output .= '<p><a href="'.$session{page}{url}.'?func=addLink&wid='.$session{form}{wid}.'">'.WebGUI::International::get(221).'</a><p>';
|
||||
$output .= '<table border=1 cellpadding=3 cellspacing=0>';
|
||||
$sth = WebGUI::SQL->read("select linkId, name from link where widgetId='$session{form}{wid}' order by sequenceNumber",$session{dbh});
|
||||
$sth = WebGUI::SQL->read("select linkId, name from LinkList_link where widgetId='$session{form}{wid}' order by sequenceNumber",$session{dbh});
|
||||
while (@link = $sth->array) {
|
||||
$output .= '<tr><td><a href="'.$session{page}{url}.'?func=editLink&wid='.$session{form}{wid}.'&lid='.$link[0].'"><img src="'.$session{setting}{lib}.'/edit.gif" border=0></a><a href="'.$session{page}{url}.'?func=deleteLink&wid='.$session{form}{wid}.'&lid='.$link[0].'"><img src="'.$session{setting}{lib}.'/delete.gif" border=0></a><a href="'.$session{page}{url}.'?func=moveLinkUp&wid='.$session{form}{wid}.'&lid='.$link[0].'"><img src="'.$session{setting}{lib}.'/upArrow.gif" border=0></a><a href="'.$session{page}{url}.'?func=moveLinkDown&wid='.$session{form}{wid}.'&lid='.$link[0].'"><img src="'.$session{setting}{lib}.'/downArrow.gif" border=0></a></td><td>'.$link[1].'</td></tr>';
|
||||
}
|
||||
|
|
@ -172,6 +183,7 @@ sub www_edit {
|
|||
sub www_editSave {
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
update();
|
||||
WebGUI::SQL->write("update LinkList set indent='$session{form}{indent}', lineSpacing='$session{form}{lineSpacing}', bullet=".quote($session{form}{bullet})." where widgetId=$session{form}{wid}",$session{dbh});
|
||||
return "";
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -183,7 +195,7 @@ sub www_editLink {
|
|||
my ($output, %link);
|
||||
tie %link, 'Tie::CPHash';
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
%link = WebGUI::SQL->quickHash("select name, url, description from link where linkId='$session{form}{lid}'",$session{dbh});
|
||||
%link = WebGUI::SQL->quickHash("select * from LinkList_link where linkId='$session{form}{lid}'",$session{dbh});
|
||||
$output = '<h1>'.WebGUI::International::get(220).'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
|
|
@ -192,6 +204,7 @@ sub www_editLink {
|
|||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("name",20,30,$link{name}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(216).'</td><td>'.WebGUI::Form::text("url",20,2048,$link{url}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(3,$namespace).'</td><td>'.WebGUI::Form::checkbox("newWindow",1,$link{newWindow}).'</td></tr>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(85).'</td><td>'.WebGUI::Form::textArea("description",$link{description},50,10).'</td></tr>';
|
||||
$output .= '<tr><td></td><td>'.WebGUI::Form::submit(WebGUI::International::get(62)).'</td></tr>';
|
||||
$output .= '</table></form>';
|
||||
|
|
@ -205,8 +218,8 @@ sub www_editLink {
|
|||
#-------------------------------------------------------------------
|
||||
sub www_editLinkSave {
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
WebGUI::SQL->write("update link set name=".quote($session{form}{name}).", url=".quote($session{form}{url}).", description=".quote($session{form}{description})." where linkId=$session{form}{lid}",$session{dbh});
|
||||
return "";
|
||||
WebGUI::SQL->write("update LinkList_link set name=".quote($session{form}{name}).", url=".quote($session{form}{url}).", description=".quote($session{form}{description}).", newWindow='$session{form}{newWindow}' where linkId=$session{form}{lid}",$session{dbh});
|
||||
return www_edit();
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
|
|
@ -216,11 +229,11 @@ sub www_editLinkSave {
|
|||
sub www_moveLinkDown {
|
||||
my (@data, $thisSeq);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
($thisSeq) = WebGUI::SQL->quickArray("select sequenceNumber from link where linkId=$session{form}{lid}",$session{dbh});
|
||||
@data = WebGUI::SQL->quickArray("select linkId from link where widgetId=$session{form}{wid} and sequenceNumber=$thisSeq+1 group by widgetId",$session{dbh});
|
||||
($thisSeq) = WebGUI::SQL->quickArray("select sequenceNumber from LinkList_link where linkId=$session{form}{lid}",$session{dbh});
|
||||
@data = WebGUI::SQL->quickArray("select linkId from LinkList_link where widgetId=$session{form}{wid} and sequenceNumber=$thisSeq+1 group by widgetId",$session{dbh});
|
||||
if ($data[0] ne "") {
|
||||
WebGUI::SQL->write("update link set sequenceNumber=sequenceNumber+1 where linkId=$session{form}{lid}",$session{dbh});
|
||||
WebGUI::SQL->write("update link set sequenceNumber=sequenceNumber-1 where linkId=$data[0]",$session{dbh});
|
||||
WebGUI::SQL->write("update LinkList_link set sequenceNumber=sequenceNumber+1 where linkId=$session{form}{lid}",$session{dbh});
|
||||
WebGUI::SQL->write("update LinkList_link set sequenceNumber=sequenceNumber-1 where linkId=$data[0]",$session{dbh});
|
||||
}
|
||||
return www_edit();
|
||||
} else {
|
||||
|
|
@ -232,11 +245,11 @@ sub www_moveLinkDown {
|
|||
sub www_moveLinkUp {
|
||||
my (@data, $thisSeq);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
($thisSeq) = WebGUI::SQL->quickArray("select sequenceNumber from link where linkId=$session{form}{lid}",$session{dbh});
|
||||
@data = WebGUI::SQL->quickArray("select linkId from link where widgetId=$session{form}{wid} and sequenceNumber=$thisSeq-1 group by widgetId",$session{dbh});
|
||||
($thisSeq) = WebGUI::SQL->quickArray("select sequenceNumber from LinkList_link where linkId=$session{form}{lid}",$session{dbh});
|
||||
@data = WebGUI::SQL->quickArray("select linkId from LinkList_link where widgetId=$session{form}{wid} and sequenceNumber=$thisSeq-1 group by widgetId",$session{dbh});
|
||||
if ($data[0] ne "") {
|
||||
WebGUI::SQL->write("update link set sequenceNumber=sequenceNumber-1 where linkId=$session{form}{lid}",$session{dbh});
|
||||
WebGUI::SQL->write("update link set sequenceNumber=sequenceNumber+1 where linkId=$data[0]",$session{dbh});
|
||||
WebGUI::SQL->write("update LinkList_link set sequenceNumber=sequenceNumber-1 where linkId=$session{form}{lid}",$session{dbh});
|
||||
WebGUI::SQL->write("update LinkList_link set sequenceNumber=sequenceNumber+1 where linkId=$data[0]",$session{dbh});
|
||||
}
|
||||
return www_edit();
|
||||
} else {
|
||||
|
|
@ -246,10 +259,10 @@ sub www_moveLinkUp {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_view {
|
||||
my (%data, @link, $output, $widgetId, $sth);
|
||||
my (%data, $i, $indent, $lineSpacing, @link, $output, $widgetId, $sth);
|
||||
tie %data, 'Tie::CPHash';
|
||||
$widgetId = shift;
|
||||
%data = WebGUI::SQL->quickHash("select * from widget where widget.widgetId='$widgetId'",$session{dbh});
|
||||
%data = WebGUI::SQL->quickHash("select * from widget,LinkList where widget.widgetId='$widgetId' and widget.widgetId=LinkList.widgetId",$session{dbh});
|
||||
if (defined %data) {
|
||||
if ($data{displayTitle}) {
|
||||
$output = "<h1>".$data{title}."</h1>";
|
||||
|
|
@ -257,13 +270,23 @@ sub www_view {
|
|||
if ($data{description} ne "") {
|
||||
$output .= $data{description}.'<p>';
|
||||
}
|
||||
$sth = WebGUI::SQL->read("select name, url, description from link where widgetId='$widgetId' order by sequenceNumber",$session{dbh});
|
||||
for ($i=0;$i<$data{indent};$i++) {
|
||||
$indent .= " ";
|
||||
}
|
||||
for ($i=0;$i<$data{lineSpacing};$i++) {
|
||||
$lineSpacing .= "<br>";
|
||||
}
|
||||
$sth = WebGUI::SQL->read("select name, url, description from LinkList_link where widgetId='$widgetId' order by sequenceNumber",$session{dbh});
|
||||
while (@link = $sth->array) {
|
||||
$output .= '<li><b><a href="'.$link[1].'">'.$link[0].'</a></b>';
|
||||
$output .= $indent.$data{bullet}.'<b><a href="'.$link[1].'"';
|
||||
if ($data{newWindow}) {
|
||||
$output .= ' target="_blank"';
|
||||
}
|
||||
$output .= '>'.$link[0].'</a></b>';
|
||||
if ($link[2] ne "") {
|
||||
$output .= ' - '.$link[2];
|
||||
}
|
||||
$output .= '<br>';
|
||||
$output .= $lineSpacing;
|
||||
}
|
||||
$sth->finish;
|
||||
if ($data{processMacros}) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package WebGUI::Widget::MessageBoard;
|
||||
|
||||
our $namespace = "MessageBoard";
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -35,13 +37,13 @@ sub _traverseReplyTree {
|
|||
for ($i=0;$i<=$_[1];$i++) {
|
||||
$depth .= " ";
|
||||
}
|
||||
$sth = WebGUI::SQL->read("select messageId,subject,username,dateOfPost from message where pid=$_[0] order by messageId", $session{dbh});
|
||||
$sth = WebGUI::SQL->read("select messageId,subject,username,dateOfPost,userId from message where pid=$_[0] order by messageId", $session{dbh});
|
||||
while (@data = $sth->array) {
|
||||
$html .= '<tr';
|
||||
if ($session{form}{mid} eq $data[0]) {
|
||||
$html .= ' class="highlight"';
|
||||
}
|
||||
$html .= '><td class="tableData">'.$depth.'<a href="'.$session{page}{url}.'?func=showMessage&mid='.$data[0].'&wid='.$session{form}{wid}.'">'.substr($data[1],0,30).'</a></td><td class="tableData">'.$data[2].'</td><td class="tableData">'.epochToHuman($data[3],"%M/%D %H:%n%p").'</td></tr>';
|
||||
$html .= '><td class="tableData">'.$depth.'<a href="'.$session{page}{url}.'?func=showMessage&mid='.$data[0].'&wid='.$session{form}{wid}.'">'.substr($data[1],0,30).'</a></td><td class="tableData"><a href="'.$session{page}{url}.'?op=viewProfile&uid='.$data[4].'">'.$data[2].'</a></td><td class="tableData">'.epochToHuman($data[3],"%M/%D %H:%n%p").'</td></tr>';
|
||||
$html .= _traverseReplyTree($data[0],$_[1]+1);
|
||||
}
|
||||
$sth->finish;
|
||||
|
|
@ -65,10 +67,10 @@ sub www_add {
|
|||
my ($output, %hash, @array);
|
||||
tie %hash, "Tie::IxHash";
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=32"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(222).'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("widget","MessageBoard");
|
||||
$output .= WebGUI::Form::hidden("widget",$namespace);
|
||||
$output .= WebGUI::Form::hidden("func","addSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,30,'Message Board').'</td></tr>';
|
||||
|
|
@ -108,7 +110,7 @@ sub www_edit {
|
|||
if (WebGUI::Privilege::canEditPage()) {
|
||||
tie %board, 'Tie::CPHash';
|
||||
%board = _getBoardProperties($session{form}{wid});
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=32"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(227).'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
|
|
@ -151,11 +153,7 @@ sub www_editMessage {
|
|||
%board = _getBoardProperties($session{form}{wid});
|
||||
if (WebGUI::Privilege::isInGroup($board{groupToPost},$session{user}{userId})) {
|
||||
%message = WebGUI::SQL->quickHash("select * from message where messageId=$session{form}{mid}",$session{dbh});
|
||||
$html .= '<table width="100%"><tr><td class="boardTitle">';
|
||||
if ($board{displayTitle}) {
|
||||
$html .= $board{title};
|
||||
}
|
||||
$html .= '<td align="right" valign="bottom" class="boardMenu">'.WebGUI::International::get(228).'</td></tr></table>';
|
||||
$html = '<h1>'.WebGUI::International::get(228).'</h1>';
|
||||
$html .= '<form action="'.$session{page}{url}.'" method="post"><table>';
|
||||
$html .= WebGUI::Form::hidden("func","editMessageSave");
|
||||
$html .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
|
|
@ -196,11 +194,7 @@ sub www_postNewMessage {
|
|||
tie %board, 'Tie::CPHash';
|
||||
%board = _getBoardProperties($session{form}{wid});
|
||||
if (WebGUI::Privilege::isInGroup($board{groupToPost},$session{user}{userId})) {
|
||||
$html .= '<table width="100%"><tr><td class="boardTitle">';
|
||||
if ($board{displayTitle}) {
|
||||
$html .= $board{title};
|
||||
}
|
||||
$html .= '<td align="right" valign="bottom" class="boardMenu">'.WebGUI::International::get(231).'</td></tr></table>';
|
||||
$html = '<h1>'.WebGUI::International::get(231).'</h1>';
|
||||
$html .= '<form action="'.$session{page}{url}.'" method="post"><table>';
|
||||
$html .= WebGUI::Form::hidden("func","postNewMessageSave");
|
||||
$html .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
|
|
@ -242,11 +236,7 @@ sub www_postReply {
|
|||
if (WebGUI::Privilege::isInGroup($board{groupToPost},$session{user}{userId})) {
|
||||
($subject) = WebGUI::SQL->quickArray("select subject from message where messageId=$session{form}{mid}", $session{dbh});
|
||||
$subject = "Re: ".$subject;
|
||||
$html .= '<table width="100%"><tr><td class="boardTitle">';
|
||||
if ($board{displayTitle}) {
|
||||
$html .= $board{title};
|
||||
}
|
||||
$html .= '<td align="right" valign="bottom" class="boardMenu">'.WebGUI::International::get(234).'</td></tr></table>';
|
||||
$html = '<h1>'.WebGUI::International::get(234).'</h1>';
|
||||
$html .= '<form action="'.$session{page}{url}.'" method="post"><table>';
|
||||
$html .= WebGUI::Form::hidden("func","postReplySave");
|
||||
$html .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
|
|
@ -290,46 +280,42 @@ sub www_showMessage {
|
|||
tie %board, 'Tie::CPHash';
|
||||
%message = WebGUI::SQL->quickHash("select * from message where messageId=$session{form}{mid}",$session{dbh});
|
||||
%board = _getBoardProperties($session{form}{wid});
|
||||
$html .= '<table width="100%"><tr><td class="boardTitle">';
|
||||
if ($board{displayTitle}) {
|
||||
$html .= $board{title};
|
||||
}
|
||||
$html .= '</td><td align="right" valign="bottom" class="boardMenu">';
|
||||
$html .= '<h1>'.$message{subject}.'</h1>';
|
||||
$html .= '<table width="100%" cellpadding=3 cellspacing=1 border=0><tr><td class="tableHeader">';
|
||||
$html .= '<b>'.WebGUI::International::get(238).'</b> <a href="'.$session{page}{url}.'?op=viewProfile&uid='.$message{userId}.'">'.$message{username}.'</a><br>';
|
||||
$html .= "<b>".WebGUI::International::get(239)."</b> ".epochToHuman($message{dateOfPost},"%w, %c %D, %y at %H:%n%p")."<br>";
|
||||
$html .= "<b>".WebGUI::International::get(240)."</b> ".$message{widgetId}."-".$message{rid}."-".$message{pid}."-".$message{messageId}."<br>";
|
||||
$html .= '</td>';
|
||||
$html .= '<td rowspan=2 valign="top" class="tableMenu" nowrap>';
|
||||
$html .= '<a href="'.$session{page}{url}.'?func=postReply&mid='.$session{form}{mid}.'&wid='.$session{form}{wid}.'">'.WebGUI::International::get(236).'</a><br>';
|
||||
if ((time()-$message{dateOfPost}) < 3600*$board{editTimeout} && $message{'userId'} eq $session{user}{userId}) {
|
||||
$html .= '<a href="'.$session{page}{url}.'?func=editMessage&mid='.$session{form}{mid}.'&wid='.$session{form}{wid}.'">'.WebGUI::International::get(235).'</a> · ';
|
||||
$html .= '<a href="'.$session{page}{url}.'?func=editMessage&mid='.$session{form}{mid}.'&wid='.$session{form}{wid}.'">'.WebGUI::International::get(235).'</a><br>';
|
||||
}
|
||||
$html .= '<a href="'.$session{page}{url}.'?func=postReply&mid='.$session{form}{mid}.'&wid='.$session{form}{wid}.'">'.WebGUI::International::get(236).'</a></td></tr></table>';
|
||||
$html .= '<table width="100%"><tr><td class="tableHeader">';
|
||||
$html .= "<b>".WebGUI::International::get(237)."</b> ".$message{subject}."<br>";
|
||||
$html .= "<b>".WebGUI::International::get(238)."</b> ".$message{username}."<br>";
|
||||
$html .= "<b>".WebGUI::International::get(239)."</b> ".epochToHuman($message{dateOfPost},"%w, %c %D, %y at %H:%n%p")."<br>";
|
||||
$html .= "<b>".WebGUI::International::get(240)."</b> ".$message{widgetId}."-".$message{rid}."-".$message{pid}."-".$message{messageId}."<br>";
|
||||
$html .= '</td>';
|
||||
$html .= '</tr><tr><td colspan=2 class="boardMessage">';
|
||||
$html .= '<a href="'.$session{page}{url}.'">'.WebGUI::International::get(242).'</a><br>';
|
||||
@data = WebGUI::SQL->quickArray("select max(messageId) from message where widgetId=$message{widgetId} and pid=0 and messageId<$message{rid}",$session{dbh});
|
||||
if ($data[0] ne "") {
|
||||
$html .= '<a href="'.$session{page}{url}.'?func=showMessage&mid='.$data[0].'&wid='.$session{form}{wid}.'">« '.WebGUI::International::get(241).'</a><br>';
|
||||
# } else {
|
||||
# $html .= '« '.WebGUI::International::get(241).'</a><br>';
|
||||
}
|
||||
@data = WebGUI::SQL->quickArray("select min(messageId) from message where widgetId=$message{widgetId} and pid=0 and messageId>$message{rid}",$session{dbh});
|
||||
if ($data[0] ne "") {
|
||||
$html .= '<a href="'.$session{page}{url}.'?func=showMessage&mid='.$data[0].'&wid='.$session{form}{wid}.'">'.WebGUI::International::get(243).' »</a><br>';
|
||||
# } else {
|
||||
# $html .= WebGUI::International::get(243).' »<br>';
|
||||
}
|
||||
$html .= '</tr><tr><td class="tableData">';
|
||||
$message{message} =~ s/\n/\<br\>/g;
|
||||
$html .= $message{message};
|
||||
$html .= '</td></tr></table><p><div align="center" class="boardMenu">';
|
||||
@data = WebGUI::SQL->quickArray("select max(messageId) from message where widgetId=$message{widgetId} and pid=0 and messageId<$message{rid}",$session{dbh});
|
||||
if ($data[0] ne "") {
|
||||
$html .= '<a href="'.$session{page}{url}.'?func=showMessage&mid='.$data[0].'&wid='.$session{form}{wid}.'">« '.WebGUI::International::get(241).'</a>';
|
||||
} else {
|
||||
$html .= '« '.WebGUI::International::get(241).'</a>';
|
||||
}
|
||||
$html .= ' · <a href="'.$session{page}{url}.'">'.WebGUI::International::get(242).'</a> · ';
|
||||
@data = WebGUI::SQL->quickArray("select min(messageId) from message where widgetId=$message{widgetId} and pid=0 and messageId>$message{rid}",$session{dbh});
|
||||
if ($data[0] ne "") {
|
||||
$html .= '<a href="'.$session{page}{url}.'?func=showMessage&mid='.$data[0].'&wid='.$session{form}{wid}.'">'.WebGUI::International::get(243).' »</a>';
|
||||
} else {
|
||||
$html .= WebGUI::International::get(243).' »';
|
||||
}
|
||||
$html .= '</div><table border=0 cellpadding=2 cellspacing=1 width="100%">';
|
||||
$html .= '</td></tr></table>';
|
||||
$html .= '<table border=0 cellpadding=2 cellspacing=1 width="100%">';
|
||||
$html .= '<tr><td class="tableHeader">'.WebGUI::International::get(229).'</td><td class="tableHeader">'.WebGUI::International::get(244).'</td><td class="tableHeader">'.WebGUI::International::get(245).'</td></tr>';
|
||||
@data = WebGUI::SQL->quickArray("select messageId,subject,username,dateOfPost from message where messageId=$message{rid}",$session{dbh});
|
||||
@data = WebGUI::SQL->quickArray("select messageId,subject,username,dateOfPost,userId from message where messageId=$message{rid}",$session{dbh});
|
||||
$html .= '<tr';
|
||||
if ($session{form}{mid} eq $message{rid}) {
|
||||
$html .= ' class="highlight"';
|
||||
}
|
||||
$html .= '><td class="tableData"><a href="'.$session{page}{url}.'?func=showMessage&mid='.$data[0].'&wid='.$message{widgetId}.'">'.substr($data[1],0,30).'</a></td><td class="tableData">'.$data[2].'</td><td class="tableData">'.epochToHuman($data[3],"%M/%D %H:%n%p").'</td></tr>';
|
||||
$html .= '><td class="tableData"><a href="'.$session{page}{url}.'?func=showMessage&mid='.$data[0].'&wid='.$message{widgetId}.'">'.substr($data[1],0,30).'</a></td><td class="tableData"><a href="'.$session{page}{url}.'?op=viewProfile&uid='.$data[4].'">'.$data[2].'</a></td><td class="tableData">'.epochToHuman($data[3],"%M/%D %H:%n%p").'</td></tr>';
|
||||
$html .= _traverseReplyTree($message{rid},1);
|
||||
$html .= "</table>";
|
||||
return $html;
|
||||
|
|
@ -346,26 +332,25 @@ sub www_view {
|
|||
} else {
|
||||
$pn = $session{form}{pn};
|
||||
}
|
||||
if ($board{displayTitle}) {
|
||||
$html = '<h1>'.$board{title}.'</h1>';
|
||||
}
|
||||
if ($board{description} ne "") {
|
||||
$html = $board{description}.'<p>';
|
||||
$html .= $board{description}.'<p>';
|
||||
}
|
||||
if ($board{processMacros}) {
|
||||
$html = WebGUI::Macro::process($html);
|
||||
}
|
||||
$html .= '<table width="100%"><tr><td class="boardTitle">';
|
||||
if ($board{displayTitle}) {
|
||||
$html .= $board{title};
|
||||
}
|
||||
$html .= '</td><td align="right" valign="bottom" class="boardMenu"><a href="'.$session{page}{url}.'?func=postNewMessage&wid='.$_[0].'">'.WebGUI::International::get(246).'</a></td></tr></table>';
|
||||
$html .= '<table width="100%" cellpadding=3 cellspacing=0 border=0><tr><td align="right" valign="bottom" class="tableMenu"><a href="'.$session{page}{url}.'?func=postNewMessage&wid='.$_[0].'">'.WebGUI::International::get(246).'</a></td></tr></table>';
|
||||
$html .= '<table border=0 cellpadding=2 cellspacing=1 width="100%">';
|
||||
$html .= '<tr><td class="tableHeader">'.WebGUI::International::get(229).'</td><td class="tableHeader">'.WebGUI::International::get(244).'</td><td class="tableHeader">'.WebGUI::International::get(247).'</td><td class="tableHeader">'.WebGUI::International::get(248).'</td><td class="tableHeader">'.WebGUI::International::get(249).'</td></tr>';
|
||||
#$sth = WebGUI::SQL->read("select messageId,subject,count(*)-1,username,dateOfPost,max(dateOfPost),max(messageId) from message where widgetId=$_[0] group by rid order by messageId desc", $session{dbh});
|
||||
$sth = WebGUI::SQL->read("select messageId,subject,username,dateOfPost from message where widgetId=$_[0] and pid=0 order by messageId desc", $session{dbh});
|
||||
$sth = WebGUI::SQL->read("select messageId,subject,username,dateOfPost,userId from message where widgetId=$_[0] and pid=0 order by messageId desc", $session{dbh});
|
||||
while (@data = $sth->array) {
|
||||
if ($i >= ($itemsPerPage*$pn) && $i < ($itemsPerPage*($pn+1))) {
|
||||
@last = WebGUI::SQL->quickArray("select messageId,dateOfPost,username,subject from message where widgetId=$_[0] and rid=$data[0] order by dateOfPost desc",$session{dbh});
|
||||
@last = WebGUI::SQL->quickArray("select messageId,dateOfPost,username,subject,userId from message where widgetId=$_[0] and rid=$data[0] order by dateOfPost desc",$session{dbh});
|
||||
($replies) = WebGUI::SQL->quickArray("select count(*)-1 from message where rid=$data[0]",$session{dbh});
|
||||
$html .= '<tr><td class="tableData"><a href="'.$session{page}{url}.'?func=showMessage&mid='.$data[0].'&wid='.$_[0].'">'.substr($data[1],0,30).'</a></td><td class="tableData">'.$data[2].'</td><td class="tableData">'.epochToHuman($data[3],"%M/%D %H:%n%p").'</td><td class="tableData">'.$replies.'</td><td class="tableData"><a href="'.$session{page}{url}.'?func=showMessage&mid='.$last[0].'&wid='.$_[0].'">'.substr($last[3],0,30).'</a><span style="font-size: 8pt;"> @ '.epochToHuman($last[1],"%M/%D %H:%n%p").' by '.$last[2].'</span></td></tr>';
|
||||
$html .= '<tr><td class="tableData"><a href="'.$session{page}{url}.'?func=showMessage&mid='.$data[0].'&wid='.$_[0].'">'.substr($data[1],0,30).'</a></td><td class="tableData"><a href="'.$session{page}{url}.'?op=viewProfile&uid='.$data[4].'">'.$data[2].'</a></td><td class="tableData">'.epochToHuman($data[3],"%M/%D %H:%n%p").'</td><td class="tableData">'.$replies.'</td><td class="tableData"><span style="font-size: 8pt;"><a href="'.$session{page}{url}.'?func=showMessage&mid='.$last[0].'&wid='.$_[0].'">'.substr($last[3],0,30).'</a> @ '.epochToHuman($last[1],"%M/%D %H:%n%p").' by <a href="'.$session{page}{url}.'?op=viewProfile&uid='.$last[4].'">'.$last[2].'</a></span></td></tr>';
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package WebGUI::Widget::Poll;
|
||||
|
||||
our $namespace = "Poll";
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -62,14 +64,14 @@ sub _viewResults {
|
|||
$output .= $poll{description}.'<p>';
|
||||
}
|
||||
$output .= '<span class="pollQuestion">'.$poll{question}.'</span>';
|
||||
($totalResponses) = WebGUI::SQL->quickArray("select count(*) from pollAnswer where widgetId=$widgetId",$session{dbh});
|
||||
($totalResponses) = WebGUI::SQL->quickArray("select count(*) from Poll_answer where widgetId=$widgetId",$session{dbh});
|
||||
if ($totalResponses < 1) {
|
||||
$totalResponses = 1;
|
||||
}
|
||||
for ($i=1; $i<=20; $i++) {
|
||||
if ($poll{'a'.$i} =~ /\w/) {
|
||||
$output .= '<span class="pollAnswer"><hr size=1>'.$poll{'a'.$i}.'<br></span>';
|
||||
@data = WebGUI::SQL->quickArray("select count(*), answer from pollAnswer where answer='a$i' and widgetId=$widgetId group by answer",$session{dbh});
|
||||
@data = WebGUI::SQL->quickArray("select count(*), answer from Poll_answer where answer='a$i' and widgetId=$widgetId group by answer",$session{dbh});
|
||||
$output .= '<table cellpadding=0 cellspacing=0 border=0><tr><td width="'.round($poll{graphWidth}*$data[0]/$totalResponses).'" class="pollColor"><img src="'.$session{setting}{lib}.'/spacer.gif" height="1" width="1"></td><td class="pollAnswer"> '.round(100*$data[0]/$totalResponses).'%</td></tr></table>';
|
||||
}
|
||||
}
|
||||
|
|
@ -80,7 +82,7 @@ sub _viewResults {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub purge {
|
||||
WebGUI::SQL->write("delete from pollAnswer where widgetId=$_[0]",$_[1]);
|
||||
WebGUI::SQL->write("delete from Poll_answer where widgetId=$_[0]",$_[1]);
|
||||
WebGUI::SQL->write("delete from Poll where widgetId=$_[0]",$_[1]);
|
||||
purgeWidget($_[0],$_[1]);
|
||||
}
|
||||
|
|
@ -95,10 +97,10 @@ sub www_add {
|
|||
my ($output, %hash, @array);
|
||||
tie %hash, "Tie::IxHash";
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=28"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(251).'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("widget","Poll");
|
||||
$output .= WebGUI::Form::hidden("widget",$namespace);
|
||||
$output .= WebGUI::Form::hidden("func","addSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,30,'Poll').'</td></tr>';
|
||||
|
|
@ -141,7 +143,7 @@ sub www_edit {
|
|||
tie %data, 'Tie::CPHash';
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
%data = WebGUI::SQL->quickHash("select * from widget,Poll where widget.widgetId=Poll.widgetId and widget.widgetId=$session{form}{wid}",$session{dbh});
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=28"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(258).'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
|
|
@ -182,7 +184,7 @@ sub www_editSave {
|
|||
#-------------------------------------------------------------------
|
||||
sub www_resetVotes {
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
WebGUI::SQL->write("delete from pollAnswer where widgetId='$session{form}{wid}'",$session{dbh});
|
||||
WebGUI::SQL->write("delete from Poll_answer where widgetId='$session{form}{wid}'",$session{dbh});
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
|
@ -195,7 +197,7 @@ sub www_view {
|
|||
if ($data{active} eq "0") {
|
||||
$output = _viewResults($_[0]);
|
||||
} elsif (WebGUI::Privilege::isInGroup($data{voteGroup},$session{user}{userId})) {
|
||||
($hasVoted) = WebGUI::SQL->quickArray("select count(*) from pollAnswer where widgetId=$_[0] and ((userId=$session{user}{userId} and userId<>1) or (userId=1 and ipAddress='$session{env}{REMOTE_ADDR}'))",$session{dbh});
|
||||
($hasVoted) = WebGUI::SQL->quickArray("select count(*) from Poll_answer where widgetId=$_[0] and ((userId=$session{user}{userId} and userId<>1) or (userId=1 and ipAddress='$session{env}{REMOTE_ADDR}'))",$session{dbh});
|
||||
if ($hasVoted) {
|
||||
$output = _viewResults($_[0]);
|
||||
} else {
|
||||
|
|
@ -212,7 +214,7 @@ sub www_vote {
|
|||
my ($voteGroup);
|
||||
($voteGroup) = WebGUI::SQL->quickArray("select voteGroup from Poll where widgetId='$session{form}{wid}'",$session{dbh});
|
||||
if (WebGUI::Privilege::isInGroup($voteGroup,$session{user}{userId})) {
|
||||
WebGUI::SQL->write("insert into pollAnswer values ($session{form}{wid}, '$session{form}{answer}', $session{user}{userId}, '$session{env}{REMOTE_ADDR}')",$session{dbh});
|
||||
WebGUI::SQL->write("insert into Poll_answer values ($session{form}{wid}, '$session{form}{answer}', $session{user}{userId}, '$session{env}{REMOTE_ADDR}')",$session{dbh});
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package WebGUI::Widget::SQLReport;
|
||||
|
||||
our $namespace = "SQLReport";
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -35,10 +37,10 @@ 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>';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(260).'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("widget","SQLReport");
|
||||
$output .= WebGUI::Form::hidden("widget",$namespace);
|
||||
$output .= WebGUI::Form::hidden("func","addSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,30,'SQL Report').'</td></tr>';
|
||||
|
|
@ -78,7 +80,7 @@ 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 = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=20"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(266).'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package WebGUI::Widget::SiteMap;
|
||||
|
||||
our $namespace = "SiteMap";
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -52,8 +54,8 @@ sub widgetName {
|
|||
sub www_add {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=30"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Add Site Map</h1><form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("widget","SiteMap");
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Add Site Map</h1><form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("widget",$namespace);
|
||||
$output .= WebGUI::Form::hidden("func","addSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">Title</td><td>'.WebGUI::Form::text("title",20,30,'Site Map').'</td></tr>';
|
||||
|
|
@ -89,7 +91,7 @@ sub www_edit {
|
|||
tie %data, 'Tie::CPHash';
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
%data = WebGUI::SQL->quickHash("select * from widget,SiteMap where widget.widgetId=SiteMap.widgetId and widget.widgetId=$session{form}{wid}",$session{dbh});
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=30"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Edit Site Map</h1><form method="post" action="'.$session{page}{url}.'">';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a><h1>Edit Site Map</h1><form method="post" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
$output .= WebGUI::Form::hidden("func","editSave");
|
||||
$output .= '<table>';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package WebGUI::Widget::SyndicatedContent;
|
||||
|
||||
our $namespace = "SyndicatedContent";
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -36,10 +38,10 @@ sub widgetName {
|
|||
sub www_add {
|
||||
my ($output);
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=36"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(272).'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("widget","SyndicatedContent");
|
||||
$output .= WebGUI::Form::hidden("widget",$namespace);
|
||||
$output .= WebGUI::Form::hidden("func","addSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,30,'Syndicated Content').'</td></tr>';
|
||||
|
|
@ -74,7 +76,7 @@ sub www_edit {
|
|||
tie %data, 'Tie::CPHash';
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
%data = WebGUI::SQL->quickHash("select * from widget,SyndicatedContent where widget.widgetId=$session{form}{wid}",$session{dbh});
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=36"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(274).'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package WebGUI::Widget::UserSubmission;
|
||||
|
||||
our $namespace = "UserSubmission";
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -23,7 +25,7 @@ use WebGUI::Widget;
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub purge {
|
||||
WebGUI::SQL->write("delete from submission where widgetId=$_[0]",$_[1]);
|
||||
WebGUI::SQL->write("delete from UserSubmission_submission where widgetId=$_[0]",$_[1]);
|
||||
WebGUI::SQL->write("delete from UserSubmission where widgetId=$_[0]",$_[1]);
|
||||
purgeWidget($_[0],$_[1]);
|
||||
}
|
||||
|
|
@ -38,10 +40,10 @@ sub www_add {
|
|||
my ($output, %hash, @array);
|
||||
tie %hash, "Tie::IxHash";
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=44"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(278).'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("widget","UserSubmission");
|
||||
$output .= WebGUI::Form::hidden("widget",$namespace);
|
||||
$output .= WebGUI::Form::hidden("func","addSave");
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><td class="formDescription">'.WebGUI::International::get(99).'</td><td>'.WebGUI::Form::text("title",20,30,'User Submission System').'</td></tr>';
|
||||
|
|
@ -94,7 +96,7 @@ sub www_addSubmission {
|
|||
$output .= '</table></form>';
|
||||
$output .= '<table width="100%" cellspacing=1 cellpadding=2 border=0>';
|
||||
$output .= '<tr><td class="tableHeader">'.WebGUI::International::get(289).'</td><td class="tableHeader">'.WebGUI::International::get(99).'</td><td class="tableHeader">'.WebGUI::International::get(287).'</td><td class="tableHeader">'.WebGUI::International::get(288).'</td></tr>';
|
||||
$sth = WebGUI::SQL->read("select title,submissionId,dateSubmitted,status from submission where widgetId='$session{form}{wid}' and userId=$session{user}{userId} order by dateSubmitted desc",$session{dbh});
|
||||
$sth = WebGUI::SQL->read("select title,submissionId,dateSubmitted,status from UserSubmission_submission where widgetId='$session{form}{wid}' and userId=$session{user}{userId} order by dateSubmitted desc",$session{dbh});
|
||||
while (@submission = $sth->array) {
|
||||
$output .= '<tr><td class="tableData"><a href="'.$session{page}{url}.'?func=editSubmission&wid='.$session{form}{wid}.'&sid='.$submission[1].'"><img src="'.$session{setting}{lib}.'/edit.gif" border=0></a><a href="'.$session{page}{url}.'?wid='.$session{form}{wid}.'&sid='.$submission[1].'&func=deleteSubmission"><img src="'.$session{setting}{lib}.'/delete.gif" border=0></a></td><td class="tableData"><a href="'.$session{page}{url}.'?wid='.$session{form}{wid}.'&func=viewSubmission&sid='.$submission[1].'">'.$submission[0].'</a></td><td class="tableData">'.epochToHuman($submission[2],"%M/%D/%y").'</td><td class="tableData">'.$submission[3].'</td></tr>';
|
||||
}
|
||||
|
|
@ -119,7 +121,7 @@ sub www_addSubmissionSave {
|
|||
} else {
|
||||
$title = WebGUI::International::get(290);
|
||||
}
|
||||
WebGUI::SQL->write("insert into submission values ($session{form}{wid}, $submissionId, ".quote($title).", ".time().", ".quote($session{user}{username}).", '$session{user}{userId}', ".quote($session{form}{content}).", ".quote($image).", ".quote($attachment).", '$status', '$session{form}{convertCarriageReturns}')",$session{dbh});
|
||||
WebGUI::SQL->write("insert into UserSubmission_submission values ($session{form}{wid}, $submissionId, ".quote($title).", ".time().", ".quote($session{user}{username}).", '$session{user}{userId}', ".quote($session{form}{content}).", ".quote($image).", ".quote($attachment).", '$status', '$session{form}{convertCarriageReturns}')",$session{dbh});
|
||||
return "";
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -129,9 +131,9 @@ sub www_addSubmissionSave {
|
|||
#-------------------------------------------------------------------
|
||||
sub www_deleteAttachment {
|
||||
my ($owner);
|
||||
($owner) = WebGUI::SQL->quickArray("select userId from submission where submissionId=$session{form}{sid}",$session{dbh});
|
||||
($owner) = WebGUI::SQL->quickArray("select userId from UserSubmission_submission where submissionId=$session{form}{sid}",$session{dbh});
|
||||
if ($owner == $session{user}{userId}) {
|
||||
WebGUI::SQL->write("update submission set attachment='' where submissionId=$session{form}{sid}",$session{dbh});
|
||||
WebGUI::SQL->write("update UserSubmission_submission set attachment='' where submissionId=$session{form}{sid}",$session{dbh});
|
||||
return www_editSubmission();
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -141,9 +143,9 @@ sub www_deleteAttachment {
|
|||
#-------------------------------------------------------------------
|
||||
sub www_deleteImage {
|
||||
my ($owner);
|
||||
($owner) = WebGUI::SQL->quickArray("select userId from submission where submissionId=$session{form}{sid}",$session{dbh});
|
||||
($owner) = WebGUI::SQL->quickArray("select userId from UserSubmission_submission where submissionId=$session{form}{sid}",$session{dbh});
|
||||
if ($owner == $session{user}{userId}) {
|
||||
WebGUI::SQL->write("update submission set image='' where submissionId=$session{form}{sid}",$session{dbh});
|
||||
WebGUI::SQL->write("update UserSubmission_submission set image='' where submissionId=$session{form}{sid}",$session{dbh});
|
||||
return www_editSubmission();
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -153,7 +155,7 @@ sub www_deleteImage {
|
|||
#-------------------------------------------------------------------
|
||||
sub www_deleteSubmission {
|
||||
my ($output, $owner);
|
||||
($owner) = WebGUI::SQL->quickArray("select userId from submission where submissionId=$session{form}{sid}",$session{dbh});
|
||||
($owner) = WebGUI::SQL->quickArray("select userId from UserSubmission_submission where submissionId=$session{form}{sid}",$session{dbh});
|
||||
if ($owner == $session{user}{userId}) {
|
||||
$output = '<h1>'.WebGUI::International::get(42).'</h1>';
|
||||
$output .= WebGUI::International::get(291).'<p>';
|
||||
|
|
@ -168,9 +170,9 @@ sub www_deleteSubmission {
|
|||
#-------------------------------------------------------------------
|
||||
sub www_deleteSubmissionConfirm {
|
||||
my ($output, $owner);
|
||||
($owner) = WebGUI::SQL->quickArray("select userId from submission where submissionId=$session{form}{sid}",$session{dbh});
|
||||
($owner) = WebGUI::SQL->quickArray("select userId from UserSubmission_submission where submissionId=$session{form}{sid}",$session{dbh});
|
||||
if ($owner == $session{user}{userId}) {
|
||||
WebGUI::SQL->write("delete from submission where submissionId=$session{form}{sid}",$session{dbh});
|
||||
WebGUI::SQL->write("delete from UserSubmission_submission where submissionId=$session{form}{sid}",$session{dbh});
|
||||
return www_addSubmission();
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -183,7 +185,7 @@ sub www_edit {
|
|||
tie %data, 'Tie::CPHash';
|
||||
if (WebGUI::Privilege::canEditPage()) {
|
||||
%data = WebGUI::SQL->quickHash("select * from widget,UserSubmission where widget.widgetId=$session{form}{wid} and widget.widgetId=UserSubmission.widgetId",$session{dbh});
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=44"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output = '<a href="'.$session{page}{url}.'?op=viewHelp&hid=1&namespace='.$namespace.'"><img src="'.$session{setting}{lib}.'/help.gif" border="0" align="right"></a>';
|
||||
$output .= '<h1>'.WebGUI::International::get(292).'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
|
|
@ -223,9 +225,9 @@ sub www_editSave {
|
|||
sub www_editSubmission {
|
||||
my ($output, %submission, $owner);
|
||||
tie %submission, 'Tie::CPHash';
|
||||
($owner) = WebGUI::SQL->quickArray("select userId from submission where submissionId=$session{form}{sid}",$session{dbh});
|
||||
($owner) = WebGUI::SQL->quickArray("select userId from UserSubmission_submission where submissionId=$session{form}{sid}",$session{dbh});
|
||||
if ($owner == $session{user}{userId}) {
|
||||
%submission = WebGUI::SQL->quickHash("select * from submission where submissionId='$session{form}{sid}'",$session{dbh});
|
||||
%submission = WebGUI::SQL->quickHash("select * from UserSubmission_submission where submissionId='$session{form}{sid}'",$session{dbh});
|
||||
$output = '<h1>'.WebGUI::International::get(293).'</h1>';
|
||||
$output .= '<form method="post" enctype="multipart/form-data" action="'.$session{page}{url}.'">';
|
||||
$output .= WebGUI::Form::hidden("wid",$session{form}{wid});
|
||||
|
|
@ -257,7 +259,7 @@ sub www_editSubmission {
|
|||
#-------------------------------------------------------------------
|
||||
sub www_editSubmissionSave {
|
||||
my ($owner,$status,$image,$attachment,$title);
|
||||
($owner) = WebGUI::SQL->quickArray("select userId from submission where submissionId=$session{form}{sid}",$session{dbh});
|
||||
($owner) = WebGUI::SQL->quickArray("select userId from UserSubmission_submission where submissionId=$session{form}{sid}",$session{dbh});
|
||||
if ($owner == $session{user}{userId}) {
|
||||
($status) = WebGUI::SQL->quickArray("select defaultStatus from UserSubmission where widgetId=$session{form}{wid}",$session{dbh});
|
||||
$image = saveAttachment("image",$session{form}{wid},$session{form}{sid});
|
||||
|
|
@ -273,7 +275,7 @@ sub www_editSubmissionSave {
|
|||
} else {
|
||||
$title = WebGUI::International::get(290);
|
||||
}
|
||||
WebGUI::SQL->write("update submission set dateSubmitted=".time().", convertCarriageReturns='$session{form}{convertCarriageReturns}', title=".quote($title).", content=".quote($session{form}{content}).", ".$image.$attachment." status='$status' where submissionId=$session{form}{sid}",$session{dbh});
|
||||
WebGUI::SQL->write("update UserSubmission_submission set dateSubmitted=".time().", convertCarriageReturns='$session{form}{convertCarriageReturns}', title=".quote($title).", content=".quote($session{form}{content}).", ".$image.$attachment." status='$status' where submissionId=$session{form}{sid}",$session{dbh});
|
||||
return www_viewSubmission();
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
|
|
@ -296,15 +298,15 @@ sub www_view {
|
|||
if ($data{processMacros}) {
|
||||
$output = WebGUI::Macro::process($output);
|
||||
}
|
||||
$sth = WebGUI::SQL->read("select title,submissionId,dateSubmitted,username,userId from submission where widgetId='$widgetId' and status='Approved' order by dateSubmitted desc",$session{dbh});
|
||||
$sth = WebGUI::SQL->read("select title,submissionId,dateSubmitted,username,userId from UserSubmission_submission where widgetId='$widgetId' and status='Approved' order by dateSubmitted desc",$session{dbh});
|
||||
while (@submission = $sth->array) {
|
||||
$row[$i] = '<tr><td class="tableData"><a href="'.$session{page}{url}.'?wid='.$widgetId.'&func=viewSubmission&sid='.$submission[1].'">'.$submission[0].'</a></td><td class="tableData">'.epochToHuman($submission[2],"%M/%D/%y").'</td><td class="tableData">'.$submission[3].'</td></tr>';
|
||||
$row[$i] = '<tr><td class="tableData"><a href="'.$session{page}{url}.'?wid='.$widgetId.'&func=viewSubmission&sid='.$submission[1].'">'.$submission[0].'</a></td><td class="tableData">'.epochToHuman($submission[2],"%M/%D/%y").'</td><td class="tableData"><a href="'.$session{page}{url}.'?op=viewProfile&uid='.$submission[4].'">'.$submission[3].'</a></td></tr>';
|
||||
$i++;
|
||||
}
|
||||
$sth->finish;
|
||||
$output .= '<table width="100%"><tr><td align="right"><a href="'.$session{page}{url}.'?func=addSubmission&wid='.$widgetId.'">'.WebGUI::International::get(294).'</a></td></tr></table>';
|
||||
$output .= '<table width="100%" cellpadding=3 cellspacing=0 border=0><tr><td align="right" class="tableMenu"><a href="'.$session{page}{url}.'?func=addSubmission&wid='.$widgetId.'">'.WebGUI::International::get(294).'</a></td></tr></table>';
|
||||
$output .= '<table width="100%" cellspacing=1 cellpadding=2 border=0>';
|
||||
$output .= '<tr><td class="tableHeader">'.WebGUI::International::get(99).'</td><td class="tableHeader">'.WebGUI::International::get(287).'</td><td class="tableHeader">'.WebGUI::International::get(295).'</td></tr>';
|
||||
$output .= '<tr><td class="tableHeader">'.WebGUI::International::get(99).'</td><td class="tableHeader">'.WebGUI::International::get(287).'</td><td class="tableHeader">'.WebGUI::International::get(296).'</td></tr>';
|
||||
if ($session{form}{pn} < 1) {
|
||||
$pn = 0;
|
||||
} else {
|
||||
|
|
@ -335,10 +337,27 @@ sub www_view {
|
|||
sub www_viewSubmission {
|
||||
my ($output, %submission);
|
||||
tie %submission, 'Tie::CPHash';
|
||||
%submission = WebGUI::SQL->quickHash("select * from submission where submissionId=$session{form}{sid}",$session{dbh});
|
||||
%submission = WebGUI::SQL->quickHash("select * from UserSubmission_submission where submissionId=$session{form}{sid}",$session{dbh});
|
||||
$output = "<h1>".$submission{title}."</h1>";
|
||||
$output .= '<b>'.WebGUI::International::get(297).'</b> '.$submission{username}.'<br>';
|
||||
$output .= '<b>'.WebGUI::International::get(298).'</b> '.epochToHuman($submission{dateSubmitted},"%w, %c %D, %y at %H:%n%p").'<p>';
|
||||
$output .= '<table width="100%" cellpadding=2 cellspacing=1 border=0>';
|
||||
$output .= '<tr><td class="tableHeader">';
|
||||
#---header
|
||||
$output .= '<b>'.WebGUI::International::get(297).'</b> <a href="'.$session{page}{url}.'?op=viewProfile&uid='.$submission{userId}.'">'.$submission{username}.'</a><br>';
|
||||
$output .= '<b>'.WebGUI::International::get(298).'</b> '.epochToHuman($submission{dateSubmitted},"%w, %c %D, %y at %H:%n%p");
|
||||
$output .= '</td><td rowspan="2" class="tableMenu" nowrap valign="top">';
|
||||
#---menu
|
||||
$output .= '<a href="'.$session{page}{url}.'">'.WebGUI::International::get(303).'</a><br>';
|
||||
if ($submission{userId} == $session{user}{userId}) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?func=deleteSubmission&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}.'">'.WebGUI::International::get(186).'</a><br>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?func=editSubmission&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}.'">'.WebGUI::International::get(302).'</a><br>';
|
||||
}
|
||||
if ($submission{status} eq "Pending" && (WebGUI::Privilege::isInGroup(3,$session{user}{userId}) || WebGUI::Privilege::isInGroup(4,$session{user}{userId}))) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=approveSubmission&sid='.$session{form}{sid}.'">'.WebGUI::International::get(299).'</a><br>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=viewPendingSubmissions">'.WebGUI::International::get(300).'</a><br>';
|
||||
$output .= '<a href="'.$session{page}{url}.'?op=denySubmission&sid='.$session{form}{sid}.'">'.WebGUI::International::get(301).'</a><br>';
|
||||
}
|
||||
$output .= '</td</tr><tr><td class="tableData">';
|
||||
#---content
|
||||
if ($submission{image} ne "") {
|
||||
$output .= '<img src="'.$session{setting}{attachmentDirectoryWeb}.'/'.$session{form}{wid}.'/'.$session{form}{sid}.'/'.$submission{image}.'" hspace=3 align="right">';
|
||||
}
|
||||
|
|
@ -356,13 +375,7 @@ sub www_viewSubmission {
|
|||
if ($submission{attachment} ne "") {
|
||||
$output .= '<p><a href="'.$session{setting}{attachmentDirectoryWeb}.'/'.$session{form}{wid}.'/'.$session{form}{sid}.'/'.$submission{attachment}.'"><img src="'.$session{setting}{lib}.'/attachment.gif" border=0 alt="Download Attachment"></a><p>';
|
||||
}
|
||||
$output .= '<div align="center">';
|
||||
if ($submission{userId} == $session{user}{userId}) {
|
||||
$output .= '<a href="'.$session{page}{url}.'?func=deleteSubmission&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}.'">'.WebGUI::International::get(186).'</a> · ';
|
||||
$output .= '<a href="'.$session{page}{url}.'?func=editSubmission&wid='.$session{form}{wid}.'&sid='.$session{form}{sid}.'">'.WebGUI::International::get(302).'</a> · ';
|
||||
}
|
||||
$output .= '<a href="'.$session{page}{url}.'">'.WebGUI::International::get(303).'</a>';
|
||||
$output .= '</div>';
|
||||
$output .= '</td></tr></table>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue