Changeset 572 for trunk

Show
Ignore:
Timestamp:
08/01/08 14:30:36 (4 months ago)
Author:
sidtheduck
Message:

+ Miscellaneous accessibility fixes for admin panel
+ Better 404 error / empty collection or album handling

Location:
trunk
Files:
28 modified

Legend:

Unmodified
Added
Removed
  • trunk/plog-admin/plog-admin-functions.php

    r571 r572  
    6363        } 
    6464        $output.= "\n\t\t\t".'</select>'; 
     65        $output.= "\n\t\t\t".'<input id="pagination-go" class="submit" type="submit" value="' . plog_tr('Go') . '" />'; 
     66        $output.= "\n\t\t\t<script type=\"text/javascript\">toggle('pagination-go');</script>\n";; 
    6567        return $output; 
    6668} 
     
    11811183// so plugins could add new fields to all those forms. 
    11821184function plog_add_collection_form() { 
    1183         $output = "\n\t\t" . '<input type="button" class="submit" id="show-collection" onclick="toggle(\'create-collection\'); toggle(\'show-collection\')" value="' . plog_tr('Create a Collection') . '" />'; 
     1185        $output = "\n\t\t" . '<input type="button" class="submit" id="show-collection" onclick="toggle(\'create-collection\'); toggle(\'show-collection\')" value="' . plog_tr('Create a Collection') . '" style="display: none;" />'; 
    11841186        $output .= "\n\t\t" . '<form action="'.$_SERVER["PHP_SELF"].'" method="post"> 
    1185                         <div id="create-collection" class="cssbox-green" style="width: 385px !important; display: none;"> 
     1187                        <div id="create-collection" class="cssbox-green" style="width: 385px !important;"> 
    11861188                                <div class="cssbox_head-green"><h2>' . plog_tr('Create a Collection') . '</h2></div> 
    11871189                                <div class="cssbox_body-green"> 
     
    11951197                        </div> 
    11961198                </form>' . "\n"; 
     1199        $output .= "\n\t\t<script type=\"text/javascript\">toggle('create-collection'); toggle('show-collection');</script>\n"; 
    11971200        return $output; 
    11981201} 
     
    12001203function plog_add_album_form($parent_collection) { 
    12011204        $parent_collection = intval($parent_collection); 
    1202         $output = "\n\t\t" . '<input type="button" class="submit" id="show-album" onclick="toggle(\'create-album\'); toggle(\'show-album\')" value="' . plog_tr('Create an Album') . '" />'; 
     1205        $output = "\n\t\t" . '<input type="button" class="submit" id="show-album" onclick="toggle(\'create-album\'); toggle(\'show-album\')" value="' . plog_tr('Create an Album') . '" style="display: none;" />'; 
    12031206        $output .= "\n\t\t" . '<form action="'.$_SERVER["REQUEST_URI"].'" method="post"> 
    1204                         <div id="create-album" class="cssbox-green" style="width: 385px !important; display: none;"> 
     1207                        <div id="create-album" class="cssbox-green" style="width: 385px !important;"> 
    12051208                                <div class="cssbox_head-green"><h2>' . plog_tr('Create an Album') . '</h2></div> 
    12061209                                <div class="cssbox_body-green"> 
     
    12151218                        </div> 
    12161219                </form>' . "\n"; 
     1220        $output .= "\n\t\t<script type=\"text/javascript\">toggle('create-album'); toggle('show-album');</script>\n"; 
    12171221         return $output; 
    12181222} 
  • trunk/plog-admin/plog-admin.php

    r570 r572  
    3434        $tabs = array(); 
    3535        $tabs['upload']         = array('url' => 'plog-upload.php','caption' => plog_tr('<em>U</em>pload')); 
    36         $tabs['import']         = array('url' => 'plog-import.php','caption' => plog_tr('<em>I</em>mport')); 
     36        $tabs['import']         = array('url' => 'plog-import.php?nojs=1','caption' => plog_tr('<em>I</em>mport'), 'onclick' => "window.location='plog-import.php'; return false;"); 
    3737        $tabs['manage']         = array('url' => 'plog-manage.php','caption' => plog_tr('<em>M</em>anage')); 
    38         $tabs['feedback'] = array('url' => 'plog-feedback.php','caption' => plog_tr('<em>F</em>eedback')); 
     38        $tabs['feedback']       = array('url' => 'plog-feedback.php','caption' => plog_tr('<em>F</em>eedback')); 
    3939        $tabs['options']        = array('url' => 'plog-options.php','caption' => plog_tr('<em>O</em>ptions')); 
    40         $tabs['themes'] = array('url' => 'plog-themes.php','caption' => plog_tr('<em>T</em>hemes')); 
     40        $tabs['themes']         = array('url' => 'plog-themes.php','caption' => plog_tr('<em>T</em>hemes')); 
    4141        $tabs['view']           = array('url' => $config['gallery_url'],'caption' => plog_tr('<em>V</em>iew'), 'target' => '_blank'); 
    4242        $tabs['support']        = array('url' => 'http://www.plogger.org/forum/','caption' => plog_tr('<em>S</em>upport'), 'target' => '_blank'); 
  • trunk/plog-admin/plog-import.php

    r558 r572  
    4343$output = ''; 
    4444$counter = $imported = 0; 
     45 
     46// see if the 'nojs' flag has been set if javascript disabled and create query & separator strings for URLs 
     47$query = (isset($_GET['nojs'])) ? "?nojs=".$_GET['nojs'] : ''; 
     48$sep = (isset($_GET['nojs'])) ? "&amp;" : '?'; 
    4549 
    4650// Check if update has been clicked, handle erroneous conditions, or upload 
     
    159163 
    160164                foreach ($directories as $dirkey => $group) { 
    161                         $output .= "\n\t\t\t" . '<li><a class="folder" href="'.$_SERVER['PHP_SELF']."?directory=$dirkey".'">'.basename($group).'</a></li>'; 
     165                        $output .= "\n\t\t\t" . '<li><a class="folder" href="'.$_SERVER['PHP_SELF'].$query.$sep.'directory='.$dirkey.'">'.basename($group).'</a></li>'; 
    162166                } 
    163167 
    164168                $upload_directory = $config['basedir'] . 'plog-content/uploads'; 
    165169                $dirkey = md5($upload_directory); 
    166                 $output .= "\n\t\t\t" . '<li><a class="folder" href="'.$_SERVER['PHP_SELF']."?directory=$dirkey".'">' . plog_tr('All Pictures') . '</a></li>'; 
     170                $output .= "\n\t\t\t" . '<li><a class="folder" href="'.$_SERVER['PHP_SELF'].$query.$sep.'directory='.$dirkey.'">' . plog_tr('All Pictures') . '</a></li>'; 
    167171                $output .= "\n\t\t</ul>\n\t</div>\n"; 
    168172 
     
    208212                $output .= "\n\t\t\t<ul>"; 
    209213                foreach ($directories as $dirkey => $group) { 
    210                         $output .= "\n\t\t\t\t" . '<li><a class="folder" href="'.$_SERVER['PHP_SELF']."?directory=$dirkey".'">'.basename($group).'</a></li>'; 
     214                        $output .= "\n\t\t\t\t" . '<li><a class="folder" href="'.$_SERVER['PHP_SELF'].$query.$sep.'directory='.$dirkey.'">'.basename($group).'</a></li>'; 
    211215                } 
    212216                //$dirkey = md5($upload_directory); 
    213                 // $output .= '<li><a class="folder" href="'.$_SERVER['PHP_SELF'].'?directory='.$dirkey.'">All pictures</a></li>'; 
     217                // $output .= '<li><a class="folder" href="'.$_SERVER['PHP_SELF'].$query.$sep.'directory='.$dirkey.'">All pictures</a></li>'; 
    214218                $output .= "\n\t\t\t</ul>\n\t\t</div>\n"; 
    215219 
     
    229233                $files = get_files($real_directory); 
    230234 
    231                 if (count($files) > 0) 
    232                 $output .= "\n\n\t\t" . '<p class="actions">' . sprintf(plog_tr('You are currently looking at <strong>%d</strong> image(s) within the <strong>%s</strong> directory.<br />' . "\n\t\t" . 'Creating thumbnails: %s done.'),count($files),$show_directory,'<span id="progress">0%</span>') . '</p>' . "\n"; 
     235                if (count($files) > 0) { 
     236                        $percent = (isset($_GET['nojs'])) ? '100%': '0%'; 
     237                        $output .= "\n\n\t\t" . '<p class="actions">' . sprintf(plog_tr('You are currently looking at <strong>%d</strong> image(s) within the <strong>%s</strong> directory.<br />' . "\n\t\t" . 'Creating thumbnails: %s done.'), count($files), $show_directory, '<span id="progress">'.$percent.'</span>') . '</p>' . "\n"; 
     238                } 
    233239 
    234240                // check to make sure album is writable and readable, and issue warning 
     
    245251                        $relative_name = substr($files[$i],strlen($upload_directory)+1); 
    246252                        if ($i == 0) 
    247                         $output.= "\n\t\t\t" . '<form id="uploadForm" action="'.$_SERVER["PHP_SELF"].'" method="post" enctype="multipart/form-data"> 
     253                        $output.= "\n\t\t\t" . '<form id="uploadForm" action="'.$_SERVER["PHP_SELF"].$query.'" method="post" enctype="multipart/form-data"> 
    248254                        <table> 
    249255                                <tr class="header"> 
     
    258264// new loop code - it works - yea! 
    259265                        $table_row_color = ($counter%2) ? "color-1" : "color-2"; 
     266                        if (isset($_GET['nojs'])) { 
     267                                $thumbpath = generate_thumb($upload_directory.'/'.$relative_name,"import-".substr($file_key,0,2),THUMB_SMALL); 
     268                        } else { 
     269                                $thumbpath = $config['gallery_url'].'plog-admin/images/ajax-loader.gif'; 
     270                        } 
    260271                        // start a new table row (alternating colors) and generate XHTML with thumbnail and link to picture view. 
    261272                        $output .= "\n\t\t\t\t" . '<tr class="'.$table_row_color.'"> 
    262273                                        <td><input type="checkbox" name="Selected[]" value="'.$file_key.'" checked="checked" /></td> 
    263                                         <td><div class="img-shadow" id="pic_'.$file_key . '"><img src="'.$config['gallery_url'].'plog-admin/images/ajax-loader.gif" alt="loading" /></div></td> 
     274                                        <td><div class="img-shadow" id="pic_'.$file_key . '"><img src="'.$thumbpath.'" alt="thumbnail" /></div></td> 
    264275                                        <td>'.basename($files[$i]).'</td> 
    265276                                        <td> 
     
    340351 
    341352                        $output .= "\n\t</form>"; 
    342                         $key_arr = join(",\n\t\t",$keys); 
    343  
    344                         $output .= "\n\n\t<script type=\"text/javascript\">\n\tvar importThumbs=[\n\t\t"; 
    345                         $output .= $key_arr; 
    346                         $output .= "];\n"; 
    347                         $output .="\trequestImportThumb();\n\t</script>\n"; 
     353                        if (!isset($_GET['nojs'])) { 
     354                                $key_arr = join(",\n\t\t",$keys); 
     355 
     356                                $output .= "\n\n\t<script type=\"text/javascript\">\n\tvar importThumbs=[\n\t\t"; 
     357                                $output .= $key_arr; 
     358                                $output .= "];\n"; 
     359                                $output .="\trequestImportThumb();\n\t</script>\n"; 
     360                        } 
    348361                } 
    349362        } 
  • trunk/plog-admin/plog-themes.php

    r570 r572  
    8787                // generate large Lightbox preview thumb, update thumb if preview.png has been updated 
    8888                $thumbnail_config[THUMB_LARGE]['timestamp'] = $timestamp; 
     89                $thumbnail_config[THUMB_LARGE]['disabled'] = 0; 
    8990                $preview_thumb_large = generate_thumb($theme_folder_name . "preview.png", $theme_name, THUMB_LARGE); 
    9091 
  • trunk/plog-admin/plog-upload.php

    r570 r572  
    1313        $albums_menu = isset($_REQUEST['albums_menu']) ?  $_REQUEST['albums_menu'] : ''; 
    1414        $new_album_name = isset($_REQUEST['new_album_name']) ?  $_REQUEST['new_album_name'] : ''; 
    15         $output = "\n\t\t\t\t\t\t<select name=\"albums_menu\" onclick=\"var k=document.getElementsByName(\'destination_radio\');k[0].checked=true;\">"; 
     15        $output = "\n\t\t\t\t\t\t<select name=\"albums_menu\" onclick=\"var k=document.getElementsByName('destination_radio');k[0].checked=true;\">"; 
    1616        foreach($albums as $album_id => $album) { 
    1717 
  • trunk/plog-content/themes/air/album.php

    r568 r572  
    2222                </ul><!-- /slides --> 
    2323<?php else : ?> 
    24                 <div id="error-404"> 
    25                         <h2><?php echo plog_tr('404 - Not Found')?></h2> 
    26                         <p><?php echo plog_tr('We are sorry, but the image that you requested does not exist. You might try using the <strong>Search</strong> feature to locate the image you are looking for.')?></p> 
     24                <div id="no-pictures-msg"> 
     25                        <h2><?php echo plog_tr('No Images') ?></h2> 
     26                        <p><?php echo plog_tr('Sorry, but there are no images in this album yet.') ?></p> 
    2727                </div> 
    2828<?php endif; ?> 
  • trunk/plog-content/themes/air/collection.php

    r568 r572  
    2424 
    2525<?php else : ?> 
    26                 <div id="error-404"> 
    27                         <h2><?php echo plog_tr('404 - Not Found')?></h2> 
    28                         <p><?php echo plog_tr('We are sorry, but the collection that you requested does not exist.')?></p> 
     26                <div id="no-pictures-msg"> 
     27                        <h2><?php echo plog_tr('No Albums') ?></h2> 
     28                        <p><?php echo plog_tr('Sorry, but there are no images or albums in this collection yet.') ?></p> 
    2929                </div> 
    3030<?php endif; ?> 
  • trunk/plog-content/themes/air/collections.php

    r568 r572  
    2323 
    2424        <?php else : ?> 
    25                 <div id="error-404"> 
    26                         <h2><?php echo plog_tr('404 - Not Found')?></h2> 
    27                         <p><?php echo plog_tr('We are sorry, but the collection that you requested does not exist.')?></p> 
     25                <div id="no-pictures-msg"> 
     26                        <h2><?php echo plog_tr('No Images') ?></h2> 
     27                        <p><?php echo plog_tr('Sorry, but there are no images in this gallery yet.') ?></p> 
    2828                </div> 
    2929        <?php endif; ?> 
  • trunk/plog-content/themes/air/gallery.css

    r568 r572  
    131131#no-pictures-msg { 
    132132        /* #no-pictures-msg controls the "no collections", "no albums", and "no picture" messages displayed when a visitor goes to a page without collections, albums, or a picture */ 
    133         margin: 0 0 200px; 
    134         padding: 80px 0; 
    135         font-size: 1.4em; 
    136         text-align: center; 
     133        margin: 50px; 
     134        text-align: justify; 
    137135} 
    138136 
  • trunk/plog-content/themes/air/header.php

    r568 r572  
    1414 
    1515                        </div> 
    16                         <?php echo generate_breadcrumb(); ?> 
     16                        <?php echo generate_breadcrumb("Home", " | "); ?> 
    1717 
    1818                </div><!-- /breadcrumbs --> 
  • trunk/plog-content/themes/air/picture.php

    r568 r572  
    4545<?php endwhile; ?> 
    4646<?php else : ?> 
    47                 <div id="error-404"> 
    48                         <h2><?php echo plog_tr('404 - Not Found')?></h2> 
    49                         <p><?php echo plog_tr('We are sorry, but the image that you requested does not exist. You might try using the <strong>Search</strong> feature to locate the image you are looking for.')?></p> 
     47                <div id="no-pictures-msg"> 
     48                        <h2><?php echo plog_tr('Not Found') ?></h2> 
     49                        <p><?php echo plog_tr('Sorry, but the image that you requested does not exist.') ?></p> 
    5050                </div> 
    5151        <?php endif; ?> 
  • trunk/plog-content/themes/air/search.php

    r568 r572  
    2222                </ul><!-- /slides --> 
    2323<?php else : ?> 
    24                 <div id="error-404"> 
    25                         <h2><?php echo plog_tr('Search Results')?></h2> 
    26                         <p><?php echo plog_tr('We are sorry, but there are no pictures that matched your search.')?></p> 
     24                <div id="no-pictures-msg"> 
     25                        <h2><?php echo plog_tr('Search Results') ?></h2> 
     26                        <p><?php echo plog_tr('Sorry, but there are no images that matched your search terms.') ?></p> 
    2727                </div> 
    2828<?php endif; ?> 
  • trunk/plog-content/themes/air/slideshow.php

    r568 r572  
    2525<?php echo generate_slideshow_interface(); ?> 
    2626<?php else : ?> 
    27                 <div id="error-404"> 
    28                         <h2><?php echo plog_tr('404 - Not Found')?></h2> 
    29                         <p><?php echo plog_tr('We are sorry, but there are no images in this album to create a slideshow with.')?></p> 
     27                <div id="no-pictures-msg"> 
     28                        <h2><?php echo plog_tr('No Images') ?></h2> 
     29                        <p><?php echo plog_tr('Sorry, but there are no images in this album to create a slideshow with.') ?></p> 
    3030                </div> 
    31  
    3231<?php endif; ?> 
    3332 
  • trunk/plog-content/themes/default/album.php

    r568 r572  
    2929                        </ul><!-- /slides --> 
    3030<?php else : ?> 
    31                         <div id="error-404"> 
    32                                 <h2><?php echo plog_tr('404 - Not Found')?></h2> 
    33                                 <p><?php echo plog_tr('We are sorry, but the image that you requested does not exist. You might try using the <strong>Search</strong> feature to locate the image you are looking for.')?></p> 
     31                        <div id="no-pictures-msg"> 
     32                                <h2><?php echo plog_tr('No Images') ?></h2> 
     33                                <p><?php echo plog_tr('Sorry, but there are no images in this album yet.') ?></p> 
    3434                        </div> 
    35  
    3635<?php endif; ?> 
    3736                </div><!-- /thumbnail container --> 
  • trunk/plog-content/themes/default/collection.php

    r568 r572  
    2323                        </ul><!-- /slides --> 
    2424<?php else : ?> 
    25                         <div id="error-404"> 
    26                                 <h2><?php echo plog_tr('404 - Not Found')?></h2> 
    27                                 <p><?php echo plog_tr('We are sorry, but the collection that you requested does not exist.')?></p> 
     25                        <div id="no-pictures-msg"> 
     26                                <h2><?php echo plog_tr('No Albums') ?></h2> 
     27                                <p><?php echo plog_tr('Sorry, but there are no images or albums in this collection yet.') ?></p> 
    2828                        </div> 
    29  
    3029<?php endif; ?> 
    3130                </div><!-- /thumbnail container --> 
  • trunk/plog-content/themes/default/collections.php

    r568 r572  
    2222                        </ul><!-- /slides --> 
    2323<?php else : ?> 
    24                         <div id="error-404"> 
    25                                 <h2><?php echo plog_tr('404 - Not Found')?></h2> 
    26                                 <p><?php echo plog_tr('We are sorry, but the collection that you requested does not exist.')?></p> 
     24                        <div id="no-pictures-msg"> 
     25                                <h2><?php echo plog_tr('No Images') ?></h2> 
     26                                <p><?php echo plog_tr('Sorry, but there are no images in this gallery yet.') ?></p> 
    2727                        </div> 
    28  
    2928<?php endif; ?> 
    3029                </div><!-- /thumbnail container --> 
  • trunk/plog-content/themes/default/gallery.css

    r568 r572  
    252252} 
    253253 
    254 #error-404 { 
     254#error-404, #no-pictures-msg { 
    255255        margin: 50px 75px; 
    256256        text-align: justify; 
     
    419419/* Success/Error Messages */ 
    420420 
    421 #no-pictures-msg { 
    422         text-align: center; 
    423         padding: 15px 0; 
    424 } 
    425  
    426421.errors { 
    427422        width: 500px; 
  • trunk/plog-content/themes/default/picture.php

    r568 r572  
    4949<?php endwhile; ?> 
    5050<?php else : ?> 
    51                         <div id="error-404"> 
    52                                 <h2><?php echo plog_tr('404 - Not Found')?></h2> 
    53                                 <p><?php echo plog_tr('We are sorry, but the image that you requested does not exist. You might try using the <strong>Search</strong> feature to locate the image you are looking for.')?></p> 
     51                        <div id="no-pictures-msg"> 
     52                                <h2><?php echo plog_tr('Not Found') ?></h2> 
     53                                <p><?php echo plog_tr('Sorry, but the image that you requested does not exist.') ?></p> 
    5454                        </div> 
    5555<?php endif; ?> 
  • trunk/plog-content/themes/default/search.php

    r568 r572  
    2626                        </ul><!-- /slides --> 
    2727<?php else : ?> 
    28                         <div id="error-404"> 
    29                                 <h2><?php echo plog_tr('Search Results')?></h2> 
    30                                 <p><?php echo plog_tr('We are sorry, but there are no pictures that matched your search.')?></p> 
     28                        <div id="no-pictures-msg"> 
     29                                <h2><?php echo plog_tr('Search Results') ?></h2> 
     30                                <p><?php echo plog_tr('Sorry, but there are no images that matched your search terms.') ?></p> 
    3131                        </div> 
    3232<?php endif; ?> 
  • trunk/plog-content/themes/default/slideshow.php

    r568 r572  
    3333<?php echo generate_slideshow_interface(); ?> 
    3434<?php else : ?> 
    35                         <div id="error-404"> 
    36                                 <h2><?php echo plog_tr('404 - Not Found')?></h2> 
    37                                 <p><?php echo plog_tr('We are sorry, but there are no images in this album to create a slideshow with.')?></p> 
     35                        <div id="no-pictures-msg"> 
     36                                <h2><?php echo plog_tr('No Images') ?></h2> 
     37                                <p><?php echo plog_tr('Sorry, but there are no images in this album to create a slideshow with.') ?></p> 
    3838                        </div> 
    39  
    4039<?php endif; ?> 
    4140 
  • trunk/plog-content/themes/lucid/album.php

    r568 r572  
    2727                        </ul><!-- /slides --> 
    2828<?php else : ?> 
    29                         <div id="error-404"> 
    30                                 <h2><?php echo plog_tr('404 - Not Found')?></h2> 
    31                                 <p><?php echo plog_tr('We are sorry, but the image that you requested does not exist. You might try using the <strong>Search</strong> feature to locate the image you are looking for.')?></p> 
     29                        <div id="no-pictures-msg"> 
     30                                <h2><?php echo plog_tr('No Images') ?></h2> 
     31                                <p><?php echo plog_tr('Sorry, but there are no images in this album yet.') ?></p> 
    3232                        </div> 
    33  
    3433<?php endif; ?> 
    3534                </div><!-- /thumbnail container --> 
  • trunk/plog-content/themes/lucid/collection.php

    r568 r572  
    2424                        </div><!-- /collections --> 
    2525<?php else : ?> 
    26                         <div id="error-404"> 
    27                                 <h2><?php echo plog_tr('404 - Not Found')?></h2> 
    28                                 <p><?php echo plog_tr('We are sorry, but the collection that you requested does not exist.')?></p> 
     26                        <div id="no-pictures-msg"> 
     27                                <h2><?php echo plog_tr('No Albums') ?></h2> 
     28                                <p><?php echo plog_tr('Sorry, but there are no images or albums in this collection yet.') ?></p> 
    2929                        </div> 
    3030<?php endif; ?> 
  • trunk/plog-content/themes/lucid/collections.php

    r568 r572  
    2323                        </div><!-- /collections --> 
    2424<?php else : ?> 
    25                         <div id="error-404"> 
    26                                 <h2><?php echo plog_tr('404 - Not Found')?></h2> 
    27                                 <p><?php echo plog_tr('We are sorry, but the collection that you requested does not exist.')?></p> 
     25                        <div id="no-pictures-msg"> 
     26                                <h2><?php echo plog_tr('No Images') ?></h2> 
     27                                <p><?php echo plog_tr('Sorry, but there are no images in this gallery yet.') ?></p> 
    2828                        </div> 
    2929<?php endif; ?> 
  • trunk/plog-content/themes/lucid/gallery.css