plugins/gallery/browser.php
changeset 10 b38afb86dcad
parent 9 ebd7003e73c6
child 11 3c4304fae21e
child 13 f6ca7cead82c
equal deleted inserted replaced
9:ebd7003e73c6 10:b38afb86dcad
   350   
   350   
   351   if ( $session->user_level >= USER_LEVEL_ADMIN && isset($_POST['create_folder']) )
   351   if ( $session->user_level >= USER_LEVEL_ADMIN && isset($_POST['create_folder']) )
   352   {
   352   {
   353     if ( !isset($first_row['folder_id']) )
   353     if ( !isset($first_row['folder_id']) )
   354     {
   354     {
   355       // $first_row['folder_id'] =& $first_row['img_id'];
   355       $first_row['folder_id'] =& $first_row['img_id'];
   356       $first_row['folder_id'] = 'NULL';
       
   357     }
   356     }
   358     if ( !isset($first_row['folder_id']) )
   357     if ( !isset($first_row['folder_id']) )
   359     {
   358     {
   360       $f_errors[] = 'Internal error getting parent folder ID';
   359       $f_errors[] = 'Internal error getting parent folder ID';
   361     }
   360     }
   487     $start = intval($_GET['start']);
   486     $start = intval($_GET['start']);
   488   }
   487   }
   489   
   488   
   490   $per_page = $rows_in_browser * 5;
   489   $per_page = $rows_in_browser * 5;
   491   
   490   
   492   if ( $db->numrows($img_query) < 1 )
   491   $html = paginate($img_query, '{img_id}', $db->numrows($img_query), makeUrl($paths->fullpage, 'sort=' . $sort_column . '&order=' . $sort_order . '&start=%s', false), $start, $per_page, $callers, '<table border="0" cellspacing="8"><tr>', '</tr></table>');
   493   {
   492   echo $html;
   494     $html = '';
       
   495     if ( $session->user_level >= USER_LEVEL_ADMIN )
       
   496     {
       
   497       $html .= '<p><a href="' . makeUrlNS('Special', 'GalleryUpload', 'folder=' . $first_row['img_id'], true) . '">Upload an image</a></p>';
       
   498     }
       
   499     
       
   500     echo '<p>There are no items in this folder.</p>' . $html;
       
   501   }
       
   502   else
       
   503   {
       
   504     $html = paginate($img_query, '{img_id}', $db->numrows($img_query), makeUrl($paths->fullpage, 'sort=' . $sort_column . '&order=' . $sort_order . '&start=%s', true), $start, $per_page, $callers, '<table border="0" cellspacing="8"><tr>', '</tr></table>');
       
   505     echo $html;
       
   506   }
       
   507   
   493   
   508   if ( $session->user_level >= USER_LEVEL_ADMIN )
   494   if ( $session->user_level >= USER_LEVEL_ADMIN )
   509   {
   495   {
   510     echo '<div class="select-outer">Create new folder';
   496     echo '<div class="select-outer">Create new folder';
   511     echo '<div class="select-inner" style="padding-top: 4px;">';
   497     echo '<div class="select-inner" style="padding-top: 4px;">';