diff options
29 files changed, 1358 insertions, 1320 deletions
diff --git a/actions/event_calendar/add_personal.php b/actions/event_calendar/add_personal.php new file mode 100644 index 000000000..fd6f6cee2 --- /dev/null +++ b/actions/event_calendar/add_personal.php @@ -0,0 +1,17 @@ +<?php +elgg_load_library('elgg:event_calendar'); + +$event_guid = get_input('guid',0); +$event = get_entity($event_guid); +if (elgg_instanceof($event,'object','event_calendar')) { + $user_guid = elgg_get_logged_in_user_guid(); + if (!event_calendar_has_personal_event($event_guid,$user_guid)) { + if (event_calendar_add_personal_event($event_guid,$user_guid)) { + system_message(elgg_echo('event_calendar:add_to_my_calendar_response')); + } else { + register_error(elgg_echo('event_calendar:add_to_my_calendar_error')); + } + } +} + +forward(REFERER);
\ No newline at end of file diff --git a/actions/event_calendar/delete.php b/actions/event_calendar/delete.php new file mode 100644 index 000000000..dd8a7ef22 --- /dev/null +++ b/actions/event_calendar/delete.php @@ -0,0 +1,21 @@ +<?php +$event_guid = get_input('guid',0); +$event = get_entity($event_guid); +if (elgg_instanceof($event,'object','event_calendar') && $event->canEdit()) { + if (get_input('cancel','')) { + system_message(elgg_echo('event_calendar:delete_cancel_response')); + } else { + $container = get_entity($event->container_guid); + $event->delete(); + system_message(elgg_echo('event_calendar:delete_response')); + if (elgg_instanceof($container,'group')) { + forward('event_calendar/group/'.$container->guid); + } else { + forward('event_calendar/list'); + } + } +} else { + register_error(elgg_echo('event_calendar:error_delete')); +} + +forward(REFERER);
\ No newline at end of file diff --git a/actions/event_calendar/edit.php b/actions/event_calendar/edit.php new file mode 100644 index 000000000..2365d3965 --- /dev/null +++ b/actions/event_calendar/edit.php @@ -0,0 +1,51 @@ +<?php + +/** + * Edit action + * + * @package event_calendar + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Kevin Jardine <kevin@radagast.biz> + * @copyright Radagast Solutions 2008 + * @link http://radagast.biz/ + * + */ + +elgg_load_library('elgg:event_calendar'); + +// start a new sticky form session in case of failure +elgg_make_sticky_form('event_calendar'); + +$event_guid = get_input('event_guid',0); +$group_guid = get_input('group_guid',0); +$event = event_calendar_set_event_from_form($event_guid,$group_guid); +if ($event) { + // remove sticky form entries + elgg_clear_sticky_form('event_calendar'); + $user_guid = elgg_get_logged_in_user_guid(); + if ($event_guid) { + add_to_river('river/object/event_calendar/update','update',$user_guid,$event_guid); + system_message(elgg_echo('event_calendar:manage_event_response')); + } else { + $event_calendar_autopersonal = elgg_get_plugin_setting('autopersonal', 'event_calendar'); + if (!$event_calendar_autopersonal || ($event_calendar_autopersonal == 'yes')) { + event_calendar_add_personal_event($event_guid,$user_guid); + } + add_to_river('river/object/event_calendar/create','create',$user_guid,$event_guid); + system_message(elgg_echo('event_calendar:add_event_response')); + } + + forward($event->getURL()); +} else { + // redisplay form with error message + register_error(elgg_echo('event_calendar:manage_event_error')); + if ($event_guid) { + forward('event_calendar/edit/'.$event_guid); + } else { + if ($group_guid) { + forward('event_calendar/add/'.$group_guid); + } else { + forward('event_calendar/add/'); + } + } +} diff --git a/actions/event_calendar/remove_personal.php b/actions/event_calendar/remove_personal.php new file mode 100644 index 000000000..1308b17e9 --- /dev/null +++ b/actions/event_calendar/remove_personal.php @@ -0,0 +1,12 @@ +<?php +elgg_load_library('elgg:event_calendar'); + +$event_guid = get_input('guid',0); +$event = get_entity($event_guid); +if (elgg_instanceof($event,'object','event_calendar')) { + $user_guid = elgg_get_logged_in_user_guid(); + event_calendar_remove_personal_event($event_guid,$user_guid); + system_message(elgg_echo('event_calendar:remove_from_my_calendar_response')); +} + +forward(REFERER); diff --git a/actions/event_calendar/request_personal_calendar.php b/actions/event_calendar/request_personal_calendar.php new file mode 100644 index 000000000..68c96e364 --- /dev/null +++ b/actions/event_calendar/request_personal_calendar.php @@ -0,0 +1,16 @@ +<?php +// asks the event owner to add you to the event +elgg_load_library('elgg:event_calendar'); + +$event_guid = get_input('guid',0); +$user_guid = elgg_get_logged_in_user_guid(); +$event = get_entity($event_guid); +if (elgg_instanceof($event,'object','event_calendar')) { + if (event_calendar_send_event_request($event,$user_guid)) { + system_message(elgg_echo('event_calendar:request_event_response')); + } else { + register_error(elgg_echo('event_calendar:request_event_error')); + } +} + +forward(REFERER); diff --git a/actions/manage.php b/actions/manage.php deleted file mode 100644 index 5acf5c279..000000000 --- a/actions/manage.php +++ /dev/null @@ -1,105 +0,0 @@ -<?php - -/** - * Manage actions - * - * @package event_calendar - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Kevin Jardine <kevin@radagast.biz> - * @copyright Radagast Solutions 2008 - * @link http://radagast.biz/ - * - */ - -// Load RIBA event model -require_once(dirname(dirname(__FILE__)) . "/models/model.php"); - -gatekeeper(); - -$event_action = get_input('event_action',''); -if ($event_action == 'add_event' || $event_action == 'manage_event') { - $result = event_calendar_set_event_from_form(); - if ($result->success) { - if ($event_action == 'manage_event') { - add_to_river('river/object/event_calendar/update','update',$_SESSION['user']->guid,$result->event->guid); - system_message(elgg_echo('event_calendar:manage_event_response')); - } else { - $event_calendar_autopersonal = get_plugin_setting('autopersonal', 'event_calendar'); - if (!$event_calendar_autopersonal || ($event_calendar_autopersonal == 'yes')) { - event_calendar_add_personal_event($result->event->guid,$_SESSION['user']->guid); - } - add_to_river('river/object/event_calendar/create','create',$_SESSION['user']->guid,$result->event->guid); - system_message(elgg_echo('event_calendar:add_event_response')); - } - - forward($result->event->getURL()); - } else { - // redisplay form with error message - register_error(elgg_echo('event_calendar:manage_event_error')); - $group_guid = (int) get_input('group_guid',0); - - if ($result->form_data->event_id) { - $event = get_entity($result->form_data->event_id); - if (!$event) { - register_error(elgg_echo('event_calendar:no_such_event_edit_error')); - forward(); - } else { - set_page_owner($event->container_guid); - if (page_owner_entity() instanceof ElggGroup) { - set_context('groups'); - } - } - - $title = elgg_echo('event_calendar:manage_event_title'); - } else { - $title = elgg_echo('event_calendar:add_event_title'); - if ($group_guid && $group = get_entity($group_guid)) { - // redefine context - set_context('groups'); - set_page_owner($group_guid); - } - } - $body = elgg_view('event_calendar/forms/manage_event', array('event'=>$result->form_data,'event_id'=>$result->form_data->event_id,'group_guid'=>$group_guid)); - - page_draw($title,elgg_view_layout("two_column_left_sidebar", '', elgg_view_title($title) . $body)); - } -} else if ($event_action == 'delete_event') { - $event_id = get_input('event_id',0); - if (($event_id = get_input('event_id',0)) && ($event = get_entity($event_id)) && $event->canEdit()) { - if (get_input('cancel','')) { - system_message(elgg_echo('event_calendar:delete_cancel_response')); - forward($event->getUrl()); - } else { - $container = get_entity($event->container_guid); - $event->delete(); - system_message(elgg_echo('event_calendar:delete_response')); - forward($container->getUrl()); - } - } else { - register_error(elgg_echo('event_calendar:error_delete')); - } -} else if ($event_action == 'add_personal') { - $event_id = get_input('event_id',0); - if (($event_id = get_input('event_id',0)) && ($event = get_entity($event_id))) { - $user_id = $_SESSION['user']->getGUID(); - if (!event_calendar_has_personal_event($event_id,$user_id)) { - if (event_calendar_add_personal_event($event_id,$user_id)) { - system_message(elgg_echo('event_calendar:add_to_my_calendar_response')); - } else { - register_error(elgg_echo('event_calendar:add_to_my_calendar_error')); - } - forward($event->getUrl()); - } - } -} else if ($event_action == 'remove_personal') { - $event_id = get_input('event_id',0); - if (($event_id = get_input('event_id',0)) && ($event = get_entity($event_id))) { - event_calendar_remove_personal_event($event_id,$_SESSION['user']->getGUID()); - system_message(elgg_echo('event_calendar:remove_from_my_calendar_response')); - forward($event->getUrl()); - } -} - -forward(); - -?>
\ No newline at end of file diff --git a/actions/request_personal_calendar.php b/actions/request_personal_calendar.php deleted file mode 100644 index 4160326a6..000000000 --- a/actions/request_personal_calendar.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php -// asks the event owner to add you to the event -$event_id = get_input('event_id',0); -$user_id = get_loggedin_userid(); -$event = get_entity($event_id); -if ($event && ($event->getSubtype() == 'event_calendar')) { - if (event_calendar_send_event_request($event,$user_id)) { - system_message(elgg_echo('event_calendar:request_event_response')); - } else { - register_error(elgg_echo('event_calendar:request_event_error')); - } - - forward($event->getUrl()); - - exit; -} - -forward(); diff --git a/datepicker.css b/datepicker.css deleted file mode 100644 index 64f486908..000000000 --- a/datepicker.css +++ /dev/null @@ -1,234 +0,0 @@ -/* Main Style Sheet for jQuery UI ui-datepicker */ -#ui-datepicker-div, .ui-datepicker-inline { - font-family: Arial,Helvetica,sans-serif; - font-size: 14px; - padding: 0; - margin: 0; - background: #F5F5F5; - width: 185px; -} -#ui-datepicker-div { - display: none; - border: 1px solid #FF9900; - z-index: 10; -} -.ui-datepicker-inline { - float: left; - display: block; - border: 0; -} -.ui-datepicker-rtl { - direction: rtl; -} -.ui-datepicker-dialog { - padding: 5px !important; - border: 4px ridge #83C948 !important; -} -button.ui-datepicker-trigger { - width: 25px; -} -img.ui-datepicker-trigger { - margin: 2px; - vertical-align: middle; -} -.ui-datepicker-prompt { - float: left; - padding: 2px; - background: #F5F5F5; - color: #000; -} -*html .ui-datepicker-prompt { - width: 185px; -} -.ui-datepicker-control, .ui-datepicker-links, .ui-datepicker-header, .ui-datepicker { - clear: both; - float: left; - width: 100%; - color: #FFF; -} -.ui-datepicker-control { - background: #FF9900; - padding: 2px 0px; -} -.ui-datepicker-links { - background: #F5F5F5; - padding: 2px 0px; -} -.ui-datepicker-control, .ui-datepicker-links { - font-weight: bold; - font-size: 80%; - letter-spacing: 1px; -} - -/* KJ change this to avoid weird display change */ -/*.ui-datepicker-links label { - padding: 2px 5px; - color: #888; -}*/ - -.ui-datepicker-links label { - font-weight: bold; - font-size: 100%; - padding: 2px 5px; - letter-spacing: 1px; -} -.ui-datepicker-clear, .ui-datepicker-prev { - float: left; - width: 34%; -} -.ui-datepicker-rtl .ui-datepicker-clear, .ui-datepicker-rtl .ui-datepicker-prev { - float: right; - text-align: right; -} -.ui-datepicker-current { - float: left; - width: 30%; - text-align: center; -} -.ui-datepicker-close, .ui-datepicker-next { - float: right; - width: 34%; - text-align: right; -} -.ui-datepicker-rtl .ui-datepicker-close, .ui-datepicker-rtl .ui-datepicker-next { - float: left; - text-align: left; -} -.ui-datepicker-header { - padding: 1px 0 3px; - background: #3873B6; - text-align: center; - font-weight: bold; - height: 1.3em; - color: #FFFFFF; -} -.ui-datepicker-header select { - background: #3873B6; - color: #FFFFFF; - border: 0px; - font-weight: bold; -} -.ui-datepicker { - background: #CCC; - text-align: center; - font-size: 100%; -} -.ui-datepicker a { - display: block; - width: 100%; -} -.ui-datepicker-title-row { - background: #E3E3E3; - color: #000; -} -.ui-datepicker-title-row .ui-datepicker-week-end-cell { - background: #E3E3E3; -} -.ui-datepicker-days-row { - background: #FFF; - /*color: #666;*/ -} -.ui-datepicker-week-col { - background: #E3E3E3; - color: #000; -} -.ui-datepicker-days-cell { - /*color: #000;*/ - border: 1px solid #DDD; -} -.ui-datepicker-days-cell a { - display: block; -} -.ui-datepicker-week-end-cell { - background: #F5F5F5; -} -.ui-datepicker-unselectable { - color: #888; -} -.ui-datepicker-week-over, .ui-datepicker-week-over .ui-datepicker-week-end-cell { - background: #E3E3E3 !important; -} -.ui-datepicker-days-cell-over, .ui-datepicker-days-cell-over.ui-datepicker-week-end-cell { - background: #FFF !important; - border: 1px solid #777; -} -* html .ui-datepicker-title-row .ui-datepicker-week-end-cell { - background: #E3E3E3 !important; -} -* html .ui-datepicker-week-end-cell { - background: #F5F5F5 !important; - border: 1px solid #DDD !important; -} -* html .ui-datepicker-days-cell-over { - background: #FFF !important; - border: 1px solid #777 !important; -} -* html .ui-datepicker-current-day { - background: #3873B6 !important; - color: #FFFFFF !important; -} -.ui-datepicker-today { - background: #E3E3E3 !important; -} -.ui-datepicker-current-day { - background: #3873B6 !important; - color: #FFFFFF !important; -} - -.ui-datepicker-current-day a { - background: #3873B6 !important; - color: #FFFFFF !important; -} - -.ui-datepicker-status { - background: #F5F5F5; - width: 100%; - font-size: 80%; - text-align: center; -} -#ui-datepicker-div a, .ui-datepicker-inline a { - cursor: pointer; - margin: 0; - padding: 0; - background: none; - color: 000000; -} -.ui-datepicker-inline .ui-datepicker-links a { - padding: 0 5px !important; -} -.ui-datepicker-control a, .ui-datepicker-links a { - padding: 2px 5px !important; - color: #000 !important; -} -.ui-datepicker-title-row a { - color: #000 !important; -} -.ui-datepicker-control a:hover { - background: #FDD !important; - color: #333 !important; -} -.ui-datepicker-links a:hover, .ui-datepicker-title-row a:hover { - background: #FFF !important; - color: #333 !important; -} -.ui-datepicker-multi .ui-datepicker { - border: 1px solid #3873B6; -} -.ui-datepicker-one-month { - float: left; - width: 185px; -} -.ui-datepicker-new-row { - clear: left; -} -.ui-datepicker-cover { - display: none; - display/**/: block; - position: absolute; - z-index: -1; - filter: mask(); - top: -4px; - left: -4px; - width: 193px; - height: 200px; -} diff --git a/flora.datepicker.css b/flora.datepicker.css deleted file mode 100644 index 20c3dabb3..000000000 --- a/flora.datepicker.css +++ /dev/null @@ -1,234 +0,0 @@ -/* Main Flora Style Sheet for jQuery UI ui-datepicker */ -#ui-datepicker-div, .ui-datepicker-inline { - font-family: Arial,Helvetica,sans-serif; - font-size: 14px; - padding: 0; - margin: 0; - background: #E0F4D7; - width: 185px; -} -#ui-datepicker-div { - display: none; - border: 1px solid #FF9900; - z-index: 10; -} -.ui-datepicker-inline { - float: left; - display: block; - border: 0; -} -.ui-datepicker-rtl { - direction: rtl; -} -.ui-datepicker-dialog { - padding: 5px !important; - border: 4px ridge #83C948 !important; -} -button.ui-datepicker-trigger { - width: 25px; -} -img.ui-datepicker-trigger { - margin: 2px; - vertical-align: middle; -} -.ui-datepicker-prompt { - float: left; - padding: 2px; - background: #E0F4D7; - color: #000; -} -*html .ui-datepicker-prompt { - width: 185px; -} -.ui-datepicker-control, .ui-datepicker-links, .ui-datepicker-header, .ui-datepicker { - clear: both; - float: left; - width: 100%; - color: #FFF; -} -.ui-datepicker-control { - background: #FF9900; - padding: 2px 0px; -} -.ui-datepicker-links { - background: #E0F4D7; - padding: 2px 0px; -} -.ui-datepicker-control, .ui-datepicker-links { - font-weight: bold; - font-size: 80%; - letter-spacing: 1px; -} - -/* KJ change this to avoid weird display change */ -/*.ui-datepicker-links label { - padding: 2px 5px; - color: #888; -}*/ - -.ui-datepicker-links label { - font-weight: bold; - font-size: 100%; - padding: 2px 5px; - letter-spacing: 1px; -} -.ui-datepicker-clear, .ui-datepicker-prev { - float: left; - width: 34%; -} -.ui-datepicker-rtl .ui-datepicker-clear, .ui-datepicker-rtl .ui-datepicker-prev { - float: right; - text-align: right; -} -.ui-datepicker-current { - float: left; - width: 30%; - text-align: center; -} -.ui-datepicker-close, .ui-datepicker-next { - float: right; - width: 34%; - text-align: right; -} -.ui-datepicker-rtl .ui-datepicker-close, .ui-datepicker-rtl .ui-datepicker-next { - float: left; - text-align: left; -} -.ui-datepicker-header { - padding: 1px 0 3px; - background: #478787; - text-align: center; - font-weight: bold; - height: 1.3em; - color: #FFFFFF; -} -.ui-datepicker-header select { - background: #478787; - color: #FFFFFF; - border: 0px; - font-weight: bold; -} -.ui-datepicker { - background: #CCC; - text-align: center; - font-size: 100%; -} -.ui-datepicker a { - display: block; - width: 100%; -} -.ui-datepicker-title-row { - background: #DAE5DC; - color: #000; -} -.ui-datepicker-title-row .ui-datepicker-week-end-cell { - background: #DAE5DC; -} -.ui-datepicker-days-row { - background: #FFF; - /*color: #666;*/ -} -.ui-datepicker-week-col { - background: #DAE5DC; - color: #000; -} -.ui-datepicker-days-cell { - /*color: #000;*/ - border: 1px solid #DDD; -} -.ui-datepicker-days-cell a { - display: block; -} -.ui-datepicker-week-end-cell { - background: #E0F4D7; -} -.ui-datepicker-unselectable { - color: #888; -} -.ui-datepicker-week-over, .ui-datepicker-week-over .ui-datepicker-week-end-cell { - background: #DAE5DC !important; -} -.ui-datepicker-days-cell-over, .ui-datepicker-days-cell-over.ui-datepicker-week-end-cell { - background: #FFF !important; - border: 1px solid #777; -} -* html .ui-datepicker-title-row .ui-datepicker-week-end-cell { - background: #DAE5DC !important; -} -* html .ui-datepicker-week-end-cell { - background: #E0F4D7 !important; - border: 1px solid #DDD !important; -} -* html .ui-datepicker-days-cell-over { - background: #FFF !important; - border: 1px solid #777 !important; -} -* html .ui-datepicker-current-day { - background: #478787 !important; - color: #FFFFFF !important; -} -.ui-datepicker-today { - background: #DAE5DC !important; -} -.ui-datepicker-current-day { - background: #478787 !important; - color: #FFFFFF !important; -} - -.ui-datepicker-current-day a { - background: #478787 !important; - color: #FFFFFF !important; -} - -.ui-datepicker-status { - background: #E0F4D7; - width: 100%; - font-size: 80%; - text-align: center; -} -#ui-datepicker-div a, .ui-datepicker-inline a { - cursor: pointer; - margin: 0; - padding: 0; - background: none; - color: 000000; -} -.ui-datepicker-inline .ui-datepicker-links a { - padding: 0 5px !important; -} -.ui-datepicker-control a, .ui-datepicker-links a { - padding: 2px 5px !important; - color: #000 !important; -} -.ui-datepicker-title-row a { - color: #000 !important; -} -.ui-datepicker-control a:hover { - background: #FDD !important; - color: #333 !important; -} -.ui-datepicker-links a:hover, .ui-datepicker-title-row a:hover { - background: #FFF !important; - color: #333 !important; -} -.ui-datepicker-multi .ui-datepicker { - border: 1px solid #478787; -} -.ui-datepicker-one-month { - float: left; - width: 185px; -} -.ui-datepicker-new-row { - clear: left; -} -.ui-datepicker-cover { - display: none; - display/**/: block; - position: absolute; - z-index: -1; - filter: mask(); - top: -4px; - left: -4px; - width: 193px; - height: 200px; -} diff --git a/languages/en.php b/languages/en.php index 785b7392c..26312af25 100644 --- a/languages/en.php +++ b/languages/en.php @@ -189,6 +189,12 @@ 'event_calendar:add_to_group:success' => "Event added to group calendar", 'event_calendar:settings:add_to_group_calendar:title' => "Allow group admins to add any existing event to a group calendar", + 'event_calendar:group_breadcrumb' => "Group event calendar", + 'event_calendar:no_group' => "There is no such group.", + 'event_calendar:generic_error_title' => "Error", + 'event_calendar:error_event_edit' => "Error: there is no such event or you do not have permission to edit it.", + 'event_calendar:add' => "Add", + /** * Event calendar river **/ diff --git a/manifest.xml b/manifest.xml index c3ce812c1..dcbebc48a 100644 --- a/manifest.xml +++ b/manifest.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8"?> <plugin_manifest> <field key="author" value="Kevin Jardine <kevin@radagast.biz>" /> - <field key="version" value="0.8" /> + <field key="version" value="0.81" /> <field key="description" value="Elgg event calendar plugin" /> <field key="website" value="http://radagast.biz/" /> - <field key="copyright" value="(C) Radagast Solutions 2009" /> + <field key="copyright" value="(C) Radagast Solutions 2009-2011" /> <field key="licence" value="GNU Public License version 2" /> <field key="elgg_version" value="2009030101" /> </plugin_manifest> diff --git a/models/model.php b/models/model.php index dcc9506f3..d4bc5d0a7 100644 --- a/models/model.php +++ b/models/model.php @@ -5,7 +5,7 @@ * @package event_calendar * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 * @author Kevin Jardine <kevin@radagast.biz> - * @copyright Radagast Solutions 2008 + * @copyright Radagast Solutions 2008-2011 * @link http://radagast.biz/ * */ @@ -22,91 +22,20 @@ function event_calendar_get_event_for_edit($event_id) { } } -function event_calendar_get_event_from_form() { - - // returns an event data object (not an ElggObject) - - $event_data = new stdClass(); - $event_data->form_data = true; - // debug message to test new add user feature - $event_data->event_id = get_input('event_id',0); - $event_data->access_id = get_input('access',ACCESS_PRIVATE); - $event_data->title = get_input('title',''); - $event_data->description = get_input('brief_description',''); - $event_data->venue = get_input('venue',''); - $event_calendar_times = get_plugin_setting('times', 'event_calendar'); - $event_calendar_region_display = get_plugin_setting('region_display', 'event_calendar'); - $event_calendar_type_display = get_plugin_setting('type_display', 'event_calendar'); - $event_calendar_spots_display = get_plugin_setting('spots_display', 'event_calendar'); - if ($event_calendar_times == 'yes') { - $sh = get_input('start_time_h',''); - $sm = get_input('start_time_m',''); - if (is_numeric($sh) && is_numeric($sm)) { - // workaround for pulldown zero value bug - $sh--; - $sm--; - $event_data->start_time = $sh*60+$sm; - } else { - $event_data->start_time = ''; - } - $eh = get_input('end_time_h',''); - $em = get_input('end_time_m',''); - if (is_numeric($eh) && is_numeric($em)) { - // workaround for pulldown zero value bug - $eh--; - $em--; - $event_data->end_time = $eh*60+$em; - } else { - $event_data->end_time = ''; - } - } - $event_data->start_date = get_input('start_date',''); - $event_data->end_date = get_input('end_date',''); - if ($event_calendar_spots_display == 'yes') { - $event_data->spots = get_input('spots',''); - } - if ($event_calendar_region_display == 'yes') { - $region = get_input('region',''); - if ($region == '-') { - $region = ''; - } - $event_data->region = $region; - } - if ($event_calendar_type_display == 'yes') { - $event_type = get_input('event_type',''); - if ($event_type == '-') { - $event_type = ''; - } - $event_data->event_type = $event_type; - } - $event_data->fees = get_input('fees',''); - $event_data->contact = get_input('contact',''); - $event_data->organiser = get_input('organiser',''); - $event_data->event_tags = get_input('event_tags',''); - $event_data->long_description = get_input('long_description',''); +// returns the event or FALSE +function event_calendar_set_event_from_form($event_guid,$group_guid) { - return $event_data; -} - -function event_calendar_set_event_from_form() { - global $CONFIG; - - $group_guid = 0; - $result = new stdClass(); - $ed = event_calendar_get_event_from_form(); - $result->form_data = $ed; - $fields_are_valid = TRUE; - $event_calendar_times = get_plugin_setting('times', 'event_calendar'); - $event_calendar_region_display = get_plugin_setting('region_display', 'event_calendar'); - $event_calendar_type_display = get_plugin_setting('type_display', 'event_calendar'); - $event_calendar_spots_display = get_plugin_setting('spots_display', 'event_calendar'); - $event_calendar_hide_end = get_plugin_setting('hide_end', 'event_calendar'); - $event_calendar_more_required = get_plugin_setting('more_required', 'event_calendar'); + $event_calendar_times = elgg_get_plugin_setting('times', 'event_calendar'); + $event_calendar_region_display = elgg_get_plugin_setting('region_display', 'event_calendar'); + $event_calendar_type_display = elgg_get_plugin_setting('type_display', 'event_calendar'); + $event_calendar_spots_display = elgg_get_plugin_setting('spots_display', 'event_calendar'); + $event_calendar_hide_end = elgg_get_plugin_setting('hide_end', 'event_calendar'); + $event_calendar_more_required = elgg_get_plugin_setting('more_required', 'event_calendar'); if ($event_calendar_more_required == 'yes') { $required_fields = array('title','venue','start_date', 'brief_description','fees','contact','organiser', - 'event_tags'); + 'tags'); if ($event_calendar_times == 'yes') { $required_fields[] = 'start_time'; @@ -126,100 +55,90 @@ function event_calendar_set_event_from_form() { } else { $required_fields = array('title','venue','start_date'); } - foreach ($required_fields as $fn) { - if (!trim($ed->$fn)) { - $fields_are_valid = FALSE; - break; - } - } - if ($fields_are_valid) { - if ($ed->event_id) { - $event = get_entity($ed->event_id); - if (!$event) { - // do nothing because this is a bad event id - $result->success = false; - } - } else { - $event = new ElggObject(); - $event->subtype = 'event_calendar'; - $event->owner_guid = $_SESSION['user']->getGUID(); - $group_guid = (int) get_input('group_guid',0); - if ($group_guid) { - $event->container_guid = $group_guid; - } else { - $event->container_guid = $event->owner_guid; - } + + if ($event_guid) { + $event = get_entity($event_guid); + if (!elgg_instanceof($event, 'object', 'event_calendar')) { + // do nothing because this is a bad event guid + return FALSE; } - $event->access_id = $ed->access_id; - $event->title = $ed->title; - $event->description = $ed->description; - $event->venue = $ed->venue; - $event->start_date = strtotime($ed->start_date); - if ($ed->end_date) { - $event->end_date = strtotime($ed->end_date); + } else { + $user_guid = elgg_get_logged_in_user_guid(); + $event = new ElggObject(); + $event->subtype = 'event_calendar'; + $event->owner_guid = $user_guid; + if ($group_guid) { + $event->container_guid = $group_guid; } else { - $event->end_date = $ed->end_date; - } - if ($event_calendar_times == 'yes') { - $event->start_time = $ed->start_time; - //$event->original_start_date = $event->start_date; - if (is_numeric($ed->start_time)) { - // Set start date to the Unix start time, if set. - // This allows sorting by date *and* time. - $event->start_date += $ed->start_time*60; - } - $event->end_time = $ed->end_time; - } - if ($event_calendar_spots_display == 'yes') { - $event->spots = trim($ed->spots); + $event->container_guid = $event->owner_guid; } - if ($event_calendar_region_display == 'yes') { - $event->region = $ed->region; + } + $event->access_id = get_input('access_id'); + $event->title = get_input('title'); + $event->description = get_input('description'); + $event->venue = get_input('venue'); + $event->start_date = get_input('start_date'); + $event->end_date = get_input('end_date'); + + if ($event_calendar_times == 'yes') { + $event->start_time = get_input('start_time'); + //$event->original_start_date = $event->start_date; + if (is_numeric($event->start_time)) { + // Set start date to the Unix start time, if set. + // This allows sorting by date *and* time. + $event->start_date += $event->start_time*60; } - if ($event_calendar_type_display == 'yes') { - $event->event_type = $ed->event_type; + $event->end_time = get_input('end_time'); + } + if ($event_calendar_spots_display == 'yes') { + $event->spots = trim(get_input('spots')); + } + if ($event_calendar_region_display == 'yes') { + $event->region = get_input('region'); + } + if ($event_calendar_type_display == 'yes') { + $event->event_type = get_input('event_type'); + } + $event->fees = get_input('fees'); + $event->contact = get_input('contact'); + $event->organiser = get_input('organiser'); + $event->tags = string_to_tag_array(get_input('tags')); + $event->long_description = get_input('long_description'); + $event->real_end_time = event_calendar_get_end_time($event); + foreach ($required_fields as $fn) { + if (!trim($event->$fn)) { + return FALSE; + break; + } + } + if ($event->save()) { + if ($group_guid && (elgg_get_plugin_setting('autogroup', 'event_calendar') == 'yes')) { + event_calendar_add_personal_events_from_group($event->guid,$group_guid); } - $event->fees = $ed->fees; - $event->contact = $ed->contact; - $event->organiser = $ed->organiser; - $event->event_tags = array_reverse(string_to_tag_array($ed->event_tags)); - $event->long_description = $ed->long_description; - $event->real_end_time = event_calendar_get_end_time($event); - $result->success = $event->save(); - if ($result->success) { - if ($group_guid && (get_plugin_setting('autogroup', 'event_calendar') == 'yes')) { - event_calendar_add_personal_events_from_group($event->getGUID(),$group_guid); - } - if (get_plugin_setting('add_users', 'event_calendar') == 'yes') { - if (function_exists('autocomplete_member_to_user')) { - $addusers = get_input('adduser',array()); - foreach($addusers as $adduser) { - if ($adduser) { - $user = autocomplete_member_to_user($adduser); - $user_id = $user->guid; - event_calendar_add_personal_event($event->guid,$user_id); - if (get_plugin_setting('add_users_notify', 'event_calendar') == 'yes') { - notify_user($user_id, $CONFIG->site->guid, elgg_echo('event_calendar:add_users_notify:subject'), - sprintf( - elgg_echo('event_calendar:add_users_notify:body'), - $user->name, - $event->title, - $event->getURL() - ) - ); - } + if (elgg_get_plugin_setting('add_users', 'event_calendar') == 'yes') { + if (function_exists('autocomplete_member_to_user')) { + $addusers = get_input('adduser',array()); + foreach($addusers as $adduser) { + if ($adduser) { + $user = autocomplete_member_to_user($adduser); + $user_id = $user->guid; + event_calendar_add_personal_event($event->guid,$user_id); + if (elgg_get_plugin_setting('add_users_notify', 'event_calendar') == 'yes') { + notify_user($user_id, $CONFIG->site->guid, elgg_echo('event_calendar:add_users_notify:subject'), + sprintf( + elgg_echo('event_calendar:add_users_notify:body'), + $user->name, + $event->title, + $event->getURL() + ) + ); } } } } } - $result->event = $event; - } else { - // required data missing - $result->success = false; } - - return $result; + return $event; } function event_calendar_get_events_between($start_date,$end_date,$is_count,$limit=10,$offset=0,$container_guid=0,$region='-') { @@ -518,7 +437,7 @@ function event_calendar_get_entities_from_metadata_between_related($meta_start_n return event_calendar_vsort($main_events,$meta_start_name); } -// TODO: replace the original version with this one +// TODO: try to replace this with new Elgg 1.7 API /** * Return a list of entities based on the given search criteria. * In this case, returns entities with the given metadata between two values inclusive @@ -683,21 +602,27 @@ $count = false, $region='-', $meta_max = '', $annotation_name = '') return false; } -function event_calendar_has_personal_event($event_id,$user_id) { - $annotations = get_annotations($event_id, "object", "event_calendar", "personal_event", (int) $user_id, $user_id); - if ($annotations && count($annotations) > 0) { - return true; +function event_calendar_has_personal_event($event_guid,$user_guid) { + // check legacy implementation and new one + if (check_entity_relationship($user_guid,'personal_event',$event_guid)) { + return TRUE; } else { - return false; + // use old method for now + $annotations = get_annotations($event_guid, "object", "event_calendar", "personal_event", (int) $user_guid, $user_guid); + if ($annotations && count($annotations) > 0) { + return true; + } else { + return false; + } } } -function event_calendar_add_personal_event($event_id,$user_id) { - if ($event_id && $user_id) { - if ( !event_calendar_has_personal_event($event_id,$user_id) - && !event_calendar_has_collision($event_id,$user_id)) { - if (!event_calendar_is_full($event_id)) { - create_annotation($event_id, "personal_event", (int) $user_id, 'integer', $user_id, ACCESS_PUBLIC); +function event_calendar_add_personal_event($event_guid,$user_guid) { + if ($event_guid && $user_guid) { + if (!event_calendar_has_personal_event($event_guid,$user_guid) + && !event_calendar_has_collision($event_guid,$user_guid)) { + if (!event_calendar_is_full($event_guid)) { + add_entity_relationship($user_guid,'personal_event',$event_guid); return TRUE; } } @@ -705,16 +630,18 @@ function event_calendar_add_personal_event($event_id,$user_id) { return FALSE; } -function event_calendar_add_personal_events_from_group($event_id,$group_guid) { +function event_calendar_add_personal_events_from_group($event_guid,$group_guid) { $members = get_group_members($group_guid, 100000); foreach($members as $member) { $member_id = $member->getGUID(); - event_calendar_add_personal_event($event_id,$member_id); + event_calendar_add_personal_event($event_guid,$member_id); } } -function event_calendar_remove_personal_event($event_id,$user_id) { - $annotations = get_annotations($event_id, "object", "event_calendar", "personal_event", (int) $user_id, $user_id); +function event_calendar_remove_personal_event($event_guid,$user_guid) { + remove_entity_relationship($user_guid,'personal_event',$event_guid); + // also use old method for now + $annotations = get_annotations($event_guid, "object", "event_calendar", "personal_event", (int) $user_guid, $user_guid); if ($annotations) { foreach ($annotations as $annotation) { $annotation->delete(); @@ -722,14 +649,25 @@ function event_calendar_remove_personal_event($event_id,$user_id) { } } -function event_calendar_get_personal_events_for_user($user_id,$limit) { - $events = elgg_get_entities_from_annotations(array( +function event_calendar_get_personal_events_for_user($user_guid,$limit) { + $events_old_way = elgg_get_entities_from_annotations(array( 'type' => 'object', 'subtype' => 'event_calendar', 'annotation_names' => 'personal_event', - 'annotation_value' => $user_id, - 'limit' => 1000, + 'annotation_value' => $user_guid, + 'limit' => 0, )); + + $events_new_way = elgg_get_entities_from_relationship(array( + 'type' => 'object', + 'subtype' => 'event_calendar', + 'relationship' => 'personal_event', + 'relationship_guid' => $user_guid, + 'limit' => 0, + )); + + $events = array_merge($events_old_way,$events_new_way); + $final_events = array(); if ($events) { $now = time(); @@ -745,20 +683,31 @@ function event_calendar_get_personal_events_for_user($user_id,$limit) { return array_slice($sorted,0,$limit); } -function event_calendar_get_users_for_event($event_id,$limit,$offset,$is_count) { +function event_calendar_get_users_for_event($event_guid,$limit,$offset,$is_count) { + $options = array( + 'type' => 'user', + 'relationship' => 'personal_event', + 'relationship_guid' => $event_guid, + 'inverse_relationship' => TRUE, + 'limit' => 0, + ); if ($is_count) { - return count_annotations($event_id, "object", "event_calendar", "personal_event"); + $count_old_way = count_annotations($event_guid, "object", "event_calendar", "personal_event"); + $options ['count'] = TRUE; + $count_new_way = elgg_get_entities_from_relationship($options); + return $count_old_way + $count_new_way; } else { - $users = array(); + $users_old_way = array(); $annotations = get_annotations($event_id, "object", "event_calendar", "personal_event", "", 0, $limit, $offset); if ($annotations) { foreach($annotations as $annotation) { if (($user = get_entity($annotation->value)) && ($user instanceOf ElggUser)) { - $users[] = $user; + $users_old_way[] = $user; } } } - return $users; + $users_new_way = elgg_get_entities_from_relationship($options); + return array_merge($users_old_way,$users_new_way); } } @@ -849,8 +798,8 @@ function event_calendar_get_type($event) { function event_calendar_get_formatted_full_items($event) { $time_bit = event_calendar_get_formatted_time($event); - $event_calendar_region_display = get_plugin_setting('region_display', 'event_calendar'); - $event_calendar_type_display = get_plugin_setting('type_display', 'event_calendar'); + $event_calendar_region_display = elgg_get_plugin_setting('region_display', 'event_calendar'); + $event_calendar_type_display = elgg_get_plugin_setting('type_display', 'event_calendar'); $event_items = array(); $item = new stdClass(); $item->title = elgg_echo('event_calendar:when_label'); @@ -884,17 +833,13 @@ function event_calendar_get_formatted_full_items($event) { $item->title = elgg_echo('event_calendar:contact_label'); $item->value = htmlspecialchars($event->contact); $event_items[] = $item; - $item = new stdClass(); - $item->title = elgg_echo('event_calendar:event_tags_label'); - $item->value = elgg_view("output/tags",array('value'=>$event->event_tags)); - $event_items[] = $item; return $event_items; } function event_calendar_get_formatted_time($event) { $date_format = 'j M Y'; - $event_calendar_times = get_plugin_setting('times', 'event_calendar'); + $event_calendar_times = elgg_get_plugin_setting('times', 'event_calendar'); $start_date = date($date_format,$event->start_date); if ((!$event->end_date) || ($event->end_date == $event->start_date)) { @@ -920,7 +865,7 @@ function event_calendar_get_formatted_date($ts) { } function event_calendar_is_full($event_id) { - $event_calendar_spots_display = get_plugin_setting('spots_display', 'event_calendar'); + $event_calendar_spots_display = elgg_get_plugin_setting('spots_display', 'event_calendar'); if ($event_calendar_spots_display == 'yes') { $count = event_calendar_get_users_for_event($event_id,0,0,TRUE); $event = get_entity($event_id); @@ -937,7 +882,7 @@ function event_calendar_is_full($event_id) { } function event_calendar_has_collision($event_id, $user_id) { - $no_collisions = get_plugin_setting('no_collisions', 'event_calendar'); + $no_collisions = elgg_get_plugin_setting('no_collisions', 'event_calendar'); if ($no_collisions == 'yes') { $event = get_entity($event_id); if ($event) { @@ -958,7 +903,7 @@ function event_calendar_has_collision($event_id, $user_id) { // this complicated bit of code determines the event end time function event_calendar_get_end_time($event) { - $default_length = get_plugin_setting('collision_length', 'event_calendar'); + $default_length = elgg_get_plugin_setting('collision_length', 'event_calendar'); $start_time = $event->start_date; $end_time = $event->end_time; $end_date = $event->end_date; @@ -1005,7 +950,7 @@ function event_calendar_view_entity_list($entities, $count, $offset, $limit, $fu $offset = sanitise_int(get_input('offset', 0)); } - $context = get_context(); + $context = elgg_get_context(); $html = elgg_view('event_calendar/entities/entity_list',array( 'entities' => $entities, @@ -1025,11 +970,11 @@ function event_calendar_view_entity_list($entities, $count, $offset, $limit, $fu function event_calendar_personal_can_manage($event,$user_id) { $authorised = FALSE; - $event_calendar_personal_manage = get_plugin_setting('personal_manage', 'event_calendar'); + $event_calendar_personal_manage = elgg_get_plugin_setting('personal_manage', 'event_calendar'); if ($event_calendar_personal_manage != 'no') { $authorised = TRUE; } else { - if(isadminloggedin()) { + if(elgg_is_admin_logged_in()) { $authorised = TRUE; } else { // load the event from the database @@ -1058,4 +1003,348 @@ function event_calendar_send_event_request($event,$user_id) { return $result; } -?>
\ No newline at end of file +// pages + +function event_calendar_get_page_content_list($page_type,$group_guid,$start_date,$display_mode,$filter,$region='-') { + if ($page_type == 'group') { + if (!event_calendar_activated_for_group($group_guid)) { + forward(); + } + elgg_push_breadcrumb(elgg_echo('event_calendar:group_breadcrumb')); + elgg_set_context('groups'); + elgg_set_page_owner_guid($group_guid); + $user_guid = elgg_get_logged_in_user_guid(); + $group_calendar = elgg_get_plugin_setting('group_calendar', 'event_calendar'); + if (!$group_calendar || $group_calendar == 'members') { + if (elgg_get_page_owner()->canWriteToContainer($user_guid)){ + elgg_register_menu_item('title', array( + 'name' => 'add', + 'href' => "event_calendar/add/".$group_guid, + 'text' => elgg_echo('event_calendar:add'), + 'class' => 'elgg-button elgg-button-action', + )); + } + } else if ($group_calendar == 'admin') { + if (elgg_is_admin_logged_in() || ($group->owner_guid == $user_guid)) { + elgg_register_menu_item('title', array( + 'name' => 'add', + 'href' => "event_calendar/add/".$group_guid, + 'text' => elgg_echo('event_calendar:add'), + 'class' => 'elgg-button elgg-button-action', + )); + } + } + } else { + elgg_push_breadcrumb(elgg_echo('item:object:event_calendar')); + $site_calendar = elgg_get_plugin_setting('site_calendar', 'event_calendar'); + if (!$site_calendar || $site_calendar == 'admin') { + // only admins can post directly to the site-wide calendar + if (elgg_is_admin_logged_in()) { + elgg_register_menu_item('title', array( + 'name' => 'add', + 'href' => "event_calendar/add", + 'text' => elgg_echo('event_calendar:add'), + 'class' => 'elgg-button elgg-button-action', + )); + } + } else if ($site_calendar == 'loggedin') { + // any logged-in user can post to the site calendar + if (elgg_is_logged_in()) { + elgg_register_menu_item('title', array( + 'name' => 'add', + 'href' => "event_calendar/add", + 'text' => elgg_echo('event_calendar:add'), + 'class' => 'elgg-button elgg-button-action', + )); + } + } + } + + $params = event_calendar_generate_listing_params($page_type,$group_guid,$start_date,$display_mode,$filter,$region); + + $body = elgg_view_layout("content", $params); + + return elgg_view_page($title,$body); +} + +function event_calendar_get_page_content_edit($page_type,$guid) { + $vars = array(); + $vars['id'] = 'event-calendar-edit'; + $vars['name'] = 'event_calendar_edit'; + // just in case a feature adds an image upload + $vars['enctype'] = 'multipart/form-data'; + + $body_vars = array(); + + if ($page_type == 'edit') { + $title = elgg_echo('event_calendar:manage_event_title'); + $event = get_entity((int)$guid); + if (elgg_instanceof($event, 'object', 'event_calendar') && $event->canEdit()) { + $body_vars['event'] = $event; + $body_vars['form_data'] = event_calendar_prepare_edit_form_vars($event); + $event_container = get_entity($event->container_guid); + if (elgg_instanceof($event_container, 'group')) { + elgg_push_breadcrumb(elgg_echo('event_calendar:group_breadcrumb'), 'event_calendar/group/'.$event->container_guid); + } else { + elgg_push_breadcrumb(elgg_echo('event_calendar:show_events_title'),'event_calendar/list'); + } + elgg_push_breadcrumb(elgg_echo('event_calendar:manage_event_title')); + + $content = elgg_view_form('event_calendar/edit', $vars,$body_vars); + } else { + $content = elgg_echo('event_calendar:error_event_edit'); + } + } else { + $title = elgg_echo('event_calendar:add_event_title'); + if ($guid) { + // add to group + $group = get_entity($guid); + if (elgg_instanceof($group, 'group')) { + $body_vars['group_guid'] = $guid; + elgg_push_breadcrumb(elgg_echo('event_calendar:group_breadcrumb'), 'event_calendar/group/'.$guid); + elgg_push_breadcrumb(elgg_echo('event_calendar:add_event_title')); + $body_vars['form_data'] = event_calendar_prepare_edit_form_vars(); + $content = elgg_view_form('event_calendar/edit', $vars, $body_vars); + } else { + $content = elgg_echo('event_calendar:no_group'); + } + } else { + elgg_push_breadcrumb(elgg_echo('event_calendar:show_events_title'),'event_calendar/list'); + + elgg_push_breadcrumb(elgg_echo('event_calendar:add_event_title')); + $body_vars['form_data'] = event_calendar_prepare_edit_form_vars(); + + $content = elgg_view_form('event_calendar/edit', $vars, $body_vars); + } + } + + $params = array('title' => $title, 'content' => $content,'filter' => ''); + + $body = elgg_view_layout("content", $params); + + return elgg_view_page($title,$body); +} + +/** + * Pull together variables for the edit form + * + * @param ElggObject $event + * @return array + */ +function event_calendar_prepare_edit_form_vars($event = NULL) { + + // input names => defaults + $values = array( + 'title' => NULL, + 'description' => NULL, + 'venue' => NULL, + 'start_date' => NULL, + 'end_date' => NULL, + 'start_time' => NULL, + 'end_time' => NULL, + 'spots' => NULL, + 'region' => '-', + 'event_type' => '-', + 'fees' => NULL, + 'contact' => NULL, + 'organiser' => NULL, + 'tags' => NULL, + 'long_description' => NULL, + 'access_id' => ACCESS_DEFAULT, + 'group_guid' => NULL, + ); + + if ($event) { + foreach (array_keys($values) as $field) { + if (isset($event->$field)) { + $values[$field] = $event->$field; + } + } + } + + if (elgg_is_sticky_form('event_calendar')) { + $sticky_values = elgg_get_sticky_values('event_calendar'); + foreach ($sticky_values as $key => $value) { + $values[$key] = $value; + } + } + + elgg_clear_sticky_form('event_calendar'); + + return $values; +} + +function event_calendar_generate_listing_params($page_type,$group_guid,$original_start_date,$display_mode,$filter,$region='-') { + $event_calendar_listing_format = elgg_get_plugin_setting('listing_format', 'event_calendar'); + $event_calendar_spots_display = trim(elgg_get_plugin_setting('spots_display', 'event_calendar')); + $event_calendar_first_date = trim(elgg_get_plugin_setting('first_date', 'event_calendar')); + $event_calendar_last_date = trim(elgg_get_plugin_setting('last_date', 'event_calendar')); + + if (!$original_start_date) { + $original_start_date = date('Y-m-d'); + } + if ( $event_calendar_first_date && ($original_start_date < $event_calendar_first_date) ) { + $original_start_date = $event_calendar_first_date; + } + if ( $event_calendar_last_date && ($original_start_date > $event_calendar_last_date) ) { + $original_start_date = $event_calendar_first_date; + } + + if ($event_calendar_listing_format == 'paged') { + $start_ts = strtotime($original_start_date); + $start_date = $original_start_date; + if ($event_calendar_last_date) { + $end_ts = strtotime($event_calendar_last_date); + } else { + // set to a large number + $end_ts = 2000000000; + } + $mode = 'paged'; + } else { + + // the default interval is one month + $day = 60*60*24; + $week = 7*$day; + $month = 31*$day; + + $mode = trim($display_mode); + if (!$mode) { + $mode = 'month'; + } + + if ($mode == "day") { + $start_date = $original_start_date; + $end_date = $start_date; + $start_ts = strtotime($start_date); + $end_ts = strtotime($end_date)+$day-1; + } else if ($mode == "week") { + // need to adjust start_date to be the beginning of the week + $start_ts = strtotime($original_start_date); + $start_ts -= date("w",$start_ts)*$day; + $end_ts = $start_ts + 6*$day; + + $start_date = date('Y-m-d',$start_ts); + $end_date = date('Y-m-d',$end_ts); + } else { + $start_ts = strtotime($original_start_date); + $month = date('m',$start_ts); + $year = date('Y',$start_ts); + $start_date = $year.'-'.$month.'-1'; + $end_date = $year.'-'.$month.'-'.getLastDayOfMonth($month,$year); + } + + if ($event_calendar_first_date && ($start_date < $event_calendar_first_date)) { + $start_date = $event_calendar_first_date; + } + + if ($event_calendar_last_date && ($end_date > $event_calendar_last_date)) { + $end_date = $event_calendar_last_date; + } + + $start_ts = strtotime($start_date); + + if ($mode == "day") { + $end_ts = strtotime($end_date)+$day-1; + $subtitle = elgg_echo('event_calendar:day_label').': '.date('j F Y',strtotime($start_date)); + } else if ($mode == "week") { + $end_ts = $start_ts + 6*$day; + $subtitle = elgg_echo('event_calendar:week_label').': '.date('j F',$start_ts) . ' - '.date('j F Y',$end_ts); + } else { + $end_ts = strtotime($end_date); + $subtitle = date('F Y',$start_ts); + } + } + + $user_guid = elgg_get_logged_in_user_guid(); + + $offset = get_input('offset'); + + $limit = 15; + if ($event_calendar_spots_display == 'yes') { + if (!$filter) { + $filter = 'open'; + } + } else { + if (!$filter) { + $filter = 'all'; + } + } + if ($filter == 'all') { + $count = event_calendar_get_events_between($start_ts,$end_ts,true,$limit,$offset,$group_guid,$region); + $events = event_calendar_get_events_between($start_ts,$end_ts,false,$limit,$offset,$group_guid,$region); + } else if ($filter == 'open') { + $count = event_calendar_get_open_events_between($start_ts,$end_ts,true,$limit,$offset,$group_guid,$region); + $events = event_calendar_get_open_events_between($start_ts,$end_ts,false,$limit,$offset,$group_guid,$region); + } else if ($filter == 'friends') { + $count = event_calendar_get_events_for_friends_between($start_ts,$end_ts,true,$limit,$offset,$user_guid,$group_guid,$region); + $events = event_calendar_get_events_for_friends_between($start_ts,$end_ts,false,$limit,$offset,$user_guid,$group_guid,$region); + } else if ($filter == 'mine') { + $count = event_calendar_get_events_for_user_between($start_ts,$end_ts,true,$limit,$offset,$user_guid,$group_guid,$region); + $events = event_calendar_get_events_for_user_between($start_ts,$end_ts,false,$limit,$offset,$user_guid,$group_guid,$region); + } + + $vars = array( + 'original_start_date' => $original_start_date, + 'start_date' => $start_date, + 'end_date' => $end_date, + 'first_date' => $event_calendar_first_date, + 'last_date' => $event_calendar_last_date, + 'mode' => $mode, + 'events' => $events, + 'count' => $count, + 'offset' => $offset, + 'limit' => $limit, + 'group_guid' => $group_guid, + 'filter' => $filter, + 'region' => $region, + 'listing_format' => $event_calendar_listing_format, + ); + + $content = elgg_view('event_calendar/show_events', $vars); + $filter_override = elgg_view('event_calendar/filter_menu',$vars); + + if ($event_calendar_listing_format == 'paged') { + $title = elgg_echo('event_calendar:upcoming_events_title'); + } else { + $title = elgg_echo('event_calendar:show_events_title'). ' ('.$subtitle.')'; + } + + $params = array('title' => $title, 'content' => $content, 'filter_override'=>$filter_override); + + return $params; +} + +function event_calendar_get_page_content_view($event_guid) { + // add personal calendar button and links + $event = get_entity($event_guid); + + if (!elgg_instanceof($event, 'object', 'event_calendar')) { + $content = elgg_echo('event_calendar:error_nosuchevent'); + $title = elgg_echo('event_calendar:generic_error_title'); + } else { + $title = htmlspecialchars($event->title); + $event_container = get_entity($event->container_guid); + if (elgg_instanceof($event_container, 'group')) { + elgg_push_breadcrumb(elgg_echo('event_calendar:group_breadcrumb'), 'event_calendar/group/'.$event->container_guid); + } else { + elgg_push_breadcrumb(elgg_echo('event_calendar:show_events_title'),'event_calendar/list'); + } + + elgg_push_breadcrumb($event->title); + $content = elgg_view_entity($event, array('full_view' => true)); + //check to see if comment are on - TODO - add this feature to all events + if ($event->comments_on != 'Off') { + $content .= elgg_view_comments($event); + } + } + + $params = array('title' => $title, 'content' => $content,'filter' => ''); + + $body = elgg_view_layout("content", $params); + + return elgg_view_page($title,$body); +} + +function getLastDayOfMonth($month,$year) { + return idate('d', mktime(0, 0, 0, ($month + 1), 0, $year)); +} @@ -1,187 +1,292 @@ <?php - /** - * Event calendar plugin - * - * @package RIBA event - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Kevin Jardine <kevin@radagast.biz> - * @copyright Radagast Solutions 2008 - * @link http://radagast.biz/ - */ - // Load event calendar model - require_once(dirname(__FILE__) . "/models/model.php"); - /** - * event calendar initialisation - * - * These parameters are required for the event API, but we won't use them: - * - * @param unknown_type $event - * @param unknown_type $object_type - * @param unknown_type $object - */ - - function event_calendar_init() { - - // Load system configuration - global $CONFIG; - - // Register a page handler, so we can have nice URLs - register_page_handler('event_calendar','event_calendar_page_handler'); - - // Register URL handler - register_entity_url_handler('event_calendar_url','object', 'event_calendar'); - - // Register granular notification for this type - register_notification_object('object', 'event_calendar', elgg_echo('event_calendar:new_event')); - - // Set up menu for users - if (isloggedin()) { - $site_calendar = get_plugin_setting('site_calendar', 'event_calendar'); - if (!$site_calendar || $site_calendar != 'no') { - add_menu(elgg_echo('item:object:event_calendar'), $CONFIG->wwwroot . "pg/event_calendar/"); - } - } - // make tags searchable for Elgg 1.7.4 - if (function_exists('elgg_register_tag_metadata_name')) { - elgg_register_tag_metadata_name('event_tags'); - } - - //add to group profile page - $group_calendar = get_plugin_setting('group_calendar', 'event_calendar'); - if (!$group_calendar || $group_calendar != 'no') { - $group_profile_display = get_plugin_setting('group_profile_display', 'event_calendar'); - if (!$group_profile_display || $group_profile_display == 'right') { - elgg_extend_view('groups/right_column', 'event_calendar/groupprofile_calendar'); - } else if ($group_profile_display == 'left') { - elgg_extend_view('groups/left_column', 'event_calendar/groupprofile_calendar'); - } - } - - //add to the css - elgg_extend_view('css', 'event_calendar/css'); - - //add a widget - add_widget_type('event_calendar',elgg_echo("event_calendar:widget_title"),elgg_echo('event_calendar:widget:description')); +/** + * Event calendar plugin + * + * @package event_calendar + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Kevin Jardine <kevin@radagast.biz> + * @copyright Radagast Solutions 2008-2011 + * @link http://radagast.biz/ + */ + + +elgg_register_event_handler('init','system','event_calendar_init'); + +function event_calendar_init() { + + elgg_register_library('elgg:event_calendar', elgg_get_plugins_path() . 'event_calendar/models/model.php'); - // add the event calendar group tool option - $event_calendar_group_default = get_plugin_setting('group_default', 'event_calendar'); - if (!$event_calendar_group_default || ($event_calendar_group_default == 'yes')) { - add_group_tool_option('event_calendar',elgg_echo('event_calendar:enable_event_calendar'),true); - } else { - add_group_tool_option('event_calendar',elgg_echo('event_calendar:enable_event_calendar'),false); - } + // Register a page handler, so we can have nice URLs + elgg_register_page_handler('event_calendar','event_calendar_page_handler'); + + // Register URL handler + elgg_register_entity_url_handler('object', 'event_calendar','event_calendar_url'); + + // Register granular notification for this type + register_notification_object('object', 'event_calendar', elgg_echo('event_calendar:new_event')); - // if autogroup is set, listen and respond to join/leave events - if (get_plugin_setting('autogroup', 'event_calendar') == 'yes') { - register_elgg_event_handler('join', 'group', 'event_calendar_handle_join'); - register_elgg_event_handler('leave', 'group', 'event_calendar_handle_leave'); + // Set up site menu + $site_calendar = elgg_get_plugin_setting('site_calendar', 'event_calendar'); + if (!$site_calendar || $site_calendar != 'no') { + // add a site navigation item + $item = new ElggMenuItem('event_calendar', elgg_echo('item:object:event_calendar'), 'event_calendar/list/'); + elgg_register_menu_item('site', $item); + } + // make event calendar title and description searchable + elgg_register_entity_type('object','event_calendar'); + + // make legacy tags searchable + if (function_exists('elgg_register_tag_metadata_name')) { + elgg_register_tag_metadata_name('event_tags'); + } + + //add to group profile page + // TODO - are the left and right values still relevant for Elgg 1.8? + $group_calendar = elgg_get_plugin_setting('group_calendar', 'event_calendar'); + if (!$group_calendar || $group_calendar != 'no') { + $group_profile_display = elgg_get_plugin_setting('group_profile_display', 'event_calendar'); + if (!$group_profile_display || $group_profile_display == 'right') { + //elgg_extend_view('groups/right_column', 'event_calendar/groupprofile_calendar'); + elgg_extend_view('groups/tool_latest', 'event_calendar/groupprofile_calendar'); + } else if ($group_profile_display == 'left') { + elgg_extend_view('groups/tool_latest', 'event_calendar/groupprofile_calendar'); + //elgg_extend_view('groups/left_column', 'event_calendar/groupprofile_calendar'); } + } + + //add to the css + elgg_extend_view('css/elgg', 'event_calendar/css'); - register_entity_type('object','event_calendar'); + //add a widget + elgg_register_widget_type('event_calendar',elgg_echo("event_calendar:widget_title"),elgg_echo('event_calendar:widget:description')); + + // add the event calendar group tool option + $event_calendar_group_default = elgg_get_plugin_setting('group_default', 'event_calendar'); + if (!$event_calendar_group_default || ($event_calendar_group_default == 'yes')) { + add_group_tool_option('event_calendar',elgg_echo('event_calendar:enable_event_calendar'),true); + } else { + add_group_tool_option('event_calendar',elgg_echo('event_calendar:enable_event_calendar'),false); + } + + // if autogroup is set, listen and respond to join/leave events + if (elgg_get_plugin_setting('autogroup', 'event_calendar') == 'yes') { + elgg_register_event_handler('join', 'group', 'event_calendar_handle_join'); + elgg_register_event_handler('leave', 'group', 'event_calendar_handle_leave'); } - function event_calendar_pagesetup() { - - global $CONFIG; - - $page_owner = page_owner_entity(); - - $context = get_context(); - - // Group submenu option - if ($page_owner instanceof ElggGroup && $context == 'groups') { - if (event_calendar_activated_for_group($page_owner)) { - add_submenu_item(elgg_echo("event_calendar:group"), $CONFIG->wwwroot . "pg/event_calendar/group/" . $page_owner->getGUID()); + // entity menu + elgg_register_plugin_hook_handler('register', 'menu:entity', 'event_calendar_entity_menu_setup'); + + // register actions + $action_path = elgg_get_plugins_path() . 'event_calendar/actions/event_calendar'; + + elgg_register_action("event_calendar/edit","$action_path/edit.php"); + elgg_register_action("event_calendar/delete","$action_path/delete.php"); + elgg_register_action("event_calendar/add_personal","$action_path/add_personal.php"); + elgg_register_action("event_calendar/remove_personal","$action_path/remove_personal.php"); + elgg_register_action("event_calendar/request_personal_calendar","$action_path/request_personal_calendar.php"); + elgg_register_action("event_calendar/toggle_personal_calendar","$action_path/toggle_personal_calendar.php"); + elgg_register_action("event_calendar/killrequest","$action_path/killrequest.php"); + elgg_register_action("event_calendar/addtocalendar","$action_path/addtocalendar.php"); + elgg_register_action("event_calendar/add_to_group","$action_path/add_to_group.php"); + elgg_register_action("event_calendar/remove_from_group","$action_path/remove_from_group.php"); + +} + +// TODO: delete this once everything is recoded + +function event_calendar_pagesetup() { + + global $CONFIG; + + $page_owner = page_owner_entity(); + + $context = get_context(); + + // Group submenu option + if ($page_owner instanceof ElggGroup && $context == 'groups') { + if (event_calendar_activated_for_group($page_owner)) { + add_submenu_item(elgg_echo("event_calendar:group"), $CONFIG->wwwroot . "pg/event_calendar/group/" . $page_owner->getGUID()); + } + } else if ($context == 'event_calendar'){ + add_submenu_item(elgg_echo("event_calendar:site_wide_link"), $CONFIG->wwwroot . "pg/event_calendar/"); + $site_calendar = get_plugin_setting('site_calendar', 'event_calendar'); + if (!$site_calendar || $site_calendar == 'admin') { + if (isadminloggedin()) { + // only admins can post directly to the site-wide calendar + add_submenu_item(elgg_echo('event_calendar:new'), $CONFIG->url . "pg/event_calendar/new/", 'eventcalendaractions'); + } + } else if ($site_calendar == 'loggedin') { + // any logged-in user can post to the site calendar + if (isloggedin()) { + add_submenu_item(elgg_echo('event_calendar:new'), $CONFIG->url . "pg/event_calendar/new/", 'eventcalendaractions'); } - } else if ($context == 'event_calendar'){ - add_submenu_item(elgg_echo("event_calendar:site_wide_link"), $CONFIG->wwwroot . "pg/event_calendar/"); - $site_calendar = get_plugin_setting('site_calendar', 'event_calendar'); - if (!$site_calendar || $site_calendar == 'admin') { - if (isadminloggedin()) { - // only admins can post directly to the site-wide calendar - add_submenu_item(elgg_echo('event_calendar:new'), $CONFIG->url . "pg/event_calendar/new/", 'eventcalendaractions'); + } + } + + if (($context == 'groups') || ($context == 'event_calendar')) { + if (($event_id = get_input('event_id',0)) && ($event = get_entity($event_id))) { + if (isadminloggedin() && (get_plugin_setting('allow_featured', 'event_calendar') == 'yes')) { + if ($event->featured) { + add_submenu_item(elgg_echo('event_calendar:unfeature'), $CONFIG->url . "action/event_calendar/unfeature?event_id=".$event_id.'&'.event_calendar_security_fields(), 'eventcalendaractions'); + } else { + add_submenu_item(elgg_echo('event_calendar:feature'), $CONFIG->url . "action/event_calendar/feature?event_id=".$event_id.'&'.event_calendar_security_fields(), 'eventcalendaractions'); } - } else if ($site_calendar == 'loggedin') { - // any logged-in user can post to the site calendar - if (isloggedin()) { - add_submenu_item(elgg_echo('event_calendar:new'), $CONFIG->url . "pg/event_calendar/new/", 'eventcalendaractions'); + } + add_submenu_item(elgg_echo("event_calendar:view_link"), $CONFIG->wwwroot . "pg/event_calendar/view/" . $event_id,'0eventcalendaradmin'); + if ($event->canEdit()) { + add_submenu_item(elgg_echo("event_calendar:edit_link"), $CONFIG->wwwroot . "mod/event_calendar/manage_event.php?event_id=" . $event_id,'0eventcalendaradmin'); + add_submenu_item(elgg_echo("event_calendar:delete_link"), $CONFIG->wwwroot . "mod/event_calendar/delete_confirm.php?event_id=" . $event_id,'0eventcalendaradmin'); + $event_calendar_personal_manage = get_plugin_setting('personal_manage', 'event_calendar'); + if ($event_calendar_personal_manage == 'no') { + add_submenu_item(elgg_echo('event_calendar:review_requests_title'), $CONFIG->wwwroot . "pg/event_calendar/review_requests/".$event_id, '0eventcalendaradmin'); } } } - - if (($context == 'groups') || ($context == 'event_calendar')) { - if (($event_id = get_input('event_id',0)) && ($event = get_entity($event_id))) { - if (isadminloggedin() && (get_plugin_setting('allow_featured', 'event_calendar') == 'yes')) { - if ($event->featured) { - add_submenu_item(elgg_echo('event_calendar:unfeature'), $CONFIG->url . "action/event_calendar/unfeature?event_id=".$event_id.'&'.event_calendar_security_fields(), 'eventcalendaractions'); + } +} + +function event_calendar_url($entity) { + $friendly_title = elgg_get_friendly_title($entity->title); + return "event_calendar/view/{$entity->guid}/$friendly_title"; +} + +/** + * Dispatches event calendar pages. + * + * URLs take the form of + * Site event calendar: event_calendar/list/<start_date>/<display_mode>/<filter_context>/<region> + * Single event: event_calendar/view/<event_guid>/<title> + * New event: event_calendar/add + * Edit event: event_calendar/edit/<event_guid> + * Group event calendar: event_calendar/group/<group_guid>/<start_date>/<display_mode> + * Add group event: event_calendar/add/<group_guid> + * Review requests: event_calendar/review_requests/<event_guid> + * + * Title is ignored + * + * @param array $page + * @return NULL + */ +function event_calendar_page_handler($page) { + + elgg_load_library('elgg:event_calendar'); + $page_type = $page[0]; + switch ($page_type) { + case 'list': + if (isset($page[1])) { + $start_date = $page[1]; + if (isset($page[2])) { + $display_mode = $page[2]; + if (isset($page[3])) { + $filter_mode = $page[3]; + if (isset($page[4])) { + $region = $page[4]; + } else { + $region = ''; + } } else { - add_submenu_item(elgg_echo('event_calendar:feature'), $CONFIG->url . "action/event_calendar/feature?event_id=".$event_id.'&'.event_calendar_security_fields(), 'eventcalendaractions'); + $filter_mode = ''; } + } else { + $display_mode = ''; } - add_submenu_item(elgg_echo("event_calendar:view_link"), $CONFIG->wwwroot . "pg/event_calendar/view/" . $event_id,'0eventcalendaradmin'); - if ($event->canEdit()) { - add_submenu_item(elgg_echo("event_calendar:edit_link"), $CONFIG->wwwroot . "mod/event_calendar/manage_event.php?event_id=" . $event_id,'0eventcalendaradmin'); - add_submenu_item(elgg_echo("event_calendar:delete_link"), $CONFIG->wwwroot . "mod/event_calendar/delete_confirm.php?event_id=" . $event_id,'0eventcalendaradmin'); - $event_calendar_personal_manage = get_plugin_setting('personal_manage', 'event_calendar'); - if ($event_calendar_personal_manage == 'no') { - add_submenu_item(elgg_echo('event_calendar:review_requests_title'), $CONFIG->wwwroot . "pg/event_calendar/review_requests/".$event_id, '0eventcalendaradmin'); - } - } + } else { + $start_date = 0; } - } - } - - function event_calendar_url($entity) { - global $CONFIG; - return $CONFIG->url . 'pg/event_calendar/view/'.$entity->getGUID(); - } - - /** - * Page handler; allows the use of fancy URLs - * - * @param array $page From the page_handler function - * @return true|false Depending on success - */ - function event_calendar_page_handler($page) { - if (isset($page[0]) && $page[0]) { - if (($page[0] == 'group') && isset($page[1])) { - set_input('group_guid',$page[1]); + echo event_calendar_get_page_content_list($page_type,0,$start_date,$display_mode,$filter_mode,$region); + break; + case 'view': + echo event_calendar_get_page_content_view($page[1]); + break; + case 'add': + if (isset($page[1])) { + group_gatekeeper(); + $group_guid = $page[1]; + } else { + gatekeeper(); + $group_guid = 0; + } + echo event_calendar_get_page_content_edit($page_type,$group_guid); + break; + case 'edit': + gatekeeper(); + echo event_calendar_get_page_content_edit($page_type, $page[1]); + break; + case 'group': + group_gatekeeper(); + if (isset($page[1])) { + $group_guid = $page[1]; if (isset($page[2])) { - set_input('filter',$page[2]); + $start_date = $page[2]; + if (isset($page[3])) { + $display_mode = $page[3]; + } else { + $display_mode = ''; + } + } else { + $start_date = ''; } - @include(dirname(__FILE__) . "/show_events.php"); - } else if (($page[0] == 'view') && isset($page[1])) { - set_input('event_id',$page[1]); - @include(dirname(__FILE__) . "/show_event.php"); - } else if ($page[0] == 'new') { - @include(dirname(__FILE__) . "/manage_event.php"); - } else if ($page[0] == 'review_requests' && isset($page[1])) { - set_input('event_id',$page[1]); - @include(dirname(__FILE__) . "/pages/review_requests.php"); - } else if (in_array($page[0],array('all','friends','mine'))) { - set_input('filter',$page[0]); - @include(dirname(__FILE__) . "/show_events.php"); + } else { + $group_guid = 0; } + echo event_calendar_get_page_content_list($page_type,$group_guid,$start_date,$display_mode,''); + break; + case 'review_requests': + gatekeeper(); + $params = event_calendar_get_page_content_review_requests($page_type, $page[1], $page[2]); + break; + } +} + +/** + * Add particular blog links/info to entity menu + */ +function event_calendar_entity_menu_setup($hook, $type, $return, $params) { + if (elgg_in_context('widgets')) { + return $return; + } + + $entity = $params['entity']; + $handler = elgg_extract('handler', $params, false); + if ($handler != 'event_calendar') { + return $return; + } + $user_guid = elgg_get_logged_in_user_guid(); + if (event_calendar_personal_can_manage($entity,$user_guid)) { + if (event_calendar_has_personal_event($entity->guid,$user_guid)) { + $options = array( + 'name' => 'personal_calendar', + 'text' => elgg_echo('event_calendar:remove_from_the_calendar'), + 'title' => elgg_echo('event_calendar:remove_from_my_calendar'), + 'href' => elgg_add_action_tokens_to_url("action/event_calendar/remove_personal?guid={$entity->guid}"), + 'priority' => 150, + ); + $return[] = ElggMenuItem::factory($options); } else { - @include(dirname(__FILE__) . "/show_events.php"); + if (!event_calendar_is_full($entity->guid) && !event_calendar_has_collision($entity->guid,$user_guid)) { + $options = array( + 'name' => 'personal_calendar', + 'text' => elgg_echo('event_calendar:add_to_the_calendar'), + 'title' => elgg_echo('event_calendar:add_to_my_calendar'), + 'href' => elgg_add_action_tokens_to_url("action/event_calendar/add_personal?guid={$entity->guid}"), + 'priority' => 150, + ); + $return[] = ElggMenuItem::factory($options); } } - return true; + } else { + if (!check_entity_relationship($user_guid, 'event_calendar_request', $entity->guid)) { + $options = array( + 'name' => 'personal_calendar', + 'text' => elgg_echo('event_calendar:make_request_title'), + 'title' => elgg_echo('event_calendar:make_request_title'), + 'href' => elgg_add_action_tokens_to_url("action/event_calendar/request_personal_calendar?guid={$entity->guid}"), + 'priority' => 150, + ); + $return[] = ElggMenuItem::factory($options); + } } - -// Make sure the event calendar functions are called - register_elgg_event_handler('init','system','event_calendar_init'); - register_elgg_event_handler('pagesetup','system','event_calendar_pagesetup'); - -// Register actions - global $CONFIG; - register_action("event_calendar/manage",false,$CONFIG->pluginspath . "event_calendar/actions/manage.php"); - register_action("event_calendar/request_personal_calendar",false,$CONFIG->pluginspath . "event_calendar/actions/request_personal_calendar.php"); - register_action("event_calendar/toggle_personal_calendar",false,$CONFIG->pluginspath . "event_calendar/actions/toggle_personal_calendar.php"); - register_action("event_calendar/killrequest",false,$CONFIG->pluginspath . "event_calendar/actions/killrequest.php"); - register_action("event_calendar/addtocalendar",false,$CONFIG->pluginspath . "event_calendar/actions/addtocalendar.php"); - register_action("event_calendar/add_to_group",false,$CONFIG->pluginspath . "event_calendar/actions/add_to_group.php"); - register_action("event_calendar/remove_from_group",false,$CONFIG->pluginspath . "event_calendar/actions/remove_from_group.php"); - -?>
\ No newline at end of file + return $return; +} diff --git a/ui.core.min.js b/ui.core.min.js deleted file mode 100644 index b2352c67f..000000000 --- a/ui.core.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/*
- * jQuery UI 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI
- */
jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7.2",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]])}},call:function(j,l,k){var n=j.plugins[l];if(!n||!j.element[0].parentNode){return}for(var m=0;m<n.length;m++){if(j.options[n[m][0]]){n[m][1].apply(j.element,k)}}}},contains:function(k,j){return document.compareDocumentPosition?k.compareDocumentPosition(j)&16:k!==j&&k.contains(j)},hasScroll:function(m,k){if(c(m).css("overflow")=="hidden"){return false}var j=(k&&k=="left")?"scrollLeft":"scrollTop",l=false;if(m[j]>0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return i.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);
\ No newline at end of file diff --git a/ui.datepicker.css b/ui.datepicker.css deleted file mode 100644 index 567f8c97b..000000000 --- a/ui.datepicker.css +++ /dev/null @@ -1,62 +0,0 @@ -/* Datepicker -----------------------------------*/ -.ui-datepicker { width: 17em; padding: .2em .2em 0; } -.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } -.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } -.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } -.ui-datepicker .ui-datepicker-prev { left:2px; } -.ui-datepicker .ui-datepicker-next { right:2px; } -.ui-datepicker .ui-datepicker-prev-hover { left:1px; } -.ui-datepicker .ui-datepicker-next-hover { right:1px; } -.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } -.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } -.ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; margin:1px 0; } -.ui-datepicker select.ui-datepicker-month-year {width: 100%;} -.ui-datepicker select.ui-datepicker-month, -.ui-datepicker select.ui-datepicker-year { width: 49%;} -.ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: right; } -.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } -.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } -.ui-datepicker td { border: 0; padding: 1px; } -.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } -.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } -.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } -.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } - -/* with multiple calendars */ -.ui-datepicker.ui-datepicker-multi { width:auto; } -.ui-datepicker-multi .ui-datepicker-group { float:left; } -.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } -.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } -.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } -.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } -.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } -.ui-datepicker-row-break { clear:both; width:100%; } - -/* RTL support */ -.ui-datepicker-rtl { direction: rtl; } -.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } -.ui-datepicker-rtl .ui-datepicker-group { float:right; } -.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } -.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } - -/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ -.ui-datepicker-cover { - display: none; /*sorry for IE5*/ - display/**/: block; /*sorry for IE5*/ - position: absolute; /*must have*/ - z-index: -1; /*must have*/ - filter: mask(); /*must have*/ - top: -4px; /*must have*/ - left: -4px; /*must have*/ - width: 200px; /*must have*/ - height: 200px; /*must have*/ -}
\ No newline at end of file diff --git a/ui.datepicker.js b/ui.datepicker.js deleted file mode 100644 index 009582c7d..000000000 --- a/ui.datepicker.js +++ /dev/null @@ -1,212 +0,0 @@ -(function($){ - var PROP_NAME="datepicker"; - function Datepicker(){ - this.debug=false; - this._curInst=null; - this._disabledInputs=[]; - this._datepickerShowing=false; - this._inDialog=false; - this._mainDivId="ui-datepicker-div"; - this._inlineClass="ui-datepicker-inline"; - this._appendClass="ui-datepicker-append"; - this._triggerClass="ui-datepicker-trigger"; - this._dialogClass="ui-datepicker-dialog"; - this._promptClass="ui-datepicker-prompt"; - this._disableClass="ui-datepicker-disabled"; - this._unselectableClass="ui-datepicker-unselectable"; - this._currentClass="ui-datepicker-current-day"; - this.regional=[]; - this.regional[""]={ - clearText:"Clear", - clearStatus:"Erase the current date", - closeText:"Close", - closeStatus:"Close without change", - prevText:"<Prev", - prevStatus:"Show the previous month", - prevBigText:"<<", - prevBigStatus:"Show the previous year", - nextText:"Next>", - nextStatus:"Show the next month", - nextBigText:">>", - nextBigStatus:"Show the next year", - currentText:"Today", - currentStatus:"Show the current month", - monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"], - monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"], - monthStatus:"Show a different month", - yearStatus:"Show a different year", - weekHeader:"Wk", - weekStatus:"Week of the year", - dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"], - dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"], - dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"], - dayStatus:"Set DD as first week day", - dateStatus:"Select DD, M d", - dateFormat:"mm/dd/yy", - firstDay:0, - initStatus:"Select a date", - isRTL:false - }; - this._defaults={ - onChangeToday: false, - showOn:"focus", - showAnim:"show", - showOptions:{}, - defaultDate:null, - appendText:"", - buttonText:"...", - buttonImage:"", - buttonImageOnly:false, - closeAtTop:true, - mandatory:false, - hideIfNoPrevNext:false, - navigationAsDateFormat:false, - showBigPrevNext:false, - gotoCurrent:false, - changeMonth:true, - changeYear:true, - showMonthAfterYear:false, - yearRange:"-10:+10", - changeFirstDay:true, - highlightWeek:false, - showOtherMonths:false, - showWeeks:false, - calculateWeek:this.iso8601Week, - shortYearCutoff:"+10", - showStatus:false, - statusForDate:this.dateStatus, - minDate:null, - maxDate:null, - duration:"normal", - beforeShowDay:null, - beforeShow:null, - onSelect:null, - onChangeMonthYear:null, - onClose:null, - numberOfMonths:1, - showCurrentAtPos:0, - stepMonths:1, - stepBigMonths:12, - rangeSelect:false, - rangeSeparator:" - ", - altField:"", - altFormat:"" - }; - $.extend(this._defaults,this.regional[""]); - this.dpDiv=$('<div id="'+this._mainDivId+'" style="display: none;"></div>')} - $.extend( - Datepicker.prototype, - { - markerClassName:"hasDatepicker", - log:function(){ - if(this.debug){ - console.log.apply("",arguments) - } - }, - setDefaults: - function(settings){ - extendRemove(this._defaults,settings||{}); - return this - }, - - _attachDatepicker: - function(target,settings){ - var inlineSettings=null; - for(attrName in this._defaults){ - var attrValue=target.getAttribute("date:"+attrName); - if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase();var inline=(nodeName=="div"||nodeName=="span");if(!target.id){target.id="dp"+(++this.uuid)}var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{});if(nodeName=="input"){this._connectDatepicker(target,inst)}else{if(inline){this._inlineDatepicker(target,inst)}}},_newInst:function(target,inline){var id=target[0].id.replace(/([:\[\]\.])/g,"\\\\$1");return{id:id,input:target,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:inline,dpDiv:(!inline?this.dpDiv:$('<div class="'+this._inlineClass+'"></div>'))}},_connectDatepicker:function(target,inst){var input=$(target);if(input.hasClass(this.markerClassName)){return}var appendText=this._get(inst,"appendText");var isRTL=this._get(inst,"isRTL");if(appendText){input[isRTL?"before":"after"]('<span class="'+this._appendClass+'">'+appendText+"</span>")}var showOn=this._get(inst,"showOn");if(showOn=="focus"||showOn=="both"){input.focus(this._showDatepicker)}if(showOn=="button"||showOn=="both"){var buttonText=this._get(inst,"buttonText");var buttonImage=this._get(inst,"buttonImage");var trigger=$(this._get(inst,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:buttonImage,alt:buttonText,title:buttonText}):$('<button type="button"></button>').addClass(this._triggerClass).html(buttonImage==""?buttonText:$("<img/>").attr({src:buttonImage,alt:buttonText,title:buttonText})));input[isRTL?"before":"after"](trigger);trigger.click(function(){if($.datepicker._datepickerShowing&&$.datepicker._lastInput==target){$.datepicker._hideDatepicker()}else{$.datepicker._showDatepicker(target)}return false})}input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst)},_inlineDatepicker:function(target,inst){var divSpan=$(target);if(divSpan.hasClass(this.markerClassName)){return}divSpan.addClass(this.markerClassName).append(inst.dpDiv).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst);this._setDate(inst,this._getDefaultDate(inst));this._updateDatepicker(inst)},_inlineShow:function(inst){var numMonths=this._getNumberOfMonths(inst);inst.dpDiv.width(numMonths[1]*$(".ui-datepicker",inst.dpDiv[0]).width())}, - - _dialogDatepicker: - function(input,dateText,onSelect,settings,pos){ - var inst=this._dialogInst; - if(!inst){var id="dp"+(++this.uuid); - this._dialogInput=$('<input type="text" id="'+id+'" size="1" style="position: absolute; top: -100px;"/>'); - this._dialogInput.keydown(this._doKeyDown); - $("body").append(this._dialogInput); - inst=this._dialogInst=this._newInst(this._dialogInput,false); - inst.settings={}; - $.data(this._dialogInput[0],PROP_NAME,inst)} - extendRemove(inst.settings,settings||{}); - this._dialogInput.val(dateText); - this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null); - if(!this._pos){ - var browserWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight; - var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(browserWidth/2)-100+scrollX,(browserHeight/2)-150+scrollY]}this._dialogInput.css("left",this._pos[0]+"px").css("top",this._pos[1]+"px"); - inst.settings.onSelect=onSelect; - this._inDialog=true; - this.dpDiv.addClass(this._dialogClass); - this._showDatepicker(this._dialogInput[0]);if($.blockUI){$.blockUI(this.dpDiv)}$.data(this._dialogInput[0],PROP_NAME,inst);return this},_destroyDatepicker:function(target){var $target=$(target);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();$.removeData(target,PROP_NAME);if(nodeName=="input"){$target.siblings("."+this._appendClass).remove().end().siblings("."+this._triggerClass).remove().end().removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress)}else{if(nodeName=="div"||nodeName=="span"){$target.removeClass(this.markerClassName).empty()}}},_enableDatepicker:function(target){var $target=$(target);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=false;$target.siblings("button."+this._triggerClass).each(function(){this.disabled=false}).end().siblings("img."+this._triggerClass).css({opacity:"1.0",cursor:""})}else{if(nodeName=="div"||nodeName=="span"){$target.children("."+this._disableClass).remove()}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)})},_disableDatepicker:function(target){var $target=$(target);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=true;$target.siblings("button."+this._triggerClass).each(function(){this.disabled=true}).end().siblings("img."+this._triggerClass).css({opacity:"0.5",cursor:"default"})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);var offset=inline.offset();var relOffset={left:0,top:0};inline.parents().each(function(){if($(this).css("position")=="relative"){relOffset=$(this).offset();return false}});$target.prepend('<div class="'+this._disableClass+'" style="'+($.browser.msie?"background-color: transparent; ":"")+"width: "+inline.width()+"px; height: "+inline.height()+"px; left: "+(offset.left-relOffset.left)+"px; top: "+(offset.top-relOffset.top)+'px;"></div>')}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)});this._disabledInputs[this._disabledInputs.length]=target},_isDisabledDatepicker:function(target){if(!target){return false}for(var i=0;i<this._disabledInputs.length;i++){if(this._disabledInputs[i]==target){return true}}return false},_getInst:function(target){try{return $.data(target,PROP_NAME)}catch(err){throw"Missing instance data for this datepicker"}},_changeDatepicker:function(target,name,value){var settings=name||{};if(typeof name=="string"){settings={};settings[name]=value}var inst=this._getInst(target);if(inst){if(this._curInst==inst){this._hideDatepicker(null)}extendRemove(inst.settings,settings);var date=new Date();extendRemove(inst,{rangeStart:null,endDay:null,endMonth:null,endYear:null,selectedDay:date.getDate(),selectedMonth:date.getMonth(),selectedYear:date.getFullYear(),currentDay:date.getDate(),currentMonth:date.getMonth(),currentYear:date.getFullYear(),drawMonth:date.getMonth(),drawYear:date.getFullYear()});this._updateDatepicker(inst)}},_refreshDatepicker:function(target){var inst=this._getInst(target);if(inst){this._updateDatepicker(inst)}},_setDateDatepicker:function(target,date,endDate){var inst=this._getInst(target);if(inst){this._setDate(inst,date,endDate);this._updateDatepicker(inst);this._updateAlternate(inst)}},_getDateDatepicker:function(target){var inst=this._getInst(target);if(inst&&!inst.inline){this._setDateFromField(inst)}return(inst?this._getDate(inst):null)},_doKeyDown:function(e){var inst=$.datepicker._getInst(e.target);var handled=true;if($.datepicker._datepickerShowing){switch(e.keyCode){case 9:$.datepicker._hideDatepicker(null,"");break;case 13:$.datepicker._selectDay(e.target,inst.selectedMonth,inst.selectedYear,$("td.ui-datepicker-days-cell-over",inst.dpDiv)[0]);return false;break;case 27:$.datepicker._hideDatepicker(null,$.datepicker._get(inst,"duration"));break;case 33:$.datepicker._adjustDate(e.target,(e.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M");break;case 34:$.datepicker._adjustDate(e.target,(e.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M");break;case 35:if(e.ctrlKey){$.datepicker._clearDate(e.target)}handled=e.ctrlKey;break;case 36:if(e.ctrlKey){$.datepicker._gotoToday(e.target)}handled=e.ctrlKey;break;case 37:if(e.ctrlKey){$.datepicker._adjustDate(e.target,-1,"D")}handled=e.ctrlKey;break;case 38:if(e.ctrlKey){$.datepicker._adjustDate(e.target,-7,"D")}handled=e.ctrlKey;break;case 39:if(e.ctrlKey){$.datepicker._adjustDate(e.target,+1,"D")}handled=e.ctrlKey;break;case 40:if(e.ctrlKey){$.datepicker._adjustDate(e.target,+7,"D")}handled=e.ctrlKey;break;default:handled=false}}else{if(e.keyCode==36&&e.ctrlKey){$.datepicker._showDatepicker(this)}else{handled=false}}if(handled){e.preventDefault();e.stopPropagation()}},_doKeyPress:function(e){var inst=$.datepicker._getInst(e.target);var chars=$.datepicker._possibleChars($.datepicker._get(inst,"dateFormat"));var chr=String.fromCharCode(e.charCode==undefined?e.keyCode:e.charCode);return e.ctrlKey||(chr<" "||!chars||chars.indexOf(chr)>-1)},_showDatepicker:function(input){input=input.target||input;if(input.nodeName.toLowerCase()!="input"){input=$("input",input.parentNode)[0]}if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput==input){return}var inst=$.datepicker._getInst(input);var beforeShow=$.datepicker._get(inst,"beforeShow");extendRemove(inst.settings,(beforeShow?beforeShow.apply(input,[input,inst]):{}));$.datepicker._hideDatepicker(null,"");$.datepicker._lastInput=input;$.datepicker._setDateFromField(inst);if($.datepicker._inDialog){input.value=""}if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight}var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css("position")=="fixed";return!isFixed});if(isFixed&&$.browser.opera){$.datepicker._pos[0]-=document.documentElement.scrollLeft;$.datepicker._pos[1]-=document.documentElement.scrollTop}var offset={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null;inst.rangeStart=null;inst.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});$.datepicker._updateDatepicker(inst);inst.dpDiv.width($.datepicker._getNumberOfMonths(inst)[1]*$(".ui-datepicker",inst.dpDiv[0])[0].offsetWidth);offset=$.datepicker._checkOffset(inst,offset,isFixed);inst.dpDiv.css({position:($.datepicker._inDialog&&$.blockUI?"static":(isFixed?"fixed":"absolute")),display:"none",left:offset.left+"px",top:offset.top+"px"});if(!inst.inline){var showAnim=$.datepicker._get(inst,"showAnim")||"show";var duration=$.datepicker._get(inst,"duration");var postProcess=function(){$.datepicker._datepickerShowing=true;if($.browser.msie&&parseInt($.browser.version,10)<7){$("iframe.ui-datepicker-cover").css({width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4})}};if($.effects&&$.effects[showAnim]){inst.dpDiv.show(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[showAnim](duration,postProcess)}if(duration==""){postProcess()}if(inst.input[0].type!="hidden"){inst.input[0].focus()}$.datepicker._curInst=inst}},_updateDatepicker:function(inst){var dims={width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4};inst.dpDiv.empty().append(this._generateHTML(inst)).find("iframe.ui-datepicker-cover").css({width:dims.width,height:dims.height});var numMonths=this._getNumberOfMonths(inst);inst.dpDiv[(numMonths[0]!=1||numMonths[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");inst.dpDiv[(this._get(inst,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");if(inst.input&&inst.input[0].type!="hidden"){$(inst.input[0]).focus()}},_checkOffset:function(inst,offset,isFixed){var pos=inst.input?this._findPos(inst.input[0]):null;var browserWidth=window.innerWidth||document.documentElement.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;if(this._get(inst,"isRTL")||(offset.left+inst.dpDiv.width()-scrollX)>browserWidth){offset.left=Math.max((isFixed?0:scrollX),pos[0]+(inst.input?inst.input.width():0)-(isFixed?scrollX:0)-inst.dpDiv.width()-(isFixed&&$.browser.opera?document.documentElement.scrollLeft:0))}else{offset.left-=(isFixed?scrollX:0)}if((offset.top+inst.dpDiv.height()-scrollY)>browserHeight){offset.top=Math.max((isFixed?0:scrollY),pos[1]-(isFixed?scrollY:0)-(this._inDialog?0:inst.dpDiv.height())-(isFixed&&$.browser.opera?document.documentElement.scrollTop:0))}else{offset.top-=(isFixed?scrollY:0)}return offset},_findPos:function(obj){while(obj&&(obj.type=="hidden"||obj.nodeType!=1)){obj=obj.nextSibling}var position=$(obj).offset();return[position.left,position.top]},_hideDatepicker:function(input,duration){var inst=this._curInst;if(!inst||(input&&inst!=$.data(input,PROP_NAME))){return}var rangeSelect=this._get(inst,"rangeSelect");if(rangeSelect&&inst.stayOpen){this._selectDate("#"+inst.id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear))}inst.stayOpen=false;if(this._datepickerShowing){duration=(duration!=null?duration:this._get(inst,"duration"));var showAnim=this._get(inst,"showAnim");var postProcess=function(){$.datepicker._tidyDialog(inst)};if(duration!=""&&$.effects&&$.effects[showAnim]){inst.dpDiv.hide(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[(duration==""?"hide":(showAnim=="slideDown"?"slideUp":(showAnim=="fadeIn"?"fadeOut":"hide")))](duration,postProcess)}if(duration==""){this._tidyDialog(inst)}var onClose=this._get(inst,"onClose");if(onClose){onClose.apply((inst.input?inst.input[0]:null),[(inst.input?inst.input.val():""),inst])}this._datepickerShowing=false;this._lastInput=null;inst.settings.prompt=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if($.blockUI){$.unblockUI();$("body").append(this.dpDiv)}}this._inDialog=false}this._curInst=null},_tidyDialog:function(inst){inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker");$("."+this._promptClass,inst.dpDiv).remove()},_checkExternalClick:function(event){if(!$.datepicker._curInst){return}var $target=$(event.target);if(($target.parents("#"+$.datepicker._mainDivId).length==0)&&!$target.hasClass($.datepicker.markerClassName)&&!$target.hasClass($.datepicker._triggerClass)&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)){$.datepicker._hideDatepicker(null,"")}}, -_adjustDate: - function(id,offset,period){ - var target=$(id); - var inst=this._getInst(target[0]); - this._adjustInstDate(inst,offset,period); - this._updateDatepicker(inst) -}, -_gotoToday: -function(id){ - var target=$(id); - var inst=this._getInst(target[0]); - inst.onChangeToday=true; - if(this._get(inst,"gotoCurrent")&&inst.currentDay){ - inst.selectedDay=inst.currentDay; - inst.drawMonth=inst.selectedMonth=inst.currentMonth; - inst.drawYear=inst.selectedYear=inst.currentYear - }else{ - var date=new Date(); - inst.selectedDay=date.getDate(); - inst.drawMonth=inst.selectedMonth=date.getMonth(); - inst.drawYear=inst.selectedYear=date.getFullYear(); - } - - - this._notifyChange(inst); - this._adjustDate(target); - - -} -, -_selectMonthYear: - function(id,select,period){var target=$(id);var inst=this._getInst(target[0]);inst._selectingMonthYear=false;inst["selected"+(period=="M"?"Month":"Year")]=inst["draw"+(period=="M"?"Month":"Year")]=parseInt(select.options[select.selectedIndex].value,10);this._notifyChange(inst);this._adjustDate(target)},_clickMonthYear:function(id){var target=$(id);var inst=this._getInst(target[0]);if(inst.input&&inst._selectingMonthYear&&!$.browser.msie){inst.input[0].focus()}inst._selectingMonthYear=!inst._selectingMonthYear},_changeFirstDay:function(id,day){var target=$(id);var inst=this._getInst(target[0]);inst.settings.firstDay=day;this._updateDatepicker(inst)},_selectDay:function(id,month,year,td){if($(td).hasClass(this._unselectableClass)){return}var target=$(id);var inst=this._getInst(target[0]);var rangeSelect=this._get(inst,"rangeSelect");if(rangeSelect){inst.stayOpen=!inst.stayOpen;if(inst.stayOpen){$(".ui-datepicker td",inst.dpDiv).removeClass(this._currentClass);$(td).addClass(this._currentClass)}}inst.selectedDay=inst.currentDay=$("a",td).html();inst.selectedMonth=inst.currentMonth=month;inst.selectedYear=inst.currentYear=year;if(inst.stayOpen){inst.endDay=inst.endMonth=inst.endYear=null}else{if(rangeSelect){inst.endDay=inst.currentDay;inst.endMonth=inst.currentMonth;inst.endYear=inst.currentYear}}this._selectDate(id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear));if(inst.stayOpen){inst.rangeStart=new Date(inst.currentYear,inst.currentMonth,inst.currentDay);this._updateDatepicker(inst)}else{if(rangeSelect){inst.selectedDay=inst.currentDay=inst.rangeStart.getDate();inst.selectedMonth=inst.currentMonth=inst.rangeStart.getMonth();inst.selectedYear=inst.currentYear=inst.rangeStart.getFullYear();inst.rangeStart=null;if(inst.inline){this._updateDatepicker(inst)}}}},_clearDate:function(id){var target=$(id);var inst=this._getInst(target[0]);if(this._get(inst,"mandatory")){return}inst.stayOpen=false;inst.endDay=inst.endMonth=inst.endYear=inst.rangeStart=null;this._selectDate(target,"")}, - _selectDate:function(id,dateStr){ - var target=$(id); - var inst=this._getInst(target[0]); - dateStr=(dateStr!=null?dateStr:this._formatDate(inst)); - if(this._get(inst,"rangeSelect")&&dateStr){ - dateStr=(inst.rangeStart?this._formatDate(inst,inst.rangeStart):dateStr)+this._get(inst,"rangeSeparator")+dateStr}if(inst.input){inst.input.val(dateStr)}this._updateAlternate(inst); - - var onSelect=this._get(inst,"onSelect"); - if(onSelect){ - onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst]) - }else{ - if(inst.input){ - inst.input.trigger("change")} - } - - if(inst.inline){ - this._updateDatepicker(inst)}else{if(!inst.stayOpen){this._hideDatepicker(null,this._get(inst,"duration"));this._lastInput=inst.input[0];if(typeof(inst.input[0])!="object"){inst.input[0].focus()}this._lastInput=null}}},_updateAlternate:function(inst){var altField=this._get(inst,"altField");if(altField){var altFormat=this._get(inst,"altFormat");var date=this._getDate(inst); - dateStr=(isArray(date)?(!date[0]&&!date[1]?"":this.formatDate(altFormat,date[0],this._getFormatConfig(inst))+this._get(inst,"rangeSeparator")+this.formatDate(altFormat,date[1]||date[0],this._getFormatConfig(inst))):this.formatDate(altFormat,date,this._getFormatConfig(inst))); - $(altField).each(function(){$(this).val(dateStr)})}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),""]},iso8601Week:function(date){var checkDate=new Date(date.getFullYear(),date.getMonth(),date.getDate(),(date.getTimezoneOffset()/-60));var firstMon=new Date(checkDate.getFullYear(),1-1,4);var firstDay=firstMon.getDay()||7;firstMon.setDate(firstMon.getDate()+1-firstDay);if(firstDay<4&&checkDate<firstMon){checkDate.setDate(checkDate.getDate()-3);return $.datepicker.iso8601Week(checkDate)}else{if(checkDate>new Date(checkDate.getFullYear(),12-1,28)){firstDay=new Date(checkDate.getFullYear()+1,1-1,4).getDay()||7;if(firstDay>4&&(checkDate.getDay()||7)<firstDay-3){return 1}}}return Math.floor(((checkDate-firstMon)/86400000)/7)+1},dateStatus:function(date,inst){return $.datepicker.formatDate($.datepicker._get(inst,"dateStatus"),date,$.datepicker._getFormatConfig(inst))},parseDate:function(format,value,settings){if(format==null||value==null){throw"Invalid arguments"}value=(typeof value=="object"?value.toString():value+"");if(value==""){return null}var shortYearCutoff=(settings?settings.shortYearCutoff:null)||this._defaults.shortYearCutoff;var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var year=-1;var month=-1;var day=-1;var doy=-1;var literal=false;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var getNumber=function(match){lookAhead(match);var origSize=(match=="@"?14:(match=="y"?4:(match=="o"?3:2)));var size=origSize;var num=0;while(size>0&&iValue<value.length&&value.charAt(iValue)>="0"&&value.charAt(iValue)<="9"){num=num*10+parseInt(value.charAt(iValue++),10);size--}if(size==origSize){throw"Missing number at position "+iValue}return num};var getName=function(match,shortNames,longNames){var names=(lookAhead(match)?longNames:shortNames);var size=0;for(var j=0;j<names.length;j++){size=Math.max(size,names[j].length)}var name="";var iInit=iValue;while(size>0&&iValue<value.length){name+=value.charAt(iValue++);for(var i=0;i<names.length;i++){if(name==names[i]){return i+1}}size--}throw"Unknown name at position "+iInit};var checkLiteral=function(){if(value.charAt(iValue)!=format.charAt(iFormat)){throw"Unexpected literal at position "+iValue}iValue++};var iValue=0;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{checkLiteral()}}else{switch(format.charAt(iFormat)){case"d":day=getNumber("d");break;case"D":getName("D",dayNamesShort,dayNames);break;case"o":doy=getNumber("o");break;case"m":month=getNumber("m");break;case"M":month=getName("M",monthNamesShort,monthNames);break;case"y":year=getNumber("y");break;case"@":var date=new Date(getNumber("@"));year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case"'":if(lookAhead("'")){checkLiteral()}else{literal=true}break;default:checkLiteral()}}}if(year<100){year+=new Date().getFullYear()-new Date().getFullYear()%100+(year<=shortYearCutoff?0:-100)}if(doy>-1){month=1;day=doy;do{var dim=this._getDaysInMonth(year,month-1);if(day<=dim){break}month++;day-=dim}while(true)}var date=new Date(year,month-1,day);if(date.getFullYear()!=year||date.getMonth()+1!=month||date.getDate()!=day){throw"Invalid date"}return date},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TIMESTAMP:"@",W3C:"yy-mm-dd",formatDate:function(format,date,settings){if(!date){return""}var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var formatNumber=function(match,value,len){var num=""+value;if(lookAhead(match)){while(num.length<len){num="0"+num}}return num};var formatName=function(match,value,shortNames,longNames){return(lookAhead(match)?longNames[value]:shortNames[value])};var output="";var literal=false;if(date){for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{output+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d":output+=formatNumber("d",date.getDate(),2);break;case"D":output+=formatName("D",date.getDay(),dayNamesShort,dayNames);break;case"o":var doy=date.getDate();for(var m=date.getMonth()-1;m>=0;m--){doy+=this._getDaysInMonth(date.getFullYear(),m)}output+=formatNumber("o",doy,3);break;case"m":output+=formatNumber("m",date.getMonth()+1,2);break;case"M":output+=formatName("M",date.getMonth(),monthNamesShort,monthNames);break;case"y":output+=(lookAhead("y")?date.getFullYear():(date.getYear()%100<10?"0":"")+date.getYear()%100);break;case"@":output+=date.getTime();break;case"'":if(lookAhead("'")){output+="'"}else{literal=true}break;default:output+=format.charAt(iFormat)}}}}return output},_possibleChars:function(format){var chars="";var literal=false;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{chars+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d":case"m":case"y":case"@":chars+="0123456789";break;case"D":case"M":return null;case"'":if(lookAhead("'")){chars+="'"}else{literal=true}break;default:chars+=format.charAt(iFormat)}}}return chars},_get:function(inst,name){return inst.settings[name]!==undefined?inst.settings[name]:this._defaults[name]},_setDateFromField:function(inst){var dateFormat=this._get(inst,"dateFormat");var dates=inst.input?inst.input.val().split(this._get(inst,"rangeSeparator")):null;inst.endDay=inst.endMonth=inst.endYear=null;var date=defaultDate=this._getDefaultDate(inst);if(dates.length>0){var settings=this._getFormatConfig(inst);if(dates.length>1){date=this.parseDate(dateFormat,dates[1],settings)||defaultDate;inst.endDay=date.getDate();inst.endMonth=date.getMonth();inst.endYear=date.getFullYear()}try{date=this.parseDate(dateFormat,dates[0],settings)||defaultDate}catch(e){this.log(e);date=defaultDate}}inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();inst.currentDay=(dates[0]?date.getDate():0);inst.currentMonth=(dates[0]?date.getMonth():0);inst.currentYear=(dates[0]?date.getFullYear():0);this._adjustInstDate(inst)},_getDefaultDate:function(inst){var date=this._determineDate(this._get(inst,"defaultDate"),new Date());var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);return date},_determineDate:function(date,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setUTCDate(date.getUTCDate()+offset);return date};var offsetString=function(offset,getDaysInMonth){var date=new Date();var year=date.getFullYear();var month=date.getMonth();var day=date.getDate();var pattern=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;var matches=pattern.exec(offset);while(matches){switch(matches[2]||"d"){case"d":case"D":day+=parseInt(matches[1],10);break;case"w":case"W":day+=parseInt(matches[1],10)*7;break;case"m":case"M":month+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break;case"y":case"Y":year+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break}matches=pattern.exec(offset)}return new Date(year,month,day)};date=(date==null?defaultDate:(typeof date=="string"?offsetString(date,this._getDaysInMonth):(typeof date=="number"?(isNaN(date)?defaultDate:offsetNumeric(date)):date)));return(date&&date.toString()=="Invalid Date"?defaultDate:date)},_setDate:function(inst,date,endDate){var clear=!(date);var origMonth=inst.selectedMonth;var origYear=inst.selectedYear;date=this._determineDate(date,new Date());inst.selectedDay=inst.currentDay=date.getDate();inst.drawMonth=inst.selectedMonth=inst.currentMonth=date.getMonth();inst.drawYear=inst.selectedYear=inst.currentYear=date.getFullYear();if(this._get(inst,"rangeSelect")){if(endDate){endDate=this._determineDate(endDate,null);inst.endDay=endDate.getDate();inst.endMonth=endDate.getMonth();inst.endYear=endDate.getFullYear()}else{inst.endDay=inst.currentDay;inst.endMonth=inst.currentMonth;inst.endYear=inst.currentYear}}if(origMonth!=inst.selectedMonth||origYear!=inst.selectedYear){this._notifyChange(inst)}this._adjustInstDate(inst);if(inst.input){inst.input.val(clear?"":this._formatDate(inst)+(!this._get(inst,"rangeSelect")?"":this._get(inst,"rangeSeparator")+this._formatDate(inst,inst.endDay,inst.endMonth,inst.endYear)))}},_getDate:function(inst){var startDate=(!inst.currentYear||(inst.input&&inst.input.val()=="")?null:new Date(inst.currentYear,inst.currentMonth,inst.currentDay));if(this._get(inst,"rangeSelect")){return[inst.rangeStart||startDate,(!inst.endYear?inst.rangeStart||startDate:new Date(inst.endYear,inst.endMonth,inst.endDay))]}else{return startDate}},_generateHTML:function(inst){var today=new Date();today=new Date(today.getFullYear(),today.getMonth(),today.getDate());var showStatus=this._get(inst,"showStatus");var initStatus=this._get(inst,"initStatus")||" ";var isRTL=this._get(inst,"isRTL");var clear=(this._get(inst,"mandatory")?"":'<div class="ui-datepicker-clear"><a onclick="jQuery.datepicker._clearDate(\'#'+inst.id+"');\""+this._addStatus(showStatus,inst.id,this._get(inst,"clearStatus"),initStatus)+">"+this._get(inst,"clearText")+"</a></div>");var controls='<div class="ui-datepicker-control">'+(isRTL?"":clear)+'<div class="ui-datepicker-close"><a onclick="jQuery.datepicker._hideDatepicker();"'+this._addStatus(showStatus,inst.id,this._get(inst,"closeStatus"),initStatus)+">"+this._get(inst,"closeText")+"</a></div>"+(isRTL?clear:"")+"</div>";var prompt=this._get(inst,"prompt");var closeAtTop=this._get(inst,"closeAtTop");var hideIfNoPrevNext=this._get(inst,"hideIfNoPrevNext");var navigationAsDateFormat=this._get(inst,"navigationAsDateFormat");var showBigPrevNext=this._get(inst,"showBigPrevNext");var numMonths=this._getNumberOfMonths(inst);var showCurrentAtPos=this._get(inst,"showCurrentAtPos");var stepMonths=this._get(inst,"stepMonths");var stepBigMonths=this._get(inst,"stepBigMonths");var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1);var currentDate=(!inst.currentDay?new Date(9999,9,9):new Date(inst.currentYear,inst.currentMonth,inst.currentDay));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");var drawMonth=inst.drawMonth-showCurrentAtPos;var drawYear=inst.drawYear;if(drawMonth<0){drawMonth+=12;drawYear--}if(maxDate){var maxDraw=new Date(maxDate.getFullYear(),maxDate.getMonth()-numMonths[1]+1,maxDate.getDate());maxDraw=(minDate&&maxDraw<minDate?minDate:maxDraw);while(new Date(drawYear,drawMonth,1)>maxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--}}}var prevText=this._get(inst,"prevText");prevText=(!navigationAsDateFormat?prevText:this.formatDate(prevText,new Date(drawYear,drawMonth-stepMonths,1),this._getFormatConfig(inst)));var prevBigText=(showBigPrevNext?this._get(inst,"prevBigText"):"");prevBigText=(!navigationAsDateFormat?prevBigText:this.formatDate(prevBigText,new Date(drawYear,drawMonth-stepBigMonths,1),this._getFormatConfig(inst)));var prev='<div class="ui-datepicker-prev">'+(this._canAdjustMonth(inst,-1,drawYear,drawMonth)?(showBigPrevNext?"<a onclick=\"jQuery.datepicker._adjustDate('#"+inst.id+"', -"+stepBigMonths+", 'M');\""+this._addStatus(showStatus,inst.id,this._get(inst,"prevBigStatus"),initStatus)+">"+prevBigText+"</a>":"")+"<a onclick=\"jQuery.datepicker._adjustDate('#"+inst.id+"', -"+stepMonths+", 'M');\""+this._addStatus(showStatus,inst.id,this._get(inst,"prevStatus"),initStatus)+">"+prevText+"</a>":(hideIfNoPrevNext?"":"<label>"+prevBigText+"</label><label>"+prevText+"</label>"))+"</div>";var nextText=this._get(inst,"nextText");nextText=(!navigationAsDateFormat?nextText:this.formatDate(nextText,new Date(drawYear,drawMonth+stepMonths,1),this._getFormatConfig(inst)));var nextBigText=(showBigPrevNext?this._get(inst,"nextBigText"):"");nextBigText=(!navigationAsDateFormat?nextBigText:this.formatDate(nextBigText,new Date(drawYear,drawMonth+stepBigMonths,1),this._getFormatConfig(inst)));var next='<div class="ui-datepicker-next">'+(this._canAdjustMonth(inst,+1,drawYear,drawMonth)?"<a onclick=\"jQuery.datepicker._adjustDate('#"+inst.id+"', +"+stepMonths+", 'M');\""+this._addStatus(showStatus,inst.id,this._get(inst,"nextStatus"),initStatus)+">"+nextText+"</a>"+(showBigPrevNext?"<a onclick=\"jQuery.datepicker._adjustDate('#"+inst.id+"', +"+stepBigMonths+", 'M');\""+this._addStatus(showStatus,inst.id,this._get(inst,"nextBigStatus"),initStatus)+">"+nextBigText+"</a>":""):(hideIfNoPrevNext?"":"<label>"+nextText+"</label><label>"+nextBigText+"</label>"))+"</div>";var currentText=this._get(inst,"currentText");var gotoDate=(this._get(inst,"gotoCurrent")&&inst.currentDay?currentDate:today);currentText=(!navigationAsDateFormat?currentText:this.formatDate(currentText,gotoDate,this._getFormatConfig(inst))); - -var html=(prompt?'<div class="'+ - this._promptClass+'">'+ - prompt+ - "</div>":"")+ - (closeAtTop&&!inst.inline?controls:"")+ - '<div class="ui-datepicker-links">'+ - (isRTL?next:prev)+ - (this._isInRange(inst,gotoDate)?'<div class="ui-datepicker-current"><a onclick="jQuery.datepicker._gotoToday(\'#'+inst.id+"');\""+this._addStatus(showStatus,inst.id,this._get(inst,"currentStatus"),initStatus)+">"+currentText+"</a></div>":"")+(isRTL?prev:next)+"</div>"; - -var firstDay=this._get(inst,"firstDay");var changeFirstDay=this._get(inst,"changeFirstDay");var dayNames=this._get(inst,"dayNames");var dayNamesShort=this._get(inst,"dayNamesShort");var dayNamesMin=this._get(inst,"dayNamesMin");var monthNames=this._get(inst,"monthNames");var beforeShowDay=this._get(inst,"beforeShowDay");var highlightWeek=this._get(inst,"highlightWeek");var showOtherMonths=this._get(inst,"showOtherMonths");var showWeeks=this._get(inst,"showWeeks");var calculateWeek=this._get(inst,"calculateWeek")||this.iso8601Week;var weekStatus=this._get(inst,"weekStatus");var status=(showStatus?this._get(inst,"dayStatus")||initStatus:"");var dateStatus=this._get(inst,"statusForDate")||this.dateStatus;var endDate=inst.endDay?new Date(inst.endYear,inst.endMonth,inst.endDay):currentDate;for(var row=0;row<numMonths[0];row++){for(var col=0;col<numMonths[1];col++){var selectedDate=new Date(drawYear,drawMonth,inst.selectedDay);html+='<div class="ui-datepicker-one-month'+(col==0?" ui-datepicker-new-row":"")+'">'+this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,row>0||col>0,showStatus,initStatus,monthNames)+'<table class="ui-datepicker" cellpadding="0" cellspacing="0"><thead><tr class="ui-datepicker-title-row">'+(showWeeks?"<td"+this._addStatus(showStatus,inst.id,weekStatus,initStatus)+">"+this._get(inst,"weekHeader")+"</td>":"");for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;var dayStatus=(status.indexOf("DD")>-1?status.replace(/DD/,dayNames[day]):status.replace(/D/,dayNamesShort[day]));html+="<td"+((dow+firstDay+6)%7>=5?' class="ui-datepicker-week-end-cell"':"")+">"+(!changeFirstDay?"<span":"<a onclick=\"jQuery.datepicker._changeFirstDay('#"+inst.id+"', "+day+');"')+this._addStatus(showStatus,inst.id,dayStatus,initStatus)+' title="'+dayNames[day]+'">'+dayNamesMin[day]+(changeFirstDay?"</a>":"</span>")+"</td>"}html+="</tr></thead><tbody>";var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear==inst.selectedYear&&drawMonth==inst.selectedMonth){inst.selectedDay=Math.min(inst.selectedDay,daysInMonth)}var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var tzDate=new Date(drawYear,drawMonth,1-leadDays);var utcDate=new Date(drawYear,drawMonth,1-leadDays);var printDate=utcDate;var numRows=(isMultiMonth?6:Math.ceil((leadDays+daysInMonth)/7));for(var dRow=0;dRow<numRows;dRow++){html+='<tr class="ui-datepicker-days-row">'+(showWeeks?'<td class="ui-datepicker-week-col"'+this._addStatus(showStatus,inst.id,weekStatus,initStatus)+">"+calculateWeek(printDate)+"</td>":"");for(var dow=0;dow<7;dow++){var daySettings=(beforeShowDay?beforeShowDay.apply((inst.input?inst.input[0]:null),[printDate]):[true,""]);var otherMonth=(printDate.getMonth()!=drawMonth);var unselectable=otherMonth||!daySettings[0]||(minDate&&printDate<minDate)||(maxDate&&printDate>maxDate);html+='<td class="ui-datepicker-days-cell'+((dow+firstDay+6)%7>=5?" ui-datepicker-week-end-cell":"")+(otherMonth?" ui-datepicker-other-month":"")+(printDate.getTime()==selectedDate.getTime()&&drawMonth==inst.selectedMonth?" ui-datepicker-days-cell-over":"")+(unselectable?" "+this._unselectableClass:"")+(otherMonth&&!showOtherMonths?"":" "+daySettings[1]+(printDate.getTime()>=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" "+this._currentClass:"")+(printDate.getTime()==today.getTime()?" ui-datepicker-today":""))+'"'+((!otherMonth||showOtherMonths)&&daySettings[2]?' title="'+daySettings[2]+'"':"")+(unselectable?(highlightWeek?" onmouseover=\"jQuery(this).parent().addClass('ui-datepicker-week-over');\" onmouseout=\"jQuery(this).parent().removeClass('ui-datepicker-week-over');\"":""):" onmouseover=\"jQuery(this).addClass('ui-datepicker-days-cell-over')"+(highlightWeek?".parent().addClass('ui-datepicker-week-over')":"")+";"+(!showStatus||(otherMonth&&!showOtherMonths)?"":"jQuery('#ui-datepicker-status-"+inst.id+"').html('"+(dateStatus.apply((inst.input?inst.input[0]:null),[printDate,inst])||initStatus)+"');")+"\" onmouseout=\"jQuery(this).removeClass('ui-datepicker-days-cell-over')"+(highlightWeek?".parent().removeClass('ui-datepicker-week-over')":"")+";"+(!showStatus||(otherMonth&&!showOtherMonths)?"":"jQuery('#ui-datepicker-status-"+inst.id+"').html('"+initStatus+"');")+'" onclick="jQuery.datepicker._selectDay(\'#'+inst.id+"',"+drawMonth+","+drawYear+', this);"')+">"+(otherMonth?(showOtherMonths?printDate.getDate():" "):(unselectable?printDate.getDate():"<a>"+printDate.getDate()+"</a>"))+"</td>";tzDate.setDate(tzDate.getDate()+1);utcDate.setUTCDate(utcDate.getUTCDate()+1);printDate=(tzDate>utcDate?tzDate:utcDate)}html+="</tr>"}drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++}html+="</tbody></table></div>"}}html+=(showStatus?'<div style="clear: both;"></div><div id="ui-datepicker-status-'+inst.id+'" class="ui-datepicker-status">'+initStatus+"</div>":"")+(!closeAtTop&&!inst.inline?controls:"")+'<div style="clear: both;"></div>'+($.browser.msie&&parseInt($.browser.version,10)<7&&!inst.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover"></iframe>':"");return html},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,secondary,showStatus,initStatus,monthNames){minDate=(inst.rangeStart&&minDate&&selectedDate<minDate?selectedDate:minDate);var showMonthAfterYear=this._get(inst,"showMonthAfterYear");var html='<div class="ui-datepicker-header">';var monthHtml="";if(secondary||!this._get(inst,"changeMonth")){monthHtml+=monthNames[drawMonth]+" "}else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);monthHtml+='<select class="ui-datepicker-new-month" onchange="jQuery.datepicker._selectMonthYear(\'#'+inst.id+"', this, 'M');\" onclick=\"jQuery.datepicker._clickMonthYear('#"+inst.id+"');\""+this._addStatus(showStatus,inst.id,this._get(inst,"monthStatus"),initStatus)+">";for(var month=0;month<12;month++){if((!inMinYear||month>=minDate.getMonth())&&(!inMaxYear||month<=maxDate.getMonth())){monthHtml+='<option value="'+month+'"'+(month==drawMonth?' selected="selected"':"")+">"+monthNames[month]+"</option>"}}monthHtml+="</select>"}if(!showMonthAfterYear){html+=monthHtml}if(secondary||!this._get(inst,"changeYear")){html+=drawYear}else{var years=this._get(inst,"yearRange").split(":");var year=0;var endYear=0;if(years.length!=2){year=drawYear-10;endYear=drawYear+10}else{if(years[0].charAt(0)=="+"||years[0].charAt(0)=="-"){year=endYear=new Date().getFullYear();year+=parseInt(years[0],10);endYear+=parseInt(years[1],10)}else{year=parseInt(years[0],10);endYear=parseInt(years[1],10)}}year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);html+='<select class="ui-datepicker-new-year" onchange="jQuery.datepicker._selectMonthYear(\'#'+inst.id+"', this, 'Y');\" onclick=\"jQuery.datepicker._clickMonthYear('#"+inst.id+"');\""+this._addStatus(showStatus,inst.id,this._get(inst,"yearStatus"),initStatus)+">";for(;year<=endYear;year++){html+='<option value="'+year+'"'+(year==drawYear?' selected="selected"':"")+">"+year+"</option>"}html+="</select>"}if(showMonthAfterYear){html+=monthHtml}html+="</div>";return html},_addStatus:function(showStatus,id,text,initStatus){return(showStatus?" onmouseover=\"jQuery('#ui-datepicker-status-"+id+"').html('"+(text||initStatus)+"');\" onmouseout=\"jQuery('#ui-datepicker-status-"+id+"').html('"+initStatus+"');\"":"")},_adjustInstDate:function(inst,offset,period){var year=inst.drawYear+(period=="Y"?offset:0);var month=inst.drawMonth+(period=="M"?offset:0);var day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+(period=="D"?offset:0);var date=new Date(year,month,day);var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();if(period=="M"||period=="Y"){this._notifyChange(inst)}}, -_notifyChange: - function(inst){ - var onChange=this._get(inst,"onChangeMonthYear"); - if(onChange){ - onChange.apply( - (inst.input?inst.input[0]:null), - [inst.selectedYear,inst.selectedMonth+1,inst] - ) - } - } -, -_getNumberOfMonths:function(inst){var numMonths=this._get(inst,"numberOfMonths");return(numMonths==null?[1,1]:(typeof numMonths=="number"?[1,numMonths]:numMonths))},_getMinMaxDate:function(inst,minMax,checkRange){var date=this._determineDate(this._get(inst,minMax+"Date"),null);if(date){date.setHours(0);date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0)}return(!checkRange||!inst.rangeStart?date:(!date||inst.rangeStart>date?inst.rangeStart:date))},_getDaysInMonth:function(year,month){return 32-new Date(year,month,32).getDate()},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay()},_canAdjustMonth:function(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst);var date=new Date(curYear,curMonth+(offset<0?offset:numMonths[1]),1);if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()))}return this._isInRange(inst,date)},_isInRange:function(inst,date){var newMinDate=(!inst.rangeStart?null:new Date(inst.selectedYear,inst.selectedMonth,inst.selectedDay));newMinDate=(newMinDate&&inst.rangeStart<newMinDate?inst.rangeStart:newMinDate);var minDate=newMinDate||this._getMinMaxDate(inst,"min");var maxDate=this._getMinMaxDate(inst,"max");return((!minDate||date>=minDate)&&(!maxDate||date<=maxDate))},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,"shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(inst,"dayNamesShort"),dayNames:this._get(inst,"dayNames"),monthNamesShort:this._get(inst,"monthNamesShort"),monthNames:this._get(inst,"monthNames")}},_formatDate:function(inst,day,month,year){if(!day){inst.currentDay=inst.selectedDay;inst.currentMonth=inst.selectedMonth;inst.currentYear=inst.selectedYear}var date=(day?(typeof day=="object"?day:new Date(year,month,day)):new Date(inst.currentYear,inst.currentMonth,inst.currentDay));return this.formatDate(this._get(inst,"dateFormat"),date,this._getFormatConfig(inst))}});function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null||props[name]==undefined){target[name]=props[name]}}return target}function isArray(a){return(a&&(($.browser.safari&&typeof a=="object"&&a.length)||(a.constructor&&a.constructor.toString().match(/\Array\(\)/))))}$.fn.datepicker=function(options){if(!$.datepicker.initialized){$(document.body).append($.datepicker.dpDiv).mousedown($.datepicker._checkExternalClick);$.datepicker.initialized=true}var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=="string"&&(options=="isDisabled"||options=="getDate")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}return this.each(function(){typeof options=="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options)})};$.datepicker=new Datepicker();$.datepicker.initialized=false;$.datepicker.uuid=new Date().getTime()})(jQuery) diff --git a/ui.datepicker.min.js b/ui.datepicker.min.js deleted file mode 100644 index 155949aad..000000000 --- a/ui.datepicker.min.js +++ /dev/null @@ -1,12 +0,0 @@ -/*
- * jQuery UI Datepicker 1.7.2
- *
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Datepicker
- *
- * Depends:
- * ui.core.js
- */
(function($){$.extend($.ui,{datepicker:{version:"1.7.2"}});var PROP_NAME="datepicker";function Datepicker(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass="ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],dateFormat:"mm/dd/yy",firstDay:0,isRTL:false};this._defaults={showOn:"focus",showAnim:"show",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,showMonthAfterYear:false,yearRange:"-10:+10",showOtherMonths:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"normal",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false};$.extend(this._defaults,this.regional[""]);this.dpDiv=$('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible"></div>')}$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",log:function(){if(this.debug){console.log.apply("",arguments)}},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase();var inline=(nodeName=="div"||nodeName=="span");if(!target.id){target.id="dp"+(++this.uuid)}var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{});if(nodeName=="input"){this._connectDatepicker(target,inst)}else{if(inline){this._inlineDatepicker(target,inst)}}},_newInst:function(target,inline){var id=target[0].id.replace(/([:\[\]\.])/g,"\\\\$1");return{id:id,input:target,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:inline,dpDiv:(!inline?this.dpDiv:$('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}},_connectDatepicker:function(target,inst){var input=$(target);inst.append=$([]);inst.trigger=$([]);if(input.hasClass(this.markerClassName)){return}var appendText=this._get(inst,"appendText");var isRTL=this._get(inst,"isRTL");if(appendText){inst.append=$('<span class="'+this._appendClass+'">'+appendText+"</span>");input[isRTL?"before":"after"](inst.append)}var showOn=this._get(inst,"showOn");if(showOn=="focus"||showOn=="both"){input.focus(this._showDatepicker)}if(showOn=="button"||showOn=="both"){var buttonText=this._get(inst,"buttonText");var buttonImage=this._get(inst,"buttonImage");inst.trigger=$(this._get(inst,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:buttonImage,alt:buttonText,title:buttonText}):$('<button type="button"></button>').addClass(this._triggerClass).html(buttonImage==""?buttonText:$("<img/>").attr({src:buttonImage,alt:buttonText,title:buttonText})));input[isRTL?"before":"after"](inst.trigger);inst.trigger.click(function(){if($.datepicker._datepickerShowing&&$.datepicker._lastInput==target){$.datepicker._hideDatepicker()}else{$.datepicker._showDatepicker(target)}return false})}input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst)},_inlineDatepicker:function(target,inst){var divSpan=$(target);if(divSpan.hasClass(this.markerClassName)){return}divSpan.addClass(this.markerClassName).append(inst.dpDiv).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst);this._setDate(inst,this._getDefaultDate(inst));this._updateDatepicker(inst);this._updateAlternate(inst)},_dialogDatepicker:function(input,dateText,onSelect,settings,pos){var inst=this._dialogInst;if(!inst){var id="dp"+(++this.uuid);this._dialogInput=$('<input type="text" id="'+id+'" size="1" style="position: absolute; top: -100px;"/>');this._dialogInput.keydown(this._doKeyDown);$("body").append(this._dialogInput);inst=this._dialogInst=this._newInst(this._dialogInput,false);inst.settings={};$.data(this._dialogInput[0],PROP_NAME,inst)}extendRemove(inst.settings,settings||{});this._dialogInput.val(dateText);this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){var browserWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(browserWidth/2)-100+scrollX,(browserHeight/2)-150+scrollY]}this._dialogInput.css("left",this._pos[0]+"px").css("top",this._pos[1]+"px");inst.settings.onSelect=onSelect;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if($.blockUI){$.blockUI(this.dpDiv)}$.data(this._dialogInput[0],PROP_NAME,inst);return this},_destroyDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();$.removeData(target,PROP_NAME);if(nodeName=="input"){inst.append.remove();inst.trigger.remove();$target.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress)}else{if(nodeName=="div"||nodeName=="span"){$target.removeClass(this.markerClassName).empty()}}},_enableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=false;inst.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().removeClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)})},_disableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=true;inst.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().addClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)});this._disabledInputs[this._disabledInputs.length]=target},_isDisabledDatepicker:function(target){if(!target){return false}for(var i=0;i<this._disabledInputs.length;i++){if(this._disabledInputs[i]==target){return true}}return false},_getInst:function(target){try{return $.data(target,PROP_NAME)}catch(err){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(target,name,value){var inst=this._getInst(target);if(arguments.length==2&&typeof name=="string"){return(name=="defaults"?$.extend({},$.datepicker._defaults):(inst?(name=="all"?$.extend({},inst.settings):this._get(inst,name)):null))}var settings=name||{};if(typeof name=="string"){settings={};settings[name]=value}if(inst){if(this._curInst==inst){this._hideDatepicker(null)}var date=this._getDateDatepicker(target);extendRemove(inst.settings,settings);this._setDateDatepicker(target,date);this._updateDatepicker(inst)}},_changeDatepicker:function(target,name,value){this._optionDatepicker(target,name,value)},_refreshDatepicker:function(target){var inst=this._getInst(target);if(inst){this._updateDatepicker(inst)}},_setDateDatepicker:function(target,date,endDate){var inst=this._getInst(target);if(inst){this._setDate(inst,date,endDate);this._updateDatepicker(inst);this._updateAlternate(inst)}},_getDateDatepicker:function(target){var inst=this._getInst(target);if(inst&&!inst.inline){this._setDateFromField(inst)}return(inst?this._getDate(inst):null)},_doKeyDown:function(event){var inst=$.datepicker._getInst(event.target);var handled=true;var isRTL=inst.dpDiv.is(".ui-datepicker-rtl");inst._keyEvent=true;if($.datepicker._datepickerShowing){switch(event.keyCode){case 9:$.datepicker._hideDatepicker(null,"");break;case 13:var sel=$("td."+$.datepicker._dayOverClass+", td."+$.datepicker._currentClass,inst.dpDiv);if(sel[0]){$.datepicker._selectDay(event.target,inst.selectedMonth,inst.selectedYear,sel[0])}else{$.datepicker._hideDatepicker(null,$.datepicker._get(inst,"duration"))}return false;break;case 27:$.datepicker._hideDatepicker(null,$.datepicker._get(inst,"duration"));break;case 33:$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M");break;case 34:$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M");break;case 35:if(event.ctrlKey||event.metaKey){$.datepicker._clearDate(event.target)}handled=event.ctrlKey||event.metaKey;break;case 36:if(event.ctrlKey||event.metaKey){$.datepicker._gotoToday(event.target)}handled=event.ctrlKey||event.metaKey;break;case 37:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?+1:-1),"D")}handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M")}break;case 38:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,-7,"D")}handled=event.ctrlKey||event.metaKey;break;case 39:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?-1:+1),"D")}handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M")}break;case 40:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,+7,"D")}handled=event.ctrlKey||event.metaKey;break;default:handled=false}}else{if(event.keyCode==36&&event.ctrlKey){$.datepicker._showDatepicker(this)}else{handled=false}}if(handled){event.preventDefault();event.stopPropagation()}},_doKeyPress:function(event){var inst=$.datepicker._getInst(event.target);if($.datepicker._get(inst,"constrainInput")){var chars=$.datepicker._possibleChars($.datepicker._get(inst,"dateFormat"));var chr=String.fromCharCode(event.charCode==undefined?event.keyCode:event.charCode);return event.ctrlKey||(chr<" "||!chars||chars.indexOf(chr)>-1)}},_showDatepicker:function(input){input=input.target||input;if(input.nodeName.toLowerCase()!="input"){input=$("input",input.parentNode)[0]}if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput==input){return}var inst=$.datepicker._getInst(input);var beforeShow=$.datepicker._get(inst,"beforeShow");extendRemove(inst.settings,(beforeShow?beforeShow.apply(input,[input,inst]):{}));$.datepicker._hideDatepicker(null,"");$.datepicker._lastInput=input;$.datepicker._setDateFromField(inst);if($.datepicker._inDialog){input.value=""}if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight}var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css("position")=="fixed";return !isFixed});if(isFixed&&$.browser.opera){$.datepicker._pos[0]-=document.documentElement.scrollLeft;$.datepicker._pos[1]-=document.documentElement.scrollTop}var offset={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null;inst.rangeStart=null;inst.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});$.datepicker._updateDatepicker(inst);offset=$.datepicker._checkOffset(inst,offset,isFixed);inst.dpDiv.css({position:($.datepicker._inDialog&&$.blockUI?"static":(isFixed?"fixed":"absolute")),display:"none",left:offset.left+"px",top:offset.top+"px"});if(!inst.inline){var showAnim=$.datepicker._get(inst,"showAnim")||"show";var duration=$.datepicker._get(inst,"duration");var postProcess=function(){$.datepicker._datepickerShowing=true;if($.browser.msie&&parseInt($.browser.version,10)<7){$("iframe.ui-datepicker-cover").css({width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4})}};if($.effects&&$.effects[showAnim]){inst.dpDiv.show(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[showAnim](duration,postProcess)}if(duration==""){postProcess()}if(inst.input[0].type!="hidden"){inst.input[0].focus()}$.datepicker._curInst=inst}},_updateDatepicker:function(inst){var dims={width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4};var self=this;inst.dpDiv.empty().append(this._generateHTML(inst)).find("iframe.ui-datepicker-cover").css({width:dims.width,height:dims.height}).end().find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){$(this).removeClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).removeClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).removeClass("ui-datepicker-next-hover")}}).bind("mouseover",function(){if(!self._isDisabledDatepicker(inst.inline?inst.dpDiv.parent()[0]:inst.input[0])){$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");$(this).addClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).addClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).addClass("ui-datepicker-next-hover")}}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();var numMonths=this._getNumberOfMonths(inst);var cols=numMonths[1];var width=17;if(cols>1){inst.dpDiv.addClass("ui-datepicker-multi-"+cols).css("width",(width*cols)+"em")}else{inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("")}inst.dpDiv[(numMonths[0]!=1||numMonths[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");inst.dpDiv[(this._get(inst,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");if(inst.input&&inst.input[0].type!="hidden"&&inst==$.datepicker._curInst){$(inst.input[0]).focus()}},_checkOffset:function(inst,offset,isFixed){var dpWidth=inst.dpDiv.outerWidth();var dpHeight=inst.dpDiv.outerHeight();var inputWidth=inst.input?inst.input.outerWidth():0;var inputHeight=inst.input?inst.input.outerHeight():0;var viewWidth=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)+$(document).scrollLeft();var viewHeight=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)+$(document).scrollTop();offset.left-=(this._get(inst,"isRTL")?(dpWidth-inputWidth):0);offset.left-=(isFixed&&offset.left==inst.input.offset().left)?$(document).scrollLeft():0;offset.top-=(isFixed&&offset.top==(inst.input.offset().top+inputHeight))?$(document).scrollTop():0;offset.left-=(offset.left+dpWidth>viewWidth&&viewWidth>dpWidth)?Math.abs(offset.left+dpWidth-viewWidth):0;offset.top-=(offset.top+dpHeight>viewHeight&&viewHeight>dpHeight)?Math.abs(offset.top+dpHeight+inputHeight*2-viewHeight):0;return offset},_findPos:function(obj){while(obj&&(obj.type=="hidden"||obj.nodeType!=1)){obj=obj.nextSibling}var position=$(obj).offset();return[position.left,position.top]},_hideDatepicker:function(input,duration){var inst=this._curInst;if(!inst||(input&&inst!=$.data(input,PROP_NAME))){return}if(inst.stayOpen){this._selectDate("#"+inst.id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear))}inst.stayOpen=false;if(this._datepickerShowing){duration=(duration!=null?duration:this._get(inst,"duration"));var showAnim=this._get(inst,"showAnim");var postProcess=function(){$.datepicker._tidyDialog(inst)};if(duration!=""&&$.effects&&$.effects[showAnim]){inst.dpDiv.hide(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[(duration==""?"hide":(showAnim=="slideDown"?"slideUp":(showAnim=="fadeIn"?"fadeOut":"hide")))](duration,postProcess)}if(duration==""){this._tidyDialog(inst)}var onClose=this._get(inst,"onClose");if(onClose){onClose.apply((inst.input?inst.input[0]:null),[(inst.input?inst.input.val():""),inst])}this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if($.blockUI){$.unblockUI();$("body").append(this.dpDiv)}}this._inDialog=false}this._curInst=null},_tidyDialog:function(inst){inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(event){if(!$.datepicker._curInst){return}var $target=$(event.target);if(($target.parents("#"+$.datepicker._mainDivId).length==0)&&!$target.hasClass($.datepicker.markerClassName)&&!$target.hasClass($.datepicker._triggerClass)&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)){$.datepicker._hideDatepicker(null,"")}},_adjustDate:function(id,offset,period){var target=$(id);var inst=this._getInst(target[0]);if(this._isDisabledDatepicker(target[0])){return}this._adjustInstDate(inst,offset+(period=="M"?this._get(inst,"showCurrentAtPos"):0),period);this._updateDatepicker(inst)},_gotoToday:function(id){var target=$(id);var inst=this._getInst(target[0]);if(this._get(inst,"gotoCurrent")&&inst.currentDay){inst.selectedDay=inst.currentDay;inst.drawMonth=inst.selectedMonth=inst.currentMonth;inst.drawYear=inst.selectedYear=inst.currentYear}else{var date=new Date();inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear()}this._notifyChange(inst);this._adjustDate(target)},_selectMonthYear:function(id,select,period){var target=$(id);var inst=this._getInst(target[0]);inst._selectingMonthYear=false;inst["selected"+(period=="M"?"Month":"Year")]=inst["draw"+(period=="M"?"Month":"Year")]=parseInt(select.options[select.selectedIndex].value,10);this._notifyChange(inst);this._adjustDate(target)},_clickMonthYear:function(id){var target=$(id);var inst=this._getInst(target[0]);if(inst.input&&inst._selectingMonthYear&&!$.browser.msie){inst.input[0].focus()}inst._selectingMonthYear=!inst._selectingMonthYear},_selectDay:function(id,month,year,td){var target=$(id);if($(td).hasClass(this._unselectableClass)||this._isDisabledDatepicker(target[0])){return}var inst=this._getInst(target[0]);inst.selectedDay=inst.currentDay=$("a",td).html();inst.selectedMonth=inst.currentMonth=month;inst.selectedYear=inst.currentYear=year;if(inst.stayOpen){inst.endDay=inst.endMonth=inst.endYear=null}this._selectDate(id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear));if(inst.stayOpen){inst.rangeStart=this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay));this._updateDatepicker(inst)}},_clearDate:function(id){var target=$(id);var inst=this._getInst(target[0]);inst.stayOpen=false;inst.endDay=inst.endMonth=inst.endYear=inst.rangeStart=null;this._selectDate(target,"")},_selectDate:function(id,dateStr){var target=$(id);var inst=this._getInst(target[0]);dateStr=(dateStr!=null?dateStr:this._formatDate(inst));if(inst.input){inst.input.val(dateStr)}this._updateAlternate(inst);var onSelect=this._get(inst,"onSelect");if(onSelect){onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst])}else{if(inst.input){inst.input.trigger("change")}}if(inst.inline){this._updateDatepicker(inst)}else{if(!inst.stayOpen){this._hideDatepicker(null,this._get(inst,"duration"));this._lastInput=inst.input[0];if(typeof(inst.input[0])!="object"){inst.input[0].focus()}this._lastInput=null}}},_updateAlternate:function(inst){var altField=this._get(inst,"altField");if(altField){var altFormat=this._get(inst,"altFormat")||this._get(inst,"dateFormat");var date=this._getDate(inst);dateStr=this.formatDate(altFormat,date,this._getFormatConfig(inst));$(altField).each(function(){$(this).val(dateStr)})}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),""]},iso8601Week:function(date){var checkDate=new Date(date.getFullYear(),date.getMonth(),date.getDate());var firstMon=new Date(checkDate.getFullYear(),1-1,4);var firstDay=firstMon.getDay()||7;firstMon.setDate(firstMon.getDate()+1-firstDay);if(firstDay<4&&checkDate<firstMon){checkDate.setDate(checkDate.getDate()-3);return $.datepicker.iso8601Week(checkDate)}else{if(checkDate>new Date(checkDate.getFullYear(),12-1,28)){firstDay=new Date(checkDate.getFullYear()+1,1-1,4).getDay()||7;if(firstDay>4&&(checkDate.getDay()||7)<firstDay-3){return 1}}}return Math.floor(((checkDate-firstMon)/86400000)/7)+1},parseDate:function(format,value,settings){if(format==null||value==null){throw"Invalid arguments"}value=(typeof value=="object"?value.toString():value+"");if(value==""){return null}var shortYearCutoff=(settings?settings.shortYearCutoff:null)||this._defaults.shortYearCutoff;var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var year=-1;var month=-1;var day=-1;var doy=-1;var literal=false;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var getNumber=function(match){lookAhead(match);var origSize=(match=="@"?14:(match=="y"?4:(match=="o"?3:2)));var size=origSize;var num=0;while(size>0&&iValue<value.length&&value.charAt(iValue)>="0"&&value.charAt(iValue)<="9"){num=num*10+parseInt(value.charAt(iValue++),10);size--}if(size==origSize){throw"Missing number at position "+iValue}return num};var getName=function(match,shortNames,longNames){var names=(lookAhead(match)?longNames:shortNames);var size=0;for(var j=0;j<names.length;j++){size=Math.max(size,names[j].length)}var name="";var iInit=iValue;while(size>0&&iValue<value.length){name+=value.charAt(iValue++);for(var i=0;i<names.length;i++){if(name==names[i]){return i+1}}size--}throw"Unknown name at position "+iInit};var checkLiteral=function(){if(value.charAt(iValue)!=format.charAt(iFormat)){throw"Unexpected literal at position "+iValue}iValue++};var iValue=0;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{checkLiteral()}}else{switch(format.charAt(iFormat)){case"d":day=getNumber("d");break;case"D":getName("D",dayNamesShort,dayNames);break;case"o":doy=getNumber("o");break;case"m":month=getNumber("m");break;case"M":month=getName("M",monthNamesShort,monthNames);break;case"y":year=getNumber("y");break;case"@":var date=new Date(getNumber("@"));year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case"'":if(lookAhead("'")){checkLiteral()}else{literal=true}break;default:checkLiteral()}}}if(year==-1){year=new Date().getFullYear()}else{if(year<100){year+=new Date().getFullYear()-new Date().getFullYear()%100+(year<=shortYearCutoff?0:-100)}}if(doy>-1){month=1;day=doy;do{var dim=this._getDaysInMonth(year,month-1);if(day<=dim){break}month++;day-=dim}while(true)}var date=this._daylightSavingAdjust(new Date(year,month-1,day));if(date.getFullYear()!=year||date.getMonth()+1!=month||date.getDate()!=day){throw"Invalid date"}return date},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TIMESTAMP:"@",W3C:"yy-mm-dd",formatDate:function(format,date,settings){if(!date){return""}var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var formatNumber=function(match,value,len){var num=""+value;if(lookAhead(match)){while(num.length<len){num="0"+num}}return num};var formatName=function(match,value,shortNames,longNames){return(lookAhead(match)?longNames[value]:shortNames[value])};var output="";var literal=false;if(date){for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{output+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d":output+=formatNumber("d",date.getDate(),2);break;case"D":output+=formatName("D",date.getDay(),dayNamesShort,dayNames);break;case"o":var doy=date.getDate();for(var m=date.getMonth()-1;m>=0;m--){doy+=this._getDaysInMonth(date.getFullYear(),m)}output+=formatNumber("o",doy,3);break;case"m":output+=formatNumber("m",date.getMonth()+1,2);break;case"M":output+=formatName("M",date.getMonth(),monthNamesShort,monthNames);break;case"y":output+=(lookAhead("y")?date.getFullYear():(date.getYear()%100<10?"0":"")+date.getYear()%100);break;case"@":output+=date.getTime();break;case"'":if(lookAhead("'")){output+="'"}else{literal=true}break;default:output+=format.charAt(iFormat)}}}}return output},_possibleChars:function(format){var chars="";var literal=false;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{chars+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d":case"m":case"y":case"@":chars+="0123456789";break;case"D":case"M":return null;case"'":if(lookAhead("'")){chars+="'"}else{literal=true}break;default:chars+=format.charAt(iFormat)}}}return chars},_get:function(inst,name){return inst.settings[name]!==undefined?inst.settings[name]:this._defaults[name]},_setDateFromField:function(inst){var dateFormat=this._get(inst,"dateFormat");var dates=inst.input?inst.input.val():null;inst.endDay=inst.endMonth=inst.endYear=null;var date=defaultDate=this._getDefaultDate(inst);var settings=this._getFormatConfig(inst);try{date=this.parseDate(dateFormat,dates,settings)||defaultDate}catch(event){this.log(event);date=defaultDate}inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();inst.currentDay=(dates?date.getDate():0);inst.currentMonth=(dates?date.getMonth():0);inst.currentYear=(dates?date.getFullYear():0);this._adjustInstDate(inst)},_getDefaultDate:function(inst){var date=this._determineDate(this._get(inst,"defaultDate"),new Date());var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);return date},_determineDate:function(date,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setDate(date.getDate()+offset);return date};var offsetString=function(offset,getDaysInMonth){var date=new Date();var year=date.getFullYear();var month=date.getMonth();var day=date.getDate();var pattern=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;var matches=pattern.exec(offset);while(matches){switch(matches[2]||"d"){case"d":case"D":day+=parseInt(matches[1],10);break;case"w":case"W":day+=parseInt(matches[1],10)*7;break;case"m":case"M":month+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break;case"y":case"Y":year+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break}matches=pattern.exec(offset)}return new Date(year,month,day)};date=(date==null?defaultDate:(typeof date=="string"?offsetString(date,this._getDaysInMonth):(typeof date=="number"?(isNaN(date)?defaultDate:offsetNumeric(date)):date)));date=(date&&date.toString()=="Invalid Date"?defaultDate:date);if(date){date.setHours(0);date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0)}return this._daylightSavingAdjust(date)},_daylightSavingAdjust:function(date){if(!date){return null}date.setHours(date.getHours()>12?date.getHours()+2:0);return date},_setDate:function(inst,date,endDate){var clear=!(date);var origMonth=inst.selectedMonth;var origYear=inst.selectedYear;date=this._determineDate(date,new Date());inst.selectedDay=inst.currentDay=date.getDate();inst.drawMonth=inst.selectedMonth=inst.currentMonth=date.getMonth();inst.drawYear=inst.selectedYear=inst.currentYear=date.getFullYear();if(origMonth!=inst.selectedMonth||origYear!=inst.selectedYear){this._notifyChange(inst)}this._adjustInstDate(inst);if(inst.input){inst.input.val(clear?"":this._formatDate(inst))}},_getDate:function(inst){var startDate=(!inst.currentYear||(inst.input&&inst.input.val()=="")?null:this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return startDate},_generateHTML:function(inst){var today=new Date();today=this._daylightSavingAdjust(new Date(today.getFullYear(),today.getMonth(),today.getDate()));var isRTL=this._get(inst,"isRTL");var showButtonPanel=this._get(inst,"showButtonPanel");var hideIfNoPrevNext=this._get(inst,"hideIfNoPrevNext");var navigationAsDateFormat=this._get(inst,"navigationAsDateFormat");var numMonths=this._getNumberOfMonths(inst);var showCurrentAtPos=this._get(inst,"showCurrentAtPos");var stepMonths=this._get(inst,"stepMonths");var stepBigMonths=this._get(inst,"stepBigMonths");var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1);var currentDate=this._daylightSavingAdjust((!inst.currentDay?new Date(9999,9,9):new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");var drawMonth=inst.drawMonth-showCurrentAtPos;var drawYear=inst.drawYear;if(drawMonth<0){drawMonth+=12;drawYear--}if(maxDate){var maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(),maxDate.getMonth()-numMonths[1]+1,maxDate.getDate()));maxDraw=(minDate&&maxDraw<minDate?minDate:maxDraw);while(this._daylightSavingAdjust(new Date(drawYear,drawMonth,1))>maxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--}}}inst.drawMonth=drawMonth;inst.drawYear=drawYear;var prevText=this._get(inst,"prevText");prevText=(!navigationAsDateFormat?prevText:this.formatDate(prevText,this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepMonths,1)),this._getFormatConfig(inst)));var prev=(this._canAdjustMonth(inst,-1,drawYear,drawMonth)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#'+inst.id+"', -"+stepMonths+", 'M');\" title=\""+prevText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"e":"w")+'">'+prevText+"</span></a>":(hideIfNoPrevNext?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+prevText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"e":"w")+'">'+prevText+"</span></a>"));var nextText=this._get(inst,"nextText");nextText=(!navigationAsDateFormat?nextText:this.formatDate(nextText,this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepMonths,1)),this._getFormatConfig(inst)));var next=(this._canAdjustMonth(inst,+1,drawYear,drawMonth)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#'+inst.id+"', +"+stepMonths+", 'M');\" title=\""+nextText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"w":"e")+'">'+nextText+"</span></a>":(hideIfNoPrevNext?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+nextText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"w":"e")+'">'+nextText+"</span></a>"));var currentText=this._get(inst,"currentText");var gotoDate=(this._get(inst,"gotoCurrent")&&inst.currentDay?currentDate:today);currentText=(!navigationAsDateFormat?currentText:this.formatDate(currentText,gotoDate,this._getFormatConfig(inst)));var controls=(!inst.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery.datepicker._hideDatepicker();">'+this._get(inst,"closeText")+"</button>":"");var buttonPanel=(showButtonPanel)?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(isRTL?controls:"")+(this._isInRange(inst,gotoDate)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery.datepicker._gotoToday(\'#'+inst.id+"');\">"+currentText+"</button>":"")+(isRTL?"":controls)+"</div>":"";var firstDay=parseInt(this._get(inst,"firstDay"),10);firstDay=(isNaN(firstDay)?0:firstDay);var dayNames=this._get(inst,"dayNames");var dayNamesShort=this._get(inst,"dayNamesShort");var dayNamesMin=this._get(inst,"dayNamesMin");var monthNames=this._get(inst,"monthNames");var monthNamesShort=this._get(inst,"monthNamesShort");var beforeShowDay=this._get(inst,"beforeShowDay");var showOtherMonths=this._get(inst,"showOtherMonths");var calculateWeek=this._get(inst,"calculateWeek")||this.iso8601Week;var endDate=inst.endDay?this._daylightSavingAdjust(new Date(inst.endYear,inst.endMonth,inst.endDay)):currentDate;var defaultDate=this._getDefaultDate(inst);var html="";for(var row=0;row<numMonths[0];row++){var group="";for(var col=0;col<numMonths[1];col++){var selectedDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,inst.selectedDay));var cornerClass=" ui-corner-all";var calender="";if(isMultiMonth){calender+='<div class="ui-datepicker-group ui-datepicker-group-';switch(col){case 0:calender+="first";cornerClass=" ui-corner-"+(isRTL?"right":"left");break;case numMonths[1]-1:calender+="last";cornerClass=" ui-corner-"+(isRTL?"left":"right");break;default:calender+="middle";cornerClass="";break}calender+='">'}calender+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+cornerClass+'">'+(/all|left/.test(cornerClass)&&row==0?(isRTL?next:prev):"")+(/all|right/.test(cornerClass)&&row==0?(isRTL?prev:next):"")+this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,row>0||col>0,monthNames,monthNamesShort)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var thead="";for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;thead+="<th"+((dow+firstDay+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+dayNames[day]+'">'+dayNamesMin[day]+"</span></th>"}calender+=thead+"</tr></thead><tbody>";var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear==inst.selectedYear&&drawMonth==inst.selectedMonth){inst.selectedDay=Math.min(inst.selectedDay,daysInMonth)}var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var numRows=(isMultiMonth?6:Math.ceil((leadDays+daysInMonth)/7));var printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays));for(var dRow=0;dRow<numRows;dRow++){calender+="<tr>";var tbody="";for(var dow=0;dow<7;dow++){var daySettings=(beforeShowDay?beforeShowDay.apply((inst.input?inst.input[0]:null),[printDate]):[true,""]);var otherMonth=(printDate.getMonth()!=drawMonth);var unselectable=otherMonth||!daySettings[0]||(minDate&&printDate<minDate)||(maxDate&&printDate>maxDate);tbody+='<td class="'+((dow+firstDay+6)%7>=5?" ui-datepicker-week-end":"")+(otherMonth?" ui-datepicker-other-month":"")+((printDate.getTime()==selectedDate.getTime()&&drawMonth==inst.selectedMonth&&inst._keyEvent)||(defaultDate.getTime()==printDate.getTime()&&defaultDate.getTime()==selectedDate.getTime())?" "+this._dayOverClass:"")+(unselectable?" "+this._unselectableClass+" ui-state-disabled":"")+(otherMonth&&!showOtherMonths?"":" "+daySettings[1]+(printDate.getTime()>=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" "+this._currentClass:"")+(printDate.getTime()==today.getTime()?" ui-datepicker-today":""))+'"'+((!otherMonth||showOtherMonths)&&daySettings[2]?' title="'+daySettings[2]+'"':"")+(unselectable?"":" onclick=\"DP_jQuery.datepicker._selectDay('#"+inst.id+"',"+drawMonth+","+drawYear+', this);return false;"')+">"+(otherMonth?(showOtherMonths?printDate.getDate():" "):(unselectable?'<span class="ui-state-default">'+printDate.getDate()+"</span>":'<a class="ui-state-default'+(printDate.getTime()==today.getTime()?" ui-state-highlight":"")+(printDate.getTime()>=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" ui-state-active":"")+'" href="#">'+printDate.getDate()+"</a>"))+"</td>";printDate.setDate(printDate.getDate()+1);printDate=this._daylightSavingAdjust(printDate)}calender+=tbody+"</tr>"}drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++}calender+="</tbody></table>"+(isMultiMonth?"</div>"+((numMonths[0]>0&&col==numMonths[1]-1)?'<div class="ui-datepicker-row-break"></div>':""):"");group+=calender}html+=group}html+=buttonPanel+($.browser.msie&&parseInt($.browser.version,10)<7&&!inst.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':"");inst._keyEvent=false;return html},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,secondary,monthNames,monthNamesShort){minDate=(inst.rangeStart&&minDate&&selectedDate<minDate?selectedDate:minDate);var changeMonth=this._get(inst,"changeMonth");var changeYear=this._get(inst,"changeYear");var showMonthAfterYear=this._get(inst,"showMonthAfterYear");var html='<div class="ui-datepicker-title">';var monthHtml="";if(secondary||!changeMonth){monthHtml+='<span class="ui-datepicker-month">'+monthNames[drawMonth]+"</span> "}else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);monthHtml+='<select class="ui-datepicker-month" onchange="DP_jQuery.datepicker._selectMonthYear(\'#'+inst.id+"', this, 'M');\" onclick=\"DP_jQuery.datepicker._clickMonthYear('#"+inst.id+"');\">";for(var month=0;month<12;month++){if((!inMinYear||month>=minDate.getMonth())&&(!inMaxYear||month<=maxDate.getMonth())){monthHtml+='<option value="'+month+'"'+(month==drawMonth?' selected="selected"':"")+">"+monthNamesShort[month]+"</option>"}}monthHtml+="</select>"}if(!showMonthAfterYear){html+=monthHtml+((secondary||changeMonth||changeYear)&&(!(changeMonth&&changeYear))?" ":"")}if(secondary||!changeYear){html+='<span class="ui-datepicker-year">'+drawYear+"</span>"}else{var years=this._get(inst,"yearRange").split(":");var year=0;var endYear=0;if(years.length!=2){year=drawYear-10;endYear=drawYear+10}else{if(years[0].charAt(0)=="+"||years[0].charAt(0)=="-"){year=drawYear+parseInt(years[0],10);endYear=drawYear+parseInt(years[1],10)}else{year=parseInt(years[0],10);endYear=parseInt(years[1],10)}}year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);html+='<select class="ui-datepicker-year" onchange="DP_jQuery.datepicker._selectMonthYear(\'#'+inst.id+"', this, 'Y');\" onclick=\"DP_jQuery.datepicker._clickMonthYear('#"+inst.id+"');\">";for(;year<=endYear;year++){html+='<option value="'+year+'"'+(year==drawYear?' selected="selected"':"")+">"+year+"</option>"}html+="</select>"}if(showMonthAfterYear){html+=(secondary||changeMonth||changeYear?" ":"")+monthHtml}html+="</div>";return html},_adjustInstDate:function(inst,offset,period){var year=inst.drawYear+(period=="Y"?offset:0);var month=inst.drawMonth+(period=="M"?offset:0);var day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+(period=="D"?offset:0);var date=this._daylightSavingAdjust(new Date(year,month,day));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();if(period=="M"||period=="Y"){this._notifyChange(inst)}},_notifyChange:function(inst){var onChange=this._get(inst,"onChangeMonthYear");if(onChange){onChange.apply((inst.input?inst.input[0]:null),[inst.selectedYear,inst.selectedMonth+1,inst])}},_getNumberOfMonths:function(inst){var numMonths=this._get(inst,"numberOfMonths");return(numMonths==null?[1,1]:(typeof numMonths=="number"?[1,numMonths]:numMonths))},_getMinMaxDate:function(inst,minMax,checkRange){var date=this._determineDate(this._get(inst,minMax+"Date"),null);return(!checkRange||!inst.rangeStart?date:(!date||inst.rangeStart>date?inst.rangeStart:date))},_getDaysInMonth:function(year,month){return 32-new Date(year,month,32).getDate()},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay()},_canAdjustMonth:function(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst);var date=this._daylightSavingAdjust(new Date(curYear,curMonth+(offset<0?offset:numMonths[1]),1));if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()))}return this._isInRange(inst,date)},_isInRange:function(inst,date){var newMinDate=(!inst.rangeStart?null:this._daylightSavingAdjust(new Date(inst.selectedYear,inst.selectedMonth,inst.selectedDay)));newMinDate=(newMinDate&&inst.rangeStart<newMinDate?inst.rangeStart:newMinDate);var minDate=newMinDate||this._getMinMaxDate(inst,"min");var maxDate=this._getMinMaxDate(inst,"max");return((!minDate||date>=minDate)&&(!maxDate||date<=maxDate))},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,"shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(inst,"dayNamesShort"),dayNames:this._get(inst,"dayNames"),monthNamesShort:this._get(inst,"monthNamesShort"),monthNames:this._get(inst,"monthNames")}},_formatDate:function(inst,day,month,year){if(!day){inst.currentDay=inst.selectedDay;inst.currentMonth=inst.selectedMonth;inst.currentYear=inst.selectedYear}var date=(day?(typeof day=="object"?day:this._daylightSavingAdjust(new Date(year,month,day))):this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return this.formatDate(this._get(inst,"dateFormat"),date,this._getFormatConfig(inst))}});function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null||props[name]==undefined){target[name]=props[name]}}return target}function isArray(a){return(a&&(($.browser.safari&&typeof a=="object"&&a.length)||(a.constructor&&a.constructor.toString().match(/\Array\(\)/))))}$.fn.datepicker=function(options){if(!$.datepicker.initialized){$(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv);$.datepicker.initialized=true}var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=="string"&&(options=="isDisabled"||options=="getDate")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}if(options=="option"&&arguments.length==2&&typeof arguments[1]=="string"){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}return this.each(function(){typeof options=="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options)})};$.datepicker=new Datepicker();$.datepicker.initialized=false;$.datepicker.uuid=new Date().getTime();$.datepicker.version="1.7.2";window.DP_jQuery=$})(jQuery);
\ No newline at end of file diff --git a/ui.datepicker.packed.js b/ui.datepicker.packed.js deleted file mode 100644 index 919cade2d..000000000 --- a/ui.datepicker.packed.js +++ /dev/null @@ -1,2 +0,0 @@ -eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(p($){c 2T="f";p 3Z(){b.7P=E;b.3Q=t;b.2y=[];b.3l=E;b.2S=E;b.5W="v-f-I";b.6f="v-f-1c";b.6h="v-f-3v";b.2w="v-f-4o";b.5Y="v-f-af";b.5B="v-f-3I";b.6e="v-f-4u";b.5v="v-f-49";b.4G="v-f-4O-H";b.6k=[];b.6k[""]={76:"ae",77:"ad 3s 4O h",74:"7U",75:"7U ac 7j",2M:"m;ab",72:"3t 3s 7T F",2N:"m;m;",73:"3t 3s 7T B",2L:"aal;",71:"3t 3s 3H F",2K:"l;l;",70:"3t 3s 3H B",3f:"a9",6Z:"3t 3s 4O F",1n:["a8","a7","a6","a5","7S","a4","a3","a2","a1","a0","9Z","9Y"],1Z:["9X","9W","9V","9U","7S","9T","9S","9R","9Q","9P","9O","9N"],6K:"3t a 7R F",6D:"3t a 7R B",6X:"9M",4d:"9L 9K 3s B",1v:["9J","9I","9H","9G","9F","9E","9D"],1z:["9C","9B","9A","9z","9y","9x","9w"],4K:["9v","9u","9t","9s","9r","9q","9p"],4L:"9o 4g 9n 9m 2F H",3d:"7Q 4g, M d",2X:"4U/3J/3k",1B:0,Z:"7Q a h",1I:E};b.1D={3r:"2P",1V:"69",62:{},2e:t,4v:"",2W:"...",3X:"",7N:E,47:1d,5E:E,4h:E,2I:E,3g:E,5C:E,6L:1d,6H:1d,44:E,6G:"-10:+10",4f:1d,3D:E,2C:E,4e:E,4I:b.4M,1F:"+10",15:E,6Y:b.3d,R:t,T:t,1j:"9l",4c:t,4s:t,2Q:t,6C:t,4q:t,6B:1,4P:0,2r:1,2q:12,1K:E,4j:" - ",4n:"",3N:""};$.4x(b.1D,b.6k[""]);b.O=$(\'<I u="\'+b.5W+\'" 46="6a: 7t;"></I>\')}$.4x(3Z.6q,{29:"9k",5L:p(){k(b.7P){9j.5L.2k("",5d)}},9i:p(z){3x(b.1D,z||{});r b},6n:p(n,z){c 3Y=t;1l(59 6v b.1D){c 58=n.9h("h:"+59);k(58){3Y=3Y||{};5O{3Y[59]=9g(58)}5M(7x){3Y[59]=58}}}c 1a=n.1a.4t();c 1c=(1a=="I"||1a=="2H");k(!n.u){n.u="7F"+(++b.5a)}c 8=b.6i($(n),1c);8.z=$.4x({},z||{},3Y||{});k(1a=="q"){b.7O(n,8)}P{k(1c){b.7I(n,8)}}},6i:p(n,1c){c u=n[0].u.5y(/([:\\[\\]\\.])/g,"\\\\\\\\$1");r{u:u,q:n,1u:0,1m:0,1q:0,G:0,J:0,1c:1c,O:(!1c?b.O:$(\'<I 16="\'+b.6f+\'"></I>\'))}},7O:p(n,8){c q=$(n);k(q.2R(b.29)){r}c 4v=b.l(8,"4v");c 1I=b.l(8,"1I");k(4v){q[1I?"7K":"7J"](\'<2H 16="\'+b.6h+\'">\'+4v+"</2H>")}c 3r=b.l(8,"3r");k(3r=="2P"||3r=="4D"){q.2P(b.3U)}k(3r=="3W"||3r=="4D"){c 2W=b.l(8,"2W");c 3X=b.l(8,"3X");c 4o=$(b.l(8,"7N")?$("<56/>").2o(b.2w).7M({5s:3X,7L:2W,4b:2W}):$(\'<3W 4r="3W"></3W>\').2o(b.2w).V(3X==""?2W:$("<56/>").7M({5s:3X,7L:2W,4b:2W})));q[1I?"7K":"7J"](4o);4o.9f(p(){k($.f.3l&&$.f.3O==n){$.f.2s()}P{$.f.3U(n)}r E})}q.2o(b.29).6g(b.54).7C(b.6d).57("7H.f",p(3P,2V,K){8.z[2V]=K}).57("7G.f",p(3P,2V){r b.l(8,2V)});$.3n(n,2T,8)},7I:p(n,8){c 6j=$(n);k(6j.2R(b.29)){r}6j.2o(b.29).3v(8.O).57("7H.f",p(3P,2V,K){8.z[2V]=K}).57("7G.f",p(3P,2V){r b.l(8,2V)});$.3n(n,2T,8);b.5G(8,b.5K(8));b.26(8)},9e:p(8){c 1i=b.3z(8);8.O.1E(1i[1]*$(".v-f",8.O[0]).1E())},9d:p(q,7D,2Q,z,2x){c 8=b.7E;k(!8){c u="7F"+(++b.5a);b.2g=$(\'<q 4r="5l" u="\'+u+\'" 2f="1" 46="1T: 4Z; 1x: -7m;"/>\');b.2g.6g(b.54);$("2l").3v(b.2g);8=b.7E=b.6i(b.2g,E);8.z={};$.3n(b.2g[0],2T,8)}3x(8.z,z||{});b.2g.3i(7D);b.1O=(2x?(2x.1f?2x:[2x.9c,2x.9b]):t);k(!b.1O){c 52=53.7o||1e.1W.67||1e.2l.67;c 51=53.7n||1e.1W.66||1e.2l.66;c 3q=1e.1W.3T||1e.2l.3T;c 3p=1e.1W.3S||1e.2l.3S;b.1O=[(52/2)-2Z+3q,(51/2)-9a+3p]}b.2g.2a("1N",b.1O[0]+"2U").2a("1x",b.1O[1]+"2U");8.z.2Q=2Q;b.2S=1d;b.O.2o(b.5Y);b.3U(b.2g[0]);k($.4p){$.4p(b.O)}$.3n(b.2g[0],2T,8);r b},99:p(n){c $n=$(n);k(!$n.2R(b.29)){r}c 1a=n.1a.4t();$.98(n,2T);k(1a=="q"){$n.3V("."+b.6h).3R().3F().3V("."+b.2w).3R().3F().3b(b.29).4Y("2P",b.3U).4Y("6g",b.54).4Y("7C",b.6d)}P{k(1a=="I"||1a=="2H"){$n.3b(b.29).7s()}}},97:p(n){c $n=$(n);k(!$n.2R(b.29)){r}c 1a=n.1a.4t();k(1a=="q"){n.4u=E;$n.3V("3W."+b.2w).3u(p(){b.4u=E}).3F().3V("56."+b.2w).2a({7B:"1.0",7A:""})}P{k(1a=="I"||1a=="2H"){$n.7z("."+b.6e).3R()}}b.2y=$.7y(b.2y,p(K){r(K==n?t:K)})},96:p(n){c $n=$(n);k(!$n.2R(b.29)){r}c 1a=n.1a.4t();k(1a=="q"){n.4u=1d;$n.3V("3W."+b.2w).3u(p(){b.4u=1d}).3F().3V("56."+b.2w).2a({7B:"0.5",7A:"4l"})}P{k(1a=="I"||1a=="2H"){c 1c=$n.7z("."+b.6f);c L=1c.L();c 55={1N:0,1x:0};1c.5X().3u(p(){k($(b).2a("1T")=="95"){55=$(b).L();r E}});$n.94(\'<I 16="\'+b.6e+\'" 46="\'+($.2c.4C?"93-92: 91; ":"")+"1E: "+1c.1E()+"2U; 2h: "+1c.2h()+"2U; 1N: "+(L.1N-55.1N)+"2U; 1x: "+(L.1x-55.1x)+\'2U;"></I>\')}}b.2y=$.7y(b.2y,p(K){r(K==n?t:K)});b.2y[b.2y.1f]=n},7v:p(n){k(!n){r E}1l(c i=0;i<b.2y.1f;i++){k(b.2y[i]==n){r 1d}}r E},1r:p(n){5O{r $.3n(n,2T)}5M(7x){3K"7i 90 3n 1l b f"}},8Z:p(n,1k,K){c z=1k||{};k(1X 1k=="41"){z={};z[1k]=K}c 8=b.1r(n);k(8){k(b.3Q==8){b.2s(t)}3x(8.z,z);c h=x A();3x(8,{1g:t,1Q:t,24:t,19:t,1u:h.S(),1m:h.X(),1q:h.Q(),1h:h.S(),1t:h.X(),1p:h.Q(),G:h.X(),J:h.Q()});b.26(8)}},8Y:p(n){c 8=b.1r(n);k(8){b.26(8)}},8X:p(n,h,23){c 8=b.1r(n);k(8){b.5G(8,h,23);b.26(8);b.5V(8)}},8W:p(n){c 8=b.1r(n);k(8&&!8.1c){b.5P(8)}r(8?b.5F(8):t)},54:p(e){c 8=$.f.1r(e.n);c 2i=1d;k($.f.3l){4k(e.6c){C 9:$.f.2s(t,"");N;C 13:$.f.5u(e.n,8.1m,8.1q,$("1A.v-f-3E-3c-2E",8.O)[0]);r E;N;C 27:$.f.2s(t,$.f.l(8,"1j"));N;C 33:$.f.1J(e.n,(e.1s?-$.f.l(8,"2q"):-$.f.l(8,"2r")),"M");N;C 34:$.f.1J(e.n,(e.1s?+$.f.l(8,"2q"):+$.f.l(8,"2r")),"M");N;C 35:k(e.1s){$.f.5D(e.n)}2i=e.1s;N;C 36:k(e.1s){$.f.5z(e.n)}2i=e.1s;N;C 37:k(e.1s){$.f.1J(e.n,-1,"D")}2i=e.1s;N;C 38:k(e.1s){$.f.1J(e.n,-7,"D")}2i=e.1s;N;C 39:k(e.1s){$.f.1J(e.n,+1,"D")}2i=e.1s;N;C 40:k(e.1s){$.f.1J(e.n,+7,"D")}2i=e.1s;N;4l:2i=E}}P{k(e.6c==36&&e.1s){$.f.3U(b)}P{2i=E}}k(2i){e.8V();e.8U()}},6d:p(e){c 8=$.f.1r(e.n);c 2t=$.f.7e($.f.l(8,"2X"));c 6b=8T.8S(e.7w==5f?e.6c:e.7w);r e.1s||(6b<" "||!2t||2t.6W(6b)>-1)},3U:p(q){q=q.n||q;k(q.1a.4t()!="q"){q=$("q",q.8R)[0]}k($.f.7v(q)||$.f.3O==q){r}c 8=$.f.1r(q);c 4s=$.f.l(8,"4s");3x(8.z,(4s?4s.2k(q,[q,8]):{}));$.f.2s(t,"");$.f.3O=q;$.f.5P(8);k($.f.2S){q.K=""}k(!$.f.1O){$.f.1O=$.f.64(q);$.f.1O[1]+=q.8Q}c 1y=E;$(q).5X().3u(p(){1y|=$(b).2a("1T")=="7u";r!1y});k(1y&&$.2c.65){$.f.1O[0]-=1e.1W.3T;$.f.1O[1]-=1e.1W.3S}c L={1N:$.f.1O[0],1x:$.f.1O[1]};$.f.1O=t;8.1g=t;8.O.2a({1T:"4Z",6a:"8P",1x:"-8O"});$.f.26(8);8.O.1E($.f.3z(8)[1]*$(".v-f",8.O[0])[0].8N);L=$.f.7p(8,L,1y);8.O.2a({1T:($.f.2S&&$.4p?"8M":(1y?"7u":"4Z")),6a:"7t",1N:L.1N+"2U",1x:L.1x+"2U"});k(!8.1c){c 1V=$.f.l(8,"1V")||"69";c 1j=$.f.l(8,"1j");c 3m=p(){$.f.3l=1d;k($.2c.4C&&1G($.2c.6N,10)<7){$("4B.v-f-5r").2a({1E:8.O.1E()+4,2h:8.O.2h()+4})}};k($.50&&$.50[1V]){8.O.69(1V,$.f.l(8,"62"),1j,3m)}P{8.O[1V](1j,3m)}k(1j==""){3m()}k(8.q[0].4r!="63"){8.q[0].2P()}$.f.3Q=8}},26:p(8){c 68={1E:8.O.1E()+4,2h:8.O.2h()+4};8.O.7s().3v(b.78(8)).8L("4B.v-f-5r").2a({1E:68.1E,2h:68.2h});c 1i=b.3z(8);8.O[(1i[0]!=1||1i[1]!=1?"7r":"3R")+"7q"]("v-f-8K");8.O[(b.l(8,"1I")?"7r":"3R")+"7q"]("v-f-8J");k(8.q&&8.q[0].4r!="63"){$(8.q[0]).2P()}},7p:p(8,L,1y){c 2x=8.q?b.64(8.q[0]):t;c 52=53.7o||1e.1W.67;c 51=53.7n||1e.1W.66;c 3q=1e.1W.3T||1e.2l.3T;c 3p=1e.1W.3S||1e.2l.3S;k(b.l(8,"1I")||(L.1N+8.O.1E()-3q)>52){L.1N=21.2z((1y?0:3q),2x[0]+(8.q?8.q.1E():0)-(1y?3q:0)-8.O.1E()-(1y&&$.2c.65?1e.1W.3T:0))}P{L.1N-=(1y?3q:0)}k((L.1x+8.O.2h()-3p)>51){L.1x=21.2z((1y?0:3p),2x[1]-(1y?3p:0)-(b.2S?0:8.O.2h())-(1y&&$.2c.65?1e.1W.3S:0))}P{L.1x-=(1y?3p:0)}r L},64:p(3o){3h(3o&&(3o.4r=="63"||3o.8I!=1)){3o=3o.8H}c 1T=$(3o).L();r[1T.1N,1T.1x]},2s:p(q,1j){c 8=b.3Q;k(!8||(q&&8!=$.3n(q,2T))){r}c 1K=b.l(8,"1K");k(1K&&8.2v){b.4W("#"+8.u,b.2Y(8,8.1h,8.1t,8.1p))}8.2v=E;k(b.3l){1j=(1j!=t?1j:b.l(8,"1j"));c 1V=b.l(8,"1V");c 3m=p(){$.f.5Z(8)};k(1j!=""&&$.50&&$.50[1V]){8.O.61(1V,$.f.l(8,"62"),1j,3m)}P{8.O[(1j==""?"61":(1V=="8G"?"8F":(1V=="8E"?"8D":"61")))](1j,3m)}k(1j==""){b.5Z(8)}c 4q=b.l(8,"4q");k(4q){4q.2k((8.q?8.q[0]:t),[(8.q?8.q.3i():""),8])}b.3l=E;b.3O=t;8.z.3I=t;k(b.2S){b.2g.2a({1T:"4Z",1N:"0",1x:"-7m"});k($.4p){$.8C();$("2l").3v(b.O)}}b.2S=E}b.3Q=t},5Z:p(8){8.O.3b(b.5Y).4Y(".v-f");$("."+b.5B,8.O).3R()},6s:p(3P){k(!$.f.3Q){r}c $n=$(3P.n);k(($n.5X("#"+$.f.5W).1f==0)&&!$n.2R($.f.29)&&!$n.2R($.f.2w)&&$.f.3l&&!($.f.2S&&$.4p)){$.f.2s(t,"")}},1J:p(u,L,20){c n=$(u);c 8=b.1r(n[0]);b.4z(8,L,20);b.26(8)},5z:p(u){c n=$(u);c 8=b.1r(n[0]);k(b.l(8,"5C")&&8.1h){8.1u=8.1h;8.G=8.1m=8.1t;8.J=8.1q=8.1p}P{c h=x A();8.1u=h.S();8.G=8.1m=h.X();8.J=8.1q=h.Q()}b.43(8);b.1J(n)},5o:p(u,3a,20){c n=$(u);c 8=b.1r(n[0]);8.4X=E;8["45"+(20=="M"?"7l":"7k")]=8["8B"+(20=="M"?"7l":"7k")]=1G(3a.2j[3a.8A].K,10);b.43(8);b.1J(n)},5n:p(u){c n=$(u);c 8=b.1r(n[0]);k(8.q&&8.4X&&!$.2c.4C){8.q[0].2P()}8.4X=!8.4X},6V:p(u,H){c n=$(u);c 8=b.1r(n[0]);8.z.1B=H;b.26(8)},5u:p(u,F,B,1A){k($(1A).2R(b.5v)){r}c n=$(u);c 8=b.1r(n[0]);c 1K=b.l(8,"1K");k(1K){8.2v=!8.2v;k(8.2v){$(".v-f 1A",8.O).3b(b.4G);$(1A).2o(b.4G)}}8.1u=8.1h=$("a",1A).V();8.1m=8.1t=F;8.1q=8.1p=B;k(8.2v){8.1Q=8.24=8.19=t}P{k(1K){8.1Q=8.1h;8.24=8.1t;8.19=8.1p}}b.4W(u,b.2Y(8,8.1h,8.1t,8.1p));k(8.2v){8.1g=x A(8.1p,8.1t,8.1h);b.26(8)}P{k(1K){8.1u=8.1h=8.1g.S();8.1m=8.1t=8.1g.X();8.1q=8.1p=8.1g.Q();8.1g=t;k(8.1c){b.26(8)}}}},5D:p(u){c n=$(u);c 8=b.1r(n[0]);k(b.l(8,"5E")){r}8.2v=E;8.1Q=8.24=8.19=8.1g=t;b.4W(n,"")},4W:p(u,1U){c n=$(u);c 8=b.1r(n[0]);1U=(1U!=t?1U:b.2Y(8));k(b.l(8,"1K")&&1U){1U=(8.1g?b.2Y(8,8.1g):1U)+b.l(8,"4j")+1U}k(8.q){8.q.3i(1U)}b.5V(8);c 2Q=b.l(8,"2Q");k(2Q){2Q.2k((8.q?8.q[0]:t),[1U,8])}P{k(8.q){8.q.4o("7j")}}k(8.1c){b.26(8)}P{k(!8.2v){b.2s(t,b.l(8,"1j"));b.3O=8.q[0];k(1X(8.q[0])!="4w"){8.q[0].2P()}b.3O=t}}},5V:p(8){c 4n=b.l(8,"4n");k(4n){c 3N=b.l(8,"3N");c h=b.5F(8);1U=(6u(h)?(!h[0]&&!h[1]?"":b.1Y(3N,h[0],b.1P(8))+b.l(8,"4j")+b.1Y(3N,h[1]||h[0],b.1P(8))):b.1Y(3N,h,b.1P(8)));$(4n).3u(p(){$(b).3i(1U)})}},8z:p(h){c H=h.3A();r[(H>0&&H<6),""]},4M:p(h){c 25=x A(h.Q(),h.X(),h.S(),(h.8y()/-60));c 3M=x A(25.Q(),1-1,4);c 1B=3M.3A()||7;3M.4y(3M.S()+1-1B);k(1B<4&&25<3M){25.4y(25.S()-3);r $.f.4M(25)}P{k(25>x A(25.Q(),12-1,28)){1B=x A(25.Q()+1,1-1,4).3A()||7;k(1B>4&&(25.3A()||7)<1B-3){r 1}}}r 21.8x(((25-3M)/8w)/7)+1},3d:p(h,8){r $.f.1Y($.f.l(8,"3d"),h,$.f.1P(8))},5N:p(18,K,z){k(18==t||K==t){3K"5H 5d"}K=(1X K=="4w"?K.5e():K+"");k(K==""){r t}c 1F=(z?z.1F:t)||b.1D.1F;c 1z=(z?z.1z:t)||b.1D.1z;c 1v=(z?z.1v:t)||b.1D.1v;c 1Z=(z?z.1Z:t)||b.1D.1Z;c 1n=(z?z.1n:t)||b.1D.1n;c B=-1;c F=-1;c H=-1;c 3j=-1;c 1L=E;c 1M=p(1o){c 1C=(U+1<18.1f&&18.1b(U+1)==1o);k(1C){U++}r 1C};c 3L=p(1o){1M(1o);c 5U=(1o=="@"?14:(1o=="y"?4:(1o=="o"?3:2)));c 2f=5U;c 2u=0;3h(2f>0&&1S<K.1f&&K.1b(1S)>="0"&&K.1b(1S)<="9"){2u=2u*10+1G(K.1b(1S++),10);2f--}k(2f==5U){3K"7i 5i 5T 1T "+1S}r 2u};c 5S=p(1o,4S,4T){c 4m=(1M(1o)?4T:4S);c 2f=0;1l(c j=0;j<4m.1f;j++){2f=21.2z(2f,4m[j].1f)}c 1k="";c 7h=1S;3h(2f>0&&1S<K.1f){1k+=K.1b(1S++);1l(c i=0;i<4m.1f;i++){k(1k==4m[i]){r i+1}}2f--}3K"8v 1k 5T 1T "+7h};c 4V=p(){k(K.1b(1S)!=18.1b(U)){3K"8u 1L 5T 1T "+1S}1S++};c 1S=0;1l(c U=0;U<18.1f;U++){k(1L){k(18.1b(U)=="\'"&&!1M("\'")){1L=E}P{4V()}}P{4k(18.1b(U)){C"d":H=3L("d");N;C"D":5S("D",1z,1v);N;C"o":3j=3L("o");N;C"m":F=3L("m");N;C"M":F=5S("M",1Z,1n);N;C"y":B=3L("y");N;C"@":c h=x A(3L("@"));B=h.Q();F=h.X()+1;H=h.S();N;C"\'":k(1M("\'")){4V()}P{1L=1d}N;4l:4V()}}}k(B<2Z){B+=x A().Q()-x A().Q()%2Z+(B<=1F?0:-2Z)}k(3j>-1){F=1;H=3j;8t{c 5R=b.30(B,F-1);k(H<=5R){N}F++;H-=5R}3h(1d)}c h=x A(B,F-1,H);k(h.Q()!=B||h.X()+1!=F||h.S()!=H){3K"5H h"}r h},8s:"3k-4U-3J",8r:"D, 3J M 3k",8q:"3k-4U-3J",8p:"D, d M y",8o:"4g, 3J-M-y",8n:"D, d M y",8m:"D, d M 3k",8l:"D, d M 3k",8k:"D, d M y",8j:"@",8i:"3k-4U-3J",1Y:p(18,h,z){k(!h){r""}c 1z=(z?z.1z:t)||b.1D.1z;c 1v=(z?z.1v:t)||b.1D.1v;c 1Z=(z?z.1Z:t)||b.1D.1Z;c 1n=(z?z.1n:t)||b.1D.1n;c 1M=p(1o){c 1C=(U+1<18.1f&&18.1b(U+1)==1o);k(1C){U++}r 1C};c 4R=p(1o,K,7g){c 2u=""+K;k(1M(1o)){3h(2u.1f<7g){2u="0"+2u}}r 2u};c 5Q=p(1o,K,4S,4T){r(1M(1o)?4T[K]:4S[K])};c 1R="";c 1L=E;k(h){1l(c U=0;U<18.1f;U++){k(1L){k(18.1b(U)=="\'"&&!1M("\'")){1L=E}P{1R+=18.1b(U)}}P{4k(18.1b(U)){C"d":1R+=4R("d",h.S(),2);N;C"D":1R+=5Q("D",h.3A(),1z,1v);N;C"o":c 3j=h.S();1l(c m=h.X()-1;m>=0;m--){3j+=b.30(h.Q(),m)}1R+=4R("o",3j,3);N;C"m":1R+=4R("m",h.X()+1,2);N;C"M":1R+=5Q("M",h.X(),1Z,1n);N;C"y":1R+=(1M("y")?h.Q():(h.7f()%2Z<10?"0":"")+h.7f()%2Z);N;C"@":1R+=h.2b();N;C"\'":k(1M("\'")){1R+="\'"}P{1L=1d}N;4l:1R+=18.1b(U)}}}}r 1R},7e:p(18){c 2t="";c 1L=E;1l(c U=0;U<18.1f;U++){k(1L){k(18.1b(U)=="\'"&&!1M("\'")){1L=E}P{2t+=18.1b(U)}}P{4k(18.1b(U)){C"d":C"m":C"y":C"@":2t+="8h";N;C"D":C"M":r t;C"\'":k(1M("\'")){2t+="\'"}P{1L=1d}N;4l:2t+=18.1b(U)}}}r 2t},l:p(8,1k){r 8.z[1k]!==5f?8.z[1k]:b.1D[1k]},5P:p(8){c 2X=b.l(8,"2X");c 2O=8.q?8.q.3i().6F(b.l(8,"4j")):t;8.1Q=8.24=8.19=t;c h=2e=b.5K(8);k(2O.1f>0){c z=b.1P(8);k(2O.1f>1){h=b.5N(2X,2O[1],z)||2e;8.1Q=h.S();8.24=h.X();8.19=h.Q()}5O{h=b.5N(2X,2O[0],z)||2e}5M(e){b.5L(e);h=2e}}8.1u=h.S();8.G=8.1m=h.X();8.J=8.1q=h.Q();8.1h=(2O[0]?h.S():0);8.1t=(2O[0]?h.X():0);8.1p=(2O[0]?h.Q():0);b.4z(8)},5K:p(8){c h=b.42(b.l(8,"2e"),x A());c R=b.2m(8,"2n",1d);c T=b.2m(8,"2z");h=(R&&h<R?R:h);h=(T&&h>T?T:h);r h},42:p(h,2e){c 7b=p(L){c h=x A();h.6R(h.6Q()+L);r h};c 7c=p(L,5J){c h=x A();c B=h.Q();c F=h.X();c H=h.S();c 5I=/([+-]?[0-9]+)\\s*(d|D|w|W|m|M|y|Y)?/g;c 1C=5I.7d(L);3h(1C){4k(1C[2]||"d"){C"d":C"D":H+=1G(1C[1],10);N;C"w":C"W":H+=1G(1C[1],10)*7;N;C"m":C"M":F+=1G(1C[1],10);H=21.2n(H,5J(B,F));N;C"y":C"Y":B+=1G(1C[1],10);H=21.2n(H,5J(B,F));N}1C=5I.7d(L)}r x A(B,F,H)};h=(h==t?2e:(1X h=="41"?7c(h,b.30):(1X h=="5i"?(8g(h)?2e:7b(h)):h)));r(h&&h.5e()=="5H A"?2e:h)},5G:p(8,h,23){c 2B=!(h);c 7a=8.1m;c 79=8.1q;h=b.42(h,x A());8.1u=8.1h=h.S();8.G=8.1m=8.1t=h.X();8.J=8.1q=8.1p=h.Q();k(b.l(8,"1K")){k(23){23=b.42(23,t);8.1Q=23.S();8.24=23.X();8.19=23.Q()}P{8.1Q=8.1h;8.24=8.1t;8.19=8.1p}}k(7a!=8.1m||79!=8.1q){b.43(8)}b.4z(8);k(8.q){8.q.3i(2B?"":b.2Y(8)+(!b.l(8,"1K")?"":b.l(8,"4j")+b.2Y(8,8.1Q,8.24,8.19)))}},5F:p(8){c 4Q=(!8.1p||(8.q&&8.q.3i()=="")?t:x A(8.1p,8.1t,8.1h));k(b.l(8,"1K")){r[8.1g||4Q,(!8.19?8.1g||4Q:x A(8.19,8.24,8.1Q))]}P{r 4Q}},78:p(8){c 2G=x A();2G=x A(2G.Q(),2G.X(),2G.S());c 15=b.l(8,"15");c Z=b.l(8,"Z")||"q;";c 1I=b.l(8,"1I");c 2B=(b.l(8,"5E")?"":\'<I 16="v-f-2B"><a 22="17.f.5D(\\\'#\'+8.u+"\');\\""+b.1H(15,8.u,b.l(8,"77"),Z)+">"+b.l(8,"76")+"</a></I>");c 5t=\'<I 16="v-f-8f">\'+(1I?"":2B)+\'<I 16="v-f-8e"><a 22="17.f.2s();"\'+b.1H(15,8.u,b.l(8,"75"),Z)+">"+b.l(8,"74")+"</a></I>"+(1I?2B:"")+"</I>";c 3I=b.l(8,"3I");c 47=b.l(8,"47");c 4h=b.l(8,"4h");c 2I=b.l(8,"2I");c 3g=b.l(8,"3g");c 1i=b.3z(8);c 4P=b.l(8,"4P");c 2r=b.l(8,"2r");c 2q=b.l(8,"2q");c 6T=(1i[0]!=1||1i[1]!=1);c 4H=(!8.1h?x A(8d,9,9):x A(8.1p,8.1t,8.1h));c R=b.2m(8,"2n",1d);c T=b.2m(8,"2z");c G=8.G-4P;c J=8.J;k(G<0){G+=12;J--}k(T){c 4i=x A(T.Q(),T.X()-1i[1]+1,T.S());4i=(R&&4i<R?R:4i);3h(x A(J,G,1)>4i){G--;k(G<0){G=11;J--}}}c 2M=b.l(8,"2M");2M=(!2I?2M:b.1Y(2M,x A(J,G-2r,1),b.1P(8)));c 2N=(3g?b.l(8,"2N"):"");2N=(!2I?2N:b.1Y(2N,x A(J,G-2q,1),b.1P(8)));c 4N=\'<I 16="v-f-4N">\'+(b.5h(8,-1,J,G)?(3g?"<a 22=\\"17.f.1J(\'#"+8.u+"\', -"+2q+", \'M\');\\""+b.1H(15,8.u,b.l(8,"73"),Z)+">"+2N+"</a>":"")+"<a 22=\\"17.f.1J(\'#"+8.u+"\', -"+2r+", \'M\');\\""+b.1H(15,8.u,b.l(8,"72"),Z)+">"+2M+"</a>":(4h?"":"<2J>"+2N+"</2J><2J>"+2M+"</2J>"))+"</I>";c 2L=b.l(8,"2L");2L=(!2I?2L:b.1Y(2L,x A(J,G+2r,1),b.1P(8)));c 2K=(3g?b.l(8,"2K"):"");2K=(!2I?2K:b.1Y(2K,x A(J,G+2q,1),b.1P(8)));c 3H=\'<I 16="v-f-3H">\'+(b.5h(8,+1,J,G)?"<a 22=\\"17.f.1J(\'#"+8.u+"\', +"+2r+", \'M\');\\""+b.1H(15,8.u,b.l(8,"71"),Z)+">"+2L+"</a>"+(3g?"<a 22=\\"17.f.1J(\'#"+8.u+"\', +"+2q+", \'M\');\\""+b.1H(15,8.u,b.l(8,"70"),Z)+">"+2K+"</a>":""):(4h?"":"<2J>"+2L+"</2J><2J>"+2K+"</2J>"))+"</I>";c 3f=b.l(8,"3f");c 5A=(b.l(8,"5C")&&8.1h?4H:2G);3f=(!2I?3f:b.1Y(3f,5A,b.1P(8)));c V=(3I?\'<I 16="\'+b.5B+\'">\'+3I+"</I>":"")+(47&&!8.1c?5t:"")+\'<I 16="v-f-8c">\'+(1I?3H:4N)+(b.5g(8,5A)?\'<I 16="v-f-4O"><a 22="17.f.5z(\\\'#\'+8.u+"\');\\""+b.1H(15,8.u,b.l(8,"6Z"),Z)+">"+3f+"</a></I>":"")+(1I?4N:3H)+"</I>";c 1B=b.l(8,"1B");c 4f=b.l(8,"4f");c 1v=b.l(8,"1v");c 1z=b.l(8,"1z");c 4K=b.l(8,"4K");c 1n=b.l(8,"1n");c 4c=b.l(8,"4c");c 3D=b.l(8,"3D");c 2C=b.l(8,"2C");c 4e=b.l(8,"4e");c 4I=b.l(8,"4I")||b.4M;c 4d=b.l(8,"4d");c 2d=(15?b.l(8,"4L")||Z:"");c 3d=b.l(8,"6Y")||b.3d;c 23=8.1Q?x A(8.19,8.24,8.1Q):4H;1l(c 3e=0;3e<1i[0];3e++){1l(c 3G=0;3G<1i[1];3G++){c 3B=x A(J,G,8.1u);V+=\'<I 16="v-f-8b-F\'+(3G==0?" v-f-x-3e":"")+\'">\'+b.6M(8,G,J,R,T,3B,3e>0||3G>0,15,Z,1n)+\'<6O 16="v-f" 8a="0" 89="0"><6U><4E 16="v-f-4b-3e">\'+(4e?"<1A"+b.1H(15,8.u,4d,Z)+">"+b.l(8,"6X")+"</1A>":"");1l(c 2p=0;2p<7;2p++){c H=(2p+1B)%7;c 4L=(2d.6W("4g")>-1?2d.5y(/4g/,1v[H]):2d.5y(/D/,1z[H]));V+="<1A"+((2p+1B+6)%7>=5?\' 16="v-f-2F-3F-3c"\':"")+">"+(!4f?"<2H":"<a 22=\\"17.f.6V(\'#"+8.u+"\', "+H+\');"\')+b.1H(15,8.u,4L,Z)+\' 4b="\'+1v[H]+\'">\'+4K[H]+(4f?"</a>":"</2H>")+"</1A>"}V+="</4E></6U><6P>";c 5x=b.30(J,G);k(J==8.1q&&G==8.1m){8.1u=21.2n(8.1u,5x)}c 4J=(b.6y(J,G)-1B+7)%7;c 48=x A(J,G,1-4J);c 3C=x A(J,G,1-4J);c 1w=3C;c 6S=(6T?6:21.88((4J+5x)/7));1l(c 5w=0;5w<6S;5w++){V+=\'<4E 16="v-f-3E-3e">\'+(4e?\'<1A 16="v-f-2F-3G"\'+b.1H(15,8.u,4d,Z)+">"+4I(1w)+"</1A>":"");1l(c 2p=0;2p<7;2p++){c 4a=(4c?4c.2k((8.q?8.q[0]:t),[1w]):[1d,""]);c 2D=(1w.X()!=G);c 49=2D||!4a[0]||(R&&1w<R)||(T&&1w>T);V+=\'<1A 16="v-f-3E-3c\'+((2p+1B+6)%7>=5?" v-f-2F-3F-3c":"")+(2D?" v-f-87-F":"")+(1w.2b()==3B.2b()&&G==8.1m?" v-f-3E-3c-2E":"")+(49?" "+b.5v:"")+(2D&&!2C?"":" "+4a[1]+(1w.2b()>=4H.2b()&&1w.2b()<=23.2b()?" "+b.4G:"")+(1w.2b()==2G.2b()?" v-f-2G":""))+\'"\'+((!2D||2C)&&4a[2]?\' 4b="\'+4a[2]+\'"\':"")+(49?(3D?" 5m=\\"17(b).4F().2o(\'v-f-2F-2E\');\\" 5k=\\"17(b).4F().3b(\'v-f-2F-2E\');\\"":""):" 5m=\\"17(b).2o(\'v-f-3E-3c-2E\')"+(3D?".4F().2o(\'v-f-2F-2E\')":"")+";"+(!15||(2D&&!2C)?"":"17(\'#v-f-2d-"+8.u+"\').V(\'"+(3d.2k((8.q?8.q[0]:t),[1w,8])||Z)+"\');")+"\\" 5k=\\"17(b).3b(\'v-f-3E-3c-2E\')"+(3D?".4F().3b(\'v-f-2F-2E\')":"")+";"+(!15||(2D&&!2C)?"":"17(\'#v-f-2d-"+8.u+"\').V(\'"+Z+"\');")+\'" 22="17.f.5u(\\\'#\'+8.u+"\',"+G+","+J+\', b);"\')+">"+(2D?(2C?1w.S():"q;"):(49?1w.S():"<a>"+1w.S()+"</a>"))+"</1A>";48.4y(48.S()+1);3C.6R(3C.6Q()+1);1w=(48>3C?48:3C)}V+="</4E>"}G++;k(G>11){G=0;J++}V+="</6P></6O></I>"}}V+=(15?\'<I 46="2B: 4D;"></I><I u="v-f-2d-\'+8.u+\'" 16="v-f-2d">\'+Z+"</I>":"")+(!47&&!8.1c?5t:"")+\'<I 46="2B: 4D;"></I>\'+($.2c.4C&&1G($.2c.6N,10)<7&&!8.1c?\'<4B 5s="86:E;" 16="v-f-5r"></4B>\':"");r V},6M:p(8,G,J,R,T,3B,5p,15,Z,1n){R=(8.1g&&R&&3B<R?3B:R);c 44=b.l(8,"44");c V=\'<I 16="v-f-85">\';c 31="";k(5p||!b.l(8,"6L")){31+=1n[G]+"q;"}P{c 6J=(R&&R.Q()==J);c 6I=(T&&T.Q()==J);31+=\'<3a 16="v-f-x-F" 6E="17.f.5o(\\\'#\'+8.u+"\', b, \'M\');\\" 22=\\"17.f.5n(\'#"+8.u+"\');\\""+b.1H(15,8.u,b.l(8,"6K"),Z)+">";1l(c F=0;F<12;F++){k((!6J||F>=R.X())&&(!6I||F<=T.X())){31+=\'<4A K="\'+F+\'"\'+(F==G?\' 45="45"\':"")+">"+1n[F]+"</4A>"}}31+="</3a>"}k(!44){V+=31}k(5p||!b.l(8,"6H")){V+=J}P{c 2A=b.l(8,"6G").6F(":");c B=0;c 19=0;k(2A.1f!=2){B=J-10;19=J+10}P{k(2A[0].1b(0)=="+"||2A[0].1b(0)=="-"){B=19=x A().Q();B+=1G(2A[0],10);19+=1G(2A[1],10)}P{B=1G(2A[0],10);19=1G(2A[1],10)}}B=(R?21.2z(B,R.Q()):B);19=(T?21.2n(19,T.Q()):19);V+=\'<3a 16="v-f-x-B" 6E="17.f.5o(\\\'#\'+8.u+"\', b, \'Y\');\\" 22=\\"17.f.5n(\'#"+8.u+"\');\\""+b.1H(15,8.u,b.l(8,"6D"),Z)+">";1l(;B<=19;B++){V+=\'<4A K="\'+B+\'"\'+(B==J?\' 45="45"\':"")+">"+B+"</4A>"}V+="</3a>"}k(44){V+=31}V+="</I>";r V},1H:p(15,u,5l,Z){r(15?" 5m=\\"17(\'#v-f-2d-"+u+"\').V(\'"+(5l||Z)+"\');\\" 5k=\\"17(\'#v-f-2d-"+u+"\').V(\'"+Z+"\');\\"":"")},4z:p(8,L,20){c B=8.J+(20=="Y"?L:0);c F=8.G+(20=="M"?L:0);c H=21.2n(8.1u,b.30(B,F))+(20=="D"?L:0);c h=x A(B,F,H);c R=b.2m(8,"2n",1d);c T=b.2m(8,"2z");h=(R&&h<R?R:h);h=(T&&h>T?T:h);8.1u=h.S();8.G=8.1m=h.X();8.J=8.1q=h.Q();k(20=="M"||20=="Y"){b.43(8)}},43:p(8){c 5j=b.l(8,"6C");k(5j){5j.2k((8.q?8.q[0]:t),[8.1q,8.1m+1,8])}},3z:p(8){c 1i=b.l(8,"6B");r(1i==t?[1,1]:(1X 1i=="5i"?[1,1i]:1i))},2m:p(8,6A,6z){c h=b.42(b.l(8,6A+"A"),t);k(h){h.84(0);h.83(0);h.82(0);h.81(0)}r(!6z||!8.1g?h:(!h||8.1g>h?8.1g:h))},30:p(B,F){r 32-x A(B,F,32).S()},6y:p(B,F){r x A(B,F,1).3A()},5h:p(8,L,6x,6w){c 1i=b.3z(8);c h=x A(6x,6w+(L<0?L:1i[1]),1);k(L<0){h.4y(b.30(h.Q(),h.X()))}r b.5g(8,h)},5g:p(8,h){c 3y=(!8.1g?t:x A(8.1q,8.1m,8.1u));3y=(3y&&8.1g<3y?8.1g:3y);c R=3y||b.2m(8,"2n");c T=b.2m(8,"2z");r((!R||h>=R)&&(!T||h<=T))},1P:p(8){c 1F=b.l(8,"1F");1F=(1X 1F!="41"?1F:x A().Q()%2Z+1G(1F,10));r{1F:1F,1z:b.l(8,"1z"),1v:b.l(8,"1v"),1Z:b.l(8,"1Z"),1n:b.l(8,"1n")}},2Y:p(8,H,F,B){k(!H){8.1h=8.1u;8.1t=8.1m;8.1p=8.1q}c h=(H?(1X H=="4w"?H:x A(B,F,H)):x A(8.1p,8.1t,8.1h));r b.1Y(b.l(8,"2X"),h,b.1P(8))}});p 3x(n,3w){$.4x(n,3w);1l(c 1k 6v 3w){k(3w[1k]==t||3w[1k]==5f){n[1k]=3w[1k]}}r n}p 6u(a){r(a&&(($.2c.80&&1X a=="4w"&&a.1f)||(a.6t&&a.6t.5e().1o(/\\6r\\(\\)/))))}$.7Z.f=p(2j){k(!$.f.5b){$(1e.2l).3v($.f.O).7Y($.f.6s);$.f.5b=1d}c 5c=6r.6q.7X.7W(5d,1);k(1X 2j=="41"&&(2j=="7V"||2j=="S")){r $.f["6p"+2j+"3Z"].2k($.f,[b[0]].6o(5c))}r b.3u(p(){1X 2j=="41"?$.f["6p"+2j+"3Z"].2k($.f,[b].6o(5c)):$.f.6n(b,2j)})};$.f=x 3Z();$.f.5b=E;$.f.5a=x A().2b()})(17)',62,636,'||||||||inst|||this|var|||datepicker||date|||if|_get||target||function|input|return||null|id|ui||new||settings|Date|year|case||false|month|drawMonth|day|div|drawYear|value|offset||break|dpDiv|else|getFullYear|minDate|getDate|maxDate|iFormat|html||getMonth||initStatus||||||showStatus|class|jQuery|format|endYear|nodeName|charAt|inline|true|document|length|rangeStart|currentDay|numMonths|duration|name|for|selectedMonth|monthNames|match|currentYear|selectedYear|_getInst|ctrlKey|currentMonth|selectedDay|dayNames|printDate|top|isFixed|dayNamesShort|td|firstDay|matches|_defaults|width|shortYearCutoff|parseInt|_addStatus|isRTL|_adjustDate|rangeSelect|literal|lookAhead|left|_pos|_getFormatConfig|endDay|output|iValue|position|dateStr|showAnim|documentElement|typeof|formatDate|monthNamesShort|period|Math|onclick|endDate|endMonth|checkDate|_updateDatepicker|||markerClassName|css|getTime|browser|status|defaultDate|size|_dialogInput|height|handled|options|apply|body|_getMinMaxDate|min|addClass|dow|stepBigMonths|stepMonths|_hideDatepicker|chars|num|stayOpen|_triggerClass|pos|_disabledInputs|max|years|clear|showOtherMonths|otherMonth|over|week|today|span|navigationAsDateFormat|label|nextBigText|nextText|prevText|prevBigText|dates|focus|onSelect|hasClass|_inDialog|PROP_NAME|px|key|buttonText|dateFormat|_formatDate|100|_getDaysInMonth|monthHtml|||||||||select|removeClass|cell|dateStatus|row|currentText|showBigPrevNext|while|val|doy|yy|_datepickerShowing|postProcess|data|obj|scrollY|scrollX|showOn|the|Show|each|append|props|extendRemove|newMinDate|_getNumberOfMonths|getDay|selectedDate|utcDate|highlightWeek|days|end|col|next|prompt|dd|throw|getNumber|firstMon|altFormat|_lastInput|event|_curInst|remove|scrollTop|scrollLeft|_showDatepicker|siblings|button|buttonImage|inlineSettings|Datepicker||string|_determineDate|_notifyChange|showMonthAfterYear|selected|style|closeAtTop|tzDate|unselectable|daySettings|title|beforeShowDay|weekStatus|showWeeks|changeFirstDay|DD|hideIfNoPrevNext|maxDraw|rangeSeparator|switch|default|names|altField|trigger|blockUI|onClose|type|beforeShow|toLowerCase|disabled|appendText|object|extend|setDate|_adjustInstDate|option|iframe|msie|both|tr|parent|_currentClass|currentDate|calculateWeek|leadDays|dayNamesMin|dayStatus|iso8601Week|prev|current|showCurrentAtPos|startDate|formatNumber|shortNames|longNames|mm|checkLiteral|_selectDate|_selectingMonthYear|unbind|absolute|effects|browserHeight|browserWidth|window|_doKeyDown|relOffset|img|bind|attrValue|attrName|uuid|initialized|otherArgs|arguments|toString|undefined|_isInRange|_canAdjustMonth|number|onChange|onmouseout|text|onmouseover|_clickMonthYear|_selectMonthYear|secondary|xa0|cover|src|controls|_selectDay|_unselectableClass|dRow|daysInMonth|replace|_gotoToday|gotoDate|_promptClass|gotoCurrent|_clearDate|mandatory|_getDate|_setDate|Invalid|pattern|getDaysInMonth|_getDefaultDate|log|catch|parseDate|try|_setDateFromField|formatName|dim|getName|at|origSize|_updateAlternate|_mainDivId|parents|_dialogClass|_tidyDialog||hide|showOptions|hidden|_findPos|opera|clientHeight|clientWidth|dims|show|display|chr|keyCode|_doKeyPress|_disableClass|_inlineClass|keydown|_appendClass|_newInst|divSpan|regional|x3e|x3c|_attachDatepicker|concat|_|prototype|Array|_checkExternalClick|constructor|isArray|in|curMonth|curYear|_getFirstDayOfMonth|checkRange|minMax|numberOfMonths|onChangeMonthYear|yearStatus|onchange|split|yearRange|changeYear|inMaxYear|inMinYear|monthStatus|changeMonth|_generateMonthYearHeader|version|table|tbody|getUTCDate|setUTCDate|numRows|isMultiMonth|thead|_changeFirstDay|indexOf|weekHeader|statusForDate|currentStatus|nextBigStatus|nextStatus|prevStatus|prevBigStatus|closeText|closeStatus|clearText|clearStatus|_generateHTML|origYear|origMonth|offsetNumeric|offsetString|exec|_possibleChars|getYear|len|iInit|Missing|change|Year|Month|100px|innerHeight|innerWidth|_checkOffset|Class|add|empty|none|fixed|_isDisabledDatepicker|charCode|err|map|children|cursor|opacity|keypress|dateText|_dialogInst|dp|getData|setData|_inlineDatepicker|after|before|alt|attr|buttonImageOnly|_connectDatepicker|debug|Select|different|May|previous|Close|isDisabled|call|slice|mousedown|fn|safari|setMilliseconds|setSeconds|setMinutes|setHours|header|javascript|other|ceil|cellspacing|cellpadding|one|links|9999|close|control|isNaN|0123456789|W3C|TIMESTAMP|RSS|RFC_2822|RFC_1123|RFC_1036|RFC_850|RFC_822|ISO_8601|COOKIE|ATOM|do|Unexpected|Unknown|86400000|floor|getTimezoneOffset|noWeekends|selectedIndex|draw|unblockUI|fadeOut|fadeIn|slideUp|slideDown|nextSibling|nodeType|rtl|multi|find|static|offsetWidth|1000px|block|offsetHeight|parentNode|fromCharCode|String|stopPropagation|preventDefault|_getDateDatepicker|_setDateDatepicker|_refreshDatepicker|_changeDatepicker|instance|transparent|color|background|prepend|relative|_disableDatepicker|_enableDatepicker|removeData|_destroyDatepicker|150|pageY|pageX|_dialogDatepicker|_inlineShow|click|eval|getAttribute|setDefaults|console|hasDatepicker|normal|first|as|Set|Sa|Fr|Th|We|Tu|Mo|Su|Sat|Fri|Thu|Wed|Tue|Mon|Sun|Saturday|Friday|Thursday|Wednesday|Tuesday|Monday|Sunday|of|Week|Wk|Dec|Nov|Oct|Sep|Aug|Jul|Jun|Apr|Mar|Feb|Jan|December|November|October|September|August|July|June|April|March|February|January|Today|Next|Prev|without|Erase|Clear|dialog'.split('|'),0,{})) - diff --git a/views/default/event_calendar/calendar.php b/views/default/event_calendar/calendar.php index ebf4aa589..ea12ff603 100644 --- a/views/default/event_calendar/calendar.php +++ b/views/default/event_calendar/calendar.php @@ -4,7 +4,15 @@ if ($vars['mode']) { } else { $mode = 'month'; } -$link_bit = $vars['url'].'mod/event_calendar/show_events.php?start_date='.$vars['original_start_date'].'&group_guid='.$vars['group_guid'].'&filter='.$vars['filter'].'&mode='; + +# event_calendar/list/<start_date>/<display_mode>/<filter_context>/<region> +if ($vars['group_guid']) { + $link_bit = $vars['url']."event_calendar/group/{$vars['group_guid']}/{$vars['original_start_date']}/%s"; +} else { + $link_bit = $vars['url']."event_calendar/list/{$vars['original_start_date']}/%s/{$vars['filter']}"; +} + +#$link_bit = "event_calendar/show_events.php?start_date='.$vars['original_start_date'].'&group_guid='.$vars['group_guid'].'&filter='.$vars['filter'].'&mode='; $range_bit = ''; $first_date = $vars['first_date']; @@ -27,7 +35,7 @@ if ($first_date || $last_date) { $body .= elgg_view("input/datepicker_inline", array( - 'internalname' => 'my_datepicker', + 'name' => 'my_datepicker', 'mode' => $vars['mode']?$vars['mode']:'month', 'start_date' => $vars['start_date'], 'end_date' => $vars['end_date'], @@ -35,6 +43,7 @@ $body .= elgg_view("input/datepicker_inline", 'range_bit' => $range_bit, ) ); + $body .= '<div id="calendarmenucontainer">'; $body .= '<ul id="calendarmenu">'; if ($mode == 'day') { @@ -42,19 +51,19 @@ if ($mode == 'day') { } else { $link_class = ''; } -$body .= '<li'.$link_class.'><a href="'.$link_bit.'day">'.elgg_echo('event_calendar:day_label').'</a></li>'; +$body .= '<li'.$link_class.'><a href="'.sprintf($link_bit,'day').'">'.elgg_echo('event_calendar:day_label').'</a></li>'; if ($mode == 'week') { $link_class = ' class="sys_selected"'; } else { $link_class = ''; } -$body .= '<li'.$link_class.'><a href="'.$link_bit.'week">'.elgg_echo('event_calendar:week_label').'</a></li>'; +$body .= '<li'.$link_class.'><a href="'.sprintf($link_bit,'week').'">'.elgg_echo('event_calendar:week_label').'</a></li>'; if ($mode == 'month') { $link_class = ' class="sys_selected sys_calmenu_last"'; } else { $link_class = ' class="sys_calmenu_last"'; } -$body .= '<li'.$link_class.'><a href="'.$link_bit.'month">'.elgg_echo('event_calendar:month_label').'</a></li>'; +$body .= '<li'.$link_class.'><a href="'.sprintf($link_bit,'month').'">'.elgg_echo('event_calendar:month_label').'</a></li>'; $body .= '</ul>'; $body .= '</div>'; echo $body; diff --git a/views/default/event_calendar/css.php b/views/default/event_calendar/css.php index 359fd1e13..7e399c547 100644 --- a/views/default/event_calendar/css.php +++ b/views/default/event_calendar/css.php @@ -6,18 +6,9 @@ $background_colour = '#F5F5F5'; $highlight_colour = '#3874B7'; ?> -/* hide Today as it is not working as expected */ -.ui-datepicker-current { visibility:hidden } - -div#calendarmenucontainer { - position: relative; -} - -ul#calendarmenu { - list-style: none; - position: absolute; - top: 0px; - left: -15px; +#calendarmenucontainer { + position:relative; + left: 40px; } ul#calendarmenu li { @@ -52,6 +43,12 @@ td.ui-datepicker-unselectable { color: #888888 !important; } +#my_datepicker .week-highlight a { + text-decoration: none; + color: #FFFFFF; + background: <?php echo $highlight_colour; ?>; +} + .river_object_event_calendar_create { background: url(<?php echo $vars['url']; ?>mod/event_calendar/images/river_icon_event.gif) no-repeat left -1px; } @@ -59,7 +56,7 @@ td.ui-datepicker-unselectable { background: url(<?php echo $vars['url']; ?>mod/event_calendar/images/river_icon_event.gif) no-repeat left -1px; } #event_list { - width:440px; + width:510px; margin:0; float:left; padding:5px 0 0 0; diff --git a/views/default/event_calendar/filter_menu.php b/views/default/event_calendar/filter_menu.php new file mode 100644 index 000000000..62d38939b --- /dev/null +++ b/views/default/event_calendar/filter_menu.php @@ -0,0 +1,54 @@ +<?php +// generate a list of filter tabs +$group_guid = $vars['group_guid']; +$filter_context = $vars['filter']; +if ($group_guid) { + $url_start = "event_calendar/group/{$group_guid}/{$vars['start_date']}/{$vars['mode']}"; +} else { + $url_start = "event_calendar/list/{$vars['start_date']}/{$vars['mode']}"; +} + +$tabs = array( + 'all' => array( + 'text' => elgg_echo('all'), + 'href' => "$url_start/all", + 'selected' => ($filter_context == 'all'), + 'priority' => 200, + ), + 'mine' => array( + 'text' => elgg_echo('mine'), + 'href' => "$url_start/mine", + 'selected' => ($filter_context == 'mine'), + 'priority' => 300, + ), + 'friend' => array( + 'text' => elgg_echo('friends'), + 'href' => "$url_start/friends", + 'selected' => ($filter_context == 'friends'), + 'priority' => 400, + ), +); + +$event_calendar_spots_display = elgg_get_plugin_setting('spots_display', 'event_calendar'); +if ($event_calendar_spots_display == "yes") { + $tabs['open'] = array( + 'text' => elgg_echo('event_calendar:open'), + 'href' => "$url_start/open", + 'selected' => ($filter_context == 'open'), + 'priority' => 100, + ); +} + +foreach ($tabs as $name => $tab) { + $tab['name'] = $name; + + elgg_register_menu_item('filter', $tab); +} + +echo elgg_view_menu('filter', array('sort_by' => 'priority', 'class' => 'elgg-menu-hz')); + +$event_calendar_region_display = elgg_get_plugin_setting('region_display', 'event_calendar'); +if ($event_calendar_region_display == 'yes') { + $url_start .= "/$filter_context"; + echo elgg_view('event_calendar/region_select',array('url_start'=>$url_start,'region'=>$vars['region'])); +}
\ No newline at end of file diff --git a/views/default/event_calendar/group_module.php b/views/default/event_calendar/group_module.php new file mode 100644 index 000000000..5fc644e8b --- /dev/null +++ b/views/default/event_calendar/group_module.php @@ -0,0 +1,43 @@ +<?php +/** + * Group event calendar module + */ + +$group = elgg_get_page_owner_entity(); + +if ($group->event_calendar_enable == "no") { + return true; +} + +$all_link = elgg_view('output/url', array( + 'href' => "event_calendar/group/$group->guid/all", + 'text' => elgg_echo('link:view:all'), +)); + +elgg_push_context('widgets'); +$options = array( + 'type' => 'object', + 'subtype' => 'event_calendar', + 'container_guid' => elgg_get_page_owner_guid(), + 'limit' => 6, + 'full_view' => false, + 'pagination' => false, +); +$content = elgg_list_entities($options); +elgg_pop_context(); + +if (!$content) { + $content = '<p>' . elgg_echo('event_calendar:no_events_found') . '</p>'; +} + +$new_link = elgg_view('output/url', array( + 'href' => "event_calendar/add/$group->guid", + 'text' => elgg_echo('event_calendar:new'), +)); + +echo elgg_view('groups/profile/module', array( + 'title' => elgg_echo('event_calendar:group'), + 'content' => $content, + 'all_link' => $all_link, + 'add_link' => $new_link, +)); diff --git a/views/default/event_calendar/groupprofile_calendar.php b/views/default/event_calendar/groupprofile_calendar.php index 175098e0c..826fafa67 100644 --- a/views/default/event_calendar/groupprofile_calendar.php +++ b/views/default/event_calendar/groupprofile_calendar.php @@ -11,7 +11,9 @@ * */ -$page_owner_entity = page_owner_entity(); +elgg_load_library('elgg:event_calendar'); + +$page_owner_entity = elgg_get_page_owner_entity(); if (event_calendar_activated_for_group($page_owner_entity)) { $num = 5; diff --git a/views/default/event_calendar/show_events.php b/views/default/event_calendar/show_events.php index 31771f43d..580fb5a45 100644 --- a/views/default/event_calendar/show_events.php +++ b/views/default/event_calendar/show_events.php @@ -13,13 +13,22 @@ $listing_format = $vars['listing_format']; if ($vars['events']) { - if (get_plugin_setting('agenda_view', 'event_calendar') == 'yes') { + if (elgg_get_plugin_setting('agenda_view', 'event_calendar') == 'yes') { $event_list = elgg_view('event_calendar/agenda_view',$vars); } else { if ($listing_format == 'paged') { $event_list = elgg_view('event_calendar/paged_view',$vars); } else { - $event_list = elgg_view_entity_list($vars['events'], $vars['count'], $vars['offset'], $vars['limit'], false, false); + $options = array( + 'list_class' => 'elgg-list-entity', + 'full_view' => FALSE, + 'pagination' => TRUE, + 'list_type' => 'listing', + 'list_type_toggle' => FALSE, + 'offset' => $vars['offset'], + 'limit' => $vars['limit'], + ); + $event_list = elgg_view_entity_list($vars['events'], $options); } } } else { @@ -28,26 +37,18 @@ if ($vars['events']) { if ($listing_format == 'paged') { echo $event_list; } else { - if (isloggedin()) { - $nav = elgg_view('event_calendar/nav',$vars); - } else { - $nav = ''; - } ?> -<table width="100%"> -<tr><td> -<div id="event_list"> +<div style="width:100%"> +<div id="event_list" style="float:left;"> <?php -echo $nav.'<br />'.$event_list; +echo $event_list; ?> </div> -</td> -<td align="right"> +<div style="float:right;"> <?php echo elgg_view('event_calendar/calendar',$vars); ?> -</td></tr> -</table> +</div> +</div> <?php } -?>
\ No newline at end of file diff --git a/views/default/forms/event_calendar/edit.php b/views/default/forms/event_calendar/edit.php new file mode 100644 index 000000000..25062e2df --- /dev/null +++ b/views/default/forms/event_calendar/edit.php @@ -0,0 +1,246 @@ +<?php +$event = $vars['event']; +$fd = $vars['form_data']; + +$event_calendar_times = elgg_get_plugin_setting('times', 'event_calendar'); +$event_calendar_region_display = elgg_get_plugin_setting('region_display', 'event_calendar'); +$event_calendar_type_display = elgg_get_plugin_setting('type_display', 'event_calendar'); +$event_calendar_spots_display = elgg_get_plugin_setting('spots_display', 'event_calendar'); +$event_calendar_add_users = elgg_get_plugin_setting('add_users', 'event_calendar'); +$event_calendar_hide_access = elgg_get_plugin_setting('hide_access', 'event_calendar'); +$event_calendar_hide_end = elgg_get_plugin_setting('hide_end', 'event_calendar'); +$event_calendar_more_required = elgg_get_plugin_setting('more_required', 'event_calendar'); + +if ($event_calendar_more_required == 'yes') { + $required_fields = array('title','venue','start_date','start_time', + 'brief_description','region','event_type','fees','contact','organiser', + 'event_tags','spots'); +} else { + $required_fields = array('title','venue','start_date'); +} +$all_fields = array('title','venue','start_time','start_date','end_time','end_date', + 'brief_description','region','event_type','fees','contact','organiser','event_tags', + 'long_description','spots'); +$prefix = array(); +foreach ($all_fields as $fn) { + if (in_array($fn,$required_fields)) { + $prefix[$fn] = elgg_echo('event_calendar:required').' '; + } else { + $prefix[$fn] = elgg_echo('event_calendar:optional').' '; + } +} + +if ($event) { + $title = $event->title; + $brief_description = $event->description; + $venue = $event->venue; + // this is a form redisplay, so take the values as submitted + $start_date = $event->start_date; + $end_date = $event->end_date; + + if ($event_calendar_region_display) { + $region = $event->region; + if (!$region) { + $region = '-'; + } + } + + if ($event_calendar_spots_display) { + $spots = trim($event->spots); + } + if ($event_calendar_type_display) { + $event_type = $event->event_type; + if (!$event_type) { + $event_type = '-'; + } + } + $fees = $event->fees; + $contact = $event->contact; + $organiser = $event->organiser; + $event_tags = $event->event_tags; + $long_description = $event->long_description; + $access = $event->access_id; + if ($event_calendar_times == 'yes') { + $start_time = $event->start_time; + $end_time = $event->end_time; + } + $event_action = 'manage_event'; + $event_guid = $event->guid; +} else { + $title = $fd['title']; + $brief_description = $fd['description']; + $venue = $fd['venue']; + $start_date = $fd['start_date']; + $end_date = $fd['end_date']; + $fees = $fd['fees']; + if ($event_calendar_spots_display) { + $spots = $fd['spots']; + } + if ($event_calendar_region_display) { + $region = $fd['region']; + } + if ($event_calendar_type_display) { + $event_type = $fd['event_type']; + } + $contact = $fd['contact']; + $organiser = $fd['organiser']; + $event_tags = $fd['event_tags']; + $long_description = $fd['long_description']; + $access = $fd['access_id']; + if ($event_calendar_times == 'yes') { + $start_time = $fd['start_time']; + $end_time = $fd['end_time']; + } + $event_action = 'add_event'; + $event_guid = 0; +} +$body = ''; + +$body .= elgg_view('input/hidden',array('name'=>'event_action', 'value'=>$event_action)); +$body .= elgg_view('input/hidden',array('name'=>'event_guid', 'value'=>$event_guid)); +$body .= elgg_view('input/hidden',array('name'=>'group_guid', 'value'=>$vars['group_guid'])); + +$body .= '<p><label>'.elgg_echo("event_calendar:title_label").'<br />'; +$body .= elgg_view("input/text",array('name' => 'title','value'=>$title)); +$body .= '</label></p>'; +$body .= '<p class="description">'.$prefix['title'].elgg_echo('event_calendar:title_description').'</p>'; + +$body .= '<p><label>'.elgg_echo("event_calendar:venue_label").'<br />'; +$body .= elgg_view("input/text",array('name' => 'venue','value'=>$venue)); +$body .= '</label></p>'; +$body .= '<p class="description">'.$prefix['venue'].elgg_echo('event_calendar:venue_description').'</p>'; + +if ($event_calendar_times == 'yes') { + $body .= '<p><label>'.elgg_echo("event_calendar:start_time_label").'</label><br />'; + $body .= elgg_view("input/timepicker",array('name' => 'start_time','value'=>$start_time)); + $body .= '</p>'; + $body .= '<p class="description">'.$prefix['start_time'].elgg_echo('event_calendar:start_time_description').'</p>'; +} + +$body .= '<p><label>'.elgg_echo("event_calendar:start_date_label").'<br />'; +$body .= elgg_view("input/date",array('timestamp'=>TRUE, 'autocomplete'=>'off','name' => 'start_date','value'=>$start_date)); +$body .= '</label></p>'; +$body .= '<p class="description">'.$prefix['start_date'].elgg_echo('event_calendar:start_date_description').'</p>'; + +if ($event_calendar_hide_end != 'yes') { + if ($event_calendar_times == 'yes') { + $body .= '<p><label>'.elgg_echo("event_calendar:end_time_label").'</label><br />'; + $body .= elgg_view("input/timepicker",array('name' => 'end_time','value'=>$end_time)); + $body .= '</p>'; + $body .= '<p class="description">'.$prefix['end_time'].elgg_echo('event_calendar:end_time_description').'</p>'; + } + + $body .= '<p><label>'.elgg_echo("event_calendar:end_date_label").'<br />'; + $body .= elgg_view("input/date",array('timestamp'=>TRUE,'autocomplete'=>'off','name' => 'end_date','value'=>$end_date)); + $body .= '</label></p>'; + $body .= '<p class="description">'.$prefix['end_date'].elgg_echo('event_calendar:end_date_description').'</p>'; +} + +if ($event_calendar_spots_display == 'yes') { + $body .= '<p><label>'.elgg_echo("event_calendar:spots_label").'<br />'; + $body .= elgg_view("input/text",array('name' => 'spots','value'=>$spots)); + $body .= '</label></p>'; + $body .= '<p class="description">'.$prefix['spots'].elgg_echo('event_calendar:spots_description').'</p>'; +} + +if ($event_calendar_add_users == 'yes') { + $body .= '<p><label>'.elgg_echo("event_calendar:add_user_label").'<br />'; + $body .= elgg_view("input/adduser",array('name' => 'adduser','internalid' => 'do_adduser','width'=> 200, 'minChars'=>2)); + $body .= '</label></p><br /><br />'; + $body .= '<p class="description">'.elgg_echo('event_calendar:add_user_description').'</p>'; +} + +$body .= '<p><label>'.elgg_echo("event_calendar:brief_description_label").'<br />'; +$body .= elgg_view("input/text",array('name' => 'description','value'=>$brief_description)); +$body .= '</label></p>'; +$body .= '<p class="description">'.$prefix['brief_description'].elgg_echo('event_calendar:brief_description_description').'</p>'; + +if ($event_calendar_region_display == 'yes') { + $region_list = trim(elgg_get_plugin_setting('region_list', 'event_calendar')); + $region_list_handles = elgg_get_plugin_setting('region_list_handles', 'event_calendar'); + // make sure that we are using Unix line endings + $region_list = str_replace("\r\n","\n",$region_list); + $region_list = str_replace("\r","\n",$region_list); + if ($region_list) { + $options = array(); + $options[] = '-'; + foreach(explode("\n",$region_list) as $region_item) { + $region_item = trim($region_item); + if ($region_list_handles == 'yes') { + $options[$region_item] = elgg_echo('event_calendar:region:'.$region_item); + } else { + $options[$region_item] = $region_item; + } + } + $body .= '<p><label>'.elgg_echo("event_calendar:region_label").'<br />'; + $body .= elgg_view("input/pulldown",array('name' => 'region','value'=>$region,'options_values'=>$options)); + $body .= '</label></p>'; + $body .= '<p class="description">'.$prefix['region'].elgg_echo('event_calendar:region_description').'</p>'; + } +} + +if ($event_calendar_type_display == 'yes') { + $type_list = trim(elgg_get_plugin_setting('type_list', 'event_calendar')); + $type_list_handles = elgg_get_plugin_setting('type_list_handles', 'event_calendar'); + // make sure that we are using Unix line endings + $type_list = str_replace("\r\n","\n",$type_list); + $type_list = str_replace("\r","\n",$type_list); + if ($type_list) { + $options = array(); + $options[] = '-'; + foreach(explode("\n",$type_list) as $type_item) { + $type_item = trim($type_item); + if ($type_list_handles == 'yes') { + $options[$type_item] = elgg_echo('event_calendar:type:'.$type_item); + } else { + $options[$type_item] = $type_item; + } + } + $body .= '<p><label>'.elgg_echo("event_calendar:type_label").'<br />'; + $body .= elgg_view("input/pulldown",array('name' => 'event_type','value'=>$event_type,'options_values'=>$options)); + $body .= '</label></p>'; + $body .= '<p class="description">'.$prefix['event_type'].elgg_echo('event_calendar:type_description').'</p>'; + } +} + +$body .= '<p><label>'.elgg_echo("event_calendar:fees_label").'<br />'; +$body .= elgg_view("input/text",array('name' => 'fees','value'=>$fees)); +$body .= '</label></p>'; +$body .= '<p class="description">'.$prefix['fees'].elgg_echo('event_calendar:fees_description').'</p>'; + +$body .= '<p><label>'.elgg_echo("event_calendar:contact_label").'<br />'; +$body .= elgg_view("input/text",array('name' => 'contact','value'=>$contact)); +$body .= '</label></p>'; +$body .= '<p class="description">'.$prefix['contact'].elgg_echo('event_calendar:contact_description').'</p>'; + +$body .= '<p><label>'.elgg_echo("event_calendar:organiser_label").'<br />'; +$body .= elgg_view("input/text",array('name' => 'organiser','value'=>$organiser)); +$body .= '</label></p>'; +$body .= '<p class="description">'.$prefix['organiser'].elgg_echo('event_calendar:organiser_description').'</p>'; + +$body .= '<p><label>'.elgg_echo("event_calendar:event_tags_label").'<br />'; +$body .= elgg_view("input/tags",array('name' => 'tags','value'=>$event_tags)); +$body .= '</label></p>'; +$body .= '<p class="description">'.$prefix['event_tags'].elgg_echo('event_calendar:event_tags_description').'</p>'; + +$body .= '<p><label>'.elgg_echo("event_calendar:long_description_label").'<br />'; +$body .= elgg_view("input/longtext",array('name' => 'long_description','value'=>$long_description)); +$body .= '</label></p>'; +$body .= '<p class="description">'.$prefix['long_description'].elgg_echo('event_calendar:long_description_description').'</p>'; + +if($event_calendar_hide_access == 'yes') { + $event_calendar_default_access = elgg_get_plugin_setting('default_access', 'event_calendar'); + if($event_calendar_default_access) { + $body .= elgg_view("input/hidden",array('name' => 'access_id','value'=>$event_calendar_default_access)); + } else { + $body .= elgg_view("input/hidden",array('name' => 'access_id','value'=>ACCESS_PRIVATE)); + } +} else { + $body .= '<p><label>'.elgg_echo("access").'<br />'; + $body .= elgg_view("input/access",array('name' => 'access_id','value'=>$access)); + $body .= '</label></p>'; +} + +$body .= elgg_view('input/submit', array('name'=>'submit','value'=>elgg_echo('event_calendar:submit'))); + +echo $body; diff --git a/views/default/input/datepicker_inline.php b/views/default/input/datepicker_inline.php index 560074a2d..69520b9ef 100644 --- a/views/default/input/datepicker_inline.php +++ b/views/default/input/datepicker_inline.php @@ -6,16 +6,43 @@ * @package event_calendar * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 * @author Kevin Jardine <kevin@radagast.biz> - * @copyright Radagast Solutions 2008 + * @copyright Radagast Solutions 2008 -2011 * @link http://radagast.biz/ * */ +if ($vars['group_guid']) { + $link_bit = $vars['url']."event_calendar/group/{$vars['group_guid']}/%s/{$vars['mode']}"; +} else { + $link_bit = $vars['url']."event_calendar/list/%s/{$vars['mode']}/{$vars['filter']}"; +} + +if ($vars['mode'] == 'week') { + $selected_week = date('W',strtotime($vars['start_date']))+1; +} else { + $selected_week = ''; +} +// TODO - figure out how to move this JavaScript ?> <script language="javascript"> +var selectedWeek = "<?php echo $selected_week; ?>"; +highlightWeek = function(d) { + if (!selectedWeek) { return [true,''];} + //var date = $(this).datepicker('getDate'); + var dayOfWeek = d.getUTCDay(); + var weekNumber = $.datepicker.iso8601Week(d); + if (dayOfWeek == 6) { + weekNumber += 1; + } + + if (selectedWeek == weekNumber) { + return [true,'week-highlight']; + } + return [true,'']; +} $(document).ready(function(){ var done_loading = false; -$("#<?php echo $vars['internalname']; ?>").datepicker({ +$("#<?php echo $vars['name']; ?>").datepicker({ onChangeMonthYear: function(year, month, inst) { if(inst.onChangeToday){ day=inst.selectedDay; @@ -24,19 +51,17 @@ $("#<?php echo $vars['internalname']; ?>").datepicker({ } if (done_loading) { // in this case the mode is forced to month - document.location.href = "<?php echo $vars['url'].'mod/event_calendar/show_events.php?mode=month&group_guid='.$vars['group_guid'].'&start_date='; ?>" + year+'-'+month+'-1'; + document.location.href = "<?php echo $link_bit; ?>".replace('%s', year+'-'+month+'-1'); } }, onSelect: function(date) { // jump to the new page - document.location.href = "<?php echo $vars['url'].'mod/event_calendar/show_events.php?mode='.$vars['mode'].'&group_guid='.$vars['group_guid'].'&start_date='; ?>" + date.substring(0,10); + document.location.href = "<?php echo $link_bit; ?>".replace('%s', date.substring(0,10)); }, dateFormat: "yy-mm-dd", <?php echo $vars['range_bit']; ?> - hideIfNoPrevNext: true, defaultDate: "<?php echo $vars['start_date'] .' - '.$vars['end_date']; ?>", - <?php if ($vars['mode'] == 'week') echo 'highlightWeek: true,'; ?> - rangeSelect: true + beforeShowDay: highlightWeek }); var start_date = $.datepicker.parseDate("yy-mm-dd", "<?php echo $vars['start_date']; ?>"); var end_date = $.datepicker.parseDate("yy-mm-dd", "<?php echo $vars['end_date']; ?>"); @@ -44,9 +69,10 @@ var end_date = $.datepicker.parseDate("yy-mm-dd", "<?php echo $vars['end_date']; if ("<?php echo $vars['mode'] ?>" == "month") { end_date += 1; } -$("#<?php echo $vars['internalname']; ?>").datepicker("setDate", start_date, end_date); +$("#<?php echo $vars['name']; ?>").datepicker("setDate", start_date, end_date); var done_loading = true; }); + </script> -<div id="<?php echo $vars['internalname']; ?>" ></div> +<div style="position:relative;" id="<?php echo $vars['name']; ?>" ></div> <p style="clear: both;"><!-- See day-by-day example for highlighting days code --></p>
\ No newline at end of file diff --git a/views/default/input/datepicker_popup.php b/views/default/input/datepicker_popup.php index 8e1120ce7..5ed431e71 100644 --- a/views/default/input/datepicker_popup.php +++ b/views/default/input/datepicker_popup.php @@ -10,6 +10,7 @@ * @link http://radagast.biz/ * */ + if ($vars['dateformat']) { $date_format = $vars['dateformat']; } else { diff --git a/views/default/object/event_calendar.php b/views/default/object/event_calendar.php index 70560bd2d..97829e7c2 100644 --- a/views/default/object/event_calendar.php +++ b/views/default/object/event_calendar.php @@ -13,11 +13,10 @@ $event = $vars['entity']; - if ($vars['full']) { $body = elgg_view('event_calendar/strapline',$vars); $event_items = event_calendar_get_formatted_full_items($event); - $body .= '<div class="contentWrapper" >'; + $body .= '<br />'; foreach($event_items as $item) { $value = $item->value; @@ -28,39 +27,70 @@ if ($vars['full']) { $body .= "<p class=\"{$even_odd}\"><b>"; $body .= $item->title.':</b> '; $body .= $item->value; - } } + $metadata = elgg_view_menu('entity', array( + 'entity' => $event, + 'handler' => 'event_calendar', + 'sort_by' => 'priority', + 'class' => 'elgg-menu-hz', + )); + + $tags = elgg_view('output/tags', array('tags' => $event->event_tags)); + + $params = array( + 'entity' => $event, + 'metadata' => $metadata, + 'tags' => $tags, + 'title' => false, + ); + $list_body = elgg_view('object/elements/summary', $params); + echo $list_body; echo $body; if ($event->long_description) { echo '<p>'.$event->long_description.'</p>'; } else { echo '<p>'.$event->description.'</p>'; } - echo '</div>'; - if (get_plugin_setting('add_to_group_calendar', 'event_calendar') == 'yes') { + if (elgg_get_plugin_setting('add_to_group_calendar', 'event_calendar') == 'yes') { echo elgg_view('event_calendar/forms/add_to_group',array('event' => $event)); } } else { + $time_bit = event_calendar_get_formatted_time($event); - $icon = elgg_view( - "graphics/icon", array( - 'entity' => $vars['entity'], - 'size' => 'small', - ) - ); - $info .= '<p><b><a href="'.$event->getUrl().'">'.$event->title.'</a></b>'; - $info .= '<br />'.$time_bit; + $icon = '<img src="'.elgg_view("icon/object/event_calendar/small").'" />'; + $extras = array($time_bit); if ($event->description) { - $info .= '<br /><br />'.$event->description; + $extras[] = $event->description; } - if ($event_calendar_venue_view = get_plugin_setting('venue_view', 'event_calendar') == 'yes') { - $info .= '<br />'.$event->venue; + if ($event_calendar_venue_view = elgg_get_plugin_setting('venue_view', 'event_calendar') == 'yes') { + $extras[] = $event->venue; } - $info .= '</p>'; + if ($extras) { + $info = "<p>".implode("<br />",$extras)."</p>"; + } else { + $info = ''; + } + + $metadata = elgg_view_menu('entity', array( + 'entity' => $event, + 'handler' => 'event_calendar', + 'sort_by' => 'priority', + 'class' => 'elgg-menu-hz', + )); + + $tags = elgg_view('output/tags', array('tags' => $event->event_tags)); + + $params = array( + 'entity' => $event, + 'metadata' => $metadata, + 'subtitle' => $info, + 'tags' => $tags, + ); + $list_body = elgg_view('object/elements/summary', $params); - echo elgg_view_listing($icon, $info); + echo elgg_view_image_block($icon, $list_body); } ?>
\ No newline at end of file diff --git a/views/default/widgets/event_calendar/view.php b/views/default/widgets/event_calendar/view.php index 12fff6d60..329046cb0 100644 --- a/views/default/widgets/event_calendar/view.php +++ b/views/default/widgets/event_calendar/view.php @@ -12,7 +12,7 @@ */ // Load event calendar model - require_once(dirname(dirname(dirname(dirname(dirname(__FILE__)))))."/models/model.php"); + elgg_load_library('elgg:event_calendar'); //the number of events to display $num = (int) $vars['entity']->num_display; @@ -21,7 +21,7 @@ // Get the events - $events = event_calendar_get_personal_events_for_user(page_owner(),$num); + $events = event_calendar_get_personal_events_for_user(elgg_get_page_owner_guid(),$num); // If there are any events to view, view them if (is_array($events) && sizeof($events) > 0) { |