summaryrefslogtreecommitdiff
path: root/medialist.php
diff options
context:
space:
mode:
Diffstat (limited to 'medialist.php')
-rw-r--r--medialist.php50
1 files changed, 33 insertions, 17 deletions
diff --git a/medialist.php b/medialist.php
index e173fba615..1bf7bfb2cc 100644
--- a/medialist.php
+++ b/medialist.php
@@ -116,7 +116,9 @@ $medialist = WT_Query_Media::mediaList(
<?php
foreach (array('10', '20', '30', '40', '50', '75', '100', '125', '150', '200') as $selectEntry) {
echo '<option value="', $selectEntry, '"';
- if ($selectEntry==$max) echo ' selected="selected"';
+ if ($selectEntry == $max) {
+ echo ' selected="selected"';
+ }
echo '>', $selectEntry, '</option>';
}
?>
@@ -138,7 +140,9 @@ $medialist = WT_Query_Media::mediaList(
<?php
foreach (array('1', '2') as $selectEntry) {
echo '<option value="', $selectEntry, '"';
- if ($selectEntry==$columns) echo ' selected="selected"';
+ if ($selectEntry == $columns) {
+ echo ' selected="selected"';
+ }
echo '>', $selectEntry, '</option>';
}
?>
@@ -178,14 +182,16 @@ if ($search) {
echo '<', $tsection, '><tr><td colspan="2">';
echo '<table class="list_table_controls"><tr><td>';
- if ($TEXT_DIRECTION=='ltr') {
+ if ($TEXT_DIRECTION === 'ltr') {
if ($ct>$max) {
if ($currentPage > 1) {
echo '<a href="medialist.php?action=no&amp;search=no&amp;folder=', rawurlencode($folder), '&amp;sortby=', $sortby, '&amp;subdirs=', $subdirs, '&amp;filter=', rawurlencode($filter), '&amp;columns=', $columns, '&amp;apply_filter=', $apply_filter, '&amp;start=0&amp;max=', $max, '" class="icon-ldarrow"></a>';
}
- if ($start>0) {
+ if ($start > 0) {
$newstart = $start-$max;
- if ($start<0) $start = 0;
+ if ($start < 0) {
+ $start = 0;
+ }
echo '<a href="medialist.php?action=no&amp;search=no&amp;folder=', rawurlencode($folder), '&amp;sortby=', $sortby, '&amp;subdirs=', $subdirs, '&amp;filter=', rawurlencode($filter), '&amp;;columns=', $columns, '&amp;apply_filter=', $apply_filter, '&amp;start=', $newstart, '&amp;max=', $max, '" class="icon-larrow"></a>';
}
}
@@ -195,9 +201,11 @@ if ($search) {
$lastStart = ((int) ($ct / $max)) * $max;
echo '<a href="medialist.php?action=no&amp;search=no&amp;folder=', rawurlencode($folder), '&amp;sortby=', $sortby, '&amp;subdirs=', $subdirs, '&amp;filter=', rawurlencode($filter), '&amp;columns=', $columns, '&amp;apply_filter=', $apply_filter, '&amp;start=', $lastStart, '&amp;max=', $max, '" class="icon-rdarrow"></a>';
}
- if ($start+$max < $ct) {
+ if ($start + $max < $ct) {
$newstart = $start+$count;
- if ($start<0) $start = 0;
+ if ($start < 0) {
+ $start = 0;
+ }
echo '<a href="medialist.php?action=no&amp;search=no&amp;folder=', rawurlencode($folder), '&amp;sortby=', $sortby, '&amp;subdirs=', $subdirs, '&amp;filter=', rawurlencode($filter), '&amp;columns=', $columns, '&amp;apply_filter=', $apply_filter, '&amp;start=', $newstart, '&amp;max=', $max, '" class="icon-rarrow"></a>';
}
}
@@ -205,11 +213,13 @@ if ($search) {
echo '</td>';
echo '<td>', WT_I18N::translate('Page %s of %s', $currentPage, $lastPage), '</td>';
echo '<td>';
- if ($TEXT_DIRECTION=='ltr') {
+ if ($TEXT_DIRECTION === 'ltr') {
if ($ct>$max) {
- if ($start+$max < $ct) {
- $newstart = $start+$count;
- if ($start<0) $start = 0;
+ if ($start + $max < $ct) {
+ $newstart = $start + $count;
+ if ($start < 0) {
+ $start = 0;
+ }
echo '<a href="medialist.php?action=no&amp;search=no&amp;folder=', rawurlencode($folder), '&amp;sortby=', $sortby, '&amp;subdirs=', $subdirs, '&amp;filter=', rawurlencode($filter), '&amp;columns=', $columns, '&amp;apply_filter=', $apply_filter, '&amp;start=', $newstart, '&amp;max=', $max, '" class="icon-rarrow"></a>';
}
if ($currentPage < $lastPage) {
@@ -218,10 +228,12 @@ if ($search) {
}
}
} else {
- if ($ct>$max) {
- if ($start>0) {
- $newstart = $start-$max;
- if ($start<0) $start = 0;
+ if ($ct > $max) {
+ if ($start > 0) {
+ $newstart = $start - $max;
+ if ($start < 0) {
+ $start = 0;
+ }
echo '<a href="medialist.php?action=no&amp;search=no&amp;folder=', rawurlencode($folder), '&amp;sortby=', $sortby, '&amp;subdirs=', $subdirs, '&amp;filter=', rawurlencode($filter), '&amp;columns=', $columns, '&amp;apply_filter=', $apply_filter, '&amp;start=', $newstart, '&amp;max=', $max, '" class="icon-larrow"></a>';
}
if ($currentPage > 1) {
@@ -239,8 +251,12 @@ if ($search) {
for ($i=$start, $n=0; $i<$start+$count; ++$i) {
$mediaobject = $medialist[$i];
- if ($columns == '1') echo '<td class="list_value_wrap width80">';
- if ($columns == '2') echo '<td class="list_value_wrap width50">';
+ if ($columns == '1') {
+ echo '<td class="list_value_wrap width80">';
+ }
+ if ($columns == '2') {
+ echo '<td class="list_value_wrap width50">';
+ }
echo '<table><tr><td style="vertical-align:top; white-space:normal;">';
echo $mediaobject->displayImage();