diff --git a/regbar.admin.inc b/regbar.admin.inc
index 12f5baf..41cdc6b 100755
--- a/regbar.admin.inc
+++ b/regbar.admin.inc
@@ -11,7 +11,7 @@
  * @ingroup forms
  * @see system_settings_form()
  */
-function regbar_admin_settings() {
+function regbar_admin_settings($form, &$form) {
   // Barcode encoding type generation settings.
   $form['barcodetype'] = array(
     '#type' => 'fieldset',
diff --git a/regbar.info b/regbar.info
index 3375fca..5b5bedd 100755
--- a/regbar.info
+++ b/regbar.info
@@ -1,3 +1,7 @@
-core = 6.x
+core = 7.x
 name = Regbar
 description = Used to generate icards containing barcodes.
+
+files[] = regbar.install
+files[] = regbar.module
+files[] = regbar.admin.inc
diff --git a/regbar.install b/regbar.install
index cd6fdcd..65dae5c 100755
--- a/regbar.install
+++ b/regbar.install
@@ -54,76 +54,38 @@ function regbar_requirements($phase) {
           'title'       => $t('Arial Font file'),
           'severity'    => REQUIREMENT_OK,
         );
-        $regbar_directory = file_create_path() . '/regbar';
-        if (!file_check_directory($regbar_directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS)) {
-          if (!is_dir($regbar_directory)) {
-            $requirements['regbar_directory'] = array(
-              'title' => $t('Barcode directory'),
-              'value' => $t('%p is not a directory or is not readable by the webserver.', array('%p' => $regbar_directory)),
-              'severity' => REQUIREMENT_ERROR,
-            );
-          }
-          elseif (!is_writable($regbar_directory)) {
-            $requirements['regbar_directory'] = array(
-              'title' => $t('Barcode directory'),
-              'value' => $t('%p is not writeable by the webserver.', array('%p' => $regbar_directory)),
-              'severity' => REQUIREMENT_ERROR,
-            );
-          }
-          else {
-            $requirements['regbar_directory'] = array(
-              'title' => $t('Barcode directory'),
-              'value' => $t('An unknown error occured.'),
-              'description' => $t('An unknown error occured trying to verify %p is a directory and is writable.', array('%p' => $regbar_directory)),
-              'severity' => REQUIREMENT_ERROR,
-            );
-          }
-        }
-
-        if (!is_writable(file_directory_temp())) {
-          $requirements['regbar_directory'] = array(
-            'title' => $t('BarcodeCache temp directory'),
-            'value' => $t('%p is not writeable by the webserver.', array('%p' => file_directory_temp())),
-            'severity' => REQUIREMENT_ERROR,
-          );
-        }
+        $path = 'public://regbar';
+        file_prepare_directory($path, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSION);
+        print 'regbar dir is created in files folder.';
       }
       break;
 
     case 'runtime':
-      // Check GD library
-      if (function_exists('imagegd2')) {
-        $info = gd_info();
-        $requirements['gd'] = array(
-          'value' => $info['GD version'],
-        );
+      // Check for the PHP GD library.
+    if (function_exists('imagegd2')) {
+      $info = gd_info();
+      $requirements['image_gd'] = array(
+        'value' => $info['GD Version'],
+      );
 
-        // Check JPEG support
-        if (function_exists('imagecreatefromjpeg')) {
-          $requirements['gd']['severity'] = REQUIREMENT_OK;
-        }
-        else {
-          $requirements['gd'] = array(
-            'severity' => REQUIREMENT_ERROR,
-            'description' => $t('The GD library for PHP is enabled, but was compiled without JPEG support. Please check the !phpimagedoc for information on how to correct this.', array(
-                                '!phpimagedoc' => l($t('PHP Image Docuementation'),
-                                    'http://www.php.net/manual/en/ref.image.php',
-                                    array('absolute' => TRUE)))),
-          );
-        }
+      // Check for filter and rotate support.
+      if (function_exists('imagefilter') && function_exists('imagerotate')) {
+        $requirements['image_gd']['severity'] = REQUIREMENT_OK;
       }
       else {
-        $requirements['gd'] = array(
-          'value' => t('Not installed'),
-          'severity' => REQUIREMENT_ERROR,
-          'description' => $t('The GD library for PHP is missing or outdated. Please check the !phpimagedoc for information on how to correct this.', array('!phpimagedoc' => l($t('PHP Image Docuementation'),
-                             'http://www.php.net/manual/en/ref.image.php',
-                             array('absolute' => TRUE)))),
-        );
+        $requirements['image_gd']['severity'] = REQUIREMENT_WARNING;
+        $requirements['image_gd']['description'] = t('The GD Library for PHP is enabled, but was compiled without support for functions used by the rotate and desaturate effects. It was probably compiled using the official GD libraries from http://www.libgd.org instead of the GD library bundled with PHP. You should recompile PHP --with-gd using the bundled GD library. See <a href="http://www.php.net/manual/book.image.php">the PHP manual</a>.');
       }
-      $requirements['gd']['title'] = $t('GD library');
-
-      break;
+    }
+    else {
+      $requirements['image_gd'] = array(
+        'value' => t('Not installed'),
+        'severity' => REQUIREMENT_ERROR,
+        'description' => t('The GD library for PHP is missing or outdated. Check the <a href="@url">PHP image documentation</a> for information on how to correct this.', array('@url' => 'http://www.php.net/manual/book.image.php')),
+      );
+    }
+    $requirements['image_gd']['title'] = t('GD library rotate and desaturate effects');
+    break;
   }
   return $requirements;
 }
@@ -183,7 +145,7 @@ function regbar_uninstall() {
   variable_del('regbar_barcode_center_x');
   variable_del('regbar_barcode_center_y');
   // Remove any cached images.
-  $path = file_directory_path() . '/regbar/';
+  $path = 'public://regbar';
   if (is_dir($path)) {
     regbar_barcode_recursive_delete($path);
   }
diff --git a/regbar.module b/regbar.module
index b318f0b..a325f94 100755
--- a/regbar.module
+++ b/regbar.module
@@ -35,17 +35,26 @@ function regbar_barcode_recursive_delete($path) {
 }
 
 /**
- * Implments hook_perm().
+ * Implments hook_permission().
  */
-function regbar_perm() {
-  return array('access regbar', 'administer regbar');
+function regbar_permission() {
+  return array(
+    'access regbar' => array(
+        'info' => t('access regbar'),
+        'description' => t('access regbar'),
+    ),
+    'administer regbar' => array(
+        'info' => t('administer regbar'),
+        'description' => t('administer regbar'),
+    ),
+  );
 }
 
 /**
  * Implements hook_menu().
  */
 function regbar_menu() {
-  $items['admin/settings/regbar'] = array(
+  $items['admin/config/people/regbar'] = array(
     'title' => 'Regbar settings',
     'description' => 'Adjust the options for barcode generation.',
     'position' => 'right',
@@ -56,7 +65,7 @@ function regbar_menu() {
     'file path' => drupal_get_path('module', 'system'),
   );
 
-  $items['admin/settings/regbar/settings'] = array(
+  $items['admin/config/people/regbar/settings'] = array(
     'title' => 'Configure barcode',
     'description' => 'Change how the barcode will be generated',
     'page callback' => 'drupal_get_form',
@@ -66,11 +75,11 @@ function regbar_menu() {
     'file' => 'regbar.admin.inc',
   );
 
-  $items['regbar'] = array(
+  $items['user/%/regbar'] = array(
     'title' => 'My icard',
     'page callback' => 'theme_regbar',
     'access arguments' => array('access regbar'),
-    'type' => MENU_NORMAL_ITEM,
+    'type' => MENU_LOCAL_TASK,
     'weight' => 2,
   );
 
@@ -83,7 +92,8 @@ function regbar_menu() {
 function theme_regbar() {
   global $user;
   regbar();
-  $imagepath = file_directory_path() . '/regbar/temp_' . $user->name . '.jpg';
+  $path = 'public://regbar';
+  $imagepath = $path . '/temp_' . $user->name . '.jpg';
   return theme_image($imagepath);
 }
 
@@ -174,11 +184,12 @@ function regbar() {
   if ($showvaluebelow == 1) {
     $box = imagettfbbox($font_size, 0, $font, $data['hri']);
     $len = $box[2] - $box[0];
+    $blue = ImageColorAllocate($im, 0x00, 0x00, 0xff);
     Barcode::rotate(-$len / 2, ($data['height'] / 2) + $font_size + $marge, $angle, $xt, $yt);
     imagettftext($im, $font_size, $angle, $x + $xt, $y + $yt, $blue, $font, $data['hri']);
   }
-
-  imagejpeg($im, file_directory_path() . '/regbar/temp_' . $user_name . '.jpg');
+    $path = 'public://regbar';
+  imagejpeg($im, $path . '/temp_' . $user_name . '.jpg');
   imagedestroy($im);
 }
 
