The drupal_get_path() function will look up a string (second argument) in Drupal's system table and find a path in the same row.
The login form can easily be found on a drupal installation by appending ?q=user to the end of the drupal installations root url.
The global variable $base_url can be used to retrieve the base url within a drupal installation.
The current theme can be retrieved using the path_to_theme() function. It will return everything after the base url to the current theme.
Hooks, also called callbacks, can be described as internal Drupal events. Hooks essentially allow Drupal modules to hook into the rest of the Drupal installation.
Shortcuts are one of the many new features found in Drupal 7. They allow admins, or members with permission to create their own sets of links that can be accessed by other users using a shortcut bar.
The trigger module is not the only way to call actions. Separate modules can be written to call actions and prepare parameters. This is typically done using a function called actions_do().
When an action is created, the information that is set in the configuration form is serialized and saved into the parameters field of the actions table. Immediately before the advanced action is executed, the contents of the parameters field are unserialized and included in the $context parameter.
Actions can be called in different contexts. When an action supports multiple triggers, it determines which context it's being used in through the $context variable.
The first function in the code below describes the form to drupal. The only form defined is a text field. The text field will be used so that the admin can designate the number of beeps.
An advanced action can be based off of a normal action. The first thing to do is to tell Drupal that this action is configurable.
There are two kinds of actions: ones that take parameters and those that do not. Advanced actions take parameters. When an action that requires setup in a configuration form is called an advanced action or a configurable action.
The node of a url can be retrieved using Drupals url() function.
First thing to do when creating a new action is to inform Drupal which triggers the action should support. This is done by implementing hook_action_info() into our module file.
The following snippet demonstrates how to create a module in Drupal 7. It will send a message to the log every time new content is created.
After enabling the trigger module you will see an option for Triggers under the Structure menu. On that page, the tabs across the top all correspond to Drupal hooks.
Actions are things that Drupal does such as deleting a user or promoting a node to the front page. Actions are functions that Drupal can couple with events.
Save block-specific configuration settings. Configuration settings are defined in hook_block_configure().
Hook_block_view() takes in $delta as a parameter. $delta is the unique identifier for the block within the module. $delta is defined in hook_block_info(). It returns an array containing "subject" and "content".
This hook declares admin settings for module. It provides admin interface for controlling settings for module. A menu item for module will appear in admin menu when the hook is implemented. It returns an array containing form items.
Translates a string to appropriate language. First argument should always be in english. It takes in $string, $args, and $options as parameters. $string is the english string to translate. $args is an associative array containing substitutions. $options is an associative array of additional options.
hook_menu() registers paths to define how url requests are handled. It returns an associative array. Its keys define paths. Its values are an associative array of properties for each path.