0

enter image description here

I try to do own User Graffic Interface. That interface must help to managers do they are own form displays. By drug`n drop elements in space. Then when they push save. I will save coordinats of elements. I need to show my module in other (new one) tab when manage in structure. I have little exp. working with drupal. But deadline is coming close. I sware i will give this module for avryone. So i need help. (pls. didn't write about Display Suit.)

<?php
/**
 * Implements hook_form_FORM_ID_alter().
 */
function admt_form_node_type_form_alter(&$form, &$form_state) {
  $default_value =TRUE;// auto_nodetitle_get_setting($form['#node_type']->type);

  $type = $form['#node_type'];
  $form['#theme'] = 'admt_form_theme_function';
  $form['admt'] = array(
    '#type' => 'fieldset',
    '#title' => t('Graffic User Interface'),
    '#weight' => 0,
    '#collapsible' => TRUE,
    '#collapsed' => false,
    '#group' => 'additional_settings',
    //'#theme' => 'admt_form_theme_function',
    '#attached' => array(
      'js' => array(drupal_get_path('module', 'menu') . '/menu.admin.js'),
    ),
  );


    if (isset($type) && $type->has_title) {
    $title = $type->title_label;
    }
    $fields = array();
    $arrFieldsType=array(
    "number"=>"textfield",
    "text_textfield"=>"textfield",
    "options_select"=>"select",
    "taxonomy_autocomplete"=>"textfield",
    "text_textarea_with_summary"=>"textare",
    "image_image"=>"file",
    "checkboxes",
    "radios"
    );
  $instances = field_info_instances('node', $type->type);
  $extra_fields = field_info_extra_fields('node', $type->type, 'form');

  // Fields.
  foreach ($instances as $name => $instance) {
    $form['admt'][$name] = array(
    '#type' => $arrFieldsType[$instance["widget"]["type"]],
    '#title' => t($instance["label"]),
    '#default_value' => array('value' => '...'),
    //'#options' => $type2,   
     );
        if($arrFieldsType[$instance["widget"]["type"]]!="select") $form['admt'][$name]['#size']= '20';
  }


  // Non-field elements.
  foreach ($extra_fields as $name => $extra_field) {
    if(!empty($extra_field["type"]))
    $typ=$arrFieldsType[$extra_field["type"]];
    else 
    $typ="textfield";
    $form['admt'][$name] = array(
    '#type' => $typ,
    '#size' => '20',
    '#title' => t($extra_field["label"]),
    '#default_value' => array('value' => '...'),
    '#description' =>  t($extra_field["description"]),
    //'#options' => $type2,

     );
  }
  return $form;
}
function admt_theme($existing, $type, $theme, $path,$form)
{
  return array(
    'admt_form_theme_function' => array(
      'render element' => 'form',
      'template' => 'admt',
      'form' => $form,
    ),
  );
}
1

You need to create a menu with type as MENU_LOCAL_TASK. Can refer to menu 'node/%node/edit' in node.module.

Hope it helps

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.