Merge pull request #24203 from colemanw/fixTagFilter553
[civicrm-core.git] / Civi / Angular / Page / Main.php
index c844fd3cc04b2b9a31b7d13e5fd0233c0a0d6dbd..604158437e18d3acea67c95b4952742d0fc7706b 100644 (file)
@@ -10,60 +10,7 @@ namespace Civi\Angular\Page;
 class Main extends \CRM_Core_Page {
 
   /**
-   * The weight to assign to any Angular JS module files.
-   */
-  const DEFAULT_MODULE_WEIGHT = 200;
-
-  /**
-   * The resource manager.
-   *
-   * Do not use publicly. Inject your own copy!
-   *
-   * @var \CRM_Core_Resources
-   * @deprecated
-   */
-  public $res;
-
-  /**
-   * The Angular module manager.
-   *
-   * Do not use publicly. Inject your own copy!
-   *
-   * @var \Civi\Angular\Manager
-   * @deprecated
-   */
-  public $angular;
-
-  /**
-   * The region of the page into which JavaScript will be loaded.
-   *
-   * @var string
-   * @deprecated
-   */
-  public $region;
-
-  /**
-   * @param string $title
-   *   Title of the page.
-   * @param int $mode
-   *   Mode of the page.
-   * @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::service('angular');
-    $this->region = \CRM_Utils_Request::retrieve('snippet', 'String') ? 'ajax-snippet' : 'html-header';
-  }
-
-  /**
-   * This function takes care of all the things common to all
-   * pages. This typically involves assigning the appropriate
-   * smarty variable :)
-   *
-   * @return string
-   *   The content generated by running this page
+   * Run the page
    */
   public function run() {
     $this->registerResources();
@@ -74,14 +21,11 @@ class Main extends \CRM_Core_Page {
    * Register resources required by Angular.
    */
   public function registerResources() {
-    $loader = new \Civi\Angular\AngularLoader();
-    $loader->setPageName('civicrm/a');
+    $loader = \Civi::service('angularjs.loader');
     $loader->useApp([
       'activeRoute' => \CRM_Utils_Request::retrieve('route', 'String'),
       'defaultRoute' => NULL,
     ]);
-    $loader->load();
-
   }
 
 }