Skip to content
Snippets Groups Projects
Commit a54ba6b1 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #56093 by chx: use native php function where possible _taxonomy_depth() -> str_repeat()

parent 92496eb8
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -181,7 +181,7 @@ function taxonomy_overview_terms($vid) { ...@@ -181,7 +181,7 @@ function taxonomy_overview_terms($vid) {
foreach ($tree as $term) { foreach ($tree as $term) {
$total_entries++; // we're counting all-totals, not displayed $total_entries++; // we're counting all-totals, not displayed
if (($start_from && ($start_from * $page_increment) >= $total_entries) || ($displayed_count == $page_increment)) { continue; } if (($start_from && ($start_from * $page_increment) >= $total_entries) || ($displayed_count == $page_increment)) { continue; }
$rows[] = array(_taxonomy_depth($term->depth) . ' ' . l($term->name, "taxonomy/term/$term->tid"), l(t('edit'), "admin/content/taxonomy/edit/term/$term->tid", array(), $destination)); $rows[] = array(str_repeat('--', $term->depth) . ' ' . l($term->name, "taxonomy/term/$term->tid"), l(t('edit'), "admin/content/taxonomy/edit/term/$term->tid", array(), $destination));
$displayed_count++; // we're counting tids displayed $displayed_count++; // we're counting tids displayed
} }
...@@ -568,7 +568,7 @@ function taxonomy_form_all($free_tags = 0) { ...@@ -568,7 +568,7 @@ function taxonomy_form_all($free_tags = 0) {
$options[$vocabulary->name] = array(); $options[$vocabulary->name] = array();
if ($tree) { if ($tree) {
foreach ($tree as $term) { foreach ($tree as $term) {
$options[$vocabulary->name][$term->tid] = _taxonomy_depth($term->depth, '-') . $term->name; $options[$vocabulary->name][$term->tid] = str_repeat('-', $term->depth) . $term->name;
} }
} }
} }
...@@ -1048,7 +1048,7 @@ function _taxonomy_term_select($title, $name, $value, $vocabulary_id, $descripti ...@@ -1048,7 +1048,7 @@ function _taxonomy_term_select($title, $name, $value, $vocabulary_id, $descripti
if ($tree) { if ($tree) {
foreach ($tree as $term) { foreach ($tree as $term) {
if (!in_array($term->tid, $exclude)) { if (!in_array($term->tid, $exclude)) {
$options[$term->tid] = _taxonomy_depth($term->depth, '-') . $term->name; $options[$term->tid] = str_repeat('-', $term->depth) . $term->name;
} }
} }
if (!$blank && !$value) { if (!$blank && !$value) {
...@@ -1073,13 +1073,6 @@ function theme_taxonomy_term_select($element) { ...@@ -1073,13 +1073,6 @@ function theme_taxonomy_term_select($element) {
return theme('select', $element); return theme('select', $element);
} }
function _taxonomy_depth($depth, $graphic = '--') {
for ($n = 0; $n < $depth; $n++) {
$result .= $graphic;
}
return $result;
}
/** /**
* Finds all nodes that match selected taxonomy conditions. * Finds all nodes that match selected taxonomy conditions.
* *
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment