common.inc
Версия 1.611.2.24 (checked in on 2009/05/13 at 17:10:36 by drumm)
Common functions that many Drupal modules will need to reference.
The functions that are critical and need to be available even when serving a cached page are instead located in bootstrap.inc.
Константы
Имя | Описание |
---|---|
SAVED_DELETED | Return status for saving which deleted an existing item. |
SAVED_NEW | Return status for saving which involved creating a new item. |
SAVED_UPDATED | Return status for saving which involved an update to an existing item. |
Функции
Имя | Описание |
---|---|
base_path | Возвращает базовый путь сайта. |
check_file | |
check_url | Подготавливает URL для использования в качестве HTML-атрибута. Убирает вредоносные протоколы. |
drupal_access_denied | Генерирует ошибку 403 если для просмотра страницы недостаточно прав. |
drupal_add_css | Adds a CSS file to the stylesheet queue. |
drupal_add_feed | Добавляет URL фида для текущей страницы. |
drupal_add_js | Добавляет JavaScript файл, настройки или код на страницу. |
drupal_add_link | Добавляет тег в HEAD страницы. |
drupal_attributes | Форматирует строку с атрибутами для вставки в HTML тэг. |
drupal_build_css_cache | Объединяет и оптимизирует файлы CSS, размещая конечный файл в файловой директории. |
drupal_clear_css_cache | Удаляет все файлы кэша CSS. |
drupal_clear_path_cache | Обновляет static-переменные, в которых содержится кеш путей для данной страницы. |
drupal_clone | Обеспечивает замену функции clone() для PHP4. |
drupal_cron_cleanup | Shutdown function for cron cleanup. |
drupal_cron_run | При вызове выполняет задачи cron |
drupal_eval | Исполнить строку кода на PHP. |
drupal_final_markup | Make any final alterations to the rendered xhtml. |
drupal_get_breadcrumb | Получает хлебные крошки для текущей страницы. |
drupal_get_content | Get assigned content. |
drupal_get_css | Returns a themed representation of all stylesheets that should be attached to the page. It loads the CSS in order, with 'core' CSS first, then 'module' CSS, then 'theme' CSS files. This ensures proper cascading of styles... |
drupal_get_destination | Подготавливает строку запроса перенаправления для использования совместно с функцией drupal_goto(). Используется для перенаправления пользователя назад к ссылающейся страницы после заполнения формы. По умолчанию возвращается текущий URL. Если путь назначения задан в предыдущем запросе, возвращается этот путь.Если путь назначения задан в предыдущем запросе, возвращается этот путь. |
drupal_get_feeds | Get the feed URLs for the current page. |
drupal_get_headers | Get the HTTP response headers for the current page. |
drupal_get_html_head | Retrieve output to be displayed in the head tag of the HTML page. |
drupal_get_js | Returns a themed presentation of all JavaScript code for the current page. References to JavaScript files are placed in a certain order: first, all 'core' files, then all 'module' and finally all 'theme' JavaScript... |
drupal_get_path | Возвращает адрес системного элемента (модуль, тема и т.п.) |
drupal_get_private_key | Гарантирует, что переменная персонального ключа, которая используется для генерации токенов установлена. |
drupal_get_token | Генерирует уникальное значение (токен), основанное на значении параметра $value, текущей сессии пользователя и приватного ключа сайта. |
drupal_goto | Перенаправляет пользователя на другую страницу сайта на Друпале. |
drupal_http_request | Perform an HTTP request. |
drupal_mail | Send an e-mail message, using Drupal variables and default settings. More information in the PHP function reference for mail() |
drupal_map_assoc | Формирует ассоциативный массив из линейного массива. |
drupal_not_found | Генерирует ошибку 404 (страница не найдена) если запрос не удалось обработать. |
drupal_page_footer | Perform end-of-request tasks. |
drupal_query_string_encode | Parse an array into a valid urlencoded query string. |
drupal_render | Формирует HTML-код из структурированного массива. |
drupal_set_breadcrumb | Устанавливает хлебные крошки для текущей страницы. |
drupal_set_content | Добавляет содержание в определенный регион. |
drupal_set_header | Set an HTTP response header for the current page. |
drupal_set_html_head | Add output to the head tag of the HTML page. This function can be called as long the headers aren't sent. |
drupal_site_offline | Generates a site off-line message |
drupal_system_listing | Returns an array of files objects of the given type from the site-wide directory (i.e. modules/), the all-sites directory (i.e. sites/all/modules/), the profiles directory, and site-specific directory (i.e. sites/somesite/modules/). The returned array... |
drupal_to_js | Converts a PHP variable into its Javascript equivalent. |
drupal_urlencode | Wrapper around urlencode() which avoids Apache quirks. |
drupal_valid_token | Проверяет корректность соотношения уникального значения (токена) к ключу, основанному на параметре $value, сессии пользователя и приватного ключа сайта. |
element_child | Проверяет, является ли ключ структурированного массива атрибутом (начинается с '#') или дочерним элементом (все остальные ключи). |
element_children | Возвращает ключи структурированного массива, которые не являются атрибутами (т.е. не начинаются на '#'). |
element_properties | Get properties of a structured array element. Properties begin with '#'. |
element_property | Check if the key is a property. |
error_handler | Log errors as defined by administrator Error levels: 0 = Log errors to database. 1 = Log errors to database and to screen. |
fix_gpc_magic | Correct double-escaping problems caused by 'magic quotes' in some PHP installations. |
flood_is_allowed | Check if the current visitor (hostname/IP) is allowed to proceed with the specified event. The user is allowed to proceed if he did not trigger the specified event more than $threshold times per hour. |
flood_register_event | Register an event for the current visitor (hostname/IP) to the flood control mechanism. |
format_date | Форматирует дату в заданном формате или в формате настроек сайта. |
format_interval | Форматирует временной интервал с заданной точностью. |
format_plural | Форматирует и переводит строку, содержащую число. |
format_rss_channel | Formats an RSS channel. |
format_rss_item | Format a single RSS item. |
format_size | Генерирует строчное представление указанного количества байт. |
format_xml_elements | Format XML elements. |
l | Оформляет ссылки. |
locale_initialize | Initialize the localization system. |
page_set_cache | Store the current page in the cache. |
parse_size | Parse a given byte count. |
t | Переводит строку на заданный язык или язык страницы. |
url | Генерирует URL из указанного пути меню. Также поддерживает уже существующие URL. |
valid_email_address | Verify the syntax of the given e-mail address. |
valid_url | Verify the syntax of the given URL. |
xmlrpc | Performs one or more XML-RPC request(s). |
_drupal_add_js | Helper function for drupal_add_js(). |
_drupal_bootstrap_full | |
_element_sort | Function used by uasort in drupal_render() to sort structured arrays by weight. |
_fix_gpc_magic | |
_fix_gpc_magic_files | Helper function to strip slashes from $_FILES skipping over the tmp_name keys since PHP generates single backslashes for file paths on Windows systems. |