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'; |
356 } |
357 } |
357 if ( !isset($first_row['folder_id']) ) |
358 if ( !isset($first_row['folder_id']) ) |
358 { |
359 { |
359 $f_errors[] = 'Internal error getting parent folder ID'; |
360 $f_errors[] = 'Internal error getting parent folder ID'; |
360 } |
361 } |
486 $start = intval($_GET['start']); |
487 $start = intval($_GET['start']); |
487 } |
488 } |
488 |
489 |
489 $per_page = $rows_in_browser * 5; |
490 $per_page = $rows_in_browser * 5; |
490 |
491 |
491 $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>'); |
492 if ( $db->numrows($img_query) < 1 ) |
492 echo $html; |
493 { |
|
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 } |
493 |
507 |
494 if ( $session->user_level >= USER_LEVEL_ADMIN ) |
508 if ( $session->user_level >= USER_LEVEL_ADMIN ) |
495 { |
509 { |
496 echo '<div class="select-outer">Create new folder'; |
510 echo '<div class="select-outer">Create new folder'; |
497 echo '<div class="select-inner" style="padding-top: 4px;">'; |
511 echo '<div class="select-inner" style="padding-top: 4px;">'; |