1
0
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:
Awilum
2019-06-11 14:37:03 +03:00
parent c8915c4222
commit aa3bff58bf
2 changed files with 2 additions and 4 deletions

View File

@@ -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;
}

View 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');