Beispiel #1
0
Datei: day.php Projekt: rair/yacs
 /**
  * get form fields to change the day
  *
  * @see overlays/overlay.php
  *
  * @param array hosting attributes
  * @return a list of ($label, $input, $hint)
  */
 function get_fields($host, $field_pos = NULL)
 {
     global $context;
     $options = '<input type="hidden" name="time_stamp" value="12:00" />' . '<input type="hidden" name="duration" value="1440" />';
     // default value is now
     if (!isset($this->attributes['date_stamp']) || $this->attributes['date_stamp'] <= NULL_DATE) {
         $this->attributes['date_stamp'] = gmstrftime('%Y-%m-%d %H:%M', time() + Surfer::get_gmt_offset() * 3600);
     } else {
         $this->attributes['date_stamp'] = Surfer::from_GMT($this->attributes['date_stamp']);
     }
     // split date from time
     list($date, $time) = explode(' ', $this->attributes['date_stamp']);
     // event time
     $label = i18n::s('Date');
     $input = Skin::build_input_time('date_stamp', $date, 'date') . $options;
     $hint = i18n::s('Use format YYYY-MM-DD');
     $fields[] = array($label, $input, $hint);
     // ensure that we do have a date
     Page::insert_script('func' . 'tion validateOnSubmit(container) {' . "\n" . "\n" . '	if(!Yacs.trim(container.date_stamp.value)) {' . "\n" . '		alert("' . i18n::s('Please provide a date.') . '");' . "\n" . '		container.date_stamp.focus();' . "\n" . '		Yacs.stopWorking();' . "\n" . '		return false;' . "\n" . '	}' . "\n\n" . '	return true;' . "\n" . '}' . "\n");
     return $fields;
 }
