Package base :: Package plugins :: Package system
[hide private]

Package system

source code

Configuration system that lets administrators modify the workings of the site.
See Also:
Drupy Homepage, Drupal Homepage
Notes:

Author: Brendon Crawford

Copyright: 2008 Brendon Crawford

Contact: message144 at users dot sourceforge dot net

Version: 0.1

Functions [hide private]
 
hook_help(path_, arg)
Implementation of hook_help().
source code
 
hook_theme()
Implementation of hook_theme().
source code
 
hook_perm()
Implementation of hook_perm().
source code
 
hook_elements()
Implementation of hook_elements().
source code
 
hook_menu()
Implementation of hook_menu().
source code
 
blocked_ip_load(iid)
Retrieve a blocked IP address from the database.
source code
 
_themes_access(theme_)
Menu item access callback - only admin or enabled themes can be accessed.
source code
 
hook_init()
Implementation of hook_init().
source code
 
hook_user(type_, edit, user, category=None)
Implementation of hook_user().
source code
 
hook_block(op='list', delta='', edit=None)
Implementation of hook_block().
source code
 
admin_menu_block(item)
Provide a single block on the administration overview page.
source code
 
admin_theme_submit(form, form_state)
Process admin theme form submissions.
source code
 
theme_select_form(description='', default_value='', weight=0)
Returns a fieldset containing the theme select form.
source code
 
check_directory(form_element)
Checks the existence of the directory specified in form_element.
source code
 
get_files_database(files, type)
Retrieves the current status of an array of files in the system table.
source code
 
theme_default()
Prepare defaults for themes.
source code
 
theme_data()
Collect data about all currently available themes.
source code
 
_theme_data()
Helper function to scan and collect theme .info data and their engines.
source code
 
find_base_theme(themes, key, used_keys=[])
Recursive function to find the top level base theme.
source code
 
region_list(theme_key)
Get a list of available regions from a specified theme.
source code
 
default_region(theme_)
Get the name of the default region for a given theme.
source code
 
initialize_theme_blocks(theme_)
Assign an initial, default set of blocks for a theme.
source code
 
settings_form(form)
Add default buttons to a form and set its prefix.
source code
 
settings_form_submit(form, form_state)
Execute the system_settings_form.
source code
 
_sort_requirements(a, b)
Helper function to sort requirements.
source code
 
hook_node_type(op, info)
Implementation of hook_node_type().
source code
 
confirm_form(form, question, path_, description=None, yes=None, no=None, name='confirm')
Output a confirmation form This function returns a complete form for confirming an action.
source code
 
admin_compact_mode()
Determine if a user is in compact mode.
source code
 
admin_compact_page(mode='off')
Menu callback; Sets whether the admin menu is in compact mode or not.
source code
 
get_module_admin_tasks(plugin)
Generate a list of tasks offered by a specified module.
source code
 
hook_cron()
Implementation of hook_cron().
source code
 
hook_hook_info()
Implementation of hook_hook_info().
source code
 
hook_action_info()
Implementation of hook_action_info().
source code
 
actions_manage()
Menu callback.
source code
 
actions_manage_form(form_state, options=[])
Define the form for the actions overview page.
source code
 
actions_manage_form_submit(form, form_state)
Process system_actions_manage form submissions.
source code
 
actions_configure(form_state, action=None)
Menu callback.
source code
 
actions_configure_validate(form, form_state)
Validate system_actions_configure form submissions.
source code
 
actions_configure_submit(form, form_state)
Process system_actions_configure form submissions.
source code
 
actions_delete_form(form_state, action)
Create the form for confirmation of deleting an action.
source code
 
actions_delete_form_submit(form, form_state)
Process system_actions_delete form submissions.
source code
 
action_delete_orphans_post(orphaned)
Post-deletion operations for deleting action orphans.
source code
 
actions_remove_orphans()
Remove actions that are in the database but not supported by any enabled module.
source code
 
send_email_action_form(context)
Return a form definition so the Send email action can be configured.
source code
 
send_email_action_validate(form, form_state)
Validate system_send_email_action form submissions.
source code
 
send_email_action_submit(form, form_state)
Process system_send_email_action form submissions.
source code
 
send_email_action(object_, context)
Implementation of a configurable Drupal action.
source code
 
hook_mail(key, message, params)
Implementation of hook_mail().
source code
 
