Ejemplo n.º 1
0
 $form->registerRule('checkParameter', 'callback', 'eF_checkParameter');
 $form->addElement("text", "events_size", null, 'class = "inputText" style = "width:60px"');
 $form->addElement("submit", "submit", _SUBMIT, 'class = "flatButton"');
 if ($form->isSubmitted() && $form->validate()) {
     $timestamp = mktime(0, 0, 0, $_POST['purge_Month'], $_POST['purge_Day'], $_POST['purge_Year']);
     if (eF_checkParameter($timestamp, 'int')) {
         eF_deleteTableData("events", "timestamp < {$timestamp}");
     }
     eF_redirect(basename($_SERVER['PHP_SELF'] . "?ctg=maintenance&tab=cleanup&message=" . urlencode(_OPERATIONCOMPLETEDSUCCESSFULLY) . "&message_type=success"));
 }
 $renderer = prepareFormRenderer($form);
 $smarty->assign("T_CLEANUP_EVENTS_FORM", $renderer->toArray());
 //Recreate search table
 if (isset($_GET['reindex']) && $_GET['ajax'] == 1) {
     try {
         EfrontSearch::reBuiltIndex();
     } catch (Exception $e) {
         handleAjaxExceptions($e);
     }
     exit;
 }
 if (isset($_GET['delete_tokens']) && $_GET['ajax'] == 1) {
     try {
         $one_month_ego = time() - 30 * 24 * 60 * 60;
         eF_deleteTableData("tokens", "create_timestamp < " . $one_month_ego);
     } catch (Exception $e) {
         handleAjaxExceptions($e);
     }
     exit;
 }
 if (isset($_GET['archive_tables']) && $_GET['ajax'] == 1) {