From 63e967bdfd6d3bd52960647f8490dfd9678353f9 Mon Sep 17 00:00:00 2001
From: Anika Henke <anika@selfthinker.org>
Date: Sun, 5 Aug 2012 13:04:35 +0100
Subject: [PATCH] html validity fixes (removed name and align in some plugins)

---
 inc/media.php                | 12 ++++++------
 lib/plugins/acl/admin.php    | 10 +++++-----
 lib/plugins/acl/style.css    |  8 ++++++++
 lib/plugins/config/admin.php |  2 +-
 lib/scripts/media.js         |  4 ++--
 5 files changed, 22 insertions(+), 14 deletions(-)

diff --git a/inc/media.php b/inc/media.php
index 6941aa61a..6335bf210 100644
--- a/inc/media.php
+++ b/inc/media.php
@@ -1383,9 +1383,9 @@ function media_printfile($item,$auth,$jump,$display_namespace=false){
     // output
     echo '<div class="'.$zebra.'"'.$jump.' title="'.hsc($item['id']).'">'.NL;
     if (!$display_namespace) {
-        echo '<a name="h_:'.$item['id'].'" class="'.$class.'">'.hsc($file).'</a> ';
+        echo '<a id="h_:'.$item['id'].'" class="'.$class.'">'.hsc($file).'</a> ';
     } else {
-        echo '<a name="h_:'.$item['id'].'" class="'.$class.'">'.hsc($item['id']).'</a><br/>';
+        echo '<a id="h_:'.$item['id'].'" class="'.$class.'">'.hsc($item['id']).'</a><br/>';
     }
     echo '<span class="info">('.$info.')</span>'.NL;
 
@@ -1449,7 +1449,7 @@ function media_printfile_thumbs($item,$auth,$jump=false,$display_namespace=false
         media_printimgdetail($item, true);
 
     } else {
-        echo '<a name="d_:'.$item['id'].'" class="image" title="'.$item['id'].'" href="'.
+        echo '<a id="d_:'.$item['id'].'" class="image" title="'.$item['id'].'" href="'.
             media_managerURL(array('image' => hsc($item['id']), 'ns' => getNS($item['id']),
             'tab_details' => 'view')).'">';
         echo media_printicon($item['id']);
@@ -1462,7 +1462,7 @@ function media_printfile_thumbs($item,$auth,$jump=false,$display_namespace=false
         $name = hsc($item['id']);
     }
     echo '<dd class="name"><a href="'.media_managerURL(array('image' => hsc($item['id']), 'ns' => getNS($item['id']),
-        'tab_details' => 'view')).'" name="h_:'.$item['id'].'">'.$name.'</a></dd>'.NL;
+        'tab_details' => 'view')).'" id="h_:'.$item['id'].'">'.$name.'</a></dd>'.NL;
 
     if($item['isimg']){
         $size = '';
@@ -1510,7 +1510,7 @@ function media_printimgdetail($item, $fullscreen=false){
 
     // output
     if ($fullscreen) {
-        echo '<a name="l_:'.$item['id'].'" class="image thumb" href="'.
+        echo '<a id="l_:'.$item['id'].'" class="image thumb" href="'.
             media_managerURL(array('image' => hsc($item['id']), 'ns' => getNS($item['id']), 'tab_details' => 'view')).'">';
         echo '<img src="'.$src.'" '.$att.' />';
         echo '</a>';
@@ -1520,7 +1520,7 @@ function media_printimgdetail($item, $fullscreen=false){
 
     echo '<div class="detail">';
     echo '<div class="thumb">';
-    echo '<a name="d_:'.$item['id'].'" class="select">';
+    echo '<a id="d_:'.$item['id'].'" class="select">';
     echo '<img src="'.$src.'" '.$att.' />';
     echo '</a>';
     echo '</div>';
diff --git a/lib/plugins/acl/admin.php b/lib/plugins/acl/admin.php
index a0d2e430e..64d6ff3ca 100644
--- a/lib/plugins/acl/admin.php
+++ b/lib/plugins/acl/admin.php
@@ -191,7 +191,7 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
         echo '</div>'.NL;
 
         echo '<div class="footnotes"><div class="fn">'.NL;
-        echo '<sup><a id="fn__1" class="fn_bot" name="fn__1" href="#fnt__1">1)</a></sup>'.NL;
+        echo '<sup><a id="fn__1" class="fn_bot" href="#fnt__1">1)</a></sup>'.NL;
         echo $this->getLang('p_include');
         echo '</div></div>';
 
@@ -602,7 +602,7 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
         echo '<tr>';
         echo '<th>'.$this->getLang('where').'</th>';
         echo '<th>'.$this->getLang('who').'</th>';
-        echo '<th>'.$this->getLang('perm').'<sup><a id="fnt__1" class="fn_top" name="fnt__1" href="#fn__1">1)</a></sup></th>';
+        echo '<th>'.$this->getLang('perm').'<sup><a id="fnt__1" class="fn_top" href="#fn__1">1)</a></sup></th>';
         echo '<th>'.$lang['btn_delete'].'</th>';
         echo '</tr>';
         foreach($this->acl as $where => $set){
@@ -630,7 +630,7 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
                 echo $this->_html_checkboxes($perm,$ispage,'acl['.$where.']['.$who.']');
                 echo '</td>';
 
-                echo '<td align="center">';
+                echo '<td class="check">';
                 echo '<input type="checkbox" name="del['.hsc($where).'][]" value="'.hsc($who).'" />';
                 echo '</td>';
                 echo '</tr>';
@@ -638,7 +638,7 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
         }
 
         echo '<tr>';
-        echo '<th align="right" colspan="4">';
+        echo '<th class="action" colspan="4">';
         echo '<input type="submit" value="'.$lang['btn_update'].'" name="cmd[update]" class="button" />';
         echo '</th>';
         echo '</tr>';
@@ -746,7 +746,7 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
             }
 
             //build code
-            $ret .= '<label for="pbox'.$label.'" title="'.$this->getLang('acl_perm'.$perm).'"'.$class.'>';
+            $ret .= '<label for="pbox'.$label.'"'.$class.'>';
             $ret .= '<input '.buildAttributes($atts).' />&#160;';
             $ret .= $this->getLang('acl_perm'.$perm);
             $ret .= '</label>'.NL;
diff --git a/lib/plugins/acl/style.css b/lib/plugins/acl/style.css
index 7044254a5..f4277c341 100644
--- a/lib/plugins/acl/style.css
+++ b/lib/plugins/acl/style.css
@@ -67,6 +67,14 @@ div#acl_manager table.inline {
     margin: 0;
 }
 
+#acl_manager table .check {
+    text-align: center;
+}
+
+#acl_manager table .action {
+    text-align: right;
+}
+
 div#acl_manager .aclgroup {
     background: transparent url(pix/group.png) 0px 1px no-repeat;
     padding: 1px 0px 1px 18px;