message_action_form(context) source code
 
message_action_submit(form, form_state) source code
 
message_action(object_, context=[])
A configurable Drupal action.
source code
 
goto_action_form(context)
Implementation of a configurable Drupal action.
source code
 
goto_action_submit(form, form_state) source code
 
goto_action(object_, context) source code
 
block_ip_action()
Implementation of a Drupal action.
source code
 
_zonelist()
Generate an array of time zones and their local time&date.
source code
 
check_http_request()
Checks whether the server is capable of issuing HTTP requests.
source code
 
theme_powered_by(image_path)
Format the Powered by Drupal text.
source code
 
theme_compact_link()
Display the link to show or hide inline help descriptions.
source code
 
theme_meta_generator_html(version='7.0-dev')
Send Drupal and the major version number in the META GENERATOR HTML.
source code
 
theme_meta_generator_header(version='7.0-dev')
Send Drupal and the major version number in the HTTP headers.
source code
 
hook_image_toolkits()
Implementation of hook_image_toolkits().
source code
Variables [hide private]
  __version__ = '$Revision: 1 $'
  VERSION = '7.0-dev'
  DRUPAL_CORE_COMPATIBILITY = '7.x'
  DRUPAL_MINIMUM_PHP = None
  DRUPAL_MINIMUM_PYTHON = '2.5'
  DRUPAL_MINIMUM_PHP_MEMORY_LIMIT = None
  DRUPAL_MINIMUM_MYSQL = '5.0'
  DRUPAL_MINIMUM_PGSQL = '8.1'
  DRUPAL_MAXIMUM_TEMP_FILE_AGE = 1440
Function Details [hide private]

hook_help(path_, arg)

source code 
Implementation of hook_help().
Parameters:
  • path_ - Str
  • arg - Dict
Returns:
Str

hook_theme()

source code 
Implementation of hook_theme().
Returns:
Dict

hook_perm()

source code 
Implementation of hook_perm().
Returns:
Dict

hook_elements()

source code 
Implementation of hook_elements().
Returns:
Dict

hook_menu()

source code 
Implementation of hook_menu().
Returns:
Dict

blocked_ip_load(iid)

source code 
Retrieve a blocked IP address from the database.
Parameters:
  • iid - integer The ID of the blocked IP address to retrieve.
Returns:
The blocked IP address from the database as an array.

hook_user(type_, edit, user, category=None)

source code 
Implementation of hook_user(). Allows users to individually set their theme and time zone.

hook_block(op='list', delta='', edit=None)

source code 
Implementation of hook_block(). Generate a block with a promotional link to Drupal.org.

admin_menu_block(item)

source code 
Provide a single block on the administration overview page.
Parameters:
  • item - The menu item to be displayed.

theme_select_form(description='', default_value='', weight=0)

source code 
Returns a fieldset containing the theme select form.
Parameters:
  • description - description of the fieldset
  • default_value - default value of theme radios
  • weight - weight of the fieldset
Returns:
a form array

check_directory(form_element)

source code 
Checks the existence of the directory specified in form_element. This function is called from the system_settings form to check both the file_directory_path and file_directory_temp directories. If validation fails, the form element is flagged with an error from within the file_check_directory function.
Parameters:
  • form_element - The form element containing the name of the directory to check.

get_files_database(files, type)

source code 
Retrieves the current status of an array of files in the system table.
Parameters:
  • files - An array of files to check.
  • type - The type of the files.

theme_default()

source code 
Prepare defaults for themes.
Returns:
An array of default themes settings.

theme_data()

source code 
Collect data about all currently available themes.
Returns:
Array of all available themes and their data.

_theme_data()

source code 
Helper function to scan and collect theme .info data and their engines.
Returns:
An associative array of themes information.

find_base_theme(themes, key, used_keys=[])

source code 
Recursive function to find the top level base theme. Themes can inherit templates and function implementations from earlier themes.
Parameters:
  • themes - An array of available themes.
  • key - The name of the theme whose base we are looking for.
  • used_keys - A recursion parameter preventing endless loops.
Returns:
Returns the top level parent that has no ancestor or returns None if there isn't a valid parent.

region_list(theme_key)

source code 
Get a list of available regions from a specified theme.
Parameters:
  • theme_key - The name of a theme.
Returns:
An array of regions in the form region['name'] = 'description'.

default_region(theme_)

