Annonce

#1 2005-09-26 19:44:20

droopy191
Membre
BZH, France
2005-08-12
8

[1.5.0RC1] - (X)HTML errors PWG 1.5.0 RC1

Hello,

my (X)HTML bug report  on version 1.5.0 RC1
I tested only the users pages at the moment.
Some issues are not solved.


****************************
List of modifications on template "Yoga" to make PhpWebgallery (X)HTML valid
********************* OK
install.tpl
line 1:
doctype change to XHTML 1.0 strict  ( only to debug pwg core, xhtml is more strict than html )

line 108: form parameters must be lowercase "POST"=>"post" , name => id

line 180: tag td badly closed </th> => </td>

line 127 132 137 142 147: align=center => align="center"

line 109 114 : replace <table width="100%" with <table style="width:100%;"


********************* OK
header.tpl
line 1: doctype change to XHTML 1.0 strict ( optional )
line 5,18: meta not closed
line 7,8,9 : link not closed

line 24: bug?: body id is not filled when on redirect page -> that cause a non valid page


********************* OK
category.tpl
line 71,73,77,81,85: input tags not closed ( visible on visitors gallery only )
line 120: img not closed


********************* OK
redirect.tpl
line 1 : quoted paragraph with <p></p>


*************************************** OK
register.tpl
line 29,34,39,44,52,53: input tag not closed


********************* OK
search.tpl
line 5: tag img not closed
line 55 and 72 : input tag not closed

