コード例 #1
0
ファイル: comment.php プロジェクト: HackerMajor/root
    }
    if (!empty($_POST['delete']) && $can_delete) {
        try {
            $core->blog->delComment($comment_id);
            http::redirect($core->getPostAdminURL($rs->post_type, $rs->post_id) . '&co=1#c' . $comment_id, false);
        } catch (Exception $e) {
            $core->error->add($e->getMessage());
        }
    }
    if (!$can_edit) {
        $core->error->add(__("You can't edit this comment."));
    }
}
/* DISPLAY
-------------------------------------------------------- */
dcPage::open(__('Edit comment'), dcPage::jsConfirmClose('comment-form') . dcPage::jsToolBar() . dcPage::jsLoad('js/_comment.js'));
if ($comment_id) {
    if (!empty($_GET['upd'])) {
        echo '<p class="message">' . __('Comment has been successfully updated.') . '</p>';
    }
    $comment_mailto = '';
    if ($comment_email) {
        $comment_mailto = '<a href="mailto:' . html::escapeHTML($comment_email) . '?subject=' . rawurlencode(sprintf(__('Your comment on my blog %s'), $core->blog->name)) . '&body=' . rawurlencode(sprintf(__("Hi!\n\nYou wrote a comment on:\n%s\n\n\n"), $rs->getPostURL())) . '">' . __('Send an e-mail') . '</a>';
    }
    echo '<h2>' . html::escapeHTML($core->blog->name) . ' &rsaquo; ' . __('Edit comment') . '</h2>';
    echo '<p><a class="back" href="' . $core->getPostAdminURL($post_type, $post_id) . '&amp;co=1#c' . $comment_id . '"> ' . sprintf(__('Back to "%s"'), $post_title) . '</a></p>';
    echo '<form action="comment.php" method="post" id="comment-form">' . '<p><label>' . __('IP address:') . '</label> ' . '<a href="comments.php?ip=' . $comment_ip . '">' . $comment_ip . '</a></p>' . '<p><label>' . __('Date:') . '</label> ' . dt::dt2str(__('%Y-%m-%d %H:%M'), $comment_dt) . '</p>' . '<p><label class="required" title="' . __('Required field') . '">' . __('Author:') . form::field('comment_author', 30, 255, html::escapeHTML($comment_author)) . '</label></p>' . '<p><label>' . __('Email:') . form::field('comment_email', 30, 255, html::escapeHTML($comment_email)) . $comment_mailto . '</label></p>' . '<p><label>' . __('Web site:') . form::field('comment_site', 30, 255, html::escapeHTML($comment_site)) . '</label></p>' . '<p><label>' . __('Status:') . form::combo('comment_status', $status_combo, $comment_status, '', '', !$can_publish) . '</label></p>' . $core->callBehavior('adminAfterCommentDesc', $rs) . '<p class="area"><label for="comment_content">' . __('Comment:') . '</label> ' . form::textarea('comment_content', 50, 10, html::escapeHTML($comment_content)) . '</p>' . '<p>' . form::hidden('id', $comment_id) . $core->formNonce() . '<input type="submit" accesskey="s" name="update" value="' . __('save') . '" /> ';
    if ($can_delete) {
        echo '<input type="submit" name="delete" value="' . __('delete') . '" />';
    }
    echo '</p>' . '</form>';
コード例 #2
0
ファイル: category.php プロジェクト: HackerMajor/root
            $core->callBehavior('adminAfterCategoryUpdate', $cur, $cat_id);
            http::redirect('category.php?id=' . $_POST['id'] . '&upd=1');
        } else {
            # --BEHAVIOR-- adminBeforeCategoryCreate
            $core->callBehavior('adminBeforeCategoryCreate', $cur);
            $id = $core->blog->addCategory($cur, (int) $_POST['new_cat_parent']);
            # --BEHAVIOR-- adminAfterCategoryCreate
            $core->callBehavior('adminAfterCategoryCreate', $cur, $id);
            http::redirect('categories.php?add=1');
        }
    } catch (Exception $e) {
        $core->error->add($e->getMessage());
    }
}
$title = $cat_id ? html::escapeHTML($cat_title) : __('New category');
dcPage::open($title, dcPage::jsConfirmClose('category-form') . dcPage::jsToolBar() . dcPage::jsLoad('js/_category.js'));
if (!empty($_GET['upd'])) {
    echo '<p class="message">' . __('Category has been successfully updated.') . '</p>';
}
echo '<h2>' . html::escapeHTML($core->blog->name) . ' &rsaquo; <a href="categories.php">' . __('Categories') . '</a> &rsaquo; ';
if ($cat_id) {
    while ($parents->fetch()) {
        echo '<a href="category.php?id=' . $parents->cat_id . '">' . html::escapeHTML($parents->cat_title) . '</a>';
        echo " &rsaquo; ";
    }
}
echo $title . '</h2>';
echo '<form action="category.php" method="post" id="category-form">' . '<fieldset><legend>' . __('Category information') . '</legend>' . '<p><label class="required" title="' . __('Required field') . '">' . __('Title:') . ' ' . form::field('cat_title', 40, 255, html::escapeHTML($cat_title), '', 2) . '</label></p>';
if (!$cat_id) {
    $rs = $core->blog->getCategories(array('post_type' => 'post'));
    echo '<p><label>' . __('Parent:') . ' ' . '<select id="new_cat_parent" name="new_cat_parent" tabindex="3">' . '<option value="0">' . __('Top level') . '</option>';
コード例 #3
0
ファイル: post.php プロジェクト: HackerMajor/root
        $core->blog->delPost($post_id);
        http::redirect('posts.php');
    } catch (Exception $e) {
        $core->error->add($e->getMessage());
    }
}
/* DISPLAY
-------------------------------------------------------- */
$default_tab = 'edit-entry';
if (!$can_edit_post) {
    $default_tab = '';
}
if (!empty($_GET['co'])) {
    $default_tab = 'comments';
}
dcPage::open($page_title, dcPage::jsDatePicker() . dcPage::jsToolBar() . dcPage::jsModal() . dcPage::jsLoad('js/_post.js') . dcPage::jsConfirmClose('entry-form', 'comment-form') . $core->callBehavior('adminPostHeaders') . dcPage::jsPageTabs($default_tab) . $next_headlink . "\n" . $prev_headlink);
if (!empty($_GET['upd'])) {
    echo '<p class="message">' . __('Entry has been successfully updated.') . '</p>';
} elseif (!empty($_GET['crea'])) {
    echo '<p class="message">' . __('Entry has been successfully created.') . '</p>';
} elseif (!empty($_GET['attached'])) {
    echo '<p class="message">' . __('File has been successfully attached.') . '</p>';
} elseif (!empty($_GET['rmattach'])) {
    echo '<p class="message">' . __('Attachment has been successfully removed.') . '</p>';
}
if (!empty($_GET['creaco'])) {
    echo '<p class="message">' . __('Comment has been successfully created.') . '</p>';
}
# XHTML conversion
if (!empty($_GET['xconv'])) {
    $post_excerpt = $post_excerpt_xhtml;
コード例 #4
0
ファイル: index.php プロジェクト: HackerMajor/root
                $latest_news .= '<dt>' . $dt . '</dt>' . '<dd>' . dt::dt2str('%d %B %Y', $item->pubdate, 'Europe/Paris') . '</dd>';
            }
            $i++;
            if ($i > 7) {
                break;
            }
        }
        $latest_news .= '</dl>';
        $__dashboard_items[1][] = $latest_news;
    }
} catch (Exception $e) {
}
$core->callBehavior('adminDashboardItems', $core, $__dashboard_items);
/* DISPLAY
-------------------------------------------------------- */
dcPage::open(__('Dashboard'), dcPage::jsToolBar() . dcPage::jsLoad('js/_index.js') . $core->callBehavior('adminDashboardHeaders'));
echo '<h2>' . html::escapeHTML($core->blog->name) . ' &rsaquo; ' . __('Dashboard');
if ($core->auth->getInfo('user_default_blog') != $core->blog->id && $core->auth->blog_count > 1) {
    echo ' - <a href="index.php?default_blog=1" class="button">' . __('Make this blog my default blog') . '</a>';
}
echo '</h2>';
if ($core->blog->status == 0) {
    echo '<p class="static-msg">' . __('This blog is offline') . '</p>';
} elseif ($core->blog->status == -1) {
    echo '<p class="static-msg">' . __('This blog is removed') . '</p>';
}
if (!DC_ADMIN_URL) {
    echo '<p class="static-msg">' . __('DC_ADMIN_URL is not defined, you should edit your configuration file.') . '</p>';
}
# Plugins install messages
if (!empty($plugins_install['success'])) {