Merge pull request #5120 from eileenmcnaughton/CRM-15938
[civicrm-core.git] / CRM / Core / Block.php
index f697b0f9aaf097586b76a9325be1ba8459134a50..569f0552129c9759cef64f2ea8b89bb476b469ca 100644 (file)
@@ -23,7 +23,7 @@
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
@@ -41,7 +41,7 @@
 class CRM_Core_Block {
 
   /**
-   * The following blocks are supported
+   * The following blocks are supported.
    *
    * @var int
    */
@@ -55,12 +55,12 @@ class CRM_Core_Block {
     FULLTEXT_SEARCH = 7;
 
   /**
-   * Template file names for the above blocks
+   * Template file names for the above blocks.
    */
   static $_properties = NULL;
 
   /**
-   * Class constructor
+   * Class constructor.
    */
   public function __construct() {
   }
@@ -230,7 +230,7 @@ class CRM_Core_Block {
   }
 
   /**
-   * Creates the info block for drupal
+   * Creates the info block for drupal.
    *
    * @return array
    */
@@ -241,7 +241,7 @@ class CRM_Core_Block {
       if ($value['active']) {
         if (in_array($id, array(
           self::ADD,
-          self::CREATE_NEW
+          self::CREATE_NEW,
         ))) {
           $hasAccess = TRUE;
           if (!CRM_Core_Permission::check('add contacts') &&
@@ -269,7 +269,6 @@ class CRM_Core_Block {
         $block[$id] = array(
           'info' => $value['info'],
           'cache' => $value['cache'],
-          'status' => $value['active'],
           'region' => $value['region'],
           'visibility' => $value['visibility'],
           'pages' => $value['pages'],
@@ -330,7 +329,7 @@ class CRM_Core_Block {
         $urlArray = array(
           'fullTextSearchID' => CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue',
             'CRM_Contact_Form_Search_Custom_FullText', 'value', 'name'
-          )
+          ),
         );
         self::setProperty(self::FULLTEXT_SEARCH, 'templateValues', $urlArray);
         break;
@@ -347,7 +346,7 @@ class CRM_Core_Block {
   }
 
   /**
-   * Create the list of options to create New objects for the application and format is as a block
+   * Create the list of options to create New objects for the application and format is as a block.
    *
    * @return void
    */
@@ -370,7 +369,7 @@ class CRM_Core_Block {
           'query' => 'action=add&reset=1&context=standalone',
           'ref' => 'new-activity',
           'title' => ts('Activity'),
-        )
+        ),
       ));
 
       $components = CRM_Core_Component::getEnabledComponents();
@@ -393,7 +392,7 @@ class CRM_Core_Block {
           'query' => 'atype=3&action=add&reset=1&context=standalone',
           'ref' => 'new-email',
           'title' => ts('Email'),
-        )
+        ),
       ));
 
       if (CRM_Core_Permission::check('edit groups')) {
@@ -403,7 +402,7 @@ class CRM_Core_Block {
             'query' => 'reset=1',
             'ref' => 'new-group',
             'title' => ts('Group'),
-          )
+          ),
         ));
       }
 
@@ -414,7 +413,7 @@ class CRM_Core_Block {
             'query' => 'reset=1&action=add',
             'ref' => 'new-tag',
             'title' => ts('Tag'),
-          )
+          ),
         ));
       }
 
@@ -470,7 +469,7 @@ class CRM_Core_Block {
   }
 
   /**
-   * Create the list of dashboard links
+   * Create the list of dashboard links.
    *
    * @return void
    */
@@ -482,7 +481,7 @@ class CRM_Core_Block {
           'path' => 'civicrm/user',
           'query' => 'reset=1',
           'title' => ts('My Contact Dashboard'),
-        )
+        ),
       );
     }
 
@@ -507,7 +506,7 @@ class CRM_Core_Block {
   }
 
   /**
-   * Create the list of mail urls for the application and format is as a block
+   * Create the list of mail urls for the application and format is as a block.
    *
    * @return void
    */
@@ -540,7 +539,7 @@ class CRM_Core_Block {
   }
 
   /**
-   * Create the list of shortcuts for the application and format is as a block
+   * Create the list of shortcuts for the application and format is as a block.
    *
    * @return void
    */
@@ -555,7 +554,7 @@ class CRM_Core_Block {
   }
 
   /**
-   * Create the event blocks for upcoming events
+   * Create the event blocks for upcoming events.
    *
    * @return void
    */
@@ -591,7 +590,7 @@ class CRM_Core_Block {
     // return if upgrade mode
     $config = CRM_Core_Config::singleton();
     if ($config->isUpgradeMode()) {
-      return;
+      return NULL;
     }
 
     if (!self::getProperty($id, 'active')) {
@@ -677,4 +676,5 @@ class CRM_Core_Block {
 
     return $template->fetch('CRM/Block/' . $fileName);
   }
+
 }