예제 #1
0
파일: page.php 프로젝트: nikrou/dotclear
    if ($next_link) {
        echo $next_link;
    }
    # --BEHAVIOR-- adminPageNavLinks
    $core->callBehavior('adminPageNavLinks', isset($post) ? $post : null);
    echo '</p>';
}
# Exit if we cannot view page
if (!$can_view_page) {
    echo '</body></html>';
    return;
}
/* Post form if we can edit page
-------------------------------------------------------- */
if ($can_edit_page) {
    $sidebar_items = new ArrayObject(array('status-box' => array('title' => __('Status'), 'items' => array('post_status' => '<p><label for="post_status">' . __('Page status') . '</label> ' . form::combo('post_status', $status_combo, $post_status, '', '', !$can_publish) . '</p>', 'post_dt' => '<p><label for="post_dt">' . __('Publication date and hour') . '</label>' . form::field('post_dt', 16, 16, $post_dt, $bad_dt ? 'invalid' : '') . '</p>', 'post_lang' => '<p><label for="post_lang">' . __('Page language') . '</label>' . form::combo('post_lang', $lang_combo, $post_lang) . '</p>', 'post_format' => '<div>' . '<h5 id="label_format"><label for="post_format" class="classic">' . __('Text formatting') . '</label></h5>' . '<p>' . form::combo('post_format', $available_formats, $post_format, 'maximal') . '</p>' . '<p class="format_control control_wiki">' . '<a id="convert-xhtml" class="button' . ($post_id && $post_format != 'wiki' ? ' hide' : '') . '" href="' . html::escapeURL($redir_url) . '&amp;id=' . $post_id . '&amp;xconv=1">' . __('Convert to XHTML') . '</a></p></div>')), 'metas-box' => array('title' => __('Filing'), 'items' => array('post_position' => '<p><label for="post_position" class="classic">' . __('Page position') . '</label> ' . form::field('post_position', 3, 3, (string) $post_position) . '</p>')), 'options-box' => array('title' => __('Options'), 'items' => array('post_open_comment_tb' => '<div>' . '<h5 id="label_comment_tb">' . __('Comments and trackbacks list') . '</h5>' . '<p><label for="post_open_comment" class="classic">' . form::checkbox('post_open_comment', 1, $post_open_comment) . ' ' . __('Accept comments') . '</label></p>' . ($core->blog->settings->system->allow_comments ? isContributionAllowed($post_id, strtotime($post_dt), true) ? '' : '<p class="form-note warn">' . __('Warning: Comments are not more accepted for this entry.') . '</p>' : '<p class="form-note warn">' . __('Comments are not accepted on this blog so far.') . '</p>') . '<p><label for="post_open_tb" class="classic">' . form::checkbox('post_open_tb', 1, $post_open_tb) . ' ' . __('Accept trackbacks') . '</label></p>' . ($core->blog->settings->system->allow_trackbacks ? isContributionAllowed($post_id, strtotime($post_dt), false) ? '' : '<p class="form-note warn">' . __('Warning: Trackbacks are not more accepted for this entry.') . '</p>' : '<p class="form-note warn">' . __('Trackbacks are not accepted on this blog so far.') . '</p>') . '</div>', 'post_hide' => '<p><label for="post_selected" class="classic">' . form::checkbox('post_selected', 1, $post_selected) . ' ' . __('Hide in widget Pages') . '</label>' . '</p>', 'post_password' => '<p><label for="post_password">' . __('Password') . '</label>' . form::field('post_password', 10, 32, html::escapeHTML($post_password), 'maximal') . '</p>', 'post_url' => '<div class="lockable">' . '<p><label for="post_url">' . __('Edit basename') . '</label>' . form::field('post_url', 10, 255, html::escapeHTML($post_url), 'maximal') . '</p>' . '<p class="form-note warn">' . __('Warning: If you set the URL manually, it may conflict with another page.') . '</p></div>'))));
    $main_items = new ArrayObject(array("post_title" => '<p class="col">' . '<label class="required no-margin bold" for="post_title"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Title:') . '</label>' . form::field('post_title', 20, 255, html::escapeHTML($post_title), 'maximal') . '</p>', "post_excerpt" => '<p class="area" id="excerpt-area"><label for="post_excerpt" class="bold">' . __('Excerpt:') . ' <span class="form-note">' . __('Introduction to the page.') . '</span></label> ' . form::textarea('post_excerpt', 50, 5, html::escapeHTML($post_excerpt)) . '</p>', "post_content" => '<p class="area" id="content-area"><label class="required bold" ' . 'for="post_content"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Content:') . '</label> ' . form::textarea('post_content', 50, $core->auth->getOption('edit_size'), html::escapeHTML($post_content)) . '</p>', "post_notes" => '<p class="area" id="notes-area"><label for="post_notes" class="bold">' . __('Personal notes:') . ' <span class="form-note">' . __('Unpublished notes.') . '</span></label>' . form::textarea('post_notes', 50, 5, html::escapeHTML($post_notes)) . '</p>'));
    # --BEHAVIOR-- adminPostFormItems
    $core->callBehavior('adminPageFormItems', $main_items, $sidebar_items, isset($post) ? $post : null);
    echo '<div class="multi-part" title="' . ($post_id ? __('Edit page') : __('New page')) . sprintf(' &rsaquo; %s', $post_format) . '" id="edit-entry">';
    echo '<form action="' . html::escapeURL($redir_url) . '" method="post" id="entry-form">';
    echo '<div id="entry-wrapper">';
    echo '<div id="entry-content"><div class="constrained">';
    echo '<h3 class="out-of-screen-if-js">' . __('Edit page') . '</h3>';
    foreach ($main_items as $id => $item) {
        echo $item;
    }
    # --BEHAVIOR-- adminPageForm
    $core->callBehavior('adminPageForm', isset($post) ? $post : null);
    echo '<p class="border-top">' . ($post_id ? form::hidden('id', $post_id) : '') . '<input type="submit" value="' . __('Save') . ' (s)" ' . 'accesskey="s" name="save" /> ';
    if ($post_id) {
예제 #2
0
파일: post.php 프로젝트: nikrou/dotclear
        echo $next_link;
    }
    # --BEHAVIOR-- adminPostNavLinks
    $core->callBehavior('adminPostNavLinks', isset($post) ? $post : null);
    echo '</p>';
}
# Exit if we cannot view page
if (!$can_view_page) {
    dcPage::helpBlock('core_post');
    dcPage::close();
    exit;
}
/* Post form if we can edit post
-------------------------------------------------------- */
if ($can_edit_post) {
    $sidebar_items = new ArrayObject(array('status-box' => array('title' => __('Status'), 'items' => array('post_status' => '<p class="entry-status"><label for="post_status">' . __('Entry status') . ' ' . $img_status . '</label>' . form::combo('post_status', $status_combo, $post_status, 'maximal', '', !$can_publish) . '</p>', 'post_dt' => '<p><label for="post_dt">' . __('Publication date and hour') . '</label>' . form::field('post_dt', 16, 16, $post_dt, $bad_dt ? 'invalid' : '') . '</p>', 'post_lang' => '<p><label for="post_lang">' . __('Entry language') . '</label>' . form::combo('post_lang', $lang_combo, $post_lang) . '</p>', 'post_format' => '<div>' . '<h5 id="label_format"><label for="post_format" class="classic">' . __('Text formatting') . '</label></h5>' . '<p>' . form::combo('post_format', $available_formats, $post_format, 'maximal') . '</p>' . '<p class="format_control control_no_xhtml">' . '<a id="convert-xhtml" class="button' . ($post_id && $post_format != 'wiki' ? ' hide' : '') . '" href="' . $core->adminurl->get('admin.post', array('id' => $post_id, 'xconv' => '1')) . '">' . __('Convert to XHTML') . '</a></p></div>')), 'metas-box' => array('title' => __('Filing'), 'items' => array('post_selected' => '<p><label for="post_selected" class="classic">' . form::checkbox('post_selected', 1, $post_selected) . ' ' . __('Selected entry') . '</label></p>', 'cat_id' => '<div>' . '<h5 id="label_cat_id">' . __('Category') . '</h5>' . '<p><label for="cat_id">' . __('Category:') . '</label>' . form::combo('cat_id', $categories_combo, $cat_id, 'maximal') . '</p>' . ($core->auth->check('categories', $core->blog->id) ? '<div>' . '<h5 id="create_cat">' . __('Add a new category') . '</h5>' . '<p><label for="new_cat_title">' . __('Title:') . ' ' . form::field('new_cat_title', 30, 255, '', 'maximal') . '</label></p>' . '<p><label for="new_cat_parent">' . __('Parent:') . ' ' . form::combo('new_cat_parent', $categories_combo, '', 'maximal') . '</label></p>' . '</div>' : '') . '</div>')), 'options-box' => array('title' => __('Options'), 'items' => array('post_open_comment_tb' => '<div>' . '<h5 id="label_comment_tb">' . __('Comments and trackbacks list') . '</h5>' . '<p><label for="post_open_comment" class="classic">' . form::checkbox('post_open_comment', 1, $post_open_comment) . ' ' . __('Accept comments') . '</label></p>' . ($core->blog->settings->system->allow_comments ? isContributionAllowed($post_id, strtotime($post_dt), true) ? '' : '<p class="form-note warn">' . __('Warning: Comments are not more accepted for this entry.') . '</p>' : '<p class="form-note warn">' . __('Comments are not accepted on this blog so far.') . '</p>') . '<p><label for="post_open_tb" class="classic">' . form::checkbox('post_open_tb', 1, $post_open_tb) . ' ' . __('Accept trackbacks') . '</label></p>' . ($core->blog->settings->system->allow_trackbacks ? isContributionAllowed($post_id, strtotime($post_dt), false) ? '' : '<p class="form-note warn">' . __('Warning: Trackbacks are not more accepted for this entry.') . '</p>' : '<p class="form-note warn">' . __('Trackbacks are not accepted on this blog so far.') . '</p>') . '</div>', 'post_password' => '<p><label for="post_password">' . __('Password') . '</label>' . form::field('post_password', 10, 32, html::escapeHTML($post_password), 'maximal') . '</p>', 'post_url' => '<div class="lockable">' . '<p><label for="post_url">' . __('Edit basename') . '</label>' . form::field('post_url', 10, 255, html::escapeHTML($post_url), 'maximal') . '</p>' . '<p class="form-note warn">' . __('Warning: If you set the URL manually, it may conflict with another entry.') . '</p></div>'))));
    $main_items = new ArrayObject(array("post_title" => '<p class="col">' . '<label class="required no-margin bold" for="post_title"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Title:') . '</label>' . form::field('post_title', 20, 255, html::escapeHTML($post_title), 'maximal') . '</p>', "post_excerpt" => '<p class="area" id="excerpt-area"><label for="post_excerpt" class="bold">' . __('Excerpt:') . ' <span class="form-note">' . __('Introduction to the post.') . '</span></label> ' . form::textarea('post_excerpt', 50, 5, html::escapeHTML($post_excerpt)) . '</p>', "post_content" => '<p class="area" id="content-area"><label class="required bold" ' . 'for="post_content"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Content:') . '</label> ' . form::textarea('post_content', 50, $core->auth->getOption('edit_size'), html::escapeHTML($post_content)) . '</p>', "post_notes" => '<p class="area" id="notes-area"><label for="post_notes" class="bold">' . __('Personal notes:') . ' <span class="form-note">' . __('Unpublished notes.') . '</span></label>' . form::textarea('post_notes', 50, 5, html::escapeHTML($post_notes)) . '</p>'));
    # --BEHAVIOR-- adminPostFormItems
    $core->callBehavior('adminPostFormItems', $main_items, $sidebar_items, isset($post) ? $post : null);
    echo '<div class="multi-part" title="' . ($post_id ? __('Edit entry') : __('New entry')) . sprintf(' &rsaquo; %s', $post_format) . '" id="edit-entry">';
    echo '<form action="' . $core->adminurl->get('admin.post') . '" method="post" id="entry-form">';
    echo '<div id="entry-wrapper">';
    echo '<div id="entry-content"><div class="constrained">';
    echo '<h3 class="out-of-screen-if-js">' . __('Edit post') . '</h3>';
    foreach ($main_items as $id => $item) {
        echo $item;
    }
    # --BEHAVIOR-- adminPostForm (may be deprecated)
    $core->callBehavior('adminPostForm', isset($post) ? $post : null);
    echo '<p class="border-top">' . ($post_id ? form::hidden('id', $post_id) : '') . '<input type="submit" value="' . __('Save') . ' (s)" ' . 'accesskey="s" name="save" /> ';
    if ($post_id) {