Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.76 KB | None | 0 0
  1. /**
  2.  * Build marquee_tableselect_test form.
  3.  *
  4.  * @param array $form_state
  5.  * @return array The created form.
  6.  */
  7. function marquee_tableselect_test($form_state) {
  8.   $form = array();
  9.  
  10.   $form['test1'] = array(
  11.     '#type' => 'textfield',
  12.     '#title' => 'Teszt van ocsem',
  13.   );
  14.   $form['test2'] = array(
  15.     '#type' => 'weight',
  16.     '#title' => 'Súlyvane',
  17.     '#delta' => 20,
  18.   );
  19.  
  20.   $header = array(
  21.     'Ez is',
  22.     'Az is',
  23.   );
  24.  
  25.   $options = array();
  26.  
  27.   $options['kula'] = array(
  28.     0 => 'Ez itt szöveg',
  29.     1 => array(
  30.       'data' => array(
  31.         '#type' => 'textfield',
  32.         '#title' => 'Válasszad',
  33.         '#attributes' => array(
  34.           'class' => array('weight-class'),
  35.         ),
  36.       ),
  37.     ),
  38.     '#attributes' => array ('class' => array('draggable')),
  39.   );
  40.  
  41.   $options['mokka'] = array(
  42.     0 => array(
  43.       'data' => array(
  44.           '#type' => 'link',
  45.           '#title' => 'Linkeklek gecc!',
  46.           '#href' => 'user',
  47.           '#options' => array(
  48.             'attributes' => array('class' => 'class1 class2 eziclass'),
  49.           ),
  50.         ),
  51.       ),
  52.     1 => array(
  53.       'data' => array(
  54.         '#type' => 'textfield',
  55.         '#title' => 'Válasszad',
  56.         '#attributes' => array(
  57.           'class' => array('weight-class'),
  58.         ),
  59.       ),
  60.     ),
  61.     '#attributes' => array ('class' => array('draggable')),
  62.  
  63.   );
  64.  
  65.   $form['tableselect_test'] = array(
  66.     '#type' => 'tableselect',
  67.     '#header' => $header,
  68.     '#options' => $options,
  69.     '#empty' => 'Nincs semmi öcsém',
  70.     '#js_select' => FALSE,
  71.     '#default_value' => array(
  72.       'kula' => 1,
  73.     ),
  74.     '#attributes' => array(
  75.       'id' => 'drag-and-dropolja',
  76.     )
  77.   );
  78.  
  79.   drupal_add_tabledrag('drag-and-dropolja', 'order', 'sibling', 'weight-class');
  80.  
  81.  
  82.  
  83.   return $form;
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement