I am new to growing Drupal 7 modules, and I can not work out why my customized module’s kind knowledge is just not saved in my database’s desk referred to as ‘media_skins
‘.
I adopted Drupal Development information defined in Creating modules – a tutorial: Drupal 7.x however I can not get it working. What’s fallacious with my code?
This is my code:
perform media_skins_menu() { $gadgets = array(); $gadgets['admin/config/content/media_skins'] = array( 'title' => 'Media Skins', 'description' => 'Configuration for Skins module', 'web page callback' => 'drupal_get_form', 'web page arguments' => array('media_skins_form'), 'entry arguments' => array('entry administration pages'), 'sort' => MENU_NORMAL_ITEM, ); return $gadgets; } perform media_skins_form($kind, &$form_state) { $kind['media_skins_test'] = array( '#sort' => 'textfield', '#title' => t('Check subject'), '#dimension' => 20, '#maxlength' => 20, '#description' => t('Check information for Drupal Development subject.'), '#required' => FALSE, ); return system_settings_form($kind); } perform media_skins_form_validate($kind, &$form_state) { // For now, I'll no validate something } perform media_skins_form_submit($kind, &$form_state) { $kind = db_insert('media_skins')->fields( array( 'start_date' => $form_state['values']['media_skins_test'], ) ) ->execute(); drupal_set_message('Information saved in database efficiently'); }
Any assist will likely be very appreciated.
EDITING THE SCENARIO
After studying your feedback, I attempted Drupal Development following, however I get “Sudden error, strive it once more”:
perform media_skins_form($kind, &$form_state) { $kind['media_skins_test'] = array( '#sort' => 'textfield', '#title' => t('Check subject'), '#dimension' => 20, '#maxlength' => 20, '#description' => t('Check information for Drupal Development subject.'), '#required' => FALSE, ); $kind['submit'] = array( '#sort' => 'submit', '#worth' => t('Enviar'), ); return $kind; }