Api Explorer - add support for chaining
[civicrm-core.git] / CRM / Admin / Page / APIExplorer.php
index 15a29b25871591cd86715e4683aca17623789bab..3ea21f5d65e973976849bbe456d8e59ddf12e10f 100644 (file)
  */
 
 /**
- * Page for displaying list of contact Subtypes
+ * Api Explorer
  */
 class CRM_Admin_Page_APIExplorer extends CRM_Core_Page {
 
   function run() {
     CRM_Utils_System::setTitle(ts('API explorer and generator'));
+    CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'templates/CRM/Admin/Page/APIExplorer.js');
+    $this->assign('operators', CRM_Core_DAO::acceptedSQLOperators());
+    $this->assign('actions', array(
+      'get',
+      'create',
+      'delete',
+      'getfields',
+      'getactions',
+      'getcount',
+      'getsingle',
+      'getvalue',
+      'getoptions',
+      'getlist',
+    ));
     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';
   }
 }