CRM-15832 - Rename CRM_Core_Page_Angular to Civi\Angular\Page\Main
authorTim Otten <totten@civicrm.org>
Fri, 16 Jan 2015 11:35:01 +0000 (03:35 -0800)
committerTim Otten <totten@civicrm.org>
Mon, 19 Jan 2015 06:17:35 +0000 (22:17 -0800)
CRM/Core/xml/Menu/Misc.xml
Civi/Angular/Page/Main.php [moved from CRM/Core/Page/Angular.php with 83% similarity]
templates/Civi/Angular/Page/Main.tpl [moved from templates/CRM/Core/Page/Angular.tpl with 100% similarity]

index 98f96c99b848bf75ff93cc8d36558524c0dda3b9..0d023c655f5e4904f36caf6871c6b4367bfca8d2 100644 (file)
   </item>
   <item>
     <path>civicrm/a</path>
-    <page_callback>CRM_Core_Page_Angular</page_callback>
+    <page_callback>\Civi\Angular\Page\Main</page_callback>
     <access_arguments>access CiviCRM</access_arguments>
   </item>
   <item>
similarity index 83%
rename from CRM/Core/Page/Angular.php
rename to Civi/Angular/Page/Main.php
index 59c4dc81cefd6e7247cc8d42c03de3a7aa1e3409..35c098a104c268423a9f2d721ef5426500feebcd 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+namespace Civi\Angular\Page;
 
 /**
  * This page is simply a container; any Angular modules defined by CiviCRM (or by CiviCRM extensions)
@@ -6,20 +7,20 @@
  *
  * @link https://issues.civicrm.org/jira/browse/CRM-14479
  */
-class CRM_Core_Page_Angular extends CRM_Core_Page {
+class Main extends \CRM_Core_Page {
   /**
    * The weight to assign to any Angular JS module files
    */
   const DEFAULT_MODULE_WEIGHT = 200;
 
   /**
-   * @var CRM_Core_Resources
+   * @var \CRM_Core_Resources
    */
   protected $res;
 
 
   /**
-   * @var Civi\Angular\Manager
+   * @var \Civi\Angular\Manager
    */
   protected $angular;
 
@@ -28,13 +29,13 @@ class CRM_Core_Page_Angular extends CRM_Core_Page {
    *   Title of the page.
    * @param int $mode
    *   Mode of the page.
-   * @param CRM_Core_Resources|null $res
+   * @param \CRM_Core_Resources|null $res
    *   Resource manager.
    */
   public function __construct($title = NULL, $mode = NULL, $res = NULL) {
     parent::__construct($title, $mode);
-    $this->res = CRM_Core_Resources::singleton();
-    $this->angular = Civi\Core\Container::singleton()->get('angular');
+    $this->res = \CRM_Core_Resources::singleton();
+    $this->angular = \Civi\Core\Container::singleton()->get('angular');
   }
 
   /**
@@ -59,13 +60,13 @@ class CRM_Core_Page_Angular extends CRM_Core_Page {
     $this->res->addSettingsFactory(function () use (&$modules) {
       // TODO optimization; client-side caching
       return array(
-        'resourceUrls' => CRM_Extension_System::singleton()->getMapper()->getActiveModuleUrls(),
+        'resourceUrls' => \CRM_Extension_System::singleton()->getMapper()->getActiveModuleUrls(),
         'angular' => array(
           'modules' => array_merge(array('ngRoute'), array_keys($modules)),
           'cacheCode' => $this->res->getCacheCode(),
         ),
         'crmAttachment' => array(
-          'token' => CRM_Core_Page_AJAX_Attachment::createToken(),
+          'token' => \CRM_Core_Page_AJAX_Attachment::createToken(),
         ),
       );
     });