Beispiel #2
0
 /**
  * get form fields to change the day
  *
  * @see overlays/overlay.php
  *
  * @param array hosting attributes
  * @return a list of ($label, $input, $hint)
  */
 function get_fields($host, $field_pos = NULL)
 {
     global $context;
     // default value is now
     if (!isset($this->attributes['date_stamp']) || $this->attributes['date_stamp'] <= NULL_DATE) {
         $this->attributes['date_stamp'] = gmstrftime('%Y-%m-%d %H:%M', time() + Surfer::get_gmt_offset() * 3600);
     } else {
         $this->attributes['date_stamp'] = Surfer::from_GMT($this->attributes['date_stamp']);
     }
     // split date from time
     list($date, $time) = explode(' ', $this->attributes['date_stamp']);
     // a list for time
     $options = '<select name="time_stamp">';
     list($hours, $minutes) = explode(':', $time);
     if ($hours > '23') {
         $minutes = '23';
     }
     if ($minutes > '30') {
         $minutes = '30';
     } else {
         $minutes = '00';
     }
     if ($hours == '00' && $minutes == '00') {
         $options .= '<option selected="selected">00:00</option>';
     } else {
         $options .= '<option>00:00</option>';
     }
     if ($hours == '00' && $minutes == '30') {
         $options .= '<option selected="selected">00:30</option>';
     } else {
         $options .= '<option>00:30</option>';
     }
     if ($hours == '01' && $minutes == '00') {
         $options .= '<option selected="selected">01:00</option>';
     } else {
         $options .= '<option>01:00</option>';
     }
     if ($hours == '01' && $minutes == '30') {
         $options .= '<option selected="selected">01:30</option>';
     } else {
         $options .= '<option>01:30</option>';
     }
     if ($hours == '02' && $minutes == '00') {
         $options .= '<option selected="selected">02:00</option>';
     } else {
         $options .= '<option>02:00</option>';
     }
     if ($hours == '02' && $minutes == '30') {
         $options .= '<option selected="selected">02:30</option>';
     } else {
         $options .= '<option>02:30</option>';
     }
     if ($hours == '03' && $minutes == '00') {
         $options .= '<option selected="selected">03:00</option>';
     } else {
         $options .= '<option>03:00</option>';
     }
     if ($hours == '03' && $minutes == '30') {
         $options .= '<option selected="selected">03:30</option>';
     } else {
         $options .= '<option>03:30</option>';
     }
     if ($hours == '04' && $minutes == '00') {
         $options .= '<option selected="selected">04:00</option>';
     } else {
         $options .= '<option>04:00</option>';
     }
     if ($hours == '04' && $minutes == '30') {
         $options .= '<option selected="selected">04:30</option>';
     } else {
         $options .= '<option>04:30</option>';
     }
     if ($hours == '05' && $minutes == '00') {
         $options .= '<option selected="selected">05:00</option>';
     } else {
         $options .= '<option>05:00</option>';
     }
     if ($hours == '05' && $minutes == '30') {
         $options .= '<option selected="selected">05:30</option>';
     } else {
         $options .= '<option>05:30</option>';
     }
     if ($hours == '06' && $minutes == '00') {
         $options .= '<option selected="selected">06:00</option>';
     } else {
         $options .= '<option>06:00</option>';
     }
     if ($hours == '06' && $minutes == '30') {
         $options .= '<option selected="selected">06:30</option>';
     } else {
         $options .= '<option>06:30</option>';
     }
     if ($hours == '07' && $minutes == '00') {
         $options .= '<option selected="selected">07:00</option>';
     } else {
         $options .= '<option>07:00</option>';
     }
     if ($hours == '07' && $minutes == '30') {
         $options .= '<option selected="selected">07:30</option>';
     } else {
         $options .= '<option>07:30</option>';
     }
     if ($hours == '08' && $minutes == '00') {
         $options .= '<option selected="selected">08:00</option>';
     } else {
         $options .= '<option>08:00</option>';
     }
     if ($hours == '08' && $minutes == '30') {
         $options .= '<option selected="selected">08:30</option>';
     } else {
         $options .= '<option>08:30</option>';
     }
     if ($hours == '09' && $minutes == '00') {
         $options .= '<option selected="selected">09:00</option>';
     } else {
         $options .= '<option>09:00</option>';
     }
     if ($hours == '09' && $minutes == '30') {
         $options .= '<option selected="selected">09:30</option>';
     } else {
         $options .= '<option>09:30</option>';
     }
     if ($hours == '10' && $minutes == '00') {
         $options .= '<option selected="selected">10:00</option>';
     } else {
         $options .= '<option>10:00</option>';
     }
     if ($hours == '10' && $minutes == '30') {
         $options .= '<option selected="selected">10:30</option>';
     } else {
         $options .= '<option>10:30</option>';
     }
     if ($hours == '11' && $minutes == '00') {
         $options .= '<option selected="selected">11:00</option>';
     } else {
         $options .= '<option>11:00</option>';
     }
     if ($hours == '11' && $minutes == '30') {
         $options .= '<option selected="selected">11:30</option>';
     } else {
         $options .= '<option>11:30</option>';
     }
     if ($hours == '12' && $minutes == '00') {
         $options .= '<option selected="selected">12:00</option>';
     } else {
         $options .= '<option>12:00</option>';
     }
     if ($hours == '12' && $minutes == '30') {
         $options .= '<option selected="selected">12:30</option>';
     } else {
         $options .= '<option>12:30</option>';
     }
     if ($hours == '13' && $minutes == '00') {
         $options .= '<option selected="selected">13:00</option>';
     } else {
         $options .= '<option>13:00</option>';
     }
     if ($hours == '13' && $minutes == '30') {
         $options .= '<option selected="selected">13:30</option>';
     } else {
         $options .= '<option>13:30</option>';
     }
     if ($hours == '14' && $minutes == '00') {
         $options .= '<option selected="selected">14:00</option>';
     } else {
         $options .= '<option>14:00</option>';
     }
     if ($hours == '14' && $minutes == '30') {
         $options .= '<option selected="selected">14:30</option>';
     } else {
         $options .= '<option>14:30</option>';
     }
     if ($hours == '15' && $minutes == '00') {
         $options .= '<option selected="selected">15:00</option>';
     } else {
         $options .= '<option>15:00</option>';
     }
     if ($hours == '15' && $minutes == '30') {
         $options .= '<option selected="selected">15:30</option>';
     } else {
         $options .= '<option>15:30</option>';
     }
     if ($hours == '16' && $minutes == '00') {
         $options .= '<option selected="selected">16:00</option>';
     } else {
         $options .= '<option>16:00</option>';
     }
     if ($hours == '16' && $minutes == '30') {
         $options .= '<option selected="selected">16:30</option>';
     } else {
         $options .= '<option>16:30</option>';
     }
     if ($hours == '17' && $minutes == '00') {
         $options .= '<option selected="selected">17:00</option>';
     } else {
         $options .= '<option>17:00</option>';
     }
     if ($hours == '17' && $minutes == '30') {
         $options .= '<option selected="selected">17:30</option>';
     } else {
         $options .= '<option>17:30</option>';
     }
     if ($hours == '18' && $minutes == '00') {
         $options .= '<option selected="selected">18:00</option>';
     } else {
         $options .= '<option>18:00</option>';
     }
     if ($hours == '18' && $minutes == '30') {
         $options .= '<option selected="selected">18:30</option>';
     } else {
         $options .= '<option>18:30</option>';
     }
     if ($hours == '19' && $minutes == '00') {
         $options .= '<option selected="selected">19:00</option>';
     } else {
         $options .= '<option>19:00</option>';
     }
     if ($hours == '19' && $minutes == '30') {
         $options .= '<option selected="selected">19:30</option>';
     } else {
         $options .= '<option>19:30</option>';
     }
     if ($hours == '20' && $minutes == '00') {
         $options .= '<option selected="selected">20:00</option>';
     } else {
         $options .= '<option>20:00</option>';
     }
     if ($hours == '20' && $minutes == '30') {
         $options .= '<option selected="selected">20:30</option>';
     } else {
         $options .= '<option>20:30</option>';
     }
     if ($hours == '21' && $minutes == '00') {
         $options .= '<option selected="selected">21:00</option>';
     } else {
         $options .= '<option>21:00</option>';
     }
     if ($hours == '21' && $minutes == '30') {
         $options .= '<option selected="selected">21:30</option>';
     } else {
         $options .= '<option>21:30</option>';
     }
     if ($hours == '22' && $minutes == '00') {
         $options .= '<option selected="selected">22:00</option>';
     } else {
         $options .= '<option>22:00</option>';
     }
     if ($hours == '22' && $minutes == '30') {
         $options .= '<option selected="selected">22:30</option>';
     } else {
         $options .= '<option>22:30</option>';
     }
     if ($hours == '23' && $minutes == '00') {
         $options .= '<option selected="selected">23:00</option>';
     } else {
         $options .= '<option>23:00</option>';
     }
     if ($hours == '23' && $minutes == '30') {
         $options .= '<option selected="selected">23:30</option>';
     } else {
         $options .= '<option>23:30</option>';
     }
     $options .= '</select>';
     // event time
     $label = i18n::s('Date');
     $input = Skin::build_input_time('date_stamp', $date, 'date') . $options;
     $hint = i18n::s('Use format YYYY-MM-DD');
     $fields[] = array($label, $input, $hint);
     // ensure that we do have a date
     Page::insert_script('func' . 'tion validateOnSubmit(container) {' . "\n" . '	if(!Yacs.trim(container.date_stamp.value)) {' . "\n" . '		alert("' . i18n::s('Please provide a date.') . '");' . "\n" . '		container.date_stamp.focus();' . "\n" . '		Yacs.stopWorking();' . "\n" . '		return false;' . "\n" . '	}' . "\n" . '	return true;' . "\n" . '}' . "\n");
     // duration
     $label = i18n::s('Duration');
     $input = '<select name="duration">';
     if (!isset($this->attributes['duration']) || $this->attributes['duration'] < 15 || $this->attributes['duration'] > 1440) {
         $this->attributes['duration'] = 60;
     }
     $input .= '<option value="15"' . ($this->attributes['duration'] == 15 ? ' selected="selected"' : '') . '>' . sprintf(i18n::s('%d minutes'), 15) . '</option>';
     $input .= '<option value="30"' . ($this->attributes['duration'] == 30 ? ' selected="selected"' : '') . '>' . sprintf(i18n::s('%d minutes'), 30) . '</option>';
     $input .= '<option value="45"' . ($this->attributes['duration'] == 45 ? ' selected="selected"' : '') . '>' . sprintf(i18n::s('%d minutes'), 45) . '</option>';
     $input .= '<option value="60"' . ($this->attributes['duration'] == 60 ? ' selected="selected"' : '') . '>' . i18n::s('one hour') . '</option>';
     $input .= '<option value="120"' . ($this->attributes['duration'] == 120 ? ' selected="selected"' : '') . '>' . i18n::s('two hours') . '</option>';
     $input .= '<option value="1440"' . ($this->attributes['duration'] == 1440 ? ' selected="selected"' : '') . '>' . i18n::s('all day') . '</option>';
     $input .= '</select>';
     $fields[] = array($label, $input);
     return $fields;
 }
