예제 #1
0
 * @license   http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1
 * @link      http://www.phpmyfaq.de
 * @since     2003-02-24
 */
if (!defined('IS_VALID_PHPMYFAQ_ADMIN')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
if ($permission['delquestion']) {
    $questionId = PMF_Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT);
    $delete = PMF_Filter::filterInput(INPUT_GET, 'delete', FILTER_SANITIZE_STRING, 'no');
    $categoryData = new PMF_Category_Tree_DataProvider_SingleQuery($LANGCODE);
    $categoryLayout = new PMF_Category_Layout(new PMF_Category_Tree_Helper(new PMF_Category_Tree($categoryData)));
    $faqQuestions = new PMF_Faq_Questions();
    if ($delete == 'yes') {
        $faqQuestions->delete($questionId);
        print $PMF_LANG['ad_entry_delsuc'];
    } else {
        $toggleQuestion = PMF_Filter::filterInput(INPUT_GET, 'is_visible', FILTER_SANITIZE_STRING);
        if ($toggleQuestion == 'toggle') {
            $is_visible = $faqQuestions->getVisibility($questionId);
            if (!is_null($is_visible)) {
                $faqQuestions->setVisibility($questionId, $is_visible == 'N' ? 'Y' : 'N');
            }
        }
        printf("<h2>%s</h2>", $PMF_LANG['msgOpenQuestions']);
        $openQuestions = $faqQuestions->fetchAll();
        if (count($openQuestions) > 0) {
            ?>
    <table id="tableOpenQuestions">
    <thead>