From c910e7e9c8e061417d8a617b849874e1f55b76e0 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Wed, 29 May 2002 20:47:50 +0000 Subject: [PATCH] Massive code cleanup. --- lib/WebGUI/Form.pm | 195 ----------------------------------------- lib/WebGUI/Shortcut.pm | 88 ------------------- 2 files changed, 283 deletions(-) delete mode 100644 lib/WebGUI/Form.pm delete mode 100644 lib/WebGUI/Shortcut.pm diff --git a/lib/WebGUI/Form.pm b/lib/WebGUI/Form.pm deleted file mode 100644 index c4e4fa64e..000000000 --- a/lib/WebGUI/Form.pm +++ /dev/null @@ -1,195 +0,0 @@ -package WebGUI::Form; - - - -##################################################################### -##################################################################### -# NOTICE: Use of this subsystem is depricated and is not recommended. -##################################################################### -##################################################################### - - - -#------------------------------------------------------------------- -# WebGUI is Copyright 2001-2002 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 qw(vars subs); -use WebGUI::International; -use WebGUI::Session; -use WebGUI::SQL; - -#------------------------------------------------------------------- -sub _fixQuotes { - my $value = shift; - $value =~ s/\"/\"\;/g; - return $value; -} - -#------------------------------------------------------------------- -sub checkbox { - my ($output, $name, $value, $checked); - ($name, $value, $checked) = @_; - if ($checked) { - $checked = ' checked'; - } - $output = ''; - return $output; -} - -#------------------------------------------------------------------- -sub file { - my ($output, $name); - ($name) = @_; - $output = ''; - return $output; -} - -#------------------------------------------------------------------- -sub groupList { - my ($output, %hash, @array); - tie %hash, 'Tie::IxHash'; - %hash = WebGUI::SQL->buildHash("select groupId,groupName from groups where groupName<>'Reserved' order by groupName"); - $array[0] = $_[1]; - $output = selectList($_[0],\%hash,\@array); - return $output; -} - -#------------------------------------------------------------------- -sub hidden { - my ($output, $name, $value); - ($name, $value) = @_; - $value = _fixQuotes($value); - $output = ''; - return $output; -} - -#------------------------------------------------------------------- -sub password { - my ($output, $name, $size, $maxLength, $value); - $name = shift; - $size = shift; - if ($size eq "") { - $size = 15; - } - $maxLength = shift; - if ($maxLength ne "") { - $maxLength = ' maxlength="'.$maxLength.'"'; - } - $value = shift; - $output = ''; - return $output; -} - -#------------------------------------------------------------------- -sub radio { - my ($output, $name, $value, $checked); - ($name, $value, $checked) = @_; - if ($checked) { - $checked = ' checked'; - } - $output = ''; - return $output; -} - -#------------------------------------------------------------------- -# eg: selectList(name, valueListHashref, selectedArrayref, size, multipleSelection, onChange) -sub selectList { - my ($output, $valueList, $key, $item, $name, $selected, $size, $multiple, $onChange); - ($name, $valueList, $selected, $size, $multiple, $onChange) = @_; - if ($size > 1) { - $size = ' size="'.$size.'"'; - } - if ($multiple > 0) { - $multiple = ' multiple="1"'; - } - if ($onChange ne "") { - $onChange = ' onChange="'.$onChange.'"'; - } - $output = ''; - } - $value = _fixQuotes($value); - $output = ''.$assistance; - return $output; -} - -#------------------------------------------------------------------- -sub textArea { - my ($output, $name, $value, $cols, $rows, $htmlEdit, $wrap); - $output = ''; - $name = $_[0]; - $value = $_[1]; - $value =~ s/\<\/textarea\>/\<\;\/textarea\>\;/ig; - $cols = $_[2] || 50; - $rows = $_[3] || 5; - $htmlEdit = $_[4]; - $wrap = $_[5] || "virtual"; - if ($htmlEdit > 0) { - $output .= ''; - $output .= '
'; - } - $output .= ''; - return $output; -} - - - -1; diff --git a/lib/WebGUI/Shortcut.pm b/lib/WebGUI/Shortcut.pm deleted file mode 100644 index bbf378329..000000000 --- a/lib/WebGUI/Shortcut.pm +++ /dev/null @@ -1,88 +0,0 @@ -package WebGUI::Shortcut; - - - - -##################################################################### -##################################################################### -# NOTICE: Use of this subsystem is depricated and is not recommended. -##################################################################### -##################################################################### - - - - - -#------------------------------------------------------------------- -# WebGUI is Copyright 2001-2002 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 Exporter; -use strict; -use WebGUI::Attachment; -use WebGUI::International; -use WebGUI::Session; -use WebGUI::URL; - -our @ISA = qw(Exporter); -our @EXPORT = qw(&attachmentBox &formHeader &formSave &tableFormRow &helpLink); - -# The subroutines found herein do nothing other than creating a -# short way of doing much longer repetitive tasks. They simply -# make the programmer's life easier through fewer keystrokes and -# less cluttered code. - - -#------------------------------------------------------------------- -sub attachmentBox { - my ($output, $attachment); - $attachment = WebGUI::Attachment->new($_[0],$_[1],$_[2]); - $output = '

'. - ''.
-		$attachment->getFilename.''.$attachment->getFilename
-		.''.$attachment->getFilename.'
'; - return $output; -} - -#------------------------------------------------------------------- -sub formHeader { - my ($output); - $output = '

'; - return $output; -} - -#------------------------------------------------------------------- -sub formSave { - my ($output); - $output = ''.WebGUI::Form::submit(WebGUI::International::get(62)).''; - return $output; -} - -#------------------------------------------------------------------- -sub helpLink { - my ($output, $namespace); - $namespace = $_[1] || "WebGUI"; - $output = ''; - return $output; -} - -#------------------------------------------------------------------- -sub tableFormRow { - my ($output); - $output = ''.$_[0].''.$_[1].''; - return $output; -} - - -1; -