You are here

function farm_ui_action_link in farmOS 7

Helper function for generating an action link.

Parameters

string $title: The title of the action link.

string $path: The path of the action link.

array $query: An array of additional query parameters to add.

Return value

array Returns an action link if the path is valid.

See also

farm_ui_menu_local_tasks_alter()

1 call to farm_ui_action_link()
_farm_ui_menu_local_tasks_alter in modules/farm/farm_ui/farm_ui.action_links.inc
Helper function for adding farmOS action links.

File

modules/farm/farm_ui/farm_ui.action_links.inc, line 139

Code

function farm_ui_action_link($title, $path, $query = array()) {
  if (!drupal_valid_path($path)) {
    return array();
  }
  $action_link = array(
    '#theme' => 'menu_local_action',
    '#link' => array(
      'title' => $title,
      'href' => $path,
      'localized_options' => array(
        'query' => $query,
      ),
    ),
  );
  return $action_link;
}