modules/node/node.module, строка 412
- 5 – 6
node_get_types($op = 'types', $node = NULL, $reset = FALSE)
Формирует список доступных типов нод и возвращает те из них, которые определены параметрами.
Параметры
$op
Формат, в котором функция должна вернуть список типов. Если этот параметр равен 'type'
, 'module'
или 'name'
, функция вернет только заданный тип нод. Если же этот параметр равен 'types'
или 'names'
, будут возвращены все типы нод.
$node
Объект ноды, массив или строка, указывающие на тип ноды, который нужно вернуть. Значение по умолчанию (NULL
) вернет все доступные типы нод.
$reset
Обнулять ли внутренний кеш, который формирует эта функция (по умолчанию FALSE
).
Возвращаемое значение
Либо массив всех доступных типов нод, либо отдельный тип ноды. Возвращает FALSE
если запрошенный тип нод не найден.
Builds a list of available node types, and returns all of part of this list
in the specified format.
Parameters
$op
The format in which to return the list. When this is set to 'type',
'module', or 'name', only the specified node type is returned. When set to
'types' or 'names', all node types are returned.
$node
A node object, array, or string that indicates the node type to return.
Leave at default value (NULL) to return a list of all node types.
$reset
Whether or not to reset this function's internal cache (defaults to
FALSE).
Return value
Either an array of all available node types, or a single node type, in a
variable format. Returns FALSE if the node type is not found.
▸ 52 функции вызывают node_get_types()
▾ 52 функции вызывают node_get_types()
- blogapi_admin_settings in modules/blogapi/blogapi.module
- blog_form in modules/blog/blog.module
- Реализация hook_form().
- book_admin_settings in modules/book/book.admin.inc
- Строит и возвращает форму настройки книги.
- comment_update_6002 in modules/comment/comment.install
- Changed comment settings from global to per-node -- copy global
settings to all node types.
- forum_form in modules/forum/forum.module
- Реализация hook_form().
- hook_form in developer/hooks/node.php
- Показывает форму изменения ноды.
- hook_mail in developer/hooks/core.php
- Подготавливает письмо, основанное на параметрах. Для подробностей см. также drupal_mail().
- hook_search in developer/hooks/core.php
- Определяет пользовательскую функцию поиска.
- locale_update_6005 in modules/locale/locale.install
- Change language setting variable of content types.
- node_access in modules/node/node.module
- Устанавливает, может ли текущий пользователь выполнять заданные действия над определённой нодой.
- node_add in modules/node/node.pages.inc
- Выводит форму подтверждения ноды или ряд ссылок на такие формы.
- node_admin_nodes in modules/node/node.admin.inc
- Form builder: Builds the node administration overview.
- node_assign_owner_action in modules/node/node.module
- Implementation of a configurable Drupal action.
Assigns ownership of a node to a user.
- node_content_form in modules/node/node.module
- Реализация hook_form().
- node_delete in modules/node/node.module
- Удаляет ноду.
- node_example_form in developer/examples/node_example.module
- Реализация hook_form().
- node_filters in modules/node/node.admin.inc
- List node administration filters that can be applied.
- node_forms in modules/node/node.module
- Implementation of hook_forms(). All node forms share the same form handler
- node_form_alter in modules/node/node.module
- Implementation of hook_form_alter().
- node_form_submit in modules/node/node.pages.inc
- node_help in modules/node/node.module
- Реализация hook_help().
- node_hook in modules/node/node.module
- Determine whether a node hook exists.
- node_invoke in modules/node/node.module
- Invoke a node hook.
- node_make_sticky_action in modules/node/node.module
- Implementation of a Drupal action.
Sets the sticky-at-top-of-list property of a node to 1.
- node_make_unsticky_action in modules/node/node.module
- Implementation of a Drupal action.
Sets the sticky-at-top-of-list property of a node to 0.
- node_menu in modules/node/node.module
- Реализация hook_menu().
- node_overview_types in modules/node/content_types.inc
- Displays the content type admin overview page.
- node_perm in modules/node/node.module
- Реализация hook_perm().
- node_promote_action in modules/node/node.module
- Реализация Drupal-действий (actions).
Устанавливает значение свойства "Помещать на главную" материала равным 1.
- node_publish_action in modules/node/node.module
- Implementation of a Drupal action.
Sets the status of a node to 1, meaning published.
- node_revision_delete_confirm_submit in modules/node/node.pages.inc
- node_revision_revert_confirm_submit in modules/node/node.pages.inc
- node_save_action in modules/node/node.module
- Implementation of a Drupal action.
Saves a node.
- node_search in modules/node/node.module
- Реализация hook_search().
- node_types_rebuild in modules/node/node.module
- Resets the database cache of node types, and saves all new or non-modified
module-defined node types to the database.
- node_type_delete in modules/node/node.module
- Удаляет тип ноды из БД.
- node_type_form_validate in modules/node/content_types.inc
- Implementation of hook_form_validate().
- node_unpromote_action in modules/node/node.module
- Implementation of a Drupal action.
Sets the promote property of a node to 0.
- node_unpublish_action in modules/node/node.module
- Implementation of a Drupal action.
Sets the status of a node to 0, meaning unpublished.
- node_unpublish_by_keyword_action in modules/node/node.module
- Implementation of a configurable Drupal action.
Unpublish a node if it contains a certain string.
- node_validate in modules/node/node.module
- Perform validation checks on the given node.
- poll_form in modules/poll/poll.module
- Реализация hook_form().
- system_mail in modules/system/system.module
- Implementation of hook_mail().
- system_message_action in modules/system/system.module
- A configurable Drupal action. Sends a message to the current user's screen.
- system_theme_settings in modules/system/system.admin.inc
- Form builder; display theme configuration for entire site and individual themes.
- taxonomy_form_vocabulary in modules/taxonomy/taxonomy.admin.inc
- Display form for adding and editing vocabularies.
See alsotaxonomy_form_vocabulary_submit()
- taxonomy_overview_vocabularies in modules/taxonomy/taxonomy.admin.inc
- Form builder to list and manage vocabularies.
See alsotaxonomy_overview_vocabularies_submit()
- template_preprocess_forums in modules/forum/forum.module
- Process variables for forums.tpl.php
- theme_get_settings in includes/theme.inc
- Retrieve an associative array containing the settings for a theme.
- tracker_page in modules/tracker/tracker.pages.inc
- Menu callback. Prints a listing of active nodes on the site.
- _blogapi_get_node_types in modules/blogapi/blogapi.module
- _node_add_access in modules/node/node.module
Код
<?php
function node_get_types($op = 'types', $node = NULL, $reset = FALSE) {
static $_node_types, $_node_names;
if ($reset || !isset($_node_types)) {
list($_node_types, $_node_names) = _node_types_build();
}
if ($node) {
if (is_array($node)) {
$type = $node['type'];
}
elseif (is_object($node)) {
$type = $node->type;
}
elseif (is_string($node)) {
$type = $node;
}
if (!isset($_node_types[$type])) {
return FALSE;
}
}
switch ($op) {
case 'types':
return $_node_types;
case 'type':
return isset($_node_types[$type]) ? $_node_types[$type] : FALSE;
case 'module':
return isset($_node_types[$type]->module) ? $_node_types[$type]->module : FALSE;
case 'names':
return $_node_names;
case 'name':
return isset($_node_names[$type]) ? $_node_names[$type] : FALSE;
}
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии