INFRA-132 - CRM/Profile - phpcbf
[civicrm-core.git] / CRM / Profile / Page / Router.php
index 54da11af2f3584a046a3a431e2858a373d022ee1..384ce13dd4d76d9f5bd345d81f81ce1f009cfead 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
@@ -41,13 +41,13 @@ class CRM_Profile_Page_Router extends CRM_Core_Page {
   /**
    * This is some kind of special-purpose router/front-controller for the various profile URLs.
    *
-   * @param $args array this array contains the arguments of the url
+   * @param $args
+   *   Array this array contains the arguments of the url.
    *
    * @return string|void
    * @static
-   * @access public
    */
-  function run($args = NULL) {
+  public function run($args = NULL) {
     if ($args[1] !== 'profile') {
       return;
     }
@@ -74,7 +74,6 @@ class CRM_Profile_Page_Router extends CRM_Core_Page {
         $profileGID = CRM_Utils_Request::retrieve('gid', 'Integer', $controller, TRUE);
       }
 
-
       // make sure that this profile enables mapping
       // CRM-8609
       $isMap =
@@ -100,22 +99,6 @@ class CRM_Profile_Page_Router extends CRM_Core_Page {
     }
 
     if ($secondArg == 'edit' || $secondArg == 'create') {
-      $buttonType = CRM_Utils_Array::value('_qf_Edit_cancel', $_POST);
-      // CRM-5849: we should actually check the button *type*, but we get the *value*, potentially translated;
-      // we should keep both English and translated checks just to make sure we also handle untranslated Cancels
-      if ($buttonType == 'Cancel' or $buttonType == ts('Cancel')) {
-        $cancelURL = CRM_Utils_Request::retrieve('cancelURL',
-          'String',
-          CRM_Core_DAO::$_nullObject,
-          FALSE,
-          NULL,
-          $_POST
-        );
-        if ($cancelURL) {
-          CRM_Utils_System::redirect($cancelURL);
-        }
-      }
-
       if ($secondArg == 'edit') {
         $controller = new CRM_Core_Controller_Simple('CRM_Profile_Form_Edit',
           ts('Create Profile'),