diff --git a/e107_plugins/calendar_menu/ecal_class.php b/e107_plugins/calendar_menu/ecal_class.php index c67bf4975..900f10319 100644 --- a/e107_plugins/calendar_menu/ecal_class.php +++ b/e107_plugins/calendar_menu/ecal_class.php @@ -296,6 +296,100 @@ class ecal_class + /** + * Generate code to display a date entry box with date picker + * + * @param string $boxname - name of the date picker + * @param integer $boxvalue - Unix time stamp for initial value + * + * @return string - html to display date box + */ + public function makeCalendar($boxname, $boxvalue) + { + $frm = e107::getForm(); + + $opt = array( + 'type' => 'date', + 'dateformat' => $this->dcal_format_string, + 'firstDay' => $this->ec_first_day_of_week, // 0 = Sunday. + 'size' => 12 + ); + return $frm->datepicker($boxname,$boxvalue,$opt); + } + + + /** + * Generate code to display time entry dropdowns for hours and minutes + * + * @param string $boxname - name of the date picker + * @param integer $cur_hour - time + * @param integer $cur_minute - time + * + * @return string - html to display time dropdowns + * + * @TODO: dropdowns need to be smaller + */ + public function makeHourmin($boxname,$cur_hour,$cur_minute) + { + if (isset($this->pref['eventpost_fivemins'])) $incval = 5; else $incval = 1; + // @TODO: Need to restrict width of select box + $retval = " \n + \n"; + return $retval; + } + + + + /** + * Generate HTML for 'recurring event' options + * + * @param integer $curval - code for current setting + */ + public function recurSelect($curval) + { + while ($curval > 150) { $curval -= 100; } // Could have values up to about 406 + $ret = "\n"; + return $ret; + } + + + /** + * Generate HTML for recurring week options + */ + public function recurWeekSelect($curval) + { + $disp = $curval < 100 ? " style='display:none;'" : ""; + $curval -= intval($curval % 10); // Should make it an exact multiple of 100 + $ret = "\n"; + return $ret; + } + + + /** * Return day of week string relative to the start of the week */ diff --git a/e107_plugins/calendar_menu/event.php b/e107_plugins/calendar_menu/event.php index 99d907aa5..e7187a13a 100644 --- a/e107_plugins/calendar_menu/event.php +++ b/e107_plugins/calendar_menu/event.php @@ -398,73 +398,6 @@ if ($action == 'ne' || $action == 'ed') { if ($ecal_class->cal_super || check_class($ecal_class->pref['eventpost_admin'])) { - function make_calendar($boxname, $boxvalue) - { - global $ecal_class; - $frm = e107::getForm(); - - $opt = array( - 'type' => 'date', - 'dateformat' => $ecal_class->dcal_format_string, - 'firstDay' => $ecal_class->ec_first_day_of_week, // 0 = Sunday. @TODO: Can't change firstday ATM! - 'size' => 12 - ); - return $frm->datepicker($boxname,$boxvalue,$opt); - } - - - function make_hourmin($boxname,$cur_hour,$cur_minute) - { - global $ecal_class; // @TODO: - if (isset($ecal_class->pref['eventpost_fivemins'])) $incval = 5; else $incval = 1; - // @TODO: Need to restrict width of select box - $retval = " \n - \n"; - return $retval; - } - - function recur_select($curval) - { - global $ecal_class; // @TODO: - while ($curval > 150) { $curval -= 100; } // Could have values up to about 406 - $ret = "\n"; - return $ret; - } - - - function recur_week_select($curval) - { - global $ecal_class; // @TODO: - $disp = $curval < 100 ? " style='display:none;'" : ""; - $curval -= intval($curval % 10); // Should make it an exact multiple of 100 - $ret = "\n"; - return $ret; - } - switch ($action) { @@ -624,17 +557,17 @@ if ($action == 'ne' || $action == 'ed') $text .= "