API.txt

  1. cis7 sites/all/modules/ulmus/pathauto/API.txt
  2. cis7 sites/all/modules/ulmus/security_review/API.txt
  3. cis7 sites/all/modules/elmsln_contrib/outline_designer/API.txt
  4. cis7 sites/all/modules/elmsln_contrib/nodereference_highlight/API.txt
  5. cis7 sites/all/modules/ulmus/ctools/API.txt
  6. cis7 sites/all/modules/ulmus/context/API.txt
  7. cis7 sites/all/modules/ulmus/aes/API.txt
  8. cis7 sites/all/modules/ulmus/media/API.txt
  9. cis7 sites/all/modules/ulmus/features/API.txt
  10. cle7 sites/all/modules/ulmus/security_review/API.txt
  11. cle7 sites/all/modules/ulmus/features/API.txt
  12. cle7 sites/all/modules/ulmus/media/API.txt
  13. cle7 sites/all/modules/ulmus/pathauto/API.txt
  14. cle7 sites/all/modules/ulmus/context/API.txt
  15. cle7 sites/all/modules/ulmus/ctools/API.txt
  16. cle7 sites/all/modules/elmsln_contrib/nodereference_highlight/API.txt
  17. cle7 sites/all/modules/elmsln_contrib/outline_designer/API.txt
  18. cle7 sites/all/modules/ulmus/aes/API.txt
  19. cle7 sites/all/modules/local_contrib/votingapi/API.txt
  20. ecd7 sites/all/modules/ulmus/aes/API.txt
  21. ecd7 sites/all/modules/ulmus/ctools/API.txt
  22. ecd7 sites/all/modules/ulmus/security_review/API.txt
  23. ecd7 sites/all/modules/ulmus/context/API.txt
  24. ecd7 sites/all/modules/elmsln_contrib/nodereference_highlight/API.txt
  25. ecd7 sites/all/modules/ulmus/media/API.txt
  26. ecd7 sites/all/modules/ulmus/features/API.txt
  27. ecd7 sites/all/modules/elmsln_contrib/outline_designer/API.txt
  28. ecd7 sites/all/modules/ulmus/pathauto/API.txt
  29. elmsmedia7 sites/all/modules/ulmus/security_review/API.txt
  30. elmsmedia7 sites/all/modules/ulmus/aes/API.txt
  31. elmsmedia7 sites/all/modules/ulmus/features/API.txt
  32. elmsmedia7 sites/all/modules/ulmus/ctools/API.txt
  33. elmsmedia7 sites/all/modules/elmsln_contrib/outline_designer/API.txt
  34. elmsmedia7 sites/all/modules/ulmus/media/API.txt
  35. elmsmedia7 sites/all/modules/elmsln_contrib/nodereference_highlight/API.txt
  36. elmsmedia7 sites/all/modules/ulmus/pathauto/API.txt
  37. elmsmedia7 sites/all/modules/ulmus/context/API.txt
  38. harmony7 sites/all/modules/elmsln_contrib/nodereference_highlight/API.txt
  39. harmony7 sites/all/modules/ulmus/features/API.txt
  40. harmony7 sites/all/modules/ulmus/context/API.txt
  41. harmony7 sites/all/modules/ulmus/media/API.txt
  42. harmony7 sites/all/modules/ulmus/pathauto/API.txt
  43. harmony7 sites/all/modules/ulmus/ctools/API.txt
  44. harmony7 sites/all/modules/ulmus/aes/API.txt
  45. harmony7 sites/all/modules/ulmus/security_review/API.txt
  46. harmony7 sites/all/modules/elmsln_contrib/outline_designer/API.txt
  47. icor7 sites/all/modules/ulmus/security_review/API.txt
  48. icor7 sites/all/modules/ulmus/context/API.txt
  49. icor7 sites/all/modules/ulmus/pathauto/API.txt
  50. icor7 sites/all/modules/elmsln_contrib/outline_designer/API.txt
  51. icor7 sites/all/modules/elmsln_contrib/nodereference_highlight/API.txt
  52. icor7 sites/all/modules/ulmus/ctools/API.txt
  53. icor7 sites/all/modules/ulmus/features/API.txt
  54. icor7 sites/all/modules/ulmus/media/API.txt
  55. icor7 sites/all/modules/ulmus/aes/API.txt
  56. meedjum_blog7 sites/all/modules/elmsln_contrib/outline_designer/API.txt
  57. meedjum_blog7 sites/all/modules/elmsln_contrib/nodereference_highlight/API.txt
  58. meedjum_blog7 sites/all/modules/ulmus/aes/API.txt
  59. meedjum_blog7 sites/all/modules/ulmus/security_review/API.txt
  60. meedjum_blog7 sites/all/modules/ulmus/ctools/API.txt
  61. meedjum_blog7 sites/all/modules/ulmus/context/API.txt
  62. meedjum_blog7 sites/all/modules/ulmus/pathauto/API.txt
  63. meedjum_blog7 sites/all/modules/ulmus/media/API.txt
  64. meedjum_blog7 sites/all/modules/ulmus/features/API.txt
  65. mooc7 sites/all/modules/ulmus/aes/API.txt
  66. mooc7 sites/all/modules/ulmus/ctools/API.txt
  67. mooc7 sites/all/modules/elmsln_contrib/outline_designer/API.txt
  68. mooc7 sites/all/modules/ulmus/security_review/API.txt
  69. mooc7 sites/all/modules/ulmus/context/API.txt
  70. mooc7 sites/all/modules/ulmus/pathauto/API.txt
  71. mooc7 sites/all/modules/ulmus/media/API.txt
  72. mooc7 sites/all/modules/ulmus/features/API.txt
  73. mooc7 sites/all/modules/elmsln_contrib/nodereference_highlight/API.txt
