当前位置: 首页>>代码示例>>PHP>>正文


PHP drupal_add_tabledrag函数代码示例

本文整理汇总了PHP中drupal_add_tabledrag函数的典型用法代码示例。如果您正苦于以下问题:PHP drupal_add_tabledrag函数的具体用法?PHP drupal_add_tabledrag怎么用?PHP drupal_add_tabledrag使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了drupal_add_tabledrag函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: optionsForm

 /**
  * {@inheritdoc}
  */
 public function optionsForm(&$form, &$form_state)
 {
     $form['options']['grouptitle'] = array('#type' => 'textfield', '#title' => 'Layer group title', '#default_value' => $this->getOption('grouptitle', 'Base layers'));
     $all_layers = \Drupal\openlayers\Openlayers::loadAllExportable('Layer');
     array_walk($all_layers, function ($object) {
         $object->weight = 0;
         $object->enabled = 0;
     });
     foreach ($this->getOption('grouplayers', array()) as $weight => $layer) {
         $layer = Openlayers::load('layer', $layer);
         $all_layers[$layer->getMachineName()]->weight = $weight;
         $all_layers[$layer->getMachineName()]->enabled = 1;
     }
     uasort($all_layers, function ($a, $b) {
         if ($a->enabled > $b->enabled) {
             return -1;
         } else {
             if ($a->enabled < $b->enabled) {
                 return 1;
             }
         }
         if ($a->weight < $b->weight) {
             return -1;
         } else {
             if ($a->weight > $b->weight) {
                 return 1;
             }
         }
         if ($a->machine_name < $b->machine_name) {
             return -1;
         } else {
             if ($a->machine_name > $b->machine_name) {
                 return 1;
             }
         }
         return 0;
     });
     $data = array();
     $i = 0;
     /* @var \Drupal\openlayers\Types\Layer $layer */
     foreach ($all_layers as $machine_name => $layer) {
         $data[$machine_name] = array('name' => $layer->name, 'machine_name' => $layer->machine_name, 'factory_service' => $layer->factory_service, 'weight' => $i++, 'enabled' => isset($layer->enabled) ? $layer->enabled : 0);
     }
     $rows = array();
     $row_elements = array();
     foreach ($data as $id => $entry) {
         $rows[$id] = array('data' => array(array('class', array('entry-cross')), array('data' => array('#type' => 'weight', '#title' => t('Weight'), '#title_display' => 'invisible', '#default_value' => $entry['weight'], '#parents' => array('grouplayers', $id, 'weight'), '#attributes' => array('class' => array('entry-order-weight')))), array('data' => array('#type' => 'hidden', '#default_value' => $entry['machine_name'], '#parents' => array('grouplayers', $id, 'machine_name'))), array('data' => array('#type' => 'checkbox', '#title' => t('Enable'), '#title_display' => 'invisible', '#default_value' => $entry['enabled'], '#parents' => array('grouplayers', $id, 'enabled'))), check_plain($entry['name']), check_plain($entry['machine_name']), check_plain($entry['factory_service']), l(t('Edit'), 'admin/structure/openlayers/layers/list/' . $entry['machine_name'] . '/edit/options', array('query' => array('destination' => current_path())))), 'class' => array('draggable'));
         // Build rows of the form elements in the table.
         $row_elements[$id] = array('weight' => &$rows[$id]['data'][1]['data'], 'enabled' => &$rows[$id]['data'][2]['data'], 'machine_name' => &$rows[$id]['data'][3]['data']);
     }
     $form['grouplayers'] = array('#type' => 'fieldset', '#title' => 'Layers', '#collapsible' => FALSE, '#collapsed' => FALSE);
     // Add the table to the form.
     $form['grouplayers']['table_layers'] = array('#theme' => 'table', 'elements' => $row_elements, '#header' => array(array('data' => NULL, 'colspan' => 2), array('data' => t('Enabled'), 'colspan' => 2), t('Name'), t('Machine name'), t('Factory service'), t('Operations')), '#rows' => $rows, '#empty' => t('There are no entries available.'), '#attributes' => array('id' => 'entry-order-layers'));
     drupal_add_tabledrag('entry-order-layers', 'order', 'sibling', 'entry-order-weight');
 }
