INFRA-132 - Comment grammar cleanup
[civicrm-core.git] / CRM / Pledge / Page / Payment.php
index d05bcddb8fb739b085fb7f859cd98c4457668d70..766ba55e9d0f9c207031e4c5e53a643bcfde8017 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.4                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013                                |
+ | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
  *
  */
 class CRM_Pledge_Page_Payment extends CRM_Core_Page {
 
   /**
-   * This function is the main function that is called when the page loads, it decides the which action has to be taken for the page.
+   * the main function that is called when the page loads, it decides the which action has to be taken for the page.
    *
    * return null
-   * @access public
    */
-  function run() {
+  public function run() {
     $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse');
     $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this);
 
@@ -49,12 +48,10 @@ class CRM_Pledge_Page_Payment extends CRM_Core_Page {
 
     $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
 
-    CRM_Pledge_Page_Tab::setContext();
+    CRM_Pledge_Page_Tab::setContext($this);
 
     if ($this->_action & CRM_Core_Action::UPDATE) {
       $this->edit();
-      // set page title
-      CRM_Contact_Page_View::setTitle($this->_contactId);
     }
     else {
       $pledgeId = CRM_Utils_Request::retrieve('pledgeId', 'Positive', $this);
@@ -65,8 +62,8 @@ class CRM_Pledge_Page_Payment extends CRM_Core_Page {
       $this->assign('pledgeId', $pledgeId);
       $this->assign('contactId', $this->_contactId);
 
-      // check if we can process credit card contribs
-      CRM_Core_Payment::allowBackofficeCreditCard($this);
+      // check if we can process credit card contributions
+      $this->assign('newCredit', CRM_Core_Config::isEnabledBackOfficeCreditCardPayments());
 
       // check is the user has view/edit signer permission
       $permission = 'view';
@@ -80,12 +77,11 @@ class CRM_Pledge_Page_Payment extends CRM_Core_Page {
   }
 
   /**
-   * This function is called when action is update or new
+   * called when action is update or new
    *
    * return null
-   * @access public
    */
-  function edit() {
+  public function edit() {
     $controller = new CRM_Core_Controller_Simple('CRM_Pledge_Form_Payment',
       'Update Pledge Payment',
       $this->_action
@@ -99,4 +95,3 @@ class CRM_Pledge_Page_Payment extends CRM_Core_Page {
     return $controller->run();
   }
 }
-