// PHP EXAMPLE HOOKS
// examples taken from hidden_nodes implementation
// for adding pure API calls to the operations list (like drag and drop) set the title to <<OUTLINE_DESIGNER_API_ONLY>>
/**
 * Implementation of hook_outline_designer_operations().
 */
function hook_outline_designer_operations($type) {
  switch ($type) {
    case 'book': // the type of operation group, outline_designer_book handles book
      $ops = array(
        'hidden_nodes' => array( // the key of this operation
          'title' => t('Hide node'), // title for display in menus
          'icon' => drupal_get_path('module', 'hidden_nodes') .'/images/hidden_node.png', // the icon location for menus
          'callback' => 'hidden_nodes_outline_designer_hide_node', // optional callback to handle the ajax request this button most likely has
        ),
      );
    break;
    default: // default case of a blank array for when other things provide od types
      $ops = array();
    break;
  }
  return $ops;
}

/**
 * Implementation of hook_outline_designer_ops_js().
 */
function hook_outline_designer_ops_js($ajax_path) {
// ajax_path is provided by any sub module implementation of outline designer
// you can include any javascript or css you'd like to be included for this request
// this has a special function to ensure js is loaded in the right order
  drupal_add_js(drupal_get_path('module', 'hidden_nodes') .'/js/hidden_nodes_ops.js', 'footer');
  return 1;
}

/**
 * Implementation of hook_outline_designer_form_overlay().
 */
function hook_outline_designer_form_overlay() {
// an example output of elements for use in the overlay
// try and wrap things in a div at the end like this function does
// class name helps with theming, id helps with targetting to render
  // delete form
  $form['od_hidden_nodes_multiple'] = array(
   '#title' => t('Propagate hidden status'),
   '#id' => 'od_hidden_nodes_multiple',
   '#type' => 'checkbox',
   '#description' => t('Should this status be applied to all child content?'),
   '#weight' => 0,
   '#default_value' => TRUE,
  );
  // hidden status
  $form['od_hidden_nodes_status'] = array(
   '#title' => t('Hide content'),
   '#id' => 'od_hidden_nodes_status',
   '#type' => 'checkbox',
   '#description' => t('Hide this content'),
   '#weight' => 0,
   '#default_value' => FALSE,
  );
  $output = '<div id="od_hidden_nodes" class="od_uiscreen">'. drupal_render($form) .'</div>';
  return $output;
}
/**
 * Helper function to process the ajax callback for hiding a node
 */
function hidden_nodes_outline_designer_hide_node($nid, $multiple, $status) {
// return 0 to trigger a permission error message in the growl system
  return 'whatever info you want to return as the message after processing';
}

// JS - the key name is critical in the outline_designer_ops data object
// there are 3 key'ed function names you need, all are listed below
// {key}, {key}_submit, and {key}_reset
// this steps through rendering the overlay form, submiting it, and clean up
/*
(function ($) {
  // define function for hidden_nodes operation
  Drupal.outline_designer_ops.hidden_nodes = function() {
    $(".od_submit_button").val('Submit');
    // set default state based on whats loaded
    if ($("#node-" + Drupal.settings.outline_designer.activeNid +"-icon").parent().parent().hasClass('node_is_hidden')) {
      $('#od_hidden_nodes_status').attr('checked','checked')
    }
    else {
      $('#od_hidden_nodes_status').removeAttr('checked')
    }
    // function call
    Drupal.outline_designer.render_popup(true);
  };
  // submit handler
  Drupal.outline_designer_ops.hidden_nodes_submit = function() {
    var multiple = $('#od_hidden_nodes_multiple:checked').length;
    var hide_status = $('#od_hidden_nodes_status:checked').length;
    // update database
    Drupal.outline_designer.ajax_call('book', 'hidden_nodes', Drupal.settings.outline_designer.activeNid, multiple, hide_status, null);
  };
  // reset handler
  Drupal.outline_designer_ops.hidden_nodes_reset = function() {
    $("#od_hidden_nodes_multiple").attr("checked", true);
  };
})(jQuery);

*/

