function run($args = null, $pageArgs = null, $sort = null) { // handle the revert action and offload the rest to parent if (CRM_Utils_Request::retrieve('action', 'String', $this) & CRM_Core_Action::REVERT) { $id = CRM_Utils_Request::retrieve('id', 'Positive', $this); if (!$this->checkPermission($id, null)) { CRM_Core_Error::fatal(ts('You do not have permission to revert this template.')); } $this->_revertedId = $id; require_once 'CRM/Core/BAO/MessageTemplates.php'; CRM_Core_BAO_MessageTemplates::revert($id); } $this->assign('selectedChild', CRM_Utils_Request::retrieve('selectedChild', 'String', $this)); return parent::run($args, $pageArgs, $sort); }