public function buildQuickForm() {
CRM_Utils_System::setTitle(ts('Settings - Cleanup Caches and Update Paths'));
- $this->addElement(
- 'submit', $this->getButtonName('next', 'cleanup'), 'Cleanup Caches',
- ['class' => 'crm-form-submit', 'id' => 'cleanup-cache']
- );
-
- $this->addElement(
- 'submit', $this->getButtonName('next', 'resetpaths'), 'Reset Paths',
- ['class' => 'crm-form-submit', 'id' => 'resetpaths']
- );
-
- //parent::buildQuickForm();
+ $this->addButtons([
+ [
+ 'type' => 'next',
+ 'name' => ts('Cleanup Caches'),
+ 'subName' => 'cleanup',
+ 'icon' => 'fa-undo',
+
+ ],
+ [
+ 'type' => 'next',
+ 'name' => ts('Reset Paths'),
+ 'subName' => 'resetpaths',
+ 'icon' => 'fa-terminal',
+ ],
+ ]);
}
public function postProcess() {
- if (!empty($_POST['_qf_UpdateConfigBackend_next_cleanup'])) {
-
+ if (isset($_REQUEST['_qf_UpdateConfigBackend_next_cleanup'])) {
$config = CRM_Core_Config::singleton();
// cleanup templates_c directory
CRM_Core_Session::setStatus(ts('Cache has been cleared and menu has been rebuilt successfully.'), ts("Success"), "success");
}
-
- if (!empty($_POST['_qf_UpdateConfigBackend_next_resetpaths'])) {
+ elseif (isset($_REQUEST['_qf_UpdateConfigBackend_next_resetpaths'])) {
$msg = CRM_Core_BAO_ConfigSetting::doSiteMove();
CRM_Core_Session::setStatus($msg, ts("Success"), "success");
}
- return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/admin/setting/updateConfigBackend', 'reset=1'));
+ CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/admin/setting/updateConfigBackend', 'reset=1'));
}
}