} else { $login_url = $context['url_to_root'] . 'users/login.php?url=' . urlencode('articles/edit.php'); } $text .= '<p>' . sprintf(i18n::s('If you have previously registered to this site, please %s. Then the server will automatically put your name and address in following fields.'), Skin::build_link($login_url, 'authenticate')) . "</p>\n"; // the name, if any $label = i18n::s('Your name'); $input = '<input type="text" name="edit_name" size="45" maxlength="128" accesskey="n" value="' . encode_field(Surfer::get_name(' ')) . '" />'; $hint = i18n::s('Let us a chance to know who you are'); $fields[] = array($label, $input, $hint); // the address, if any $label = i18n::s('Your e-mail address'); $input = '<input type="text" name="edit_address" size="45" maxlength="128" accesskey="a" value="' . encode_field(Surfer::get_email_address()) . '" />'; $hint = i18n::s('Put your e-mail address to receive feed-back'); $fields[] = array($label, $input, $hint); // stop robots if ($field = Surfer::get_robot_stopper()) { $fields[] = $field; } } // the title if (!is_object($overlay) || !($label = $overlay->get_label('title', isset($item['id']) ? 'edit' : 'new'))) { $label = i18n::s('Title') . ' *'; } $value = ''; if (isset($item['title']) && $item['title']) { $value = $item['title']; } elseif (isset($_SESSION['pasted_title'])) { $value = $_SESSION['pasted_title']; } $input = '<textarea name="title" id="title" rows="2" cols="50" accesskey="t">' . encode_field($value) . '</textarea>'; if (!is_object($overlay) || !($hint = $overlay->get_label('title_hint', isset($item['id']) ? 'edit' : 'new'))) {
$label = i18n::s('Its title'); $input = '<input type="text" name="title" size="45" maxlength="255" />'; $hint = i18n::s('The title of your page'); $fields[] = array($label, $input, $hint); // the excerpt $label = i18n::s('Excerpt or description'); $input = '<textarea name="excerpt" rows="5" cols="50"></textarea>'; $hint = i18n::s('As this field may be searched by surfers, please choose adequate searchable words'); $fields[] = array($label, $input, $hint); // the blog name $label = i18n::s('Blog name or section'); $input = '<input type="text" name="blog_name" size="45" value="' . encode_field($blog_name) . '" maxlength="64" />'; $hint = i18n::s('To complement the excerpt'); $fields[] = array($label, $input, $hint); // random string to stop robots if (!Surfer::is_logged() && ($field = Surfer::get_robot_stopper())) { $fields[] = $field; } // build the form $text .= Skin::build_form($fields); // the submit button $text .= '<p>' . Skin::build_submit_button(i18n::s('Submit'), i18n::s('Press [s] to submit data'), 's') . '</p>'; // other hidden fields $text .= '<input type="hidden" name="anchor" value="' . $anchor->get_reference() . '" />'; // end of the form $text .= '</div></form>'; // the script used for form handling at the browser Page::insert_script('func' . 'tion validateDocumentPost(container) {' . "\n" . ' if(!container.url.value) {' . "\n" . ' alert("' . i18n::s('Please type a valid link.') . '");' . "\n" . ' Yacs.stopWorking();' . "\n" . ' return false;' . "\n" . ' }' . "\n" . ' if(!container.title.value) {' . "\n" . ' alert("' . i18n::s('Please provide a meaningful title.') . '");' . "\n" . ' Yacs.stopWorking();' . "\n" . ' return false;' . "\n" . ' }' . "\n" . ' if(!container.exceprt.value) {' . "\n" . ' alert("' . i18n::s('You must type an excerpt of the referencing page.') . '");' . "\n" . ' Yacs.stopWorking();' . "\n" . ' return false;' . "\n" . ' }' . "\n" . ' if(!container.blog_name.value) {' . "\n" . ' alert("' . i18n::s('You must name the originating blog.') . '");' . "\n" . ' Yacs.stopWorking();' . "\n" . ' return false;' . "\n" . ' }' . "\n" . ' return true;' . "\n" . '}' . "\n" . '$("#url").focus();' . "\n"); // trackback link $label = i18n::s('Trackback address:'); $value = $context['url_to_home'] . $context['url_to_root'] . 'links/trackback.php?anchor=' . $anchor->get_reference();