some new tweaks
This commit is contained in:
parent
979b2a3e8c
commit
d99c033411
9 changed files with 73 additions and 367 deletions
|
|
@ -53,8 +53,18 @@ There have currently been no changes to the scheduler API.
|
|||
5. System Changes Affecting Migration
|
||||
-------------------------------------
|
||||
|
||||
5.1 Nothing Yet
|
||||
5.1 Set Date Format Changes
|
||||
|
||||
In 6.0 the "set date" format used by WebGUI::Form::date() and other methods
|
||||
was changed from "MM/DD/YYYY" to "YYYY-MM-DD" and optionally "YYYY-MM-DD
|
||||
HH:MM:SS". If you are using WebGUI::FormProcessor to handle processing of your
|
||||
dates then you will notice no side effects from the format change. If you are
|
||||
not, then you should convert your plugin to use WebGUI::FormProcessor.
|
||||
|
||||
In addition to the format change above, we also made one related API change.
|
||||
WebGUI::Form::dateTime() and WebGUI::HTMLForm->dateTime() no longer have
|
||||
"dateExtras" and "timeExtras", but rather just "extras" properties. This is
|
||||
because there is only one field to represent both the date and the time,
|
||||
unlike before.
|
||||
|
||||
There have currently been no changes to the system that would affect any normal
|
||||
use of the API's by plugins.
|
||||
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -172,6 +172,7 @@ delete from international where languageId=1 and namespace='USS' and internation
|
|||
insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (71,1,'USS','User Submission Systems (USS) are a great way to add a sense of community to any site as well as get free content from your users. The User Submission System name is misleading to some people, because they immediately think of users as visitors. However, users are also staff, or business partners, or even yourself. With the USS you can select who can add new content, and even who can moderate that content.\r\n<br><br>\r\nUser Submission systems are so versatile that they allow you to create all kinds of applications, just by editing a few templates. Example applications are Photo Galleries, FAQs, Link Lists, Guest Books, Classifieds, and more.\r\n\r\n\r\n<p>\r\n<b>Submission Template</b><br/>\r\nChoose a layout for the individual submissions.\r\n<p/>\r\n\r\n<b>Submission Form Template</b><br>\r\nChoose a layout of the form users see when submitting content.\r\n<p>\r\n\r\n\r\n<b>Submissions Per Page</b><br>\r\nHow many submissions should be listed per page in the submissions index?\r\n<br><br>\r\n\r\n\r\n<b>Filter Content</b><br>\r\nSelect the level of content filtering you wish to perform on all submitted content.\r\n<p>\r\n\r\n<b>Sort By</b><br>\r\nThe field to sort the submission list by.\r\n<p>\r\n\r\n<b>Sort Order</b><br>\r\nThe direction to sort the submission list by.\r\n<p>\r\n\r\n\r\n\r\n\r\n<b>Who can approve?</b><br>\r\nWhat group is allowed to approve and deny content?\r\n<br><br>\r\n\r\n<b>Who can contribute?</b><br>\r\nWhat group is allowed to contribute content?\r\n<br><br>\r\n\r\n\r\n<b>Default Status</b><br>\r\nShould submissions be set to <i>Approved</i>, <i>Pending</i>, or <i>Denied</i> by default?\r\n<br><br>\r\n<i>Note:</i> If you set the default status to Pending, then be prepared to monitor your message log for new submissions.\r\n<p>\r\n\r\n<b>Karma Per Submission</b><br>\r\nHow much karma should be given to a user when they contribute to this user submission system?\r\n<p>\r\n\r\n\r\n<b>Allow discussion?</b><br>\r\nChecking this box will enable responses to your article much like Articles on Slashdot.org.\r\n<p>\r\n\r\n\r\n', 1070199700,NULL);
|
||||
INSERT INTO template VALUES (1,'Default Login Box','<div class=\"loginBox\">\n<tmpl_if user.isVisitor>\n <tmpl_var form.header>\n <span><tmpl_var username.label><br></span>\n <tmpl_var username.form>\n <span><br><tmpl_var password.label><br></span>\n <tmpl_var password.form>\n <span><br></span>\n <tmpl_var form.login>\n <tmpl_var form.footer>\n <tmpl_if session.setting.anonymousRegistration>\n <p><a href=\"account.create.url\"><tmpl_var account.create.label></a></p>\n </tmpl_if> \n<tmpl_else>\n <tmpl_unless customText>\n <tmpl_var hello.label> <a href=\"<tmpl_var account.display.url>\"><tmpl_var session.user.username></a>.\n <tmpl_var logout.label>\n <tmpl_else>\n <tmpl_var customText>\n </tmpl_unless>\n</tmpl_if>\n</div>\n','Macro/L_loginBox');
|
||||
INSERT INTO template VALUES (2,'Horizontal Login Box','<div class=\"loginBox\">\n<tmpl_if user.isVisitor>\n <tmpl_var form.header>\n <table border=\"0\" class=\"loginBox\" cellpadding=\"1\" cellspacing=\"0\">\n <tr>\n <td><tmpl_var username.form></td>\n <td><tmpl_var password.form></td>\n <td><tmpl_var form.login></td>\n </tr>\n <tr>\n <td><tmpl_var username.label></td>\n <td><tmpl_var password.label></td>\n <td></td>\n </tr>\n </table> \n <tmpl_var form.footer>\n <tmpl_if session.setting.anonymousRegistration>\n <a href=\"account.create.url\"><tmpl_var account.create.label></a>\n </tmpl_if> \n<tmpl_else>\n <tmpl_unless customText>\n <tmpl_var hello.label> <a href=\"<tmpl_var account.display.url>\"><tmpl_var session.user.username></a>.\n <tmpl_var logout.label><br />\n <tmpl_else>\n <tmpl_var customText>\n </tmpl_unless>\n</tmpl_if>\n</div>\n','Macro/L_loginBox');
|
||||
INSERT INTO template VALUES (2,'DHTML Admin Bar','<script language=\"JavaScript1.2\" src=\"^Extras;/coolmenus/coolmenus4.js\">\n/*****************************************************************************\nCopyright (c) 2001 Thomas Brattli (webmaster@dhtmlcentral.com)\n \nDHTML coolMenus - Get it at coolmenus.dhtmlcentral.com\nVersion 4.0_beta\nThis script can be used freely as long as all copyright messages are\nintact.\n \nExtra info - Coolmenus reference/help - Extra links to help files ****\nCSS help: http://192.168.1.31/projects/coolmenus/reference.asp?m=37\nGeneral: http://coolmenus.dhtmlcentral.com/reference.asp?m=35\nMenu properties: http://coolmenus.dhtmlcentral.com/properties.asp?m=47\nLevel properties: http://coolmenus.dhtmlcentral.com/properties.asp?m=48\nBackground bar properties: http://coolmenus.dhtmlcentral.com/properties.asp?m=49\nItem properties: http://coolmenus.dhtmlcentral.com/properties.asp?m=50\n******************************************************************************/\n</script>\n<style type=\"text/css\">\n \n.adminBarTop,.adminBarTopOver,.adminBarSub,.adminBarSubOver{position:absolute; overflow:hidden; width:130; height:25; cursor:pointer; cursor:hand}\n.adminBarTop,.adminBarTopOver{padding:4px; font-size:12px; font-weight:bold}\n.adminBarTop{color:white; }\n.adminBarTopOver,.adminBarSubOver{color:#EC4300;}\n.adminBarSub,.adminBarSubOver{padding:2px; font-size:11px; font-weight:bold}\n.adminBarSub{color: white; background-color: #666666; layer-background-color: #666666;}\n.adminBarSubOver,.adminBarSubOver,.adminBarBorder,.adminBarBkg{layer-background-color: black; background-color: black;}\n.adminBarBorder{position:absolute; visibility:hidden; z-index:300}\n.adminBarBkg{position:absolute; width:10; height:10; visibility:hidden; }\n</style>\n\n<script language=\"JavaScript1.2\">\nadminBar=new makeCM(\"adminBar\"); \n\n//menu properties\nadminBar.resizeCheck=1; \nadminBar.rows=1; \nadminBar.onlineRoot=\"\"; \nadminBar.pxBetween =0;\nadminBar.fillImg=\"^Extras/spacer.gif\"; \nadminBar.fromTop=0; \nadminBar.fromLeft=50; \nadminBar.wait=300; \nadminBar.zIndex=400;\nadminBar.menuPlacement=\"left\";\n\n//background bar properties\nadminBar.useBar=1; \nadminBar.barWidth=\"100%\"; \nadminBar.barHeight=\"menu\"; \nadminBar.barX=0;\nadminBar.barY=\"menu\"; \nadminBar.barClass=\"adminBarBkg\";\nadminBar.barBorderX=0; \nadminBar.barBorderY=0;\n\nadminBar.level[0]=new cm_makeLevel(150,20,\"adminBarTop\",\"adminBarTopOver\",1,1,\"adminBarBorder\",0,\"bottom\",0,0,0,0,0);\nadminBar.level[1]=new cm_makeLevel(150,18,\"adminBarSub\",\"adminBarSubOver\",1,1,\"adminBarBorder\",0,\"right\",0,0,\"menu_arrow.gif\",10,10);\n\n\nadminBar.makeMenu(\'addcontent\',\'\',\'<tmpl_var addcontent.label>\',\'\');\n<tmpl_loop addcontent_loop> \n adminBar.makeMenu(\'addcontent<tmpl_var addcontent.count>\',\'addcontent\',\'<tmpl_var addcontent.label>\',\'<tmpl_var addcontent.url>\');\n</tmpl_loop>\n\nadminBar.makeMenu(\'clipboard\',\'\',\'<tmpl_var clipboard.label>\',\'\');\n<tmpl_loop clipboard_loop> \n adminBar.makeMenu(\'clipboard<tmpl_var clipboard.count>\',\'clipboard\',\'<tmpl_var clipboard.label>\',\'<tmpl_var clipboard.url>\');\n</tmpl_loop>\n\nadminBar.makeMenu(\'admin\',\'\',\'<tmpl_var admin.label>\',\'\');\n<tmpl_loop admin_loop> \n adminBar.makeMenu(\'admin<tmpl_var admin.count>\',\'admin\',\'<tmpl_var admin.label>\',\'<tmpl_var admin.url>\');\n</tmpl_loop>\n \nadminBar.construct()\n</script>\n<br />\n','Macro/AdminBar');
|
||||
INSERT INTO template VALUES (2,'DHTML Admin Bar','<script language=\"JavaScript1.2\" src=\"^Extras;/coolmenus/coolmenus4.js\">\n/*****************************************************************************\nCopyright (c) 2001 Thomas Brattli (webmaster@dhtmlcentral.com)\n \nDHTML coolMenus - Get it at coolmenus.dhtmlcentral.com\nVersion 4.0_beta\nThis script can be used freely as long as all copyright messages are\nintact.\n \nExtra info - Coolmenus reference/help - Extra links to help files ****\nCSS help: http://192.168.1.31/projects/coolmenus/reference.asp?m=37\nGeneral: http://coolmenus.dhtmlcentral.com/reference.asp?m=35\nMenu properties: http://coolmenus.dhtmlcentral.com/properties.asp?m=47\nLevel properties: http://coolmenus.dhtmlcentral.com/properties.asp?m=48\nBackground bar properties: http://coolmenus.dhtmlcentral.com/properties.asp?m=49\nItem properties: http://coolmenus.dhtmlcentral.com/properties.asp?m=50\n******************************************************************************/\n</script>\n<style type=\"text/css\">\n \n.adminBarTop,.adminBarTopOver,.adminBarSub,.adminBarSubOver{position:absolute; overflow:hidden; width:130; height:25; cursor:pointer; cursor:hand}\n.adminBarTop,.adminBarTopOver{padding:4px; font-size:12px; font-weight:bold}\n.adminBarTop{color:white; }\n.adminBarTopOver,.adminBarSubOver{color:#EC4300;}\n.adminBarSub,.adminBarSubOver{padding:2px; font-size:11px; font-weight:bold}\n.adminBarSub{color: white; background-color: #666666; layer-background-color: #666666;}\n.adminBarSubOver,.adminBarSubOver,.adminBarBorder,.adminBarBkg{layer-background-color: black; background-color: black;}\n.adminBarBorder{position:absolute; visibility:hidden; z-index:300}\n.adminBarBkg{position:absolute; width:10; height:10; visibility:hidden; }\n</style>\n\n<script language=\"JavaScript1.2\">\nadminBar=new makeCM(\"adminBar\"); \n\n//menu properties\nadminBar.resizeCheck=1; \nadminBar.rows=1; \nadminBar.onlineRoot=\"\"; \nadminBar.pxBetween =0;\nadminBar.fillImg=\"^Extras/spacer.gif\"; \nadminBar.fromTop=0; \nadminBar.fromLeft=50; \nadminBar.wait=300; \nadminBar.zIndex=10000;\nadminBar.menuPlacement=\"left\";\n\n//background bar properties\nadminBar.useBar=1; \nadminBar.barWidth=\"100%\"; \nadminBar.barHeight=\"menu\"; \nadminBar.barX=0;\nadminBar.barY=\"menu\"; \nadminBar.barClass=\"adminBarBkg\";\nadminBar.barBorderX=0; \nadminBar.barBorderY=0;\n\nadminBar.level[0]=new cm_makeLevel(150,20,\"adminBarTop\",\"adminBarTopOver\",1,1,\"adminBarBorder\",0,\"bottom\",0,0,0,0,0);\nadminBar.level[1]=new cm_makeLevel(150,18,\"adminBarSub\",\"adminBarSubOver\",1,1,\"adminBarBorder\",0,\"right\",0,0,\"menu_arrow.gif\",10,10);\n\n\nadminBar.makeMenu(\'addcontent\',\'\',\'<tmpl_var addcontent.label>\',\'\');\n<tmpl_loop addcontent_loop> \n adminBar.makeMenu(\'addcontent<tmpl_var addcontent.count>\',\'addcontent\',\'<tmpl_var addcontent.label>\',\'<tmpl_var addcontent.url>\');\n</tmpl_loop>\n\nadminBar.makeMenu(\'clipboard\',\'\',\'<tmpl_var clipboard.label>\',\'\');\n<tmpl_loop clipboard_loop> \n adminBar.makeMenu(\'clipboard<tmpl_var clipboard.count>\',\'clipboard\',\'<tmpl_var clipboard.label>\',\'<tmpl_var clipboard.url>\');\n</tmpl_loop>\n\nadminBar.makeMenu(\'admin\',\'\',\'<tmpl_var admin.label>\',\'\');\n<tmpl_loop admin_loop> \n adminBar.makeMenu(\'admin<tmpl_var admin.count>\',\'admin\',\'<tmpl_var admin.label>\',\'<tmpl_var admin.url>\');\n</tmpl_loop>\n \nadminBar.construct()\n</script>\n<br />\n','Macro/AdminBar');
|
||||
INSERT INTO template VALUES (1,'Default Admin Bar',' <script language=\"JavaScript\" type=\"text/javascript\"> <!--\n function goContent(){\n location = document.content.contentSelect.options[document.content.contentSelect.selectedIndex].value\n }\n function goAdmin(){\n location = document.admin.adminSelect.options[document.admin.adminSelect.selectedIndex].value\n }\n function goClipboard(){\n location = document.clipboard.clipboardSelect.options[document.clipboard.clipboardSelect.selectedIndex].value\n }\n //--> </script>\n \n<div class=\"adminBar\">\n<table class=\"adminBar\" width=\"100%\" cellpadding=\"3\" cellspacing=\"0\" border=\"0\">\n <tr>\n <form name=\"content\"> <td>\n <select name=\"contentSelect\" onChange=\"goContent()\">\n <option value=\"\"><tmpl_var addcontent.label></option>\n <tmpl_loop addcontent_loop>\n <option value=\"<tmpl_var addcontent.url>\"><tmpl_var addcontent.label></option>\n </tmpl_loop>\n </select>\n </td> </form>\n <form name=\"clipboard\"> <td align=\"center\">\n <select name=\"clipboardSelect\" onChange=\"goClipboard()\">\n <option value=\"\"><tmpl_var clipboard.label></option>\n <tmpl_loop clipboard_loop>\n <option value=\"<tmpl_var clipboard.url>\"><tmpl_var clipboard.label></option>\n </tmpl_loop>\n </select>\n </td> </form>\n <form name=\"admin\"> <td align=\"center\">\n <select name=\"adminSelect\" onChange=\"goAdmin()\">\n <option value=\"\"><tmpl_var admin.label></option>\n <tmpl_loop admin_loop>\n <option value=\"<tmpl_var admin.url>\"><tmpl_var admin.label></option>\n </tmpl_loop>\n </select>\n </td> </form>\n </tr>\n</table>\n</div>\n','Macro/AdminBar');
|
||||
delete from international where internationalId=34 and namespace='WebGUI';
|
||||
|
||||
|
|
|
|||
|
|
@ -286,9 +286,9 @@ sub epochToHuman {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 epochToSet ( epoch )
|
||||
=head2 epochToSet ( epoch, withTime )
|
||||
|
||||
Returns a set date (used by WebGUI::HTMLForm->date) in the format of MM/DD/YYYY.
|
||||
Returns a set date (used by WebGUI::HTMLForm->date) in the format of YYYY-MM-DD.
|
||||
|
||||
=over
|
||||
|
||||
|
|
@ -296,12 +296,19 @@ Returns a set date (used by WebGUI::HTMLForm->date) in the format of MM/DD/YYYY.
|
|||
|
||||
The number of seconds since January 1, 1970.
|
||||
|
||||
=item withTime
|
||||
|
||||
A boolean indicating that the time should be added to the output, thust turning the format into YYYY-MM-DD HH:MM:SS.
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
sub epochToSet {
|
||||
return epochToHuman($_[0],"%m/%d/%y");
|
||||
if ($_[1]) {
|
||||
return epochToHuman($_[0],"%y-%m-%d %j:%n:%s");
|
||||
}
|
||||
return epochToHuman($_[0],"%y-%m-%d");
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -626,31 +633,33 @@ Returns an epoch date.
|
|||
|
||||
=item set
|
||||
|
||||
A string in the format of MM/DD/YYYY.
|
||||
A string in the format of YYYY-MM-DD or YYYY-MM-DD HH:MM:SS.
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
sub setToEpoch {
|
||||
my @date = Date::Calc::Time_to_Date(time());
|
||||
my ($month, $day, $year) = split(/\//,$_[0]);
|
||||
my @now = Date::Calc::Time_to_Date(time());
|
||||
my ($date,$time) = split(/ /,$_[0]);
|
||||
my ($year, $month, $day) = split(/\-/,$date);
|
||||
my ($hour, $minute, $second) = split(/\:/,$time);
|
||||
if (int($year) < 2038 && int($year) > 1969) {
|
||||
$year = int($year);
|
||||
} else {
|
||||
$year = $date[0];
|
||||
$year = $now[0];
|
||||
}
|
||||
if (int($month) < 13 && int($month) > 0) {
|
||||
$month = int($month);
|
||||
} else {
|
||||
$month = $date[1]++;
|
||||
$month = $now[1]++;
|
||||
}
|
||||
if (int($day) < 32 && int($day) > 0) {
|
||||
$day = int($day);
|
||||
} else {
|
||||
$day = $date[2];
|
||||
$day = $now[2];
|
||||
}
|
||||
return Date::Calc::Date_to_Time($year,$month,$day,0,0,0);
|
||||
return Date::Calc::Date_to_Time($year,$month,$day,$hour,$minute,$second);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -354,9 +354,8 @@ By default a date is placed in the "value" field. Set this to "1" to turn off th
|
|||
=cut
|
||||
|
||||
sub date {
|
||||
my ($subtext, $noDate, $class, $name, $label, $extras, $size, $value);
|
||||
$value = epochToSet($_[0]->{value}) unless ($_[0]->{noDate} && $_[0]->{value} eq '');
|
||||
$size = $_[0]->{size} || 10;
|
||||
my $value = epochToSet($_[0]->{value}) unless ($_[0]->{noDate} && $_[0]->{value} eq '');
|
||||
my $size = $_[0]->{size} || 10;
|
||||
my $output = _cssFile("calendar/calendar-win2k-1.css")
|
||||
._javascriptFile('calendar/calendar.js')
|
||||
._javascriptFile('calendar/lang/calendar-en.js')
|
||||
|
|
@ -377,10 +376,6 @@ sub date {
|
|||
mondayFirst : false
|
||||
});
|
||||
</script>';
|
||||
# $output .= '<input type="button" style="font-size: 8pt;" onClick="window.dateField = this.form.'.
|
||||
# $_[0]->{name}.';calendar = window.open(\''.$session{config}{extrasURL}.
|
||||
# '/calendar.html\',\'cal\',\'WIDTH=220,HEIGHT=250\');return false" value="'.
|
||||
# WebGUI::International::get(34).'">';
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
@ -402,29 +397,36 @@ The the base name for this form element. This form element actually returns two
|
|||
|
||||
The date and time. Pass as an epoch value. Defaults to today and now.
|
||||
|
||||
=item dateExtras
|
||||
=item extras
|
||||
|
||||
Extra parameters to add to the date form element such as javascript or stylesheet information.
|
||||
|
||||
=item timeExtras
|
||||
|
||||
Extra parameters to add to the time form element such as javascript or stylesheet information.
|
||||
Extra parameters to add to the date/time form element such as javascript or stylesheet information.
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
sub dateTime {
|
||||
my $output = date({
|
||||
name=>$_[0]->{name}."_date",
|
||||
value=>$_[0]->{value},
|
||||
extras=>$_[0]->{dateExtras}
|
||||
});
|
||||
$output .= timeField({
|
||||
name=>$_[0]->{name}."_time",
|
||||
value=>WebGUI::DateTime::getSecondsFromEpoch($_[0]->{value}),
|
||||
extras=>$_[0]->{timeExtras}
|
||||
});
|
||||
my $value = epochToSet($_[0]->{value},1);
|
||||
my $output = _cssFile("calendar/calendar-win2k-1.css")
|
||||
._javascriptFile('calendar/calendar.js')
|
||||
._javascriptFile('calendar/lang/calendar-en.js')
|
||||
._javascriptFile('calendar/calendar-setup.js');
|
||||
$output .= text({
|
||||
name=>$_[0]->{name},
|
||||
value=>$value,
|
||||
size=>19,
|
||||
extras=>'id="'.$_[0]->{name}.'Id" '.$_[0]->{extras},
|
||||
maxlength=>19
|
||||
});
|
||||
$output .= '<script type="text/javascript">
|
||||
Calendar.setup({
|
||||
inputField : "'.$_[0]->{name}.'Id",
|
||||
ifFormat : "%Y-%m-%d %H:%M:%S",
|
||||
showsTime : true,
|
||||
timeFormat : "12",
|
||||
mondayFirst : false
|
||||
});
|
||||
</script>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -191,10 +191,7 @@ The name of the form variable to retrieve.
|
|||
=cut
|
||||
|
||||
sub dateTime {
|
||||
my $date = date($_[0]."_date");
|
||||
my $time = timeField($_[0]."_time");
|
||||
my $epoch = $date+$time;
|
||||
return $epoch;
|
||||
return WebGUI::DateTime::setToEpoch($session{form}{$_[0]});
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -587,13 +587,9 @@ Extra text to describe this form element or to provide special instructions.
|
|||
|
||||
The UI level for this field. See the WebGUI developer's site for details. Defaults to "0".
|
||||
|
||||
=item dateExtras
|
||||
=item extras
|
||||
|
||||
Extra parameters such as javascript or style sheet information that you wish to add to the date form element.
|
||||
|
||||
=item timeExtras
|
||||
|
||||
Extra parameters such as javascript or style sheet information that you wish to add to the time form element.
|
||||
Extra parameters such as javascript or style sheet information that you wish to add to the form element.
|
||||
|
||||
=back
|
||||
|
||||
|
|
@ -602,14 +598,13 @@ Extra parameters such as javascript or style sheet information that you wish to
|
|||
sub dateTime {
|
||||
my ($output);
|
||||
my ($self, @p) = @_;
|
||||
my ($name, $label, $value, $subtext, $uiLevel, $dateExtras, $timeExtras) =
|
||||
rearrange([qw(name label value subtext uiLevel dateExtras timeExtras)], @p);
|
||||
my ($name, $label, $value, $subtext, $uiLevel, $extras) =
|
||||
rearrange([qw(name label value subtext uiLevel extras)], @p);
|
||||
if (_uiLevelChecksOut($uiLevel)) {
|
||||
$output = WebGUI::Form::dateTime({
|
||||
"name"=>$name,
|
||||
"value"=>$value,
|
||||
"dateExtras"=>$dateExtras,
|
||||
"timeExtras"=>$timeExtras
|
||||
"extras"=>$extras
|
||||
});
|
||||
$output .= _subtext($subtext);
|
||||
$output = $self->_tableFormRow($label,$output);
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ sub _selectPositions {
|
|||
);
|
||||
$output = '
|
||||
<script language="JavaScript">
|
||||
function checkBrowser(){
|
||||
function checkBrowserVersion(){
|
||||
this.ver=navigator.appVersion;
|
||||
this.dom=document.getElementById?1:0;
|
||||
this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
|
||||
|
|
@ -111,21 +111,21 @@ sub _selectPositions {
|
|||
this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5 || this.dom);
|
||||
return this;
|
||||
}
|
||||
bw=new checkBrowser();
|
||||
pbw=new checkBrowserVersion();
|
||||
function makeChangeTextObj(obj){
|
||||
this.css=bw.dom? document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?document.layers[obj]:0;
|
||||
this.writeref=bw.dom? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?document.layers[obj].document:0
|
||||
this.css=pbw.dom? document.getElementById(obj).style:pbw.ie4?document.all[obj].style:pbw.ns4?document.layers[obj]:0;
|
||||
this.writeref=pbw.dom? document.getElementById(obj):pbw.ie4?document.all[obj]:pbw.ns4?document.layers[obj].document:0
|
||||
;
|
||||
this.writeIt=b_writeIt;
|
||||
}
|
||||
function b_writeIt(text){
|
||||
var obj;
|
||||
if(bw.ns4) {
|
||||
if(pbw.ns4) {
|
||||
if (document.loading) document.loading.visibility = "hidden";
|
||||
this.writeref.write(text + " ");
|
||||
this.writeref.close();
|
||||
} else {
|
||||
if (bw.ie4) {
|
||||
if (pbw.ie4) {
|
||||
if (document.all.loading) obj = document.all.loading;
|
||||
}
|
||||
if (obj) obj.style.visibility = "hidden";
|
||||
|
|
@ -133,7 +133,7 @@ sub _selectPositions {
|
|||
}
|
||||
}
|
||||
function init(){
|
||||
if(bw.bw){
|
||||
if(pbw.bw){
|
||||
oMessage=new makeChangeTextObj("templatePreview");
|
||||
oMessage.css.visibility="visible";
|
||||
changeTemplatePreview('.$_[0].');
|
||||
|
|
|
|||
|
|
@ -1,308 +0,0 @@
|
|||
<html>
|
||||
|
||||
<head>
|
||||
<title>Calendar</title>
|
||||
<script language="JavaScript">
|
||||
var styleFlag;
|
||||
function setDate() {
|
||||
styleFlag = document.calControl.style?1:0;
|
||||
this.dateField = opener.dateField;
|
||||
this.inDate = dateField.value;
|
||||
|
||||
var now = new Date();
|
||||
var day = now.getDate();
|
||||
var month = now.getMonth();
|
||||
var year = now.getFullYear();
|
||||
|
||||
if (inDate.indexOf('/')) {
|
||||
var inMonth = inDate.substring(0,inDate.indexOf("/"));
|
||||
if (inMonth.substring(0,1) == "0" && inMonth.length > 1)
|
||||
inMonth = inMonth.substring(1,inMonth.length);
|
||||
inMonth = parseInt(inMonth);
|
||||
var inDay = inDate.substring(inDate.indexOf("/") + 1, inDate.lastIndexOf("/"));
|
||||
if (inDay.substring(0,1) == "0" && inDay.length > 1)
|
||||
inDay = inDay.substring(1,inDay.length);
|
||||
inDay = parseInt(inDay);
|
||||
var inYear = parseInt(inDate.substring(inDate.lastIndexOf("/") + 1, inDate.length));
|
||||
if (inDay) {day = inDay;}
|
||||
if (inMonth) {month = inMonth-1;}
|
||||
if (inYear) {year = inYear;}
|
||||
}
|
||||
this.focusDay = day;
|
||||
document.calControl.month.selectedIndex = month;
|
||||
document.calControl.year.value = year;
|
||||
displayCalendar(day, month, year);
|
||||
}
|
||||
|
||||
function setToday() {
|
||||
var now = new Date();
|
||||
var day = now.getDate();
|
||||
var month = now.getMonth();
|
||||
var year = now.getFullYear();
|
||||
|
||||
this.focusDay = day;
|
||||
document.calControl.month.selectedIndex = month;
|
||||
document.calControl.year.value = year;
|
||||
displayCalendar(day, month, year);
|
||||
}
|
||||
function isFourDigitYear(year) {
|
||||
if (year.length != 4) {
|
||||
alert ("Sorry, the year must be four-digits in length.");
|
||||
document.calControl.year.select();
|
||||
document.calControl.year.focus();
|
||||
}
|
||||
else {return true;
|
||||
}
|
||||
}
|
||||
function selectDate() {
|
||||
var year = document.calControl.year.value;
|
||||
if (isFourDigitYear(year)) {
|
||||
var day = 0;
|
||||
var month = document.calControl.month.selectedIndex;
|
||||
displayCalendar(day, month, year);
|
||||
}
|
||||
}
|
||||
function setPreviousYear() {
|
||||
var year = document.calControl.year.value;
|
||||
if (isFourDigitYear(year)) {
|
||||
var day = 0;
|
||||
var month = document.calControl.month.selectedIndex;
|
||||
year--;
|
||||
document.calControl.year.value = year;
|
||||
displayCalendar(day, month, year);
|
||||
}
|
||||
}
|
||||
function setPreviousMonth() {
|
||||
var year = document.calControl.year.value;
|
||||
if (isFourDigitYear(year)) {
|
||||
var day = 0;
|
||||
var month = document.calControl.month.selectedIndex;
|
||||
if (month == 0) {
|
||||
month = 11;
|
||||
if (year > 1000) {
|
||||
year--;
|
||||
document.calControl.year.value = year;
|
||||
}
|
||||
}
|
||||
else {
|
||||
month--;
|
||||
}
|
||||
document.calControl.month.selectedIndex = month;
|
||||
displayCalendar(day, month, year);
|
||||
}
|
||||
}
|
||||
function setNextMonth() {
|
||||
var year = document.calControl.year.value;
|
||||
if (isFourDigitYear(year)) {
|
||||
var day = 0;
|
||||
var month = document.calControl.month.selectedIndex;
|
||||
if (month == 11) {
|
||||
month = 0;
|
||||
year++;
|
||||
document.calControl.year.value = year;
|
||||
}
|
||||
else {
|
||||
month++;
|
||||
}
|
||||
document.calControl.month.selectedIndex = month;
|
||||
displayCalendar(day, month, year);
|
||||
}
|
||||
}
|
||||
function setNextYear() {
|
||||
var year = document.calControl.year.value;
|
||||
if (isFourDigitYear(year)) {
|
||||
var day = 0;
|
||||
var month = document.calControl.month.selectedIndex;
|
||||
year++;
|
||||
document.calControl.year.value = year;
|
||||
displayCalendar(day, month, year);
|
||||
}
|
||||
}
|
||||
function displayCalendar(day, month, year) {
|
||||
day = parseInt(day);
|
||||
month = parseInt(month);
|
||||
year = parseInt(year);
|
||||
var i = 0;
|
||||
var now = new Date();
|
||||
if (day == 0) {
|
||||
var nowDay = now.getDate();
|
||||
}
|
||||
else {
|
||||
var nowDay = day;
|
||||
}
|
||||
var days = getDaysInMonth(month+1,year);
|
||||
var firstOfMonth = new Date (year, month, 1);
|
||||
var startingPos = firstOfMonth.getDay();
|
||||
days += startingPos;
|
||||
|
||||
//MAKE BEGINNING NON-DATE BUTTONS BLANK
|
||||
for (i = 0; i < startingPos; i++) {
|
||||
document.calButtons.elements[i].value = " ";
|
||||
if (styleFlag) document.calButtons.elements[i].style.visibility="hidden";
|
||||
}
|
||||
// SET VALUES FOR DAYS OF THE MONTH
|
||||
for (i = startingPos; i < days; i++)
|
||||
{
|
||||
document.calButtons.elements[i].value = i-startingPos+1;
|
||||
document.calButtons.elements[i].onClick = "returnDate"
|
||||
if (styleFlag) document.calButtons.elements[i].style.visibility="visible";
|
||||
}
|
||||
// MAKE REMAINING NON-DATE BUTTONS BLANK
|
||||
for (i=days; i<42; i++) {
|
||||
document.calButtons.elements[i].value = " ";
|
||||
if (styleFlag) document.calButtons.elements[i].style.visibility="hidden";
|
||||
}
|
||||
// GIVE FOCUS TO CORRECT DAY
|
||||
document.calButtons.elements[focusDay+startingPos-1].focus();
|
||||
}
|
||||
// GET NUMBER OF DAYS IN MONTH
|
||||
function getDaysInMonth(month,year) {
|
||||
var days;
|
||||
if (month==1 || month==3 || month==5 || month==7 || month==8 ||
|
||||
month==10 || month==12) days=31;
|
||||
else if (month==4 || month==6 || month==9 || month==11) days=30;
|
||||
else if (month==2) {
|
||||
if (isLeapYear(year)) {days=29;}
|
||||
else {
|
||||
days=28;
|
||||
}
|
||||
}
|
||||
return (days);
|
||||
}
|
||||
// CHECK TO SEE IF YEAR IS A LEAP YEAR
|
||||
function isLeapYear (Year) {
|
||||
if (((Year % 4)==0) && ((Year % 100)!=0) || ((Year % 400)==0)) {
|
||||
return (true);
|
||||
}
|
||||
else {
|
||||
return (false);
|
||||
}
|
||||
}
|
||||
// SET FORM FIELD VALUE TO THE DATE SELECTED
|
||||
function returnDate(inDay) {
|
||||
var day = inDay;
|
||||
var month = (document.calControl.month.selectedIndex)+1;
|
||||
var year = document.calControl.year.value;
|
||||
if ((""+month).length == 1) {
|
||||
month="0"+month;
|
||||
}
|
||||
if ((""+day).length == 1) {
|
||||
day="0"+day;
|
||||
}
|
||||
if ((""+year).length == 1) {
|
||||
year="0"+year;
|
||||
}
|
||||
if (day != " ") {
|
||||
dateField.value = month + "/" + day + "/" + year;
|
||||
dateField.focus();
|
||||
window.close()
|
||||
}
|
||||
}
|
||||
// -->
|
||||
</script>
|
||||
</head>
|
||||
<body bgcolor="#FFFFFF" onload="setDate()" text="#990000" link="#CC3333">
|
||||
<center>
|
||||
<form name="calControl" onSubmit="return false;">
|
||||
<table cellpadding=0 cellspacing=0 border=0>
|
||||
<tr><td colspan=7>
|
||||
<center>
|
||||
<select name="month" onChange='selectDate()'>
|
||||
<option>January
|
||||
<option>February
|
||||
<option>March
|
||||
<option>April
|
||||
<option>May
|
||||
<option>June
|
||||
<option>July
|
||||
<option>August
|
||||
<option>September
|
||||
<option>October
|
||||
<option>November
|
||||
<option>December
|
||||
</select>
|
||||
<input name="year" type=text size=4 maxlength=4 onChange="selectDate()">
|
||||
</center>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=7>
|
||||
<center>
|
||||
<input type=button name="previousYear" value="<<" onClick="setPreviousYear()">
|
||||
<input type=button name="previousYear" value=" < " onClick="setPreviousMonth()">
|
||||
<input type=button name="previousYear" value="Today" onClick="setToday()">
|
||||
<input type=button name="previousYear" value=" > " onClick="setNextMonth()">
|
||||
<input type=button name="previousYear" value=">>" onClick="setNextYear()">
|
||||
</center>
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
<form name="calButtons">
|
||||
<tr height=10><td></td></tr>
|
||||
<tr><td><center><font size=-1 face="Arial,Helv,Helvetica"><b>Su</b></font></center></td>
|
||||
<td><center><font size=-1 face="Arial,Helv,Helvetica"><b>Mo</b></font></center></td>
|
||||
<td><center><font size=-1 face="Arial,Helv,Helvetica"><b>Tu</b></font></center></td>
|
||||
<td><center><font size=-1 face="Arial,Helv,Helvetica"><b>We</b></font></center></td>
|
||||
<td><center><font size=-1 face="Arial,Helv,Helvetica"><b>Th</b></font></center></td>
|
||||
<td><center><font size=-1 face="Arial,Helv,Helvetica"><b>Fr</b></font></center></td>
|
||||
<td><center><font size=-1 face="Arial,Helv,Helvetica"><b>Sa</b></font></center></td></tr>
|
||||
<tr><td><input type="button" name="but0" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td
|
||||
>
|
||||
<td><input type="button" name="but1" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td>
|
||||
<td><input type="button" name="but2" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td>
|
||||
<td><input type="button" name="but3" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td>
|
||||
<td><input type="button" name="but4" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td>
|
||||
<td><input type="button" name="but5" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td>
|
||||
<td><input type="button" name="but6" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td></t
|
||||
r>
|
||||
<tr><td><input type="button" name="but7" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td
|
||||
>
|
||||
<td><input type="button" name="but8" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td>
|
||||
<td><input type="button" name="but9" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td>
|
||||
<td><input type="button" name="but10" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td>
|
||||
<td><input type="button" name="but11" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td>
|
||||
<td><input type="button" name="but12" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td>
|
||||
<td><input type="button" name="but13" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td></t
|
||||
r>
|
||||
<tr><td><input type="button" name="but14" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td
|
||||
>
|
||||
<td><input type="button" name="but15" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td>
|
||||
<td><input type="button" name="but16" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td>
|
||||
<td><input type="button" name="but17" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td>
|
||||
<td><input type="button" name="but18" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td>
|
||||
<td><input type="button" name="but19" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td>
|
||||
<td><input type="button" name="but20" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td></t
|
||||
r>
|
||||
<tr><td><input type="button" name="but21" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td
|
||||
>
|
||||
<td><input type="button" name="but22" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td>
|
||||
<td><input type="button" name="but23" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td>
|
||||
<td><input type="button" name="but24" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td>
|
||||
<td><input type="button" name="but25" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td>
|
||||
<td><input type="button" name="but26" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td>
|
||||
<td><input type="button" name="but27" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td></t
|
||||
r>
|
||||
<tr><td><input type="button" name="but28" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td
|
||||
>
|
||||
<td><input type="button" name="but29" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td>
|
||||
<td><input type="button" name="but30" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td>
|
||||
<td><input type="button" name="but31" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td>
|
||||
<td><input type="button" name="but32" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td>
|
||||
<td><input type="button" name="but33" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td>
|
||||
<td><input type="button" name="but34" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td></t
|
||||
r>
|
||||
<tr><td><input type="button" name="but35" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td
|
||||
>
|
||||
<td><input type="button" name="but36" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td>
|
||||
<td><input type="button" name="but37" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td>
|
||||
<td><input type="button" name="but38" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td>
|
||||
<td><input type="button" name="but39" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td>
|
||||
<td><input type="button" name="but40" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td>
|
||||
<td><input type="button" name="but41" value=" " onClick="returnDate(this.value)" style="width:22px" width=22></td></t
|
||||
r>
|
||||
</form></table>
|
||||
</form>
|
||||
|
||||
</center></body>
|
||||
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue