updated core to 7.73
This commit is contained in:
@@ -25,7 +25,7 @@ function taxonomy_help($path, $arg) {
|
||||
$output .= '<h3>' . t('Uses') . '</h3>';
|
||||
$output .= '<dl>';
|
||||
$output .= '<dt>' . t('Creating vocabularies') . '</dt>';
|
||||
$output .= '<dd>' . t('Users with sufficient <a href="@perm">permissions</a> can create <em>vocabularies</em> and <em>terms</em> through the <a href="@taxo">Taxonomy page</a>. The page listing the terms provides a drag-and-drop interface for controlling the order of the terms and sub-terms within a vocabulary, in a hierarchical fashion. A <em>controlled vocabulary</em> classifying music by genre with terms and sub-terms could look as follows:', array('@taxo' => url('admin/structure/taxonomy'), '@perm' => url('admin/people/permissions', array('fragment'=>'module-taxonomy'))));
|
||||
$output .= '<dd>' . t('Users with sufficient <a href="@perm">permissions</a> can create <em>vocabularies</em> and <em>terms</em> through the <a href="@taxo">Taxonomy page</a>. The page listing the terms provides a drag-and-drop interface for controlling the order of the terms and sub-terms within a vocabulary, in a hierarchical fashion. A <em>controlled vocabulary</em> classifying music by genre with terms and sub-terms could look as follows:', array('@taxo' => url('admin/structure/taxonomy'), '@perm' => url('admin/people/permissions', array('fragment' => 'module-taxonomy'))));
|
||||
$output .= '<ul><li>' . t('<em>vocabulary</em>: Music') . '</li>';
|
||||
$output .= '<ul><li>' . t('<em>term</em>: Jazz') . '</li>';
|
||||
$output .= '<ul><li>' . t('<em>sub-term</em>: Swing') . '</li>';
|
||||
@@ -140,7 +140,7 @@ function taxonomy_entity_info() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Entity URI callback.
|
||||
* Implements callback_entity_info_uri().
|
||||
*/
|
||||
function taxonomy_term_uri($term) {
|
||||
return array(
|
||||
@@ -283,6 +283,8 @@ function taxonomy_menu() {
|
||||
'title' => 'Taxonomy term',
|
||||
'title callback' => 'taxonomy_term_title',
|
||||
'title arguments' => array(2),
|
||||
// The page callback also invokes drupal_set_title() in case
|
||||
// the menu router's title is overridden by a menu link.
|
||||
'page callback' => 'taxonomy_term_page',
|
||||
'page arguments' => array(2),
|
||||
'access arguments' => array('access content'),
|
||||
@@ -457,7 +459,12 @@ function taxonomy_vocabulary_save($vocabulary) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a vocabulary.
|
||||
* Deletes a vocabulary.
|
||||
*
|
||||
* This will update all Taxonomy fields so that they don't reference the
|
||||
* deleted vocabulary. It also will delete fields that have no remaining
|
||||
* vocabulary references. All taxonomy terms of the deleted vocabulary
|
||||
* will be deleted as well.
|
||||
*
|
||||
* @param $vid
|
||||
* A vocabulary ID.
|
||||
@@ -748,7 +755,7 @@ function taxonomy_term_delete($tid) {
|
||||
* @param term
|
||||
* A taxonomy term object.
|
||||
* @return
|
||||
* A $page element suitable for use by drupal_page_render().
|
||||
* A $page element suitable for use by drupal_render().
|
||||
*/
|
||||
function taxonomy_term_show($term) {
|
||||
return taxonomy_term_view_multiple(array($term->tid => $term), 'full');
|
||||
@@ -771,15 +778,26 @@ function taxonomy_term_show($term) {
|
||||
* An array in the format expected by drupal_render().
|
||||
*/
|
||||
function taxonomy_term_view_multiple($terms, $view_mode = 'teaser', $weight = 0, $langcode = NULL) {
|
||||
field_attach_prepare_view('taxonomy_term', $terms, $view_mode, $langcode);
|
||||
entity_prepare_view('taxonomy_term', $terms, $langcode);
|
||||
$build = array();
|
||||
$entities_by_view_mode = entity_view_mode_prepare('taxonomy_term', $terms, $view_mode, $langcode);
|
||||
foreach ($entities_by_view_mode as $entity_view_mode => $entities) {
|
||||
field_attach_prepare_view('taxonomy_term', $entities, $entity_view_mode, $langcode);
|
||||
entity_prepare_view('taxonomy_term', $entities, $langcode);
|
||||
|
||||
foreach ($entities as $entity) {
|
||||
$build['taxonomy_terms'][$entity->tid] = taxonomy_term_view($entity, $entity_view_mode, $langcode);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($terms as $term) {
|
||||
$build['taxonomy_terms'][$term->tid] = taxonomy_term_view($term, $view_mode, $langcode);
|
||||
$build['taxonomy_terms'][$term->tid]['#weight'] = $weight;
|
||||
$weight++;
|
||||
}
|
||||
// Sort here, to preserve the input order of the entities that were passed to
|
||||
// this function.
|
||||
uasort($build['taxonomy_terms'], 'element_sort');
|
||||
$build['taxonomy_terms']['#sorted'] = TRUE;
|
||||
|
||||
return $build;
|
||||
}
|
||||
|
||||
@@ -812,12 +830,7 @@ function taxonomy_term_build_content($term, $view_mode = 'full', $langcode = NUL
|
||||
$term->content = array();
|
||||
|
||||
// Allow modules to change the view mode.
|
||||
$context = array(
|
||||
'entity_type' => 'taxonomy_term',
|
||||
'entity' => $term,
|
||||
'langcode' => $langcode,
|
||||
);
|
||||
drupal_alter('entity_view_mode', $view_mode, $context);
|
||||
$view_mode = key(entity_view_mode_prepare('taxonomy_term', array($term->tid => $term), $view_mode, $langcode));
|
||||
|
||||
// Add the term description if the term has one and it is visible.
|
||||
$type = 'taxonomy_term';
|
||||
@@ -1012,7 +1025,7 @@ function taxonomy_get_parents($tid) {
|
||||
$query->join('taxonomy_term_hierarchy', 'h', 'h.parent = t.tid');
|
||||
$query->addField('t', 'tid');
|
||||
$query->condition('h.tid', $tid);
|
||||
$query->addTag('term_access');
|
||||
$query->addTag('taxonomy_term_access');
|
||||
$query->orderBy('t.weight');
|
||||
$query->orderBy('t.name');
|
||||
$tids = $query->execute()->fetchCol();
|
||||
@@ -1070,7 +1083,7 @@ function taxonomy_get_children($tid, $vid = 0) {
|
||||
if ($vid) {
|
||||
$query->condition('t.vid', $vid);
|
||||
}
|
||||
$query->addTag('term_access');
|
||||
$query->addTag('taxonomy_term_access');
|
||||
$query->orderBy('t.weight');
|
||||
$query->orderBy('t.name');
|
||||
$tids = $query->execute()->fetchCol();
|
||||
@@ -1118,7 +1131,7 @@ function taxonomy_get_tree($vid, $parent = 0, $max_depth = NULL, $load_entities
|
||||
$query->join('taxonomy_term_hierarchy', 'h', 'h.tid = t.tid');
|
||||
$result = $query
|
||||
->addTag('translatable')
|
||||
->addTag('term_access')
|
||||
->addTag('taxonomy_term_access')
|
||||
->fields('t')
|
||||
->fields('h', array('parent'))
|
||||
->condition('t.vid', $vid)
|
||||
@@ -1238,7 +1251,7 @@ class TaxonomyTermController extends DrupalDefaultEntityController {
|
||||
protected function buildQuery($ids, $conditions = array(), $revision_id = FALSE) {
|
||||
$query = parent::buildQuery($ids, $conditions, $revision_id);
|
||||
$query->addTag('translatable');
|
||||
$query->addTag('term_access');
|
||||
$query->addTag('taxonomy_term_access');
|
||||
// When name is passed as a condition use LIKE.
|
||||
if (isset($conditions['name'])) {
|
||||
$query_conditions = &$query->conditions();
|
||||
@@ -1703,13 +1716,15 @@ function taxonomy_field_formatter_prepare_view($entity_type, $entities, $field,
|
||||
}
|
||||
|
||||
/**
|
||||
* Title callback for term pages.
|
||||
* Title callback: Returns the title of the taxonomy term.
|
||||
*
|
||||
* @param $term
|
||||
* A term object.
|
||||
*
|
||||
* @return
|
||||
* The term name to be used as the page title.
|
||||
* An unsanitized string that is the title of the taxonomy term.
|
||||
*
|
||||
* @see taxonomy_menu()
|
||||
*/
|
||||
function taxonomy_term_title($term) {
|
||||
return $term->name;
|
||||
|
||||
Reference in New Issue
Block a user