Exemplo n.º 1
0
         } else {
             die('{"status": "0", "data": "' . $lang['dashboard_err_19'] . '"}');
         }
     } elseif ($_POST['setting_type'] == 'help') {
         $faq = isset($_POST['faq']) ? $_POST['faq'] : "";
         //load parsedown markup to html converter
         $ParsedownExtra = new ParsedownExtra();
         $ParsedownExtra->setBreaksEnabled(true);
         $faq_raw = $ParsedownExtra->text($faq);
         //load and use html purifier for the readme notes.
         $faq_html = Format::htmlSafeOutput($faq_raw);
         //purify the readme note html
         $_POST['faq_md'] = $faq;
         $_POST['faq_html'] = $faq_html;
         $help = new Help();
         if ($help->saveEdit()) {
             exit('{"status": "1", "data": "' . $lang['dashboard_msg_10'] . '", "callback_function": "setting_saved"}');
         } else {
             die('{"status": "0", "data": "' . $lang['dashboard_err_19'] . '"}');
         }
     } else {
         $dashboard = new Dashboard();
         if ($dashboard->saveSiteSetting()) {
             exit('{"status": "1", "data": "' . $lang['dashboard_msg_10'] . '", "callback_function": "setting_saved"}');
         } else {
             die('{"status": "0", "data": "' . $lang['dashboard_err_19'] . '"}');
         }
     }
 } else {
     die('{"status": "0", "data": "' . $lang['dashboard_err_19'] . '"}');
 }