You are here

function _outline_designer_get_operations in Outline Designer 6.2

Same name and namespace in other branches
  1. 7.2 outline_designer.module \_outline_designer_get_operations()

Helper function to invoke hook calls and build a list of operations.

5 calls to _outline_designer_get_operations()
outline_designer_book_outline_designer_ops_js in modules/outline_designer_book/outline_designer_book.module
Implementation of hook_outline_designer_ops_js().
outline_designer_menu_outline_designer_ops_js in modules/outline_designer_menu/outline_designer_menu.module
Implementation of hook_outline_designer_ops_js().
_outline_designer_ajax in ./outline_designer.module
Implementation of the ajax menu hook
_outline_designer_book_settings in modules/outline_designer_book/outline_designer_book.module
Implementation of hook_settings().
_outline_designer_menu_settings in modules/outline_designer_menu/outline_designer_menu.module
Implementation of hook_settings().

File

./outline_designer.module, line 282
API for implementation of the Outline Designer usability improvements.

Code

function _outline_designer_get_operations($type, $keep_callbacks = FALSE) {

  // allow other modules to define the list of operations
  $ops = module_invoke_all('outline_designer_operations', $type);

  // allow for altering of this list
  drupal_alter('outline_designer_operations', $ops, $type);

  // hide callbacks unless told to keep them, this helps unclutter js side
  if (!$keep_callbacks) {
    foreach ($ops as $key => $op) {

      // make sure its set so we dont throw an error
      if (isset($op['callback'])) {
        unset($ops[$key]['callback']);
      }

      // remove calls stating they are API only
      // callback removal is for all UI based calls
      if ($op['title'] == '<<OUTLINE_DESIGNER_API_ONLY>>') {
        unset($ops[$key]);
      }
    }
  }
  return $ops;
}