diff --git a/lib/plugins/config/admin.php b/lib/plugins/config/admin.php
index c5f7ee532..bc2d88322 100644
--- a/lib/plugins/config/admin.php
+++ b/lib/plugins/config/admin.php
@@ -351,7 +351,7 @@ class admin_plugin_config extends DokuWiki_Admin_Plugin {
     }
 
     function _print_h1($id, $text) {
-      ptln('<h1><a name="'.$id.'" id="'.$id.'">'.$text.'</a></h1>');
+      ptln('<h1 id="'.$id.'">'.$text.'</h1>');
     }
 
 
diff --git a/lib/scripts/media.js b/lib/scripts/media.js
index 841baa93f..1872f2c61 100644
--- a/lib/scripts/media.js
+++ b/lib/scripts/media.js
@@ -497,7 +497,7 @@ var dw_mediamanager = {
                 var maxWidth = widthFull - (widthOtherResizable + minWidthNonResizable);
                 $resizables.resizable( "option", "maxWidth", maxWidth );
 
-                // width of file panel in % = 100% - width of resizables in % 
+                // width of file panel in % = 100% - width of resizables in %
                 // this calculates with 99.99 and not 100 to overcome rounding errors
                 var relWidthNonResizable = 99.99 - (100 * widthResizables / widthFull);
                 // set width of file panel
@@ -699,7 +699,7 @@ var dw_mediamanager = {
         event.preventDefault();
 
         $link = jQuery(this);
-        id = $link.attr('name').substr(2);
+        id = $link.attr('id').substr(2);
 
         if(!opener){
             // if we don't run in popup display example
-- 
GitLab