开发者ID:ps-intelegencia-analytics,项目名称:testRepo,代码行数:58,代码来源:Group.php

示例2: theme_entityreference_prepopulate_providers_table

/**
 * Theme the providers table.
 *
 * @ingroup themeable
 */
function theme_entityreference_prepopulate_providers_table($variables)
{
    $form = $variables['form'];
    $provider_names = element_children($form['enabled']);
    foreach ($provider_names as $provider_name) {
        $row = array('data' => array(drupal_render($form['title'][$provider_name]), drupal_render($form['enabled'][$provider_name]), drupal_render($form['weight'][$provider_name])), 'class' => array('draggable'));
        $rows[] = $row;
    }
    $header = array(array('data' => t('Provider')), array('data' => t('Enabled')), array('data' => t('Weight')));
    $table_variables = array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'table-providers'));
    $output = theme('table', $table_variables);
    drupal_add_tabledrag('table-providers', 'order', 'sibling', 'provider-weight');
    return $output;
}
开发者ID:drupdateio,项目名称:teca,代码行数:19,代码来源:EntityReferencePrepopulateInstanceBehavior.class.php

示例3: paldo_keditmultiple_form

function paldo_keditmultiple_form(&$form)
{
    $output = '<div style="width:530px;overflow:scroll; padding:10px;">';
    $header = array('', t('Entry'), t(' '), t('Definition'), t('Notes'), t('Examples'), t('Priority'), t('Group'));
    $rows = array();
    /*   $groups = array_keys(array_fill(0, count(array_filter(element_children($form), 'is_numeric'))-1, 0));
        foreach ($groups as $group){
            drupal_add_tabledrag('kgrouping', 'match', 'sibling', 'group-weight-'.$group, NULL);
            drupal_add_tabledrag('kgrouping', 'order', 'sibling', 'priority-in-group', 'group-weight-'.$group);
        }*/
    drupal_add_tabledrag('keditmultiple', 'order', 'sibling', 'priority-in-group');
    foreach (element_children($form) as $i => $key) {
        if (isset($form[$key]['pos'])) {
            $row = $grow = array('');
            $row[] = drupal_render($form[$key]['title']);
            $row[] = drupal_render($form[$key]['pos']);
            $row[] = drupal_render($form[$key]['defn']);
            $row[] = drupal_render($form[$key]['notes']);
            $row[] = drupal_render($form[$key]['example']);
            // Add class to priority weight fields for drag and drop.
            if (isset($form[$key]['priority'])) {
                $form[$key]['priority']['#attributes']['class'] = 'priority-in-group';
                $row[] = drupal_render($form[$key]['priority']);
            }
            if (isset($form[$key]['grouping'])) {
                $form[$key]['grouping']['#attributes']['class'] = 'group-weight-' . $form[$key]['grouping']['#value'];
                $grow[] = $row[] = array('data' => drupal_render($form[$key]['grouping']), 'colspan' => 4);
            }
            $rows[] = array('data' => $row, 'class' => 'draggable');
            if ($i < count($groups)) {
                //  $rows[] = array('data' => $grow, 'class' => 'tabledrag-root draggable');
            }
        }
    }
    $output .= theme('table', $header, $rows, array('id' => 'keditmultiple', 'width' => '100%'));
    $output .= drupal_render($form);
    $output .= '</div>';
    return $output;
}
开发者ID:jgosier,项目名称:kamusi,代码行数:39,代码来源:template.php

示例4: drupal_add_tabledrag

 *   start_date:      (int) Start date of the poll
 *   end_date:        (int) End date of the poll
 *   mode:            The mode used to store the vote: normal, cookie, unlimited
 *   cookie_duration: (int) If mode is cookie, the number of minutes to delay votes.
 *   state:           Is the poll 'open' or 'close'
 *   behavior:        approval or pool - determines how to treat multiple vote/user 
 *                    tally. When plugin is installed, voting will default to tabulating
 *                    values returned from voting API.
 *   max_choices:     (int) How many choices a user can select per vote.
 *   show_results:    When to display results - aftervote, afterclose or never.
 *   electoral:       Boolean - voting restricted to users in an electoral list.
 *   write_in:        Boolean - all write-in voting.
 *   block:           Boolean - Poll can be displayed as a block.
 */
