theme_taxonomy_overview_vocabularies

function theme_taxonomy_overview_vocabularies

theme_taxonomy_overview_vocabularies($variables)

Returns HTML for the vocabulary overview form as a sortable list of vocabularies.

Parameters

$variables: An associative array containing:

  • form: A render element representing the form.

See also

taxonomy_overview_vocabularies()

Related topics

File

modules/taxonomy/taxonomy.admin.inc, line 70
Administrative page callbacks for the taxonomy module.

Code

function theme_taxonomy_overview_vocabularies($variables) {
  $form = $variables['form'];

  $rows = array();

  foreach (element_children($form) as $key) {
    if (isset($form[$key]['name'])) {
      $vocabulary = &$form[$key];

      $row = array();
      $row[] = drupal_render($vocabulary['name']);
      if (isset($vocabulary['weight'])) {
        $vocabulary['weight']['#attributes']['class'] = array('vocabulary-weight');
        $row[] = drupal_render($vocabulary['weight']);
      }
      $row[] = drupal_render($vocabulary['edit']);
      $row[] = drupal_render($vocabulary['list']);
      $row[] = drupal_render($vocabulary['add']);
      $rows[] = array('data' => $row, 'class' => array('draggable'));
    }
  }

  $header = array(t('Vocabulary name'));
  if (isset($form['actions'])) {
    $header[] = t('Weight');
    drupal_add_tabledrag('taxonomy', 'order', 'sibling', 'vocabulary-weight');
  }
  $header[] = array('data' => t('Operations'), 'colspan' => '3');
  return theme('table', array('header' => $header, 'rows' => $rows, 'empty' => t('No vocabularies available. <a href="drupal_7-modules-taxonomy-taxonomy-admin-inc-function-theme_taxonomy_overview_vocabularies-@link">Add vocabulary<-a>-', array('@link' => url('admin-structure-taxonomy-add'))), 'attributes' => array('id' => 'taxonomy'))) - drupal_render_children($form);
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!taxonomy!taxonomy.admin.inc/function/theme_taxonomy_overview_vocabularies/7.x

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部