File

sites/all/modules/elmsln_contrib/outline_designer/API.txt
View source
  1. // PHP EXAMPLE HOOKS
  2. // examples taken from hidden_nodes implementation
  3. // for adding pure API calls to the operations list (like drag and drop) set the title to <>
  4. /**
  5. * Implementation of hook_outline_designer_operations().
  6. */
  7. function hook_outline_designer_operations($type) {
  8. switch ($type) {
  9. case 'book': // the type of operation group, outline_designer_book handles book
  10. $ops = array(
  11. 'hidden_nodes' => array( // the key of this operation
  12. 'title' => t('Hide node'), // title for display in menus
  13. 'icon' => drupal_get_path('module', 'hidden_nodes') .'/images/hidden_node.png', // the icon location for menus
  14. 'callback' => 'hidden_nodes_outline_designer_hide_node', // optional callback to handle the ajax request this button most likely has
  15. ),
  16. );
  17. break;
  18. default: // default case of a blank array for when other things provide od types
  19. $ops = array();
  20. break;
  21. }
  22. return $ops;
  23. }
  24. /**
  25. * Implementation of hook_outline_designer_ops_js().
  26. */
  27. function hook_outline_designer_ops_js($ajax_path) {
  28. // ajax_path is provided by any sub module implementation of outline designer
  29. // you can include any javascript or css you'd like to be included for this request
  30. // this has a special function to ensure js is loaded in the right order
  31. drupal_add_js(drupal_get_path('module', 'hidden_nodes') .'/js/hidden_nodes_ops.js', 'footer');
  32. return 1;
  33. }
  34. /**
  35. * Implementation of hook_outline_designer_form_overlay().
  36. */
  37. function hook_outline_designer_form_overlay() {
  38. // an example output of elements for use in the overlay
  39. // try and wrap things in a div at the end like this function does
  40. // class name helps with theming, id helps with targetting to render
  41. // delete form
  42. $form['od_hidden_nodes_multiple'] = array(
  43. '#title' => t('Propagate hidden status'),
  44. '#id' => 'od_hidden_nodes_multiple',
  45. '#type' => 'checkbox',
  46. '#description' => t('Should this status be applied to all child content?'),
  47. '#weight' => 0,
  48. '#default_value' => TRUE,
  49. );
  50. // hidden status
  51. $form['od_hidden_nodes_status'] = array(
  52. '#title' => t('Hide content'),
  53. '#id' => 'od_hidden_nodes_status',
  54. '#type' => 'checkbox',
  55. '#description' => t('Hide this content'),
  56. '#weight' => 0,
  57. '#default_value' => FALSE,
  58. );
  59. $output = '
    '. drupal_render($form) .'
    ';
  60. return $output;
  61. }
  62. /**
  63. * Helper function to process the ajax callback for hiding a node
  64. */
  65. function hidden_nodes_outline_designer_hide_node($nid, $multiple, $status) {
  66. // return 0 to trigger a permission error message in the growl system
  67. return 'whatever info you want to return as the message after processing';
  68. }
  69. // JS - the key name is critical in the outline_designer_ops data object
  70. // there are 3 key'ed function names you need, all are listed below
  71. // {key}, {key}_submit, and {key}_reset
  72. // this steps through rendering the overlay form, submiting it, and clean up
  73. /*
  74. (function ($) {
  75. // define function for hidden_nodes operation
  76. Drupal.outline_designer_ops.hidden_nodes = function() {
  77. $(".od_submit_button").val('Submit');
  78. // set default state based on whats loaded
  79. if ($("#node-" + Drupal.settings.outline_designer.activeNid +"-icon").parent().parent().hasClass('node_is_hidden')) {
  80. $('#od_hidden_nodes_status').attr('checked','checked')
  81. }
  82. else {
  83. $('#od_hidden_nodes_status').removeAttr('checked')
  84. }
  85. // function call
  86. Drupal.outline_designer.render_popup(true);
  87. };
  88. // submit handler
  89. Drupal.outline_designer_ops.hidden_nodes_submit = function() {
  90. var multiple = $('#od_hidden_nodes_multiple:checked').length;
  91. var hide_status = $('#od_hidden_nodes_status:checked').length;
  92. // update database
  93. Drupal.outline_designer.ajax_call('book', 'hidden_nodes', Drupal.settings.outline_designer.activeNid, multiple, hide_status, null);
  94. };
  95. // reset handler
  96. Drupal.outline_designer_ops.hidden_nodes_reset = function() {
  97. $("#od_hidden_nodes_multiple").attr("checked", true);
  98. };
  99. })(jQuery);
  100. */