/**
  * @param null $args
  * @param null $pageArgs
  * @param null $sort
  *
  * @throws Exception
  */
 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;
         CRM_Core_BAO_MessageTemplate::revert($id);
     }
     $this->assign('selectedChild', CRM_Utils_Request::retrieve('selectedChild', 'String', $this));
     return parent::run($args, $pageArgs, $sort);
 }