$tableId = 'advpolltable-' . $node->nid;
drupal_add_tabledrag($tableId, 'match', 'sibling', 'advpoll-weight', NULL, NULL, FALSE);
$choices = $data->choices;
?>
<ul class="selectable-list">
  <?php 
$row = 0;
?>
  <?php 
foreach ($choices as $choice) {
    ?>
  <li class="selectable">
    <span class="choice"><?php 
    print $choice['choice'];
    ?>
</span>
    <a class="vote add" href="" style="display: none"><?php 
开发者ID:etype-services,项目名称:moser,代码行数:31,代码来源:advpoll-ranking.tpl.php

示例5: drupal_add_tabledrag

 * @file
 * Default theme implementation to configure format manager filter admin page.
 *
 * Available variables:
 * - $form_submit: Form submit button.
 *
 * Each $node_default_rows contains a row
 *
 * Each $data in $node_default_rows contains:
 * - $data->role: Role name.
 * - $data->format_select: Drop-down menu for setting format.
 * - $data->weight_select: Drop-down menu for setting weights.
 */
// Add table javascript
drupal_add_tabledrag('node-format-defaults', 'order', 'sibling', 'better-formats-role-node-weight');
drupal_add_tabledrag('comment-format-defaults', 'order', 'sibling', 'better-formats-role-comment-weight');
?>
<div class="description"><?php 
print t('Only formats that a role has permission to use are shown.');
?>
</div>
<fieldset>
  <legend><strong>Node Defaults</strong></legend>
  <table id="node-format-defaults">
    <thead>
      <tr>
        <th><?php 
print t('Role');
?>
</th>
        <th><?php 
开发者ID:justinlundy,项目名称:SenateDrupal,代码行数:31,代码来源:better-formats-defaults-admin-form.tpl.php

示例6: phptemplate_upload_form_new

/**
 * Theme the attachment form.
 * Note: required to output prefix/suffix.
 *
 * @ingroup themeable
 */
function phptemplate_upload_form_new($form)
{
    // add wysiwyg insert buttons
    foreach (element_children($form['files']) as $key) {
        $filepath = $form['files'][$key]['filepath']['#value'];
        $fid = $form['files'][$key]['fid']['#value'];
        if (image_get_info($filepath)) {
            $thumb_path = 'sites/default/files/imagecache/small_thumb/' . $filepath;
            /* The javascript for this is in imc_alba module */
            $form['files'][$key]['insertbutton'] = array('#type' => 'markup', '#value' => '<button type="button" class="insertimg" id="' . file_create_url($filepath) . '">Big</button>' . '<button type="button" class="insertthumb" id="' . file_create_url($thumb_path) . '">Small</button>');
        }
    }
    drupal_add_tabledrag('upload-attachments', 'order', 'sibling', 'upload-weight');
    $output = drupal_render($form);
    return $output;
}
开发者ID:benced,项目名称:drupal-indymedia-alba,代码行数:22,代码来源:template.php

示例7: rootcandy_system_settings_form

function rootcandy_system_settings_form($form)
{
    $themes = list_themes();
    $enabled_theme = arg(4);
    if ($form['#id'] == 'system-theme-settings' and $enabled_theme == 'rootcandy' || $themes[$enabled_theme]->base_theme == 'rootcandy') {
        foreach ($form['theme_specific']['rows'] as $rid => $row) {
            //we are only interested in numeric keys
            if (intval($rid)) {
                $this_row = $row['data']['#value'];
                //Add the weight field to the row
                $weight = $form['theme_specific']['rows'][$rid]['role-weight-' . $rid]['#value'];
                $this_row[] = drupal_render($form['theme_specific']['navigation']['nav-by-role']['rootcandy_navigation_source_' . $rid]);
                $this_row[] = drupal_render($form['theme_specific']['rows'][$rid]['role-weight-' . $rid]);
                //Add the row to the array of rows
                $table_rows[$weight] = array('data' => $this_row, 'class' => 'draggable');
            }
        }
        ksort($table_rows);
        $header = array("Role", "Navigation menu", "Order");
        $form['theme_specific']['navigation']['role-weights']['content']['#value'] = theme('table', $header, $table_rows, array('id' => 'rootcandy-settings-table'));
        $output = drupal_render($form);
        drupal_add_tabledrag('rootcandy-settings-table', 'order', 'sibling', 'weight');
    } else {
        $output = drupal_render($form);
    }
    return $output;
}
开发者ID:hoannm,项目名称:d6e,代码行数:27,代码来源:template.php

示例8: drupal_add_js

<?php

// $Id: homebox-admin-display-form.tpl.php,v 1.1.4.2 2010/06/17 23:19:07 mikestefff Exp $
/**
 * @file
 * homebox-admin-display-form.tpl.php
 * Default theme implementation to configure homebox blocks.
 */
// Add table javascript.
drupal_add_js('misc/tableheader.js');
drupal_add_js(drupal_get_path('module', 'block') . '/block.js');
foreach ($block_regions as $region => $title) {
    drupal_add_tabledrag('blocks', 'match', 'sibling', 'block-region-select', 'block-region-' . $region, NULL, FALSE);
    drupal_add_tabledrag('blocks', 'order', 'sibling', 'block-weight', 'block-weight-' . $region);
}
?>
<table id="blocks" class="sticky-enabled">
  <thead>
    <tr>
      <th><?php 
print t('Block');
?>
</th>
      <th><?php 
print t('Region');
?>
</th>
      <th><?php 
print t('Custom title');
?>
</th>
开发者ID:rdelachica,项目名称:forman,代码行数:31,代码来源:homebox-admin-display-form.tpl.php

示例9: city_magazine_custom_content_multiple_values

function city_magazine_custom_content_multiple_values($element)
{
    $field_name = $element['#field_name'];
    $field = content_fields($field_name);
    $output = '';
    if ($field['multiple'] >= 1) {
        $table_id = $element['#field_name'] . '_values';
        $order_class = $element['#field_name'] . '-delta-order';
        $required = !empty($element['#required']) ? '<span class="form-required" title="' . t('This field is required.') . '">*</span>' : '';
        $header = array(array('data' => t('!title: !required', array('!title' => $element['#title'], '!required' => $required)) . '<br /><div class="description">' . $element['#description'] . '</div>', 'colspan' => 2), t('Order'));
        $rows = array();
        // Sort items according to '_weight' (needed when the form comes back after
        // preview or failed validation)
        $items = array();
        foreach (element_children($element) as $key) {
            if ($key !== $element['#field_name'] . '_add_more') {
                $items[] =& $element[$key];
            }
        }
        usort($items, '_content_sort_items_value_helper');
        // Add the items as table rows.
        foreach ($items as $key => $item) {
            $item['_weight']['#attributes']['class'] = $order_class;
            $delta_element = drupal_render($item['_weight']);
            $cells = array(array('data' => '', 'class' => 'content-multiple-drag'), drupal_render($item), array('data' => $delta_element, 'class' => 'delta-order'));
            $rows[] = array('data' => $cells, 'class' => 'draggable');
        }
        $output .= theme('table', $header, $rows, array('id' => $table_id, 'class' => 'content-multiple-table'));
        $output .= drupal_render($element[$element['#field_name'] . '_add_more']);
        drupal_add_tabledrag($table_id, 'order', 'sibling', $order_class);
    } else {
        foreach (element_children($element) as $key) {
            $output .= drupal_render($element[$key]);
        }
    }
    return $output;
}
开发者ID:knieper,项目名称:crltmich,代码行数:37,代码来源:template.php

示例10: alim_bookmarks_overview_form

/**
 * Theme the menu overview form into a table.
 *  Modified theme_bookmarks_overview_form
 * in Bookmark module
 * hide the  default enabled , public checkboxes in mange bookmarks section 
 */
function alim_bookmarks_overview_form($form) {
  $output = ''; global $user;
  if ($_GET['q'] == BOOKMARKS_PRESETS_URL) {
    $header = array(
      t('Menu item'),
      array('data' => t('Operations'), 'colspan' => '3'),
    );
  }
  else {
    drupal_add_tabledrag('bookmarks-overview', 'match', 'parent', 'menu-plid', 'menu-plid', 'menu-mlid', TRUE, MENU_MAX_DEPTH - 1);
    drupal_add_tabledrag('bookmarks-overview', 'order', 'sibling', 'menu-weight');

    if (module_exists('bookmarks_public')) {
      $header = array(
        t('Menu item'),
        array('data' => t(''), 'class' => 'checkbox'), //Enabled
        array('data' => t(' '), 'class' => 'checkbox'),//Expanded
        array('data' => t(' '), 'class' => 'checkbox'),//Public removed
        t('Weight'),
        array('data' => t('Operations'), 'colspan' => '3'),
      );
    }
    else {
      $header = array(
        t('Menu item'),
        array('data' => t(''), 'class' => 'checkbox'),//Enabled
        array('data' => t(''), 'class' => 'checkbox'),//Expanded
        t('Weight'),
        array('data' => t('Operations'), 'colspan' => '3'),
      );
    }
  }

  $rows = array();
  foreach (element_children($form) as $mlid) {
    if (isset($form[$mlid]['hidden'])) {
      $element = &$form[$mlid];
      // Build a list of operations.
      $operations = array();
      foreach (element_children($element['operations']) as $op) {
        $operations[] = drupal_render($element['operations'][$op]);
      }
      while (count($operations) < 2) {
        $operations[] = '';
      }

      // Add special classes to be used for tabledrag.js.
      $element['plid']['#attributes']['class'] = 'menu-plid';
      $element['mlid']['#attributes']['class'] = 'menu-mlid';
      $element['weight']['#attributes']['class'] = 'menu-weight';

      // Change the parent field to a hidden. This allows any value but hides the field.
      $element['plid']['#type'] = 'hidden';
      if ($_GET['q'] == BOOKMARKS_PRESETS_URL) {
        $element['hidden']['#type'] = 'hidden';
      }

      $row = array();
      $row[] = theme('indentation', $element['#item']['depth'] - 1) . drupal_render($element['title']);
      if ($_GET['q'] != BOOKMARKS_PRESETS_URL) {
        $row[] = array('data' => drupal_render($element['hidden']), 'class' => 'checkbox');
        $row[] = array('data' => drupal_render($element['expanded']), 'class' => 'checkbox');
        if (module_exists('bookmarks_public')) {
          $row[] = array('data' => drupal_render($element['public']), 'class' => 'checkbox');
        }
      }
      $row[] = drupal_render($element['weight']) . drupal_render($element['plid']) . drupal_render($element['mlid']);
      $row = array_merge($row, $operations);

      $row = array_merge(array('data' => $row), $element['#attributes']);
      $row['class'] = !empty($row['class']) ? $row['class'] . ' draggable' : 'draggable';
      $rows[] = $row;
    }
  }
  if ($rows) {
    $output .= theme('table', $header, $rows, array('id' => 'bookmarks-overview'));
  }
  				$menuid1 = db_result(db_query("SELECT value as lpage FROM {profile_values} WHERE fid='%d' AND uid= '%d'", 12 , $user->uid ));
  				if(  isset($menuid1) && $menuid1 != ''  ) 
					$out =  l( t('Go to Last page'), $menuid1 ,array('attributes' => array(  
				'title' => 'Go to the last place you were reading.'  ) )  );
				else
					$out =  l( t('Go to Last page'), 'library/quran/surah/arabic/1/ARB' ,array('attributes' => array(  
				'title' => 'Go to the last place you were reading'  ) )  );
				 $output .= '<div style="padding:10px 0 10px 20px;" >'.$out.'</div>';
				
  $output .= drupal_render($form);

  return $output;
}
开发者ID:ATouhou,项目名称:www.alim.org,代码行数:96,代码来源:template.php

示例11: drupal_add_js

 * Each $block_listing[$state] contains an array of blocks for that region.
 *
 * Each $data in $block_listing[$state] contains:
 * - $data->region_title: Region title for the listed block.
 * - $data->block_config: Block title and other config options.
 * - $data->state_select: Drop-down menu for assigning a state.
 * - $data->weight_select: Drop-down menu for setting weights.
 * - $data->operations: Row containing all the operations for the block.
 */
// Add table javascript.
drupal_add_js('misc/tableheader.js');
drupal_add_js(drupal_get_path('module', 'region_manager') . '/region_manager.js');
drupal_add_js(array('block_name' => _region_manager_block_name()), 'setting');
foreach ($block_states as $state => $title) {
    //drupal_add_tabledrag('blocks', 'match', 'sibling', 'block-region-select', 'block-region-'. $region, NULL, FALSE);
    drupal_add_tabledrag('region-manager-blocks-active_path', 'order', 'sibling', 'block-weight');
}
?>

<?php 
foreach ($block_states as $state => $title) {
    ?>
  <?php 
    $row = 0;
    ?>
  <?php 
    print $state_prefix[$state];
    ?>
  <div class="table-wrapper">
    <table id="region-manager-blocks-<?php 
    print $state;
开发者ID:q0rban,项目名称:drupal-region_manager,代码行数:31,代码来源:region-manager-manage-form.tpl.php

示例12: drupal_add_js

<?php

// $Id: advpoll-display-ranking-form.tpl.php,v 1.1.2.1 2009/04/11 16:02:47 chriskennedy Exp $
/**
 * @file advpoll-display-ranking-form.tpl.php
 * Default theme implementation to show voting form for ranked polls.
 *
 * $writein_choice - writein_choice element, if poll needs it.
 * $form_id
 * $form_submit
 * $choice_list - choices in the poll.
 * $tabledrag_group_class
 */
// Add table JavaScript.
drupal_add_js(drupal_get_path('module', 'advpoll') . '/advpoll-vote.js');
drupal_add_tabledrag($form_id . '-table', 'order', 'self', 'advpoll-choice-order', NULL, NULL, FALSE);
?>
<div class="poll">
<div class="advpoll-available-choices">
<div class="choice-header"><?php 
print t('Choices');
?>
</div>
<div class="vote-choices">
<?php 
print $choice_list;
?>
</div>
<?php 
if (isset($writein_choice)) {
    ?>
开发者ID:pvhee,项目名称:esn_satellite,代码行数:31,代码来源:advpoll-display-ranking-form.tpl.php

示例13: ringstedtheme_preprocess_views_view_table


//.........这里部分代码省略.........
                if ($element_type) {
                    if ($element_style) {
                        $field_output = '<' . $element_type . ' ' . $element_style . '>' . $field_output . '</' . $element_type . '>';
                    } else {
                        $field_output = '<' . $element_type . '>' . $field_output . '</' . $element_type . '>';
                    }
                }
                if ($field_prefix) {
                    $field_output = $field_prefix . $field_output;
                }
                if ($field_suffix) {
                    $field_output = $field_output . $field_suffix;
                }
                // Don't bother with separators and stuff if the field does not show up.
                if (empty($field_output) && !empty($vars['rows'][$num][$column])) {
                    continue;
                }
                // Place the field into the column, along with an optional separator.
                if (!empty($vars['rows'][$num][$column])) {
                    if (!empty($options['info'][$column]['separator'])) {
                        $vars['rows'][$num][$column] .= filter_xss_admin($options['info'][$column]['separator']);
                    }
                } else {
                    $vars['rows'][$num][$column] = '';
                }
                $vars['rows'][$num][$column] .= $field_output;
            }
        }
        // Remove columns if the option is hide empty column is checked and the field is not empty.
        if (!empty($options['info'][$field]['empty_column'])) {
            $empty = TRUE;
            foreach ($vars['rows'] as $num => $columns) {
                $empty &= empty($columns[$column]);
            }
            if ($empty) {
                foreach ($vars['rows'] as $num => &$column_items) {
                    unset($column_items[$column]);
                    unset($vars['header'][$column]);
                }
            }
        }
    }
    // Hide table header if all labels are empty.
    if (!array_filter($vars['header'])) {
        $vars['header'] = array();
    }
    $count = 0;
    foreach ($vars['rows'] as $num => $row) {
        $vars['row_classes'][$num] = array();
        if ($row_class_special) {
            $vars['row_classes'][$num][] = $count++ % 2 == 0 ? 'odd' : 'even';
        }
        if ($row_class = $handler->get_row_class($num)) {
            $vars['row_classes'][$num][] = $row_class;
        }
    }
    if ($row_class_special) {
        $vars['row_classes'][0][] = 'views-row-first';
        $vars['row_classes'][count($vars['row_classes']) - 1][] = 'views-row-last';
    }
    $vars['classes_array'] = array('views-table');
    if (empty($vars['rows']) && !empty($options['empty_table'])) {
        $vars['rows'][0][0] = $view->display_handler->render_area('empty');
        // Calculate the amounts of rows with output.
        $vars['field_attributes'][0][0]['colspan'] = count($vars['header']);
        $vars['field_classes'][0][0] = 'views-empty';
    }
    if (!empty($options['sticky'])) {
        drupal_add_js('misc/tableheader.js');
        $vars['classes_array'][] = "sticky-enabled";
    }
    $vars['classes_array'][] = 'cols-' . count($vars['header']);
    // Add the summary to the list if set.
    if (!empty($handler->options['summary'])) {
        $vars['attributes_array'] = array('summary' => filter_xss_admin($handler->options['summary']));
    }
    // Add the caption to the list if set.
    if (!empty($handler->options['caption'])) {
        $vars['caption'] = filter_xss_admin($handler->options['caption']);
    } else {
        $vars['caption'] = '';
    }
    // Check whether this table view has draggableview field.
    if (!isset($vars['view']->field['draggableviews'])) {
        return;
    }
    // Check permissions.
    if (!user_access('access draggableviews')) {
        return;
    }
    // Add table class.
    $vars['classes_array'][] = 'draggable';
    // Add row class.
    foreach ($vars['row_classes'] as &$row_classes) {
        $row_classes[] = 'draggable';
    }
    $vars['attributes_array']['id'] = 'draggableviews-table-' . $vars['view']->name . '-' . $vars['view']->current_display;
    // Add javascript.
    drupal_add_tabledrag($vars['attributes_array']['id'], 'order', 'sibling', 'draggableviews-weight');
}
开发者ID:Ringsted-Kommune,项目名称:ringsted.dk,代码行数:101,代码来源:template.php

