diff options
author | Dries Buytaert <dries@buytaert.net> | 2006-08-24 06:29:50 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2006-08-24 06:29:50 +0000 |
commit | a54ba6b1ed15da720030603e2725a5be875864a7 (patch) | |
tree | 0bd1ee1de3866c46e2f5a71b23a029cf7a70f185 | |
parent | 92496eb8390edd6dcb915c005be7af882712a2f3 (diff) | |
download | brdo-a54ba6b1ed15da720030603e2725a5be875864a7.tar.gz brdo-a54ba6b1ed15da720030603e2725a5be875864a7.tar.bz2 |
- Patch #56093 by chx: use native php function where possible _taxonomy_depth() -> str_repeat()
-rw-r--r-- | modules/taxonomy/taxonomy.module | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index 467290908..cda680893 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -181,7 +181,7 @@ function taxonomy_overview_terms($vid) { foreach ($tree as $term) { $total_entries++; // we're counting all-totals, not displayed 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 } @@ -568,7 +568,7 @@ function taxonomy_form_all($free_tags = 0) { $options[$vocabulary->name] = array(); if ($tree) { 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 if ($tree) { foreach ($tree as $term) { 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) { @@ -1073,13 +1073,6 @@ function theme_taxonomy_term_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. * |