Beispiel #3
0
 }
 // the form to edit an date
 $context['text'] .= '<form method="post" action="' . $context['script_url'] . '" onsubmit="return validateDocumentPost(this)" id="main_form"><div>';
 // form fields
 $fields = array();
 // display info on current version
 if (isset($item['id'])) {
     // the last poster
     if (isset($item['edit_id']) && $item['edit_id']) {
         $text = Users::get_link($item['edit_name'], $item['edit_address'], $item['edit_id']) . ' ' . Skin::build_date($item['edit_date']);
         $fields[] = array(i18n::s('Posted by'), $text);
     }
 }
 // date
 $label = i18n::s('Target date');
 $input = Skin::build_input_time('date_stamp', $item['date_stamp'], 'date');
 $hint = i18n::s('YYYY-MM-DD');
 $fields[] = array($label, $input, $hint);
 // build the form
 $context['text'] .= Skin::build_form($fields);
 $fields = array();
 // associates may decide to not stamp changes -- complex command
 if (Surfer::is_associate() && Surfer::has_all()) {
     $context['text'] .= '<p><input type="checkbox" name="silent" value="Y" /> ' . i18n::s('Do not change modification date of the main page.') . '</p>';
 }
 // the submit button
 $context['text'] .= '<p>' . Skin::build_submit_button(i18n::s('Submit'), i18n::s('Press [s] to submit data'), 's') . '</p>' . "\n";
 // transmit the id as a hidden field
 if (isset($item['id']) && $item['id']) {
     $context['text'] .= '<input type="hidden" name="id" value="' . $item['id'] . '" />';
 }
