diff --git a/core/includes/path.inc b/core/includes/path.inc index ba7c034..d0c954e 100644 --- a/core/includes/path.inc +++ b/core/includes/path.inc @@ -96,7 +96,7 @@ function current_path() { } /** - * Fetch a specific URL alias from the database. + * Fetches a specific URL alias from the database. * * @param $conditions * A string representing the source, a number representing the pid, or an @@ -118,11 +118,11 @@ function path_load($conditions) { } /** - * Determine whether a path is in the administrative section of the site. + * Determines whether a path is in the administrative section of the site. * - * By default, paths are considered to be non-administrative. If a path does not - * match any of the patterns in path_get_admin_paths(), or if it matches both - * administrative and non-administrative patterns, it is considered + * By default, paths are considered to be non-administrative. If a path does + * not match any of the patterns in path_get_admin_paths(), or if it matches + * both administrative and non-administrative patterns, it is considered * non-administrative. * * @param $path @@ -146,7 +146,7 @@ function path_is_admin($path) { } /** - * Get a list of administrative and non-administrative paths. + * Gets a list of administrative and non-administrative paths. * * @return array * An associative array containing the following keys: diff --git a/core/includes/schema.inc b/core/includes/schema.inc index 7661dcb..b370145 100644 --- a/core/includes/schema.inc +++ b/core/includes/schema.inc @@ -123,8 +123,8 @@ function drupal_get_complete_schema($rebuild = FALSE) { * A module name. * * @return array|bool - * If the module has updates, an array of available updates sorted by version. - * Otherwise, FALSE. + * If the module has updates, an array of available updates sorted by + * version. Otherwise, FALSE. */ function drupal_get_schema_versions($module) { $updates = &drupal_static(__FUNCTION__, NULL); @@ -369,9 +369,9 @@ function drupal_schema_fields_sql($table, $prefix = NULL) { * An object or array representing the record to write, passed in by * reference. If inserting a new record, values not provided in $record will * be populated in $record and in the database with the default values from - * the schema, as well as a single serial (auto-increment) field (if present). - * If updating an existing record, only provided values are updated in the - * database, and $record is not modified. + * the schema, as well as a single serial (auto-increment) field + * (if present). If updating an existing record, only provided values are + * updated in the database, and $record is not modified. * @param array $primary_keys * To indicate that this is a new record to be inserted, omit this argument. * If this is an update, this argument specifies the primary keys' field diff --git a/core/includes/session.inc b/core/includes/session.inc index 9ffd3d1..a514cd5 100644 --- a/core/includes/session.inc +++ b/core/includes/session.inc @@ -270,7 +270,7 @@ function drupal_session_initialize() { } /** - * Forcefully starts a session, preserving already set session data. + * Starts a session, preserving already set session data. * * @ingroup php_wrappers */ diff --git a/core/includes/tablesort.inc b/core/includes/tablesort.inc index 818b61d..c42b1f4 100644 --- a/core/includes/tablesort.inc +++ b/core/includes/tablesort.inc @@ -13,7 +13,7 @@ */ /** - * Initialize the table sort context. + * Initializes the table sort context. */ function tablesort_init($header) { $ts = tablesort_get_order($header); @@ -23,7 +23,7 @@ function tablesort_init($header) { } /** - * Format a column header. + * Formats a column header. * * If the cell in question is the column header for the current sort criterion, * it gets special formatting. All possible sort criteria become links. @@ -34,6 +34,7 @@ function tablesort_init($header) { * An array of column headers in the format described in theme_table(). * @param $ts * The current table sort context as returned from tablesort_init(). + * * @return * A properly formatted cell, ready for _theme_table_cell(). */ @@ -63,7 +64,7 @@ function tablesort_header($cell, $header, $ts) { } /** - * Format a table cell. + * Formats a table cell. * * Adds a class attribute to all cells in the currently active column. * @@ -75,6 +76,7 @@ function tablesort_header($cell, $header, $ts) { * The current table sort context as returned from tablesort_init(). * @param $i * The index of the cell's table column. + * * @return * A properly formatted cell, ready for _theme_table_cell(). */ @@ -91,7 +93,7 @@ function tablesort_cell($cell, $header, $ts, $i) { } /** - * Compose a URL query parameter array for table sorting links. + * Composes a URL query parameter array for table sorting links. * * @return * A URL query parameter array that consists of all components of the current @@ -102,10 +104,11 @@ function tablesort_get_query_parameters() { } /** - * Determine the current sort criterion. + * Determines the current sort criterion. * * @param $headers * An array of column headers in the format described in theme_table(). + * * @return * An associative array describing the criterion, containing the keys: * - "name": The localized title of the table column. @@ -138,10 +141,11 @@ function tablesort_get_order($headers) { } /** - * Determine the current sort direction. + * Determines the current sort direction. * * @param $headers * An array of column headers in the format described in theme_table(). + * * @return * The current sort direction ("asc" or "desc"). */ diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 8a35b6e..260a196 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -75,7 +75,7 @@ function drupal_theme_access($theme) { } /** - * Initialize the theme system by loading the theme. + * Initializes the theme system by loading the theme. */ function drupal_theme_initialize() { global $theme, $user, $theme_key; @@ -114,8 +114,9 @@ function drupal_theme_initialize() { } /** - * Initialize the theme system given already loaded information. This - * function is useful to initialize a theme when no database is present. + * Initializes the theme system given already loaded information. + * + * This function is useful to initialize a theme when no database is present. * * @param $theme * An object with the following information: @@ -242,7 +243,7 @@ function _drupal_theme_initialize($theme, $base_theme = array(), $registry_callb } /** - * Get the theme registry. + * Gets the theme registry. * * @param bool $complete * Optional boolean to indicate whether to return the complete theme registry @@ -287,7 +288,7 @@ function theme_get_registry($complete = TRUE) { } /** - * Set the callback that will be used by theme_get_registry() to fetch the registry. + * Sets the callback that will be used by theme_get_registry(). * * @param $callback * The name of the callback function. @@ -303,7 +304,7 @@ function _theme_registry_callback($callback = NULL, array $arguments = array()) } /** - * Get the theme_registry cache; if it doesn't exist, build it. + * Gets the theme_registry cache; if it doesn't exist, builds it. * * @param $theme * The loaded $theme object as returned by list_themes(). @@ -344,16 +345,17 @@ function _theme_load_registry($theme, $base_theme = NULL, $theme_engine = NULL, } /** - * Write the theme_registry cache into the database. + * Writes the theme_registry cache into the database. */ function _theme_save_registry($theme, $registry) { cache()->set("theme_registry:$theme->name", $registry, CacheBackendInterface::CACHE_PERMANENT, array('theme_registry' => TRUE)); } /** - * Force the system to rebuild the theme registry; this should be called - * when modules are added to the system, or when a dynamic system needs - * to add more theme hooks. + * Forces the system to rebuild the theme registry. + * + * This function should be called when modules are added to the system, or when + * a dynamic system needs to add more theme hooks. */ function drupal_theme_rebuild() { drupal_static_reset('theme_get_registry'); @@ -370,17 +372,17 @@ function drupal_theme_rebuild() { * - 'type': The passed-in $type. * - 'theme path': The passed-in $path. * - 'function': The name of the function generating output for this theme - * hook. Either defined explicitly in hook_theme() or, if neither 'function' - * nor 'template' is defined, then the default theme function name is used. - * The default theme function name is the theme hook prefixed by either - * 'theme_' for modules or '$name_' for everything else. If 'function' is - * defined, 'template' is not used. + * hook. Either defined explicitly in hook_theme() or, if neither + * 'function' nor 'template' is defined, then the default theme function + * name is used. The default theme function name is the theme hook prefixed + * by either 'theme_' for modules or '$name_' for everything else. If + * 'function' is defined, 'template' is not used. * - 'template': The filename of the template generating output for this * theme hook. The template is in the directory defined by the 'path' key of * hook_theme() or defaults to "$path/templates". * - 'variables': The variables for this theme hook as defined in - * hook_theme(). If there is more than one implementation and 'variables' is - * not specified in a later one, then the previous definition is kept. + * hook_theme(). If there is more than one implementation and 'variables' + * is not specified in a later one, then the previous definition is kept. * - 'render element': The renderable element for this theme hook as defined * in hook_theme(). If there is more than one implementation and * 'render element' is not specified in a later one, then the previous @@ -555,7 +557,8 @@ function _theme_process_registry(&$cache, $name, $type, $theme, $path) { $cache = $result + $cache; } - // Let themes have variable processors even if they didn't register a template. + // Let themes have variable processors even if they didn't register a + // template. if ($type == 'theme' || $type == 'base_theme') { foreach ($cache as $hook => $info) { // Check only if not registered by the theme or engine. @@ -582,7 +585,7 @@ function _theme_process_registry(&$cache, $name, $type, $theme, $path) { } /** - * Build the theme registry cache. + * Builds the theme registry cache. * * @param $theme * The loaded $theme object as returned by list_themes(). @@ -644,7 +647,7 @@ function _theme_build_registry($theme, $base_theme, $theme_engine) { } /** - * Return a list of all currently available themes. + * Returns a list of all currently available themes. * * Retrieved from the database, if available and the site is not in maintenance * mode; otherwise compiled freshly from the filesystem. @@ -823,15 +826,15 @@ function drupal_find_base_themes($themes, $key, $used_keys = array()) { * executed (if they exist), in the following order (note that in the following * list, HOOK indicates the theme hook name, MODULE indicates a module name, * THEME indicates a theme name, and ENGINE indicates a theme engine name): - * - template_preprocess(&$variables, $hook): Creates a default set of variables - * for all theme hooks with template implementations. + * - template_preprocess(&$variables, $hook): Creates a default set of + * variables for all theme hooks with template implementations. * - template_preprocess_HOOK(&$variables): Should be implemented by the module * that registers the theme hook, to set up default variables. * - MODULE_preprocess(&$variables, $hook): hook_preprocess() is invoked on all * implementing modules. * - MODULE_preprocess_HOOK(&$variables): hook_preprocess_HOOK() is invoked on - * all implementing modules, so that modules that didn't define the theme hook - * can alter the variables. + * all implementing modules, so that modules that didn't define the theme + * hook can alter the variables. * - ENGINE_engine_preprocess(&$variables, $hook): Allows the theme engine to * set necessary variables for all theme hooks with template implementations. * - ENGINE_engine_preprocess_HOOK(&$variables): Allows the theme engine to set @@ -886,10 +889,10 @@ function drupal_find_base_themes($themes, $key, $used_keys = array()) { * @param $hook * The name of the theme hook to call. If the name contains a * double-underscore ('__') and there isn't an implementation for the full - * name, the part before the '__' is checked. This allows a fallback to a more - * generic implementation. For example, if theme('links__node', ...) is - * called, but there is no implementation of that theme hook, then the 'links' - * implementation is used. This process is iterative, so if + * name, the part before the '__' is checked. This allows a fallback to a + * more generic implementation. For example, if theme('links__node', ...) is + * called, but there is no implementation of that theme hook, then the + * 'links' implementation is used. This process is iterative, so if * theme('links__contextual__node', ...) is called, theme() checks for the * following implementations, and uses the first one that exists: * - links__contextual__node @@ -968,7 +971,8 @@ function theme($hook, $variables = array()) { // point path_to_theme() to the currently used theme path: $theme_path = $info['theme path']; - // Include a file if the theme function or variable processor is held elsewhere. + // Include a file if the theme function or variable processor is held + // elsewhere. if (!empty($info['includes'])) { foreach ($info['includes'] as $include_file) { include_once DRUPAL_ROOT . '/' . $include_file; @@ -1132,14 +1136,14 @@ function theme($hook, $variables = array()) { } /** - * Return the path to the current themed element. - * - * It can point to the active theme or the module handling a themed implementation. - * For example, when invoked within the scope of a theming call it will depend - * on where the theming function is handled. If implemented from a module, it - * will point to the module. If implemented from the active theme, it will point - * to the active theme. When called outside the scope of a theming call, it will - * always point to the active theme. + * Returns the path to the current themed element. + * + * It can point to the active theme or the module handling a themed + * implementation. For example, when invoked within the scope of a theming call + * it will depend on where the theming function is handled. If implemented from + * a module, it will point to the module. If implemented from the active theme, + * it will point to the active theme. When called outside the scope of a + * theming call, it will always point to the active theme. */ function path_to_theme() { global $theme_path; @@ -1152,7 +1156,7 @@ function path_to_theme() { } /** - * Allow themes and/or theme engines to easily discover overridden theme functions. + * Allows themes and/or theme engines to discover overridden theme functions. * * @param $cache * The existing cache of theme hooks to test against. @@ -1209,7 +1213,7 @@ function drupal_find_theme_functions($cache, $prefixes) { } /** - * Allow themes and/or theme engines to easily discover overridden templates. + * Allows themes and/or theme engines to easily discover overridden templates. * * @param $cache * The existing cache of theme hooks to test against. @@ -1306,7 +1310,8 @@ function drupal_find_theme_templates($cache, $extension, $path) { if (($pos = strpos($match, '.')) !== FALSE) { $file = substr($match, 0, $pos); } - // Put the underscores back in for the hook name and register this pattern. + // Put the underscores back in for the hook name and register this + // pattern. $arg_name = isset($info['variables']) ? 'variables' : 'render element'; $implementations[strtr($file, '-', '_')] = array( 'template' => $file, @@ -1322,7 +1327,7 @@ function drupal_find_theme_templates($cache, $extension, $path) { } /** - * Retrieve a setting for the current theme or for a given theme. + * Retrieves a setting for the current theme or for a given theme. * * The final setting is obtained from the last value found in the following * sources: @@ -1440,7 +1445,7 @@ function theme_get_setting($setting_name, $theme = NULL) { } /** - * Render a system default template, which is essentially a PHP template. + * Renders a system default template, which is essentially a PHP template. * * @param $template_file * The filename of the template to render. @@ -1451,14 +1456,21 @@ function theme_get_setting($setting_name, $theme = NULL) { * The output generated by the template. */ function theme_render_template($template_file, $variables) { - extract($variables, EXTR_SKIP); // Extract the variables to a local namespace - ob_start(); // Start output buffering - include DRUPAL_ROOT . '/' . $template_file; // Include the template file - return ob_get_clean(); // End buffering and return its contents + // Extract the variables to a local namespace + extract($variables, EXTR_SKIP); + + // Start output buffering + ob_start(); + + // Include the template file + include DRUPAL_ROOT . '/' . $template_file; + + // End buffering and return its contents + return ob_get_clean(); } /** - * Enable a given list of themes. + * Enables a given list of themes. * * @param $theme_list * An array of theme names. @@ -1486,7 +1498,7 @@ function theme_enable($theme_list) { } /** - * Disable a given list of themes. + * Disables a given list of themes. * * @param $theme_list * An array of theme names. @@ -1555,20 +1567,21 @@ function template_preprocess_datetime(&$variables) { * * @param $variables * An associative array containing: - * - timestamp: (optional) A UNIX timestamp for the datetime attribute. If the - * datetime cannot be represented as a UNIX timestamp, use a valid datetime - * attribute value in $variables['attributes']['datetime']. + * - timestamp: (optional) A UNIX timestamp for the datetime attribute. If + * the datetime cannot be represented as a UNIX timestamp, use a valid + * datetime attribute value in $variables['attributes']['datetime']. * - text: (optional) The content to display within the