Merge pull request #4818 from pratikshad/CRM-15770
[civicrm-core.git] / CRM / Contact / Page / View.php
index 82bc7cbdb71080ff30fafbce09cdeba97b2aa8a9..35a8f5be87a59a6e6aac55808a4434aca79df9ec 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
 class CRM_Contact_Page_View extends CRM_Core_Page {
 
   /**
-   * the id of the object being viewed (note/relationship etc)
+   * The id of the object being viewed (note/relationship etc)
    *
    * @int
-   * @access protected
    */
   protected $_id;
 
   /**
-   * the contact id of the contact being viewed
+   * The contact id of the contact being viewed
    *
    * @int
-   * @access protected
    */
   protected $_contactId;
 
@@ -59,7 +57,6 @@ class CRM_Contact_Page_View extends CRM_Core_Page {
    * The action that we are performing
    *
    * @string
-   * @access protected
    */
   protected $_action;
 
@@ -67,7 +64,6 @@ class CRM_Contact_Page_View extends CRM_Core_Page {
    * The permission we have on this contact
    *
    * @string
-   * @access protected
    */
   protected $_permission;
 
@@ -76,10 +72,9 @@ class CRM_Contact_Page_View extends CRM_Core_Page {
    * the contact and calls the appropriate type of page to view.
    *
    * @return void
-   * @access public
    *
    */
-  function preProcess() {
+  public function preProcess() {
     // process url params
     $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
     $this->assign('id', $this->_id);
@@ -167,7 +162,7 @@ class CRM_Contact_Page_View extends CRM_Core_Page {
         $image_URL = str_replace('http://', 'https://', $image_URL);
       }
 
-      list($imageWidth, $imageHeight) = getimagesize($image_URL);
+      list($imageWidth, $imageHeight) = getimagesize(CRM_Utils_String::unstupifyUrl($image_URL));
       list($imageThumbWidth, $imageThumbHeight) = CRM_Contact_BAO_Contact::getThumbSize($imageWidth, $imageHeight);
       $this->assign("imageWidth", $imageWidth);
       $this->assign("imageHeight", $imageHeight);
@@ -259,12 +254,11 @@ class CRM_Contact_Page_View extends CRM_Core_Page {
   /**
    * Get meta details of the contact.
    *
-   * @param $contactId
+   * @param int $contactId
    *
    * @return array contact fields in fixed order
-   * @access public
    */
-  static function getContactDetails($contactId) {
+  public static function getContactDetails($contactId) {
     return list($displayName,
       $contactImage,
       $contactType,
@@ -276,7 +270,11 @@ class CRM_Contact_Page_View extends CRM_Core_Page {
     );
   }
 
-  static function checkUserPermission($page, $contactID = NULL) {
+  /**
+   * @param $page
+   * @param int $contactID
+   */
+  public static function checkUserPermission($page, $contactID = NULL) {
     // check for permissions
     $page->_permission = NULL;
 
@@ -312,12 +310,12 @@ class CRM_Contact_Page_View extends CRM_Core_Page {
   }
 
   /**
-   * @param $contactId
+   * @param int $contactId
    * @param bool $isDeleted
    *
    * @return string
    */
-  static function setTitle($contactId, $isDeleted = FALSE) {
+  public static function setTitle($contactId, $isDeleted = FALSE) {
     static $contactDetails;
     $displayName = $contactImage = NULL;
     if (!isset($contactDetails[$contactId])) {
@@ -349,7 +347,7 @@ class CRM_Contact_Page_View extends CRM_Core_Page {
    * @param CRM_Core_Page $obj
    * @param integer $cid
    */
-  static function addUrls(&$obj, $cid) {
+  public static function addUrls(&$obj, $cid) {
      $uid = CRM_Core_BAO_UFMatch::getUFId($cid);
 
     if ($uid) {
@@ -383,4 +381,3 @@ class CRM_Contact_Page_View extends CRM_Core_Page {
     }
   }
 }
-