Beispiel #4
0
 // adjust date from UTC time zone to surfer time zone
 $value = '';
 if (isset($item['activation_date']) && $item['activation_date'] > NULL_DATE) {
     $value = Surfer::from_GMT($item['activation_date']);
 }
 $input = Skin::build_input_time('activation_date', $value, 'date_time');
 $hint = i18n::s('Publish content in the future - automatically');
 $fields[] = array($label, $input, $hint);
 // the expiry date
 $label = i18n::s('Expiry date');
 // adjust date from UTC time zone to surfer time zone
 $value = '';
 if (isset($item['expiry_date']) && $item['expiry_date'] > NULL_DATE) {
     $value = Surfer::from_GMT($item['expiry_date']);
 }
 $input = Skin::build_input_time('expiry_date', $value, 'date_time');
 $hint = i18n::s('Remove content on dead-line - automatically');
 $fields[] = array($label, $input, $hint);
 // provide my id
 $me = isset($item['id']) ? $item['id'] : NULL;
 // reference to parent section
 $ref = is_object($anchor) ? $anchor->get_reference() : NULL;
 // associates can anchor the section anywhere
 if (Surfer::is_associate()) {
     $label = i18n::s('Section');
     $input =& Skin::build_box(i18n::s('Select parent container'), Sections::get_radio_buttons($ref, $me), 'folded');
     $fields[] = array($label, $input);
     // parent section is defined and surfer is an editor of it
 } elseif (is_object($anchor) && $anchor->is_assigned()) {
     $label = i18n::s('Section');
     $input =& Skin::build_box(i18n::s('Select parent container'), Sections::get_radio_buttons($ref, $me), 'folded');
Beispiel #5
0
 /**
  * add some tabs
  *
  * Display additional information in panels.
  *
  * Accepted action codes:
  * - 'edit' - embedded into the main form page
  *
  * @see overlays/overlay.php
  *
  * @param string the on-going action
  * @param array the hosting record
  * @return an array of array('tab_id', 'tab_label', 'panel_id', 'panel_content') or NULL
  */
 function &get_tabs($variant = 'view', $host = NULL)
 {
     global $context, $local;
     // returned tabs
     $tabs = array();
     $now = strftime('%Y-%m-%d %H:%M:%S', time() + (Surfer::get_gmt_offset() - intval($context['gmt_offset'])) * 3600);
     // trackings
     //
     $tracking = '';
     // only associates and page owners can change the status
     if ($variant == 'edit' && isset($this->anchor) && $this->anchor->is_owned()) {
         // a table of fields
         $fields = array();
         // owner
         $label = i18n::s('Owner');
         if (isset($host['owner_id']) && ($user = Users::get($host['owner_id']))) {
             $value = $user['nick_name'];
         } else {
             $value = '';
         }
         $input = '<input type="text" name="owner" id="owner" value ="' . encode_field($value) . '" size="25" maxlength="32" />';
         $hint = i18n::s('Type some letters of the name and select in the list');
         $fields[] = array($label, $input, $hint);
         // enable owner autocompletion
         Page::insert_script('$(function() { Yacs.autocomplete_names("owner",true); });');
         // priority
         $label = i18n::s('Priority');
         if (!isset($this->attributes['color'])) {
             $this->attributes['color'] = 'green';
         }
         $input = self::get_color_as_radio_buttons($this->attributes['color']);
         $fields[] = array($label, $input);
         // type
         $label = i18n::s('Workflow');
         if (!isset($this->attributes['type'])) {
             $this->attributes['type'] = 'incident';
         }
         $input = '<select name="type" id="type">' . self::get_type_options($this->attributes['type']) . '</select>';
         $fields[] = array($label, $input);
         // format these fields
         $tracking .= Skin::build_form($fields);
         $fields = array();
         // to represent transitions from one step to the next one
         Skin::define_img('NEXT_STEP', 'overlays/next_step.gif', 'V');
         // status
         if (!isset($this->attributes['status'])) {
             $this->attributes['status'] = 'on-going:suspect';
         }
         // create_date
         if (!isset($host['create_date']) || !$host['create_date']) {
             $host['create_date'] = gmstrftime('%Y-%m-%d %H:%M:%S');
         }
         $host['create_date'] = Surfer::from_GMT($host['create_date']);
         if ($this->attributes['type'] == 'feature') {
             $label = i18n::s('Feature request has been created on %s');
         } elseif ($this->attributes['type'] == 'patch') {
             $label = i18n::s('Patch has been submitted on %s');
         } else {
             $label = i18n::s('Page has been created on %s');
         }
         $tracking .= '<div class="bottom" style="margin-bottom: 1em;">' . sprintf($label, Skin::build_input_time('create_date', $host['create_date'], 'date_time') . ' <a onclick="$(\'#create_date\').val(\'' . $now . '\')" style="cursor: pointer;" class="details">' . i18n::s('now') . '</a>') . '</div>';
         $tracking .= NEXT_STEP;
         // qualification_date
         if (isset($this->attributes['qualification_date'])) {
             $this->attributes['qualification_date'] = Surfer::from_GMT($this->attributes['qualification_date']);
         }
         $tracking .= '<div style="margin-top: 1em">' . sprintf(i18n::s('Qualification has taken place on %s'), Skin::build_input_time('qualification_date', isset($this->attributes['qualification_date']) ? $this->attributes['qualification_date'] : NULL_DATE, 'date_time') . ' <a onclick="$(\'#qualification_date\').val(\'' . $now . '\')" style="cursor: pointer;" class="details">' . i18n::s('now') . '</a>') . '<p>';
         $checked = '';
         if (isset($this->attributes['status']) && $this->attributes['status'] == 'on-going:problem') {
             $checked = 'checked="checked"';
         }
         $tracking .= '<input type="radio" name="status" value ="on-going:problem" ' . $checked . ' />&nbsp;' . $this->get_status_label('on-going:problem');
         $checked = '';
         if (isset($this->attributes['status']) && $this->attributes['status'] == 'cancelled:suspect') {
             $checked = 'checked="checked"';
         }
         $tracking .= BR . '<input type="radio" name="status" value ="cancelled:suspect" ' . $checked . ' />&nbsp;' . $this->get_status_label('cancelled:suspect') . '</p></div>';
         $tracking .= NEXT_STEP;
         // analysis_date, except for maintenance cases
         if ($this->attributes['type'] != 'maintenance') {
             if (isset($this->attributes['analysis_date'])) {
                 $this->attributes['analysis_date'] = Surfer::from_GMT($this->attributes['analysis_date']);
             }
             $tracking .= '<div style="margin-top: 1em">' . sprintf(i18n::s('Analysis has ended on %s'), Skin::build_input_time('analysis_date', isset($this->attributes['analysis_date']) ? $this->attributes['analysis_date'] : NULL_DATE, 'date_time') . ' <a onclick="$(\'#analysis_date\').val(\'' . $now . '\')" style="cursor: pointer;" class="details">' . i18n::s('now') . '</a>') . '<p>';
             $checked = '';
             if (isset($this->attributes['status']) && $this->attributes['status'] == 'on-going:issue') {
                 $checked = 'checked="checked"';
             }
             $tracking .= '<input type="radio" name="status" value ="on-going:issue" ' . $checked . ' />&nbsp;' . $this->get_status_label('on-going:issue');
             $checked = '';
             if (isset($this->attributes['status']) && $this->attributes['status'] == 'cancelled:problem') {
                 $checked = 'checked="checked"';
             }
             $tracking .= BR . '<input type="radio" name="status" value ="cancelled:problem" ' . $checked . ' />&nbsp;' . $this->get_status_label('cancelled:problem') . '</p></div>';
             $tracking .= NEXT_STEP;
         }
         // resolution_date
         if (isset($this->attributes['resolution_date'])) {
             $this->attributes['resolution_date'] = Surfer::from_GMT($this->attributes['resolution_date']);
         }
         if ($this->attributes['type'] == 'feature') {
             $label = i18n::s('Assignment has been finalized on %s');
         } elseif ($this->attributes['type'] == 'maintenance') {
             $label = i18n::s('Change has been finalized on %s');
         } elseif ($this->attributes['type'] == 'patch') {
             $label = i18n::s('Assignment has been finalized on %s');
         } else {
             $label = i18n::s('Resolution has been finalized on %s');
         }
         $tracking .= '<div style="margin-top: 1em">' . sprintf($label, Skin::build_input_time('resolution_date', isset($this->attributes['resolution_date']) ? $this->attributes['resolution_date'] : NULL_DATE, 'date_time') . ' <a onclick="$(\'#resolution_date\').val(\'' . $now . '\')" style="cursor: pointer;" class="details">' . i18n::s('now') . '</a>') . '<p>';
         $checked = '';
         if (isset($this->attributes['status']) && $this->attributes['status'] == 'on-going:solution') {
             $checked = 'checked="checked"';
         }
         $tracking .= '<input type="radio" name="status" value ="on-going:solution" ' . $checked . ' />&nbsp;' . $this->get_status_label('on-going:solution');
         $checked = '';
         if (isset($this->attributes['status']) && $this->attributes['status'] == 'cancelled:issue') {
             $checked = 'checked="checked"';
         }
         $tracking .= BR . '<input type="radio" name="status" value ="cancelled:issue" ' . $checked . ' />&nbsp;' . $this->get_status_label('cancelled:issue') . '</p></div>';
         $tracking .= NEXT_STEP;
         // close_date
         if (isset($this->attributes['close_date'])) {
             $this->attributes['close_date'] = Surfer::from_GMT($this->attributes['close_date']);
         }
         $tracking .= '<div style="margin-top: 1em">' . sprintf(i18n::s('Case has been closed on %s'), Skin::build_input_time('close_date', isset($this->attributes['close_date']) ? $this->attributes['close_date'] : NULL_DATE, 'date_time') . ' <a onclick="$(\'#close_date\').val(\'' . $now . '\')" style="cursor: pointer;" class="details">' . i18n::s('now') . '</a>') . '<p>';
         $checked = '';
         if (isset($this->attributes['status']) && $this->attributes['status'] == 'completed:solution') {
             $checked = 'checked="checked"';
         }
         $tracking .= '<input type="radio" name="status" value ="completed:solution" ' . $checked . ' />&nbsp;' . $this->get_status_label('completed:solution');
         $checked = '';
         if (isset($this->attributes['status']) && $this->attributes['status'] == 'cancelled:solution') {
             $checked = 'checked="checked"';
         }
         $tracking .= BR . '<input type="radio" name="status" value ="cancelled:solution" ' . $checked . ' />&nbsp;' . $this->get_status_label('cancelled:solution') . '</p></div>';
     }
     // finalize this tab
     if ($tracking) {
         $tabs[] = array('tracking', i18n::s('Tracking'), 'tracking_panel', $tracking);
     }
     // add these tabs
     return $tabs;
 }
Beispiel #6
0
     $context['text'] .= '<form method="post" action="' . $context['script_url'] . '" name="form_2"><div>' . "\n";
     // catch user input
     $context['text'] .= sprintf(i18n::s('Expire the page after the %s'), Skin::build_input_time('expiry_date', NULL, 'date_time'));
     // the submit button
     $context['text'] .= Skin::build_submit_button(i18n::s('Save the date')) . "\n" . '<input type="hidden" name="id" value="' . $item['id'] . '" />' . "\n" . '<input type="hidden" name="action" value="expiry" />' . "\n" . '</div></form>' . "\n";
 }
 // change or delete the publishing date
 $context['text'] .= Skin::build_block(i18n::s('Publication date'), 'title');
 // change the publication date
 if (isset($item['publish_date']) && $item['publish_date'] > NULL_DATE) {
     // adjust date from server time zone to surfer time zone
     $value = Surfer::from_GMT($item['publish_date']);
     // a form to change the date
     $context['text'] .= '<form method="post" action="' . $context['script_url'] . '" name="form_3"><div>' . "\n";
     // catch user input
     $context['text'] .= sprintf(i18n::s('Change the publication date to %s'), Skin::build_input_time('publish_date', $value, 'date_time'));
     // the submit button
     $context['text'] .= Skin::build_submit_button(i18n::s('Save the date')) . "\n" . '<input type="hidden" name="id" value="' . $item['id'] . '" />' . "\n" . '<input type="hidden" name="action" value="publish" />' . "\n" . '</div></form>' . "\n";
     // a form to remove the date
     $context['text'] .= '<form method="post" action="' . $context['script_url'] . '"><div>' . "\n" . Skin::build_submit_button(i18n::s('Change to draft mode')) . "\n" . '<input type="hidden" name="id" value="' . $item['id'] . '" />' . "\n" . '<input type="hidden" name="action" value="publish" />' . "\n" . '<input type="hidden" name="publish_date" value="" />' . "\n" . '</div></form>' . "\n";
     // set a new publication date
 } else {
     // go to the dedicated page
     $context['text'] .= '<p>' . Skin::build_link(Articles::get_url($item['id'], 'publish'), i18n::s('Publish the page'), 'shortcut') . '</p>';
 }
 // cancel
 if (isset($_SERVER['HTTP_REFERER'])) {
     $referer = $_SERVER['HTTP_REFERER'];
 } else {
     $referer = 'articles/review.php';
 }