/** * Tidies up the library */ public function TidyLibrary() { $response = new ResponseManager(); $tidyOldRevisions = Kit::GetParam('tidyOldRevisions', _POST, _CHECKBOX) == 1; $cleanUnusedFiles = Kit::GetParam('cleanUnusedFiles', _POST, _CHECKBOX) == 1; if (Config::GetSetting('SETTING_LIBRARY_TIDY_ENABLED') != 1) { trigger_error(__('Sorry this function is disabled.'), E_USER_ERROR); } $maintenance = new Maintenance(); if (!$maintenance->TidyLibrary($tidyOldRevisions, $cleanUnusedFiles)) { trigger_error($maintenance->GetErrorMessage(), E_USER_ERROR); } $response->SetFormSubmitResponse(__('Library Tidy Complete')); $response->Respond(); }