line 56 and 73: tag a closed incorrectly,
attribute name="#" removed because not needed ( deprecated ( =>id), duplicated, and # not allowed)
onClick muste be lowercase in XHTML

line 12: name="post" not valid => id="name"

lines 24,83,84,91,92,98,99: width="50%" not allowed => style="width:50%;"
lines 84,91,92,98,99,104: nowrap="nowrap" =>  style="word-wrap:normal;"
line 22 => <table style="width:100%;align:center"  cellpadding="2">

line 135 : </tr> was missing
lines 24,33,39,83: </td> was missing
line 132: height="38" => style="height:38px;"

line 85-89 select: not solved
return an empty select when no categories are available ( not important I think)
-> maybe a virtual empty category should be created ??


********************* OK
identification.tpl
lines 6,51,52 img not closed
lines 30,35 41, 47 tag input not closed


********************* OK
picture.tpl

Line 17,18,23,26,29,38,40,42,52,69,74: tag img not closed
line 183,187: tag input not closed

line 11,154: hr not closed
line 180,187: p not closed
line 183: p needed
line 186: missing cols="1" in textarea
line 172: missing p inside blockquote

line 185: label not well closed <p><label>{L_COMMENT}:</label></p> ( </label> removed from line 186 )
line 186: added p around textarea
copy of modified lines 185 to 187 to be clear
<p><label>{L_COMMENT}:</label></p>
<p><textarea name="content" cols ="1" rows="7" style="width:100%;"></textarea></p>
<p><input type="submit" value="{L_SUBMIT}"/></p>


line 73: tag input not closed

line 190: moved  to line 193


********************* OK
password.tpl
line 38,43,48: tag input not closed

line 31: action is empty -> do not pass the tidy validator



******************
List of modifications on phpwebgallery core
****************** OK
/include/functions_html.inc
line 344: function get_html_menu_category() -> modified to return valid HTML menu

my proposal

/**
* returns the HTML code for a category item in the menu (for category.php)
*
* HTML code generated uses logical list tags ul and each category is an
* item li. The paramter given is the category informations as an array,
* used keys are : id, name, nb_images, date_last
*
* @param array categories
* @return string
  * return a valid menu or a nbsp if empty
* <ul> <li> 1st lign </li>
*        <li> 2nd lign
*        <ul> <li> 1st sub-lign </li>
*        </ul>
*    </li>   
*</ul>
*/
function get_html_menu_category($categories)
{
  global $page, $lang;
   
  if ( empty($categories ) )
  { $menu = '&nbsp;';} // &nbsp; in case of an empty cat menu
  else
  {
      $ref_level = 0; //Last menu level
      $first= true; // to manage the first lign li of a menu or sub-menu
      $menu = '
                 <ul class="menu">';
      foreach ($categories as $category)
      {
        $level = substr_count($category['global_rank'], '.'); //current menu level
        if ($level > $ref_level)
        {
          $menu.= '
                <ul class="menu">';
                 $first = true;
        }
        else if ($level < $ref_level)
        {
          // we may have to close more than one level at the same time...
          $menu.= str_repeat("\n</li></ul>",($ref_level-$level));
        }
       
        $ref_level = $level;
       
        if ($first == true )  //close the last lign and open a new one exepted if it is a first lign
        { $menu.= '
        <li>';
         $first = false;      
        }
        else
        {   
        $menu.= '
        </li>
   
                <li>';
        }
       
        $url = add_session_id(PHPWG_ROOT_PATH.'category.php?cat='.$category['id']);
   
        $class = '';
        if (isset($page['cat'])
            and is_numeric($page['cat'])
            and $category['id'] == $page['cat'])
        {
          $class = 'menuCategorySelected';
        }
        else
        {
          $class = 'menuCategoryNotSelected';
        }
   
        $menu.= '
        <a href="'.$url.'" title="'.$lang['hint_category'].'" class="'.$class.'">'.$category['name'].'</a>';
        if ($category['nb_images'] > 0)
        {
          $menu.= '
            <span class="menuInfoCat" title="'.$category['nb_images'].$lang['images_available'].'">['.$category['nb_images'].']</span>'.get_icon($category['date_last']);
        }
   
      }
      $menu.= str_repeat("\n</li>\n</ul>",($ref_level+1)) ; // close the last line of menu
  }
 
  return $menu;
}


******************
/language/*/common.lang.php

line 275: strings used in URL blank spaces are not accepted by the Tidy validator even accepted by W3C one.
replace all " " by "%20" (blank spaces)  => '[phpwebgallery]%20une%20remarque%20sur%20ton%20site'
used in all pages when logged
It is not really critical but useful for those who use Tidy to valid local html

******************
bugs

about in main menu
instructions in admin page
do not work


******************
Todo list, not yet tested
******************


admin pages

Error messages: ??


--
Dr

Hors ligne

#2 2005-09-26 23:32:04

plg
Équipe Piwigo
Nantes, France, Europe
2002-04-05
12644

Re: [1.5.0RC1] - (X)HTML errors PWG 1.5.0 RC1

Thanks for your analyze. Please remember that template "yoga" is HTML 4.01 strict and not XHTML. Some of your bugs are not once this information taken into account.

Concerning the imbrication of UL/LI in the categories menu, I've commited a new version of the function :

Code:

/**
 * returns the HTML code for a category item in the menu (for category.php)
 *
 * HTML code generated uses logical list tags ul and each category is an
 * item li. The paramter given is the category informations as an array,
 * used keys are : id, name, nb_images, date_last
 *
 * @param array categories
 * @return string
 */
function get_html_menu_category($categories)
{
  global $page, $lang;

  $ref_level = 0;
  $menu = '';
  
  foreach ($categories as $category)
  {
    $level = substr_count($category['global_rank'], '.') + 1;
    if ($level > $ref_level)
    {
      $menu.= '
             <ul>';
    }
    else if ($level == $ref_level)
    {
      $menu.= '
             </li>';
    }
    else if ($level < $ref_level)
    {
      // we may have to close more than one level at the same time...
      $menu.= str_repeat("\n</ul>",($ref_level-$level));
      $menu.= "\n</li>";
    }
    $ref_level = $level;

    $menu.= '

           <li';
    if (isset($page['cat'])
        and is_numeric($page['cat'])
        and $category['id'] == $page['cat'])
    {
      $menu.= ' class="selected"';
    }
    $menu.= '>';
  
    $url = add_session_id(PHPWG_ROOT_PATH.'category.php?cat='.$category['id']);
    $menu.= '
             <a href="'.$url.'">'.$category['name'].'</a>';

    if ($category['nb_images'] > 0)
    {
      $menu.= '
             <span class="menuInfoCat"';
      $menu.= ' title="'.$category['nb_images'];
      $menu.= ' '.$lang['images_available'].'">';
      $menu.= '['.$category['nb_images'].']';
      $menu.= '</span>';
      $menu.= get_icon($category['date_last']);
    }
  }
  
  $menu.= '</li>
             </ul>';
  
  return $menu;
}

(and now it's HTML 4.01 Strict valid)


Les historiens ont établi que Pierrick était le premier utilisateur connu de Piwigo.

Hors ligne

#3 2005-09-27 09:35:45

droopy191
Membre
BZH, France
2005-08-12
8

Re: [1.5.0RC1] - (X)HTML errors PWG 1.5.0 RC1

Hello Zorglub,

I understand you remark concerning Xhtml. My aim was only to find some bugs ouside the template that could prevent to create xhtml template.

I can continue testing the admin pages. Does it help if I write the same report than for the main pages ?
I know that is not easy to read.

I tested the html menu function: the bug is still present.
It appears only when categories are as below
- cat1
- cat2
   - cat2.1

the bug is a non closed </ul> when one or several sub-category(ies) (cat2.1) is present in the last main category (cat2)

Dernière modification par droopy191 (2005-09-27 09:48:03)


--
Dr

Hors ligne

Pied de page des forums

Propulsé par FluxBB

github twitter newsletter Faire un don Piwigo.org © 2002-2024 · Contact