예제 #1
0
파일: edit.php 프로젝트: kailIII/articles
        $_REQUEST['rating'] = 0;
    }
    if (empty($_REQUEST['topic_id'])) {
        $_REQUEST['topic_id'] = 0;
    }
    if ($gContent->store($_REQUEST)) {
        if (isset($gContent->mInfo['status_id']) and $gContent->mInfo['status_id'] == ARTICLE_STATUS_PENDING) {
            bit_redirect(ARTICLES_PKG_URL . "index.php?feedback=" . urlencode(tra('Your article has been submitted and is awaiting approval.')));
        } else {
            bit_redirect(ARTICLES_PKG_URL . ($gBitSystem->isFeatureActive('pretty_urls_extended') || $gBitSystem->isFeatureActive('pretty_urls') ? $gContent->mArticleId : "read.php?article_id=" . $gContent->mArticleId));
        }
    }
}
// Get a topic list
$topics = BitArticleTopic::getTopicList(array('active_topic' => TRUE));
$gBitSmarty->assign_by_ref('topics', $topics);
if (!empty($_REQUEST['topic'])) {
    $gBitSmarty->assign('topic', $_REQUEST['topic']);
}
// get list of valid types
$types = BitArticleType::getTypeList();
$gBitSmarty->assign_by_ref('types', $types);
if (!empty($gContent->mErrors) || !empty($feedback)) {
    $article = $gContent->preparePreview($_REQUEST);
    $gBitSmarty->assign_by_ref('article', $article);
}
$gBitSmarty->assign_by_ref('errors', $gContent->mErrors);
$gBitSmarty->assign('feedback', !empty($feedback) ? $feedback : NULL);
// Display the Index Template
$gBitSmarty->assign('show_page_bar', 'n');
$gBitSystem->display('bitpackage:articles/edit_article.tpl', tra("Articles"), array('display_mode' => 'edit'));