--- imce_galleryOld.module 2007-04-10 01:47:32.000000000 +0200 +++ imce_gallery.module 2007-09-11 14:51:40.701796301 +0200 @@ -101,33 +101,33 @@ function imce_gallery_view($user) { if($user->uid != arg(1)) $sql .= " AND g_pub_priv=0"; else - $name = "My"; + $name = t('My'); $oth_user = db_fetch_object(db_query("SELECT name as username FROM {users} WHERE uid=%d",arg(1))); drupal_set_title($oth_user->username); $name = isset($name) ? $name : ($oth_user->username."’s"); if($oth_user->username == '') - return_with_error('User does not exist'); + return_with_error(t('User does not exist')); - $output = "

".$name . " Gallery

"; + $output = '

' . $name . ' ' . t('gallerys') . '

'; $res = db_query($sql, arg(1)); if(db_num_rows($res) == 0) - $output .= "This gallery is currently empty"; + $output .= t('This gallery is currently empty'); else - $output .= "Click on the gallery to add pictures that you have downloaded using IMCE

"; + $output .= t('Click on the gallery to add pictures that you have downloaded using IMCE

'); while($row = db_fetch_object($res)) { $output .= ""; } - + return $output; } @@ -152,10 +152,10 @@ function imce_gallery_items($user, $g_in } } else - return_with_error('User Does not Exist'); + return_with_error(t('User Does not Exist')); if(!$g_info) - return_with_error('User Gallery Does not Exist'); + return_with_error(t('User Gallery Does not Exist')); drupal_set_title($g_info->g_name); @@ -225,7 +225,7 @@ function imce_galleries_form_submit($for } if($notice != '') { - $notice = "Errors were encountered during the process:".$notice; + $notice = t('Errors were encountered during the process: ').$notice; drupal_set_message($notice); } } @@ -252,7 +252,7 @@ function gallery_load($gid, $uid) { function imce_gallery_add($user) { if(!is_numeric(arg(2)) && arg(1) != 'edit') - $output = "
Please fill all the fields in the form below"; + $output = t('
Please fill all the fields in the form below'); $output .= drupal_get_form('imce_gallery_form', $user); return $output; @@ -262,7 +262,7 @@ function imce_gallery_form($user) { $def_g_name = ''; $def_g_description = ''; $def_g_pub_priv = '0'; - $def_submit_btn = 'Create'; + $def_submit_btn = t('Create'); if(arg(1) == 'edit' && is_numeric(arg(2))) { $gid = arg(2); @@ -277,7 +277,7 @@ function imce_gallery_form($user) { $def_submit_btn = 'Update'; } else - return_with_error('You do not have proper permission to edit this Gallery'); + return_with_error(t('You do not have proper permission to edit this Gallery')); } $form['gallery_name'] = array( @@ -286,7 +286,7 @@ function imce_gallery_form($user) { '#size' => 30, '#default_value' => $def_g_name, '#maxlength' => 64, - '#description' => t('Enter the name of your gallery'), + '#description' => t('Enter the name of your gallery.'), ); $form['gallery_description'] = array( '#type' => 'textarea', @@ -319,34 +319,34 @@ function imce_gallery_form_validate($for $sql_check = "SELECT g_name FROM {imce_gallery} WHERE g_name LIKE '%%s%' AND uid=%d"; $res = db_query($sql_check, $gallery_name, $uid); $g_count = db_num_rows($res); - if($g_count > 0 && $op == 'Create') + if($g_count > 0 && $op == t('Create')) form_set_error('gallery_name', "Gallery name: ".$gallery_name." allready exist. Please insert a different gallery name."); $_MAX = variable_get('imce_gallery_count', ''); $sql_check2 = "SELECT g_name FROM {imce_gallery} WHERE uid=%d"; $g_count = db_num_rows(db_query($sql_check2, $uid)); - if($op == 'Create' && $g_count >= $_MAX) - form_set_error('gallery_name', "You have reached the maximum amount of Gallery Creation. Please contact the administrator to increase the max amount of Galleries allowed."); + if($op == t('Create') && $g_count >= $_MAX) + form_set_error('gallery_name', t('You have reached the maximum amount of Gallery Creation. Please contact the administrator to increase the max amount of Galleries allowed.')); } function imce_gallery_form_submit($form_id, $form_values) { extract($form_values); - if($op == 'Create') { + if($op == t('Create')) { $sql_insert = "INSERT INTO {imce_gallery} (g_name, g_description, g_pub_priv, uid) VALUES ('%s', '%s', %d, %d)"; if(db_query($sql_insert, $gallery_name, $gallery_description, $gallery_pub_priv, $uid)) drupal_goto('user/'.$uid.'/imce_gallery'); else form_set_error('gallery_name', 'Unable to insert the specified Gallery Name: '.$gallery_name); } - else if($op == 'Update') { + else if($op == t('Update')) { $sql_update = "UPDATE {imce_gallery} SET g_name='%s', g_description='%s', g_pub_priv=%d WHERE gid=%d"; if(db_query($sql_update, $gallery_name, $gallery_description, $gallery_pub_priv, $gid)) drupal_goto('user/'.$uid.'/imce_gallery'); else form_set_error('gallery_name', 'Unable to update the specified Gallery Name: '.$gallery_name); } - else if($op == 'Delete') { + else if($op == t('Delete')) { $sql_delete = "DELETE FROM {imce_gallery} WHERE gid=%d"; $sql_delete_items = "DELETE FROM {imce_gallery_items} WHERE gid=%d"; if(db_query($sql_delete, $gid) && db_query($sql_delete_items, $gid)) @@ -385,10 +385,10 @@ function theme_gallery_items($rows, $fol $back_url = request_uri(); $c_url = count($back_url); $pos = strrpos($back_url, "/"); - $back_url = substr($back_url, 0, ($pos-$c_url+1)); + $back_url = substr($back_url, 1, ($pos-$c_url+1)); $back_url = preg_replace("/(\?q\=)/", "", $back_url); - $output = l('Back to Gallery', $back_url); + $output = l(t('Back to Gallery list'), $back_url); $output .= theme('table', $header, $rows_img, array('id' => 'imce_gallery_table')); return $output; @@ -403,8 +403,8 @@ function imce_gallery_admin_settings() { '#type' => 'textfield', '#title' => t('Amount of albums a user may create'), '#default_value' => variable_get('imce_gallery_count', ''), - '#description' => "If left blank, the default is unlimited", - '#size' => 15, + '#description' => t('If left blank, the default is unlimited'), + '#size' => 15, '#maxlength' => 25, ); @@ -415,4 +415,4 @@ function return_with_error($msg, $where= drupal_set_message($msg); drupal_goto($where); } -?> \ Kein Zeilenumbruch am Dateiende. +?>