Index: gallery.module
=================================================================== 
@@ -33,9 +33,6 @@
 function gallery_settings() {
   $output = '';
   $output.= form_textfield(t('Location of Gallery2'), 'gallery_dir', variable_get('gallery_dir', 'gallery2/'), 64, 64, t('Path to your gallery2 directory, relative to the root directory of your drupal installation. Please include a trailing slash ("/").'));
-
-  $output .= form_radios(t('Sidebar when embed'), 'gallery_sidebar', variable_get('gallery_sidebar', 0), array(t('Disabled'), t('Enabled' )));
-			     
   $output .= form_checkboxes(t('Error logging'), 'gallery_error_mode',
 			     variable_get('gallery_error_mode', array(1)),
 			     array(1 => t('Watchdog'),
@@ -160,17 +157,10 @@
 
   case 'configure':
     $output = form_select(t('Image type'),
-			  'gallery_block_block_' . $delta,
+			  'gallery_block_block' . $delta,
 			  variable_get('gallery_block_block_' . $delta, 'randomImage'),
 			  $typeMap,
 			  t('Pick the type of image you\'d like to see'));
-			  
-    $output.= form_textfield(t('Max thumbnail size'),
-        'gallery_maxsize',
-        variable_get('gallery_maxsize', 160),
-        10,
-        10,
-        t('max size for the thumbnail, can not be over 160'));
     $output .= form_checkboxes(
       t('Image data'),
       'gallery_block_show_' . $delta,
@@ -187,7 +177,6 @@
   case 'save':
     variable_set('gallery_block_block_' . $delta, $edit['gallery_block_block_' . $delta]);
     variable_set('gallery_block_show_' . $delta, $edit['gallery_block_show_' . $delta]);
-    variable_set('gallery_maxsize',$edit['gallery_maxsize']);
     break;
 
   case 'view':
@@ -197,13 +186,11 @@
       return;
     }
 
-    $params['blocks'] = variable_get('gallery_block_block_' . $delta, 'randomImage');
-    
-    $param_show_array=variable_get('gallery_block_show_' . $delta, array());
-    $params['show']=is_array($param_show_array) ? implode('|', $param_show_array) : "";
-    
+    $params['block'] = variable_get('gallery_block_block_' . $delta, 'randomImage');
+    $params['show'] = implode('|', variable_get('gallery_block_show_' . $delta, array()));
+
     // TODO: parameterize this
-    $params['maxSize'] = variable_get('gallery_maxsize', 160);
+    $params['maxSize'] = 160;
 
     $block = array();
     list($ret, $content) = GalleryEmbed::getImageBlock($params);
@@ -212,7 +199,7 @@
       return;
     } else {
       if ($content) {
-	$block['subject'] = $typeMap[$params['blocks']];
+	$block['subject'] = $typeMap[$params['block']];
 	$block['content'] = '<center>' . $content . '</center>';
       }
     }
@@ -320,34 +307,14 @@
 
   $embedUri = url('gallery');
   $embedPath = str_replace('http://'.$_SERVER['HTTP_HOST'], '', $base_url) . '/';
-  
-  if (module_exist('i18n'))   
-  {
-    $lang = _i18n_get_lang();
-  }
-  elseif ($user->uid==0 && module_exist('locale')) //this is a visitor and locale module is enabled
-  {
-    $result = db_query('SELECT locale, name FROM {locales_meta} WHERE isdefault = 1'); //get drupal's default language
-    $row = db_fetch_object($result);
-    $lang = $row->locale;
-  }
-  else
-  {
-    $lang = $user->language;
-  }
-  
   $params = array('embedUri' => $embedUri,
                   'embedPath' => $embedPath,
                   'relativeG2Path' => $relativeG2Path,
                   'loginRedirect' => url('user/login'),
                   'activeUserId' => $user->uid,
-                  'activeLanguage' => $lang,
+                  'activeLanguage' => $user->language,
                   'fullInit' => $full);
   $ret = GalleryEmbed::init($params);
-  
-  //show or hide Gallery Sidebar
-	GalleryCapabilities::set('showSidebarBlocks', variable_get('gallery_sidebar',0));
-  
   if ($ret->getErrorCode() & ERROR_MISSING_OBJECT) {
     // Our user mapping is missing.  Make a mapping, or create a new user.
     $g2_user = null;
