janrain_views.module 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. use Drupal\janrain_views\Api;
  3. use Drupal\janrain_views\EntityType;
  4. /**
  5. * @file
  6. * Empty file needed for Drupal to register the module.
  7. */
  8. function janrain_views_menu() {
  9. $items = array();
  10. $items['jv/entityType'] = array(
  11. 'title' => 'Entity types',
  12. 'page callback' => 'janrain_views_page_entityType_list',
  13. 'access arguments' => array('administer site configuration'),
  14. );
  15. $items['jv/entityType/%jv_entity_type'] = array(
  16. 'title' => 'Entity type info',
  17. 'page callback' => 'janrain_views_page_entityType',
  18. 'page arguments' => array(2),
  19. 'access arguments' => array('administer site configuration'),
  20. );
  21. $items['jv/entityType/%jv_entity_type/access'] = array(
  22. 'title' => 'Entity type access info',
  23. 'page callback' => 'janrain_views_page_entityType_accessSchema',
  24. 'page arguments' => array(2),
  25. 'access arguments' => array('administer site configuration'),
  26. );
  27. $items['jv/settings/keys'] = array(
  28. 'title' => 'Settings/keys',
  29. 'page callback' => 'janrain_views_page_settings_keys',
  30. 'access arguments' => array('administer site configuration'),
  31. );
  32. return $items;
  33. }
  34. function janrain_views_admin_pages() {
  35. $ret = array(
  36. 'jv/*' => TRUE,
  37. );
  38. return $ret;
  39. }
  40. function janrain_views_page_entityType_list() {
  41. EntityType::bind(new Api());
  42. $ret = EntityType::getList();
  43. dsm($ret);
  44. return "fo";
  45. }
  46. function jv_entity_type_load($name) {
  47. return filter_xss($name);
  48. }
  49. function janrain_views_page_entityType($type_name) {
  50. EntityType::bind(new Api());
  51. $ret = EntityType::getEntityType($type_name);
  52. dsm($ret);
  53. return $ret;
  54. }
  55. function janrain_views_page_entityType_accessSchema($type_name) {
  56. EntityType::bind(new Api());
  57. $ret = EntityType::getAccessSchema($type_name);
  58. dsm($ret);
  59. return $ret;
  60. }
  61. function janrain_views_page_settings_keys() {
  62. $api = new Api();
  63. $ret = $api('settings/keys');
  64. dsm($ret);
  65. return "<pre>" . var_export($ret, TRUE) . "</pre>";
  66. }