source code 
Get the name of the default region for a given theme.
Parameters:
  • theme - The name of a theme.
Returns:
A string that is the region name.

initialize_theme_blocks(theme_)

source code 
Assign an initial, default set of blocks for a theme. This function is called the first time a new theme is enabled. The new theme gets a copy of the default theme's blocks, with the difference that if a particular region isn't available in the new theme, the block is assigned to the new theme's default region.
Parameters:
  • theme - The name of a theme.

settings_form(form)

source code 
Add default buttons to a form and set its prefix.
Parameters:
  • form - An associative array containing the structure of the form.
Returns:
The form structure.

See Also:

settings_form_submit(form, form_state)

source code 
Execute the system_settings_form. If you want node type configure style handling of your checkboxes, add an array_filter value to your form.

hook_node_type(op, info)

source code 
Implementation of hook_node_type(). Updates theme settings after a node type change.

confirm_form(form, question, path_, description=None, yes=None, no=None, name='confirm')

source code 
Output a confirmation form This function returns a complete form for confirming an action. A link is offered to go back to the item that is being changed in case the user changes his/her mind. If the submit handler for this form is invoked, the user successfully confirmed the action. You should never directly inspect _POST to see if an action was confirmed.
Parameters:
  • form - Additional elements to inject into the form, for example hidden elements.
  • question - The question to ask the user (e.g. "Are you sure you want to delete the block foo?").
  • path - The page to go to if the user denies the action. Can be either a drupal path, or an array with the keys 'path', 'query', 'fragment'.
  • description - Additional text to display (defaults to "This action cannot be undone.").
  • yes - A caption for the button which confirms the action (e.g. "Delete", "Replace", ...).
  • no - A caption for the link which denies the action (e.g. "Cancel").
  • name - The internal name used to refer to the confirmation item.
Returns:
The form.

admin_compact_page(mode='off')

source code 
Menu callback; Sets whether the admin menu is in compact mode or not.
Parameters:
  • mode - Valid values are 'on' and 'off'.

get_module_admin_tasks(plugin)

source code 
Generate a list of tasks offered by a specified module.
Parameters:
  • module - Module name.
Returns:
An array of task links.

hook_cron()

source code 
Implementation of hook_cron(). Remove older rows from flood and batch table. Remove old temporary files.

actions_manage()

source code 
Menu callback. Display an overview of available and configured actions.

actions_manage_form(form_state, options=[])

source code 
Define the form for the actions overview page.
Parameters:
  • form_state - An associative array containing the current state of the form; not used.
  • options - An array of configurable actions.
Returns:
Form definition.

See Also:

actions_configure(form_state, action=None)

source code 
Menu callback. Create the form for configuration of a single action. We provide the "Description" field. The rest of the form is provided by the action. We then provide the Save button. Because we are combining unknown form elements with the action configuration form, we use actions_ prefix on our elements.
Parameters:
  • action - md5 hash of action ID or an integer. If it's an md5 hash, we are creating a new instance. If it's an integer, we're editing an existing instance.
Returns:
Form definition.
See Also:
,

actions_delete_form(form_state, action)

source code 
Create the form for confirmation of deleting an action.

See Also: system_actions_delete_form_submit

actions_delete_form_submit(form, form_state)

source code 
Process system_actions_delete form submissions. Post-deletion operations for action deletion.

action_delete_orphans_post(orphaned)

source code 
Post-deletion operations for deleting action orphans.
Parameters:
  • orphaned - An array of orphaned actions.

send_email_action_form(context)

source code 
Return a form definition so the Send email action can be configured.
Parameters:
  • context - Default values (if we are editing an existing action instance).
Returns:
Form definition.
See Also:
,

send_email_action(object_, context)

source code 
Implementation of a configurable Drupal action. Sends an email.

message_action(object_, context=[])

source code 
A configurable Drupal action. Sends a message to the current user's screen.

goto_action_form(context)

source code 
Implementation of a configurable Drupal action. Redirect user to a URL.

block_ip_action()

source code 
Implementation of a Drupal action. Blocks the user's IP address.

check_http_request()

source code 
Checks whether the server is capable of issuing HTTP requests. The function sets the drupal_http_request_fail system variable to True if drupal_http_request() does not work and then the system status report page will contain an error.
Returns:
Whether the admin/reports/request-test page can be requested via HTTP and contains the same output as if called via the menu system.