diff -urp imagemenu/imagemenu.install imagemenu_changed/imagemenu.install --- imagemenu/imagemenu.install 2007-03-20 05:45:05.000000000 +1100 +++ imagemenu_changed/imagemenu.install 2008-07-21 21:10:11.000000000 +1000 @@ -19,6 +19,7 @@ function imagemenu_install() { weight tinyint(4) DEFAULT '0' NOT NULL, enabled tinyint(4) DEFAULT '1' NOT NULL, type int(2) DEFAULT '0' NOT NULL, + horizontal int DEFAULT '1' NOT NULL, PRIMARY KEY (mid) )TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;"); @@ -39,6 +40,7 @@ function imagemenu_install() { weight integer DEFAULT '0' NOT NULL, enabled integer DEFAULT '1' NOT NULL, type integer DEFAULT '0' NOT NULL, + horizontal integer DEFAULT '1' NOT NULL, PRIMARY KEY (mid) );"); if ($query1) { @@ -52,4 +54,4 @@ function imagemenu_install() { else { drupal_set_message(t('Table installation for the imagemenu module was unsuccessful. The tables may need to be installed by hand. See imagemenu.install file for a list of the installation queries.'), 'error'); } -} // imagemenu_install \ No newline at end of file +} // imagemenu_install diff -urp imagemenu/imagemenu.module imagemenu_changed/imagemenu.module --- imagemenu/imagemenu.module 2007-03-20 22:44:07.000000000 +1100 +++ imagemenu_changed/imagemenu.module 2008-07-21 20:39:16.000000000 +1000 @@ -389,11 +389,15 @@ function imagemenu_fetch_item($item, $pr function imagemenu_display($mid, $full = FALSE) { if (!$mid || !is_numeric($mid)) return FALSE; - switch (variable_get('imagemenu_layout', 'vertical')) { - case 'vertical': + + $storedMenu = imagemenu_fetch_mid($mid); + + // switch (variable_get('imagemenu_layout', 'vertical')) { + switch ($storedMenu['horizontal']) { + case 0: $output = imagemenu_build_table_vertical($mid, $full); break; - case 'horizontal': + case 1: $output = imagemenu_build_table_horizontal($mid, $full); break; } @@ -536,6 +540,14 @@ function imagemenu_menu_edit_form($mid = '#description' => t('The name of the menu.'), '#required' => TRUE, ); + + $form['layout'] = array( + '#type' => 'select', + '#title' => t('Layout'), + '#options' => array(0 => 'vertical', 1 => 'horizontal'), + '#default_value' => $fetch['horizontal'], + '#description' => t('The orientation of the menu.'), + ); $form['mid'] = array( '#type' => 'hidden', '#value' => $mid, @@ -545,7 +557,7 @@ function imagemenu_menu_edit_form($mid = function imagemenu_menu_edit_form_submit($form_id, $form) { $title = $form['title']; - db_query("UPDATE {imagemenu} SET title = '%s' WHERE mid = %d", $title, $form['mid']); + db_query("UPDATE {imagemenu} SET title = '%s', horizontal = %d WHERE mid = %d", $title, $form['layout'], $form['mid']); drupal_goto('admin/build/menu/imagemenu'); }