$input = ARTICLES_UNPUBLISH_IMG . i18n::s('not published'); } $fields[] = array($label, $input); // the expiry date $label = i18n::s('Expiry date'); if (isset($item['expiry_date']) && $item['expiry_date'] > NULL_DATE) { $input = Surfer::from_GMT($item['expiry_date']); } else { $input = i18n::s('never'); } $fields[] = array($label, $input); // the parent section if (is_object($anchor)) { if (isset($item['id']) && Articles::is_owned($item, $anchor)) { $label = i18n::s('Section'); $input =& Skin::build_box(i18n::s('Select parent container'), Sections::get_radio_buttons($anchor->get_reference()), 'folded'); $fields[] = array($label, $input); } else { $text .= '<input type="hidden" name="anchor" value="' . $anchor->get_reference() . '" />'; } } // append fields if (is_object($anchor)) { $label = sprintf(i18n::s('Contribution to "%s"'), $anchor->get_title()); } else { $label = i18n::s('Contribution to parent container'); } $text .= Skin::build_box($label, Skin::build_form($fields), 'folded'); $fields = array(); // the source $label = i18n::s('Source');
$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'); $fields[] = array($label, $input); // preserve the existing anchor } else { $text .= '<input type="hidden" name="anchor" value="' . $anchor->get_reference() . '" />'; } // append fields $parent .= Skin::build_form($fields); $fields = array(); // append fields if (is_object($anchor)) { $label = sprintf(i18n::s('Contribution to "%s"'), $anchor->get_title()); } else { $label = i18n::s('Appearance at the site map'); } $text .= Skin::build_box($label, $parent, 'folded');