Why does my form theme break my submission message?

The following is the contents of my "mymodule.module" file, which creates a form with an "email" field.

// Implements a hook.
function mymodule_menu() {
  $items = array();
  $items['form'] = array(
    'title' => 'My Form',
    'description' => t('My Form'),
    'page callback' => 'drupal_get_form',
    'page arguments' => array('mymodule_myform'),
    'access callback' => TRUE,
    'type' => MENU_NORMAL_ITEM,
    'menu_name' => t('My Menu'),
  );
  return $items;
}

function mymodule_myform($form, &$form_state) {
  $form['contact_information'] = array(
    '#title' => t('Contact Information'),
    '#type' => 'fieldset',
    '#description' => t('Please provide an e-mail address for us to contact you with further instructions.'),
  );

  $form['contact_information']['email'] = array(
    '#type' => 'textfield',
    '#title' => t('E-mail address'),
    '#id' => 'email',
    '#attributes' => array('class' => array('validate[required,custom[email]]')),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Submit'),
  );
  return $form;
}

function mymodule_myform_validate($form, &$form_state) {
}

function mymodule_myform_submit($form, &$form_state) {
  drupal_set_message(t('Thanks for submitting the form.'));
}

debug $items variable in hook_menu_alter(&$items) shows nothing.

I want to print out $items variable (the argument of hook_menu_alter) for debugging the menu properties in some pages.

I tried:

/**
* Implement hook_menu_alter()
*/
function mymodule_menu_alter(&$items) {
debug($items);
kpr($items);
}

cache cleared.

but $items are not printed out on the page.
Any ideas?
Does it show up in your side?

Thank you in advanced!

Howto set the position of a custom field in a views exposed form

I want to define the position of a custom input field within a views exposed form as following:

function mymodule_form_views_exposed_form_alter(&$form, &$form_state) {
  ...
  // set #weight as it might be needed
  $form['index_role']['#weight'] = 40;
  $form['event_place']['#weight'] = 50;
  $form['submit']['#weight'] = 60;
  $form['reset']['#weight'] = 70;

  // add a custom field between index_role and event_place -> not working
  $form['search_date'] = array(
    '#type' => 'textfield', 
    '#title' => t("Date"),
    '#size' => 20, 
    '#required' => FALSE,
    '#value' => isset($form_state['input']['search_date'])?$form_state['input']['search_date']:'YYYY/MM/DD',
    '#weight' => 45,
  );
  ...

Each views field is put into its own div but it comes that the custom field is added into the div of the submit button looking realy agly. And if you add more fields all of them are in the same div.

Investigating into this I found that the fields generated by views are filters and there is the filter info saved within $forms['#info']. This info is picked up from function template_preprocess_views_exposed_form() and used to create the $widgets records. But this function forwards my field data to function drupal_render_children and the HTML code for all custom fields and submit button is saved into $button.

specify the widht of theme_table columns

Hi, I want specify the width of columns of my theme_table
How can I do it?
I have this:

.......
$output = theme_table(
		array("header" => $header,
			  "rows" => $rows,
			  "attributes" => array(),
			  "sticky" => true,
			  "caption" => "",
			  "colgroups" => array(),
			  "empty" => t("Nessun dato da visualizzare")
		)
	).theme("pager");
	return $output;

Views giving Ajax error....

A clean install of Drupal 7, plus devel, ctools 7.x-1.0 and views 7.x3.0. I think I've enabled all the modules necessary to run views, but I get the following error when I try to use views module:

An AJAX HTTP error occurred.
HTTP Result Code: 406
Debugging information follows.
Path: /uktest/views/ajax
StatusText: error
ResponseText:
406 Not Acceptable
Not Acceptable
An appropriate representation of the requested resource /uktest/views/ajax could not be found on this server.

Image preview on front page D7

I am using nodes to publish content (including image(s)) and want to display a thumbnail of the original author's image on the front page.

Is this a possibility?

Pages

Subscribe with RSS Subscribe to RSS - Drupal 7.x