}
             }
         }
     } else {
         echo $PMF_LANG['err_NotAuth'];
     }
     break;
     // save sticky FAQs
 // save sticky FAQs
 case 'save_sticky_records':
     if ($permission['editbt']) {
         if (!empty($items)) {
             $faq = new PMF_Faq($faqConfig);
             foreach ($items as $item) {
                 if (is_array($item) && count($item) == 3 && PMF_Language::isASupportedLanguage($item[1])) {
                     echo $faq->updateRecordFlag((int) $item[0], addslashes($item[1]), $item[2], 'sticky');
                 }
             }
         }
     } else {
         echo $PMF_LANG['err_NotAuth'];
     }
     break;
     // search FAQs for suggestions
 // search FAQs for suggestions
 case 'search_records':
     if ($permission['editbt']) {
         $faq = new PMF_Faq($faqConfig);
         $faqSearch = new PMF_Search($faqConfig);
         $faqSearchResult = new PMF_Search_Resultset($user, $faq, $faqConfig);
         $searchResult = '';
예제 #2
0
     * )
     */
    $items = isset($_GET['items']) && is_array($_GET['items']) ? $_GET['items'] : array();
    switch ($ajax_action) {
        case 'save_active_records':
            $type = 'active';
            break;
        case 'save_sticky_records':
            $type = 'sticky';
            break;
    }
    if (null !== $type && !empty($items)) {
        $faq = new PMF_Faq();
        foreach ($items as $item) {
            if (is_array($item) && count($item) == 3 && PMF_Language::isASupportedLanguage($item[1])) {
                print $faq->updateRecordFlag((int) $item[0], addslashes($item[1]), (int) $item[2], $type);
            }
        }
    }
}
if ('delete_record' == $ajax_action && $permission['delbt']) {
    $record_id = PMF_Filter::filterInput(INPUT_POST, 'record_id', FILTER_VALIDATE_INT);
    $record_lang = PMF_Filter::filterInput(INPUT_POST, 'record_lang', FILTER_SANITIZE_STRING);
    $logging = new PMF_Logging();
    $logging->logAdmin($user, 'Beitragdel, ' . $record_id);
    $path = PMF_ROOT_DIR . '/attachments/' . $record_id . '/';
    if (@is_dir($path)) {
        $do = dir($path);
        while ($dat = $do->read()) {
            if ($dat != "." && $dat != "..") {
                unlink($path . $dat);