You are here

function date_repeat_dow_day_options_ordered in Date 8

Same name and namespace in other branches
  1. 5.2 date_repeat/date_repeat.module \date_repeat_dow_day_options_ordered()
  2. 6.2 date_repeat/date_repeat.module \date_repeat_dow_day_options_ordered()
  3. 6 date_repeat/date_repeat.module \date_repeat_dow_day_options_ordered()
  4. 7.3 date_repeat/date_repeat.module \date_repeat_dow_day_options_ordered()
  5. 7 date_repeat/date_repeat.module \date_repeat_dow_day_options_ordered()
  6. 7.2 date_repeat/date_repeat.module \date_repeat_dow_day_options_ordered()
1 call to date_repeat_dow_day_options_ordered()
_date_repeat_rrule_process in date_repeat/date_repeat_form.inc
Generate the repeat setting form.

File

date_repeat/date_repeat.module, line 123
This module creates a form element that allows users to select repeat rules for a date, and reworks the result into an iCal RRULE string that can be stored in the database.

Code

function date_repeat_dow_day_options_ordered($weekdays) {
  $day_keys = array_keys($weekdays);
  $day_values = array_values($weekdays);
  for ($i = 1; $i <= variable_get('date_first_day', 0); $i++) {
    $last_key = array_shift($day_keys);
    array_push($day_keys, $last_key);
    $last_value = array_shift($day_values);
    array_push($day_values, $last_value);
  }
  $weekdays = array_combine($day_keys, $day_values);
  return $weekdays;
}