mirror of
https://github.com/flextype/flextype.git
synced 2025-08-12 16:14:16 +02:00
Flextype Admin Plugin: issue with routing next round of fixing #117
This commit is contained in:
@@ -755,12 +755,13 @@ class EntriesController extends Controller
|
||||
|
||||
public function getMediaList(string $entry, bool $path = false) : array
|
||||
{
|
||||
$base_url = \Slim\Http\Uri::createFromEnvironment(new \Slim\Http\Environment($_SERVER))->getBaseUrl();
|
||||
$files = [];
|
||||
foreach (array_diff(scandir(PATH['entries'] . '/' . $entry), ['..', '.']) as $file) {
|
||||
if (strpos($this->registry->get('settings.entries.media.accept_file_types'), $file_ext = substr(strrchr($file, '.'), 1)) !== false) {
|
||||
if (strpos($file, strtolower($file_ext), 1)) {
|
||||
if ($path) {
|
||||
$files[$this->router->pathFor('admin.site.index') . '/' . $entry . '/' . $file] = $this->router->pathFor('admin.site.index') . '/' . $entry . '/' . $file;
|
||||
$files[$base_url . '/' . $entry . '/' . $file] = $base_url . '/' . $entry . '/' . $file;
|
||||
} else {
|
||||
$files[$file] = $file;
|
||||
}
|
||||
|
@@ -2,9 +2,6 @@
|
||||
|
||||
namespace Flextype;
|
||||
|
||||
// Site
|
||||
$app->get('/', '')->setName('admin.site.index');
|
||||
|
||||
// UsersController
|
||||
$app->group('/' . $admin_route, function () use ($flextype, $app) {
|
||||
$app->get('/registration', 'UsersController:registration')->setName('admin.users.registration');
|
||||
|
Reference in New Issue
Block a user