Merge remote-tracking branch 'upstream/4.4' into 4.4-master-2014-06-23-18-25-12
[civicrm-core.git] / CRM / Admin / Page / APIExplorer.php
index 77b5fc3567951781631c6f2aa27d0aca236b9c4b..809fb95f84a72e5e7cc303a44e7813d670f0b96b 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.4                                                |
+ | CiviCRM version 4.5                                                |
  +--------------------------------------------------------------------+
- | 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$
  *
  */
 
 /**
- * Page for displaying list of contact Subtypes
+ * Api Explorer
  */
 class CRM_Admin_Page_APIExplorer extends CRM_Core_Page {
 
+  /**
+   * @return string
+   */
   function run() {
     CRM_Utils_System::setTitle(ts('API explorer and generator'));
+    CRM_Core_Resources::singleton()
+      ->addScriptFile('civicrm', 'templates/CRM/Admin/Page/APIExplorer.js')
+      ->addScriptUrl('//cdnjs.cloudflare.com/ajax/libs/prettify/r298/prettify.min.js', 99)
+      ->addStyleUrl('//cdnjs.cloudflare.com/ajax/libs/prettify/r298/prettify.min.css', 99);
+    $this->assign('operators', CRM_Core_DAO::acceptedSQLOperators());
     return parent::run();
   }
 
-  function getTemplateFileName() {
-    return 'CRM/Core/AjaxDoc.tpl';
-  }
-
   /**
    * Get user context.
    *
    * @return string user context.
    */
-  function userContext($mode = NULL) {
+  function userContext() {
     return 'civicrm/api/explorer';
   }
 }