示例14: foreach

 * Each $perms_listing[$region] contains an array of blocks for that region.
 *
 * Each $data in $perms_listing[$region] contains:
 * - $data->region_title: Region title for the listed block.
 * - $data->block_title: Block title.
 * - $data->region_select: Drop-down menu for assigning a region.
 * - $data->weight_select: Drop-down menu for setting weights.
 * - $data->configure_link: Block configuration link.
 * - $data->delete_link: For deleting user added blocks.
 *
 * @see template_preprocess_block_admin_display_form()
 * @see theme_block_admin_display()
 */
foreach ($mimes as $region => $title) {
    drupal_add_tabledrag('te_perms', 'match', 'sibling', 'perm-mime-select', 'perm-mime-' . $region, NULL, FALSE);
    drupal_add_tabledrag('te_perms', 'order', 'sibling', 'perm-weight', 'perm-weight-' . $region);
}
?>
<table id="te_perms">
  <thead>
    <tr>
      <th><?php 
print t('Mime Type');
?>
</th>
      <th><?php 
print t('Order');
?>
</th>
      <th><?php 
print t('Operations');
开发者ID:estebanpcastro,项目名称:ColombiaNosUne,代码行数:31,代码来源:theme-editor-file-access-form.tpl.php

示例15: drupal_add_js

 * - $form_submit: Form submit button.
 *
 *
 * Each $data in $node_listing[$i] contains:
 * - $data->node_title: Node title.
 * - $data->weight: Drop-down menu for setting weights.
 * - $data->tid
 * - $data->nid
 *
 * @see template_preprocess_nodeorder_admin_display_form()
 * @see theme_nodeorder_admin_display()
 */
// Add table javascript.
drupal_add_js('misc/tableheader.js');
drupal_add_js(drupal_get_path('module', 'nodeorder') . '/nodeorder.js');
drupal_add_tabledrag('ordernodes', 'order', 'sibling', 'nodeorder-weight');
?>
<table id="ordernodes" class="sticky-enabled">
  <thead>
    <tr>
      <th colspan=2><?php 
print t('Node title');
?>
</th>
    </tr>
  </thead>
  <tbody>
    <?php 
$row = 0;
?>
    <?php 
开发者ID:melsawy,项目名称:auc_grads,代码行数:31,代码来源:nodeorder-admin-display-form.tpl.php


注:本文中的drupal_add_tabledrag函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。