Skip to content
Permalink
Browse files

Merge pull request #12 from area17/fix/prev-next-navigation

Correct Prev/Next navigation permissions
  • Loading branch information...
luislavena committed Feb 2, 2019
2 parents f9466b8 + 3487883 commit fcd7e59b670e5f3896d5fac5ff1f487b23feb57a
Showing with 26 additions and 18 deletions.
  1. +26 −18 engine/application/libraries/Subfolio.php
@@ -1440,16 +1440,20 @@ public function previous_link_or_span($name, $directory_name, $link_id, $class)
$items = Subfolio::$filebrowser->get_parent_file_folder_list(null, true);
$items = Subfolio::$filebrowser->sort($items);
$items = Subfolio::$filebrowser->prev_next_sort($items);
$prev = Subfolio::$filebrowser->get_prev($items, $folder);
$prev = Subfolio::$filebrowser->get_prev($items, $folder);
if ($prev <> "") {
$link = Filebrowser::double_encode_specialcharacters(urlencode($prev->name));
$link = str_replace('%2F', '/', $link);
$response = "<span id='$link_id' class='".$class."'>".$directory_name."</span>";
return "<a id='$link_id' href='$link'>$directory_name</a>";
} else {
return "<span id='$link_id' class='".$class."'>".$directory_name."</span>";
}
if ($prev <> "") {
if (!$prev->is_restricted()) {
$link = Filebrowser::double_encode_specialcharacters(urlencode($prev->name));
$link = str_replace('%2F', '/', $link);
$response = "<a id='$link_id' href='$link'>$directory_name</a>";
}
}
return $response;
}
}
}
@@ -1478,18 +1482,22 @@ public function next_link_or_span($name, $directory_name, $link_id, $class) {
$items = Subfolio::$filebrowser->get_parent_file_folder_list(null, true);
$items = Subfolio::$filebrowser->sort($items);
$items = Subfolio::$filebrowser->prev_next_sort($items);
$next = Subfolio::$filebrowser->get_next($items, $folder);
$next = Subfolio::$filebrowser->get_next($items, $folder);
if ($next <> "") {
$link = Filebrowser::double_encode_specialcharacters(urlencode($next->name));
$link = str_replace('%2F', '/', $link);
$response = "<span id='$link_id' class='".$class."'>".$directory_name."</span>";
return "<a id='$link_id' href='$link'>$directory_name</a>";
} else {
return "<span id='$link_id' class='".$class."'>".$directory_name."</span>";
}
}
}
if ($next <> "") {
if (!$next->is_restricted()) {
$link = Filebrowser::double_encode_specialcharacters(urlencode($next->name));
$link = str_replace('%2F', '/', $link);
$response = "<a id='$link_id' href='$link'>$directory_name</a>";
}
}
return $response;
}
}
}
public function updated_since_link_or_span($type)

0 comments on commit fcd7e59

Please sign in to comment.
You can’t perform that action at this time.