Index: extensions/Copyrights/admin.php
===================================================================
--- extensions/Copyrights/admin.php	(revision 11638)
+++ extensions/Copyrights/admin.php	(revision 11656)
@@ -32,5 +32,5 @@
 check_status(ACCESS_ADMINISTRATOR);
 
-// Default is to create, if changed to 1, show edit page
+// Default is to create a copyright, if changed to 1, show the edit page
 $edit = 0;
 
@@ -44,9 +44,14 @@
 // Do managing of copyrights
 if (isset($_GET['tab'])) {
+  // Create a new copyright
   if ($_GET['tab'] == 'create') {
+    // Fetch the values from the form
     $name = pwg_db_real_escape_string($_REQUEST['name']);
     $url = pwg_db_real_escape_string($_REQUEST['url']);
     $descr = pwg_db_real_escape_string($_REQUEST['descr']);
     $visible = (isset($_REQUEST['visible']) ? 1 : 0);
+
+    // Check whether a copyright with such a name exists
+    // Therefore count the number of copyrights with that name
     $query = sprintf(
       'SELECT COUNT(*)
@@ -56,7 +61,9 @@
       COPYRIGHTS_ADMIN, $name);
     list($counter) = pwg_db_fetch_row(pwg_query($query));
-    if ($counter != 0) {
+
+    if ($counter != 0) { // The copyright exists already
       array_push($page['errors'], l10n('This copyright already exists'));
-    } else {
+    } else { // The copyright did not yet exist
+      // Compose a query to insert the copyright
       $query = sprintf(
         'INSERT INTO %s
@@ -65,11 +72,14 @@
         ;',
         COPYRIGHTS_ADMIN, $name, $url, $descr, $visible);
-      pwg_query($query);
+      pwg_query($query); // Execute the query
     }
   }
 
+  // Edit an existing copyright
   if ($_GET['tab'] == 'edit') {
-    $edit = 1;
-    $CRid = $_REQUEST['id'];
+    $edit = 1; // Show the edit page
+    $CRid = $_REQUEST['id']; // Fetch the id of the copyright to be edited
+
+    // Fetch the current attributes to the copyright
     $query = sprintf(
       'SELECT *
@@ -80,4 +90,6 @@
     $result = pwg_query($query);
     $row = pwg_db_fetch_assoc($result);
+
+    // Save the attributes in convenient variables
     $CRname = $row['name'];
     $CRurl = $row['url'];
@@ -86,5 +98,7 @@
   }
 
+  // Update an existing copyright
   if ($_GET['tab'] == 'update') {
+    // Fetch the values from the edit form
     $id = pwg_db_real_escape_string($_REQUEST['id']);
     $name = pwg_db_real_escape_string($_REQUEST['name']);
@@ -92,4 +106,6 @@
     $descr= pwg_db_real_escape_string($_REQUEST['descr']);
     $visible = (isset($_REQUEST['visible']) ? 1 : 0);
+
+    // Compose a query to update the copyright
     $query = sprintf(
       'UPDATE %s
@@ -98,9 +114,12 @@
       ;',
       COPYRIGHTS_ADMIN, $name, $url, $descr, $visible, $id);
-    pwg_query($query);
+    pwg_query($query); // Execute the query
   }
-  
+
+  // Delete an existing copyright
   if ($_GET['tab'] == 'delete') {
-    $id = $_REQUEST['id'];
+    $id = $_REQUEST['id']; // Fetch the id of the copyright to be deleted
+
+    // Compose a query to delete the copyright
     $query = sprintf(
       'DELETE FROM %s
@@ -108,11 +127,12 @@
       ;',
       COPYRIGHTS_ADMIN, $id);
-    pwg_query($query);
+    pwg_query($query); // Execute the query
   }
 }
 
-// Create page template
+/* Assign variables to the template */
 global $template;
 
+// Add the admin.tpl template
 $template->set_filenames(
   array(
@@ -121,4 +141,5 @@
 );
 
+// Select the existing copyrights
 $query = sprintf(
   'SELECT *
@@ -128,4 +149,5 @@
 $result = pwg_query($query);
 
+// Append the copyrights to the Smarty array
 while ($row = pwg_db_fetch_assoc($result)) {
   $template->append(
@@ -141,4 +163,5 @@
 }
 
+// Assign the path for URL forming
 $template->assign(
   'COPYRIGHTS_PATH',
@@ -146,4 +169,5 @@
 );
 
+// Assign all the variables we constructed above
 $template->assign('edit', $edit);
 $template->assign('CRid', $CRid);
@@ -153,4 +177,5 @@
 $template->assign('CRvisible', $CRvisible);
 
+// Get it up and running
 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
 
Index: extensions/Copyrights/admin.tpl
===================================================================
--- extensions/Copyrights/admin.tpl	(revision 11638)
+++ extensions/Copyrights/admin.tpl	(revision 11656)
@@ -3,4 +3,5 @@
 </div>
 
+<!-- Create the form for creating and editing copyrights -->
 <form action='{$COPYRIGHTS_PATH}-{if $edit == 0}create{else}update{/if}'
       method='POST'>
@@ -8,5 +9,8 @@
     <legend>{if $edit == 0}{'Create copyright'|@translate}
             {else}{'Update copyright'|@translate}{/if}</legend>
+      <!-- If $edit != 0 we should remember the id of the copyright that is
+           edited -->
       {if $edit != 0}<input type='hidden' name='id' id='id' value='{$CRid}' />{/if}
+      <!-- Put all the attributes of the copyright in a nice table -->
       <table>
         <tr>
@@ -37,4 +41,6 @@
   </fieldset>
 </form>
+
+<!-- If we are on the 'homepage', show a table of all copyrights -->
 {if $edit == 0}
 <form>
@@ -43,4 +49,5 @@
     <table>
       <tr>
+        <!-- Create a nice header row -->
         <th>{'Name'|@translate}</th>
         <th>{'URL'|@translate}</th>
@@ -49,8 +56,10 @@
         <th>{'Actions'|@translate}</th>
       </tr>
+    <!-- Loop over all copyrights -->
     {if not empty($CRs)}
     {foreach from=$CRs item=CR}
     {strip}
-      <tr class="{cycle values="row1,row2"}">
+      <tr class="{cycle values="row1,row2"}"> <!-- This gives nicely colored
+                                                   table rows -->
         <td>{$CR.name}</td>
         <td><a href="{$CR.url}">{$CR.url}</a></td>
Index: extensions/Copyrights/image.php
===================================================================
--- extensions/Copyrights/image.php	(revision 11638)
+++ extensions/Copyrights/image.php	(revision 11656)
@@ -3,15 +3,7 @@
 This php file will insert the names of the copyrights into the images description,
 so you can see below the image what copyright it has.
-
-Mattias
-
-thanks to the AddInfo plugin by ddtddt!
 */
 
-// What do these prefilters do?
-// First they use loc_begin_picture to set some template variables
-// Then they use the same event to set a prefilter, who on his turn will change the content
-
-// Add a prefilter - whatever a prefilter may be
+// Add a prefilter
 add_event_handler('loc_begin_picture', 'copyrights_set_prefilter_add_to_pic_info', 55 );
 
Index: extensions/Copyrights/main.inc.php
===================================================================
--- extensions/Copyrights/main.inc.php	(revision 11638)
+++ extensions/Copyrights/main.inc.php	(revision 11656)
@@ -46,6 +46,5 @@
  * +-----------------------------------------------------------------------+ */
 
-
- // Add to the menu, dont do anything right now
+// Add an entry to the plugins menu
 add_event_handler('get_admin_plugin_menu_links', 'copyrights_admin_menu');
 function copyrights_admin_menu($menu) {
@@ -88,5 +87,5 @@
  * +-----------------------------------------------------------------------+ */
 
-// Add Copyrights dropdown menu to picture_modify
+// Add the Copyrights dropdown menu to picture_modify
 include_once(dirname(__FILE__).'/modify.php');
 
Index: extensions/Copyrights/maintain.inc.php
===================================================================
--- extensions/Copyrights/maintain.inc.php	(revision 11638)
+++ extensions/Copyrights/maintain.inc.php	(revision 11656)
