Esempio n. 1
0
    $categories_combo = array_merge(array(new formSelectOption('-', ''), new formSelectOption(__('(No cat)'), 'NULL')), dcAdminCombos::getCategoriesCombo($categories, false));
    $categories_values = array();
    foreach ($categories_combo as $cat) {
        if (isset($cat->value)) {
            $categories_values[$cat->value] = true;
        }
    }
    $status_combo = array_merge(array('-' => ''), dcAdminCombos::getPostStatusesCombo());
    $selected_combo = array('-' => '', __('Selected') => '1', __('Not selected') => '0');
    $comment_combo = array('-' => '', __('Opened') => '1', __('Closed') => '0');
    $trackback_combo = array('-' => '', __('Opened') => '1', __('Closed') => '0');
    $attachment_combo = array('-' => '', __('With attachments') => '1', __('Without attachments') => '0');
    $password_combo = array('-' => '', __('With password') => '1', __('Without password') => '0');
    # Months array
    $dt_m_combo = array_merge(array('-' => ''), dcAdminCombos::getDatesCombo($dates));
    $lang_combo = array_merge(array('-' => ''), dcAdminCombos::getLangsCombo($langs, false));
    # Post formats
    $core_formaters = $core->getFormaters();
    $available_formats = array();
    foreach ($core_formaters as $editor => $formats) {
        foreach ($formats as $format) {
            $available_formats[$format] = $format;
        }
    }
    $format_combo = array_merge(array('-' => ''), $available_formats);
    $sortby_combo = array(__('Date') => 'post_dt', __('Title') => 'post_title', __('Category') => 'cat_title', __('Author') => 'user_id', __('Status') => 'post_status', __('Selected') => 'post_selected', __('Number of comments') => 'nb_comment', __('Number of trackbacks') => 'nb_trackback');
    $order_combo = array(__('Descending') => 'desc', __('Ascending') => 'asc');
}
# Actions combo box
$posts_actions_page = new dcPostsActionsPage($core, $core->adminurl->get("admin.posts"));
if ($posts_actions_page->process()) {
Esempio n. 2
0
    $post_status = -2;
}
# Status combo
$status_combo = dcAdminCombos::getPostStatusesCombo();
$img_status_pattern = '<img class="img_select_option" alt="%1$s" title="%1$s" src="images/%2$s" />';
# Formaters combo
$core_formaters = $core->getFormaters();
$available_formats = array('' => '');
foreach ($core_formaters as $editor => $formats) {
    foreach ($formats as $format) {
        $available_formats[$format] = $format;
    }
}
# Languages combo
$rs = $core->blog->getLangs(array('order' => 'asc'));
$lang_combo = dcAdminCombos::getLangsCombo($rs, true);
# Validation flag
$bad_dt = false;
# Get page informations
if (!empty($_REQUEST['id'])) {
    $params['post_type'] = 'page';
    $params['post_id'] = $_REQUEST['id'];
    $post = $core->blog->getPosts($params);
    if ($post->isEmpty()) {
        $core->error->add(__('This page does not exist.'));
        $can_view_page = false;
    } else {
        $post_id = $post->post_id;
        $post_dt = date('Y-m-d H:i', strtotime($post->post_dt));
        $post_format = $post->post_format;
        $post_password = $post->post_password;