mirror of
https://github.com/godotengine/godot-asset-library.git
synced 2025-12-31 21:48:29 +03:00
Get things out of /frontend, closes #28
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,5 +1,5 @@
|
||||
vendor/**
|
||||
logs/**
|
||||
logs/**/*.log
|
||||
src/settings-local.php
|
||||
|
||||
**/bower_components/**
|
||||
@@ -4,7 +4,8 @@ RewriteEngine On
|
||||
# If you need to use the `RewriteBase` directive, it should be the
|
||||
# absolute physical path to the directory that contains this htaccess file.
|
||||
#
|
||||
RewriteBase /asset-library/frontend
|
||||
|
||||
RewriteBase /asset-library
|
||||
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^ index.php [QSA,L]
|
||||
2
data/.htaccess
Normal file
2
data/.htaccess
Normal file
@@ -0,0 +1,2 @@
|
||||
Order allow,deny
|
||||
Deny from all
|
||||
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
$frontend = true;
|
||||
include(__DIR__ . '/../api/index.php');
|
||||
4
index.php
Normal file
4
index.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
$frontend = true;
|
||||
include(__DIR__ . '/api/index.php');
|
||||
|
||||
2
logs/.htaccess
Normal file
2
logs/.htaccess
Normal file
@@ -0,0 +1,2 @@
|
||||
Order allow,deny
|
||||
Deny from all
|
||||
@@ -1 +0,0 @@
|
||||
Your Slim Framework application's log files will be written to this directory.
|
||||
2
src/.htaccess
Normal file
2
src/.htaccess
Normal file
@@ -0,0 +1,2 @@
|
||||
Order allow,deny
|
||||
Deny from all
|
||||
@@ -48,7 +48,7 @@ if(isset($frontend) && $frontend) {
|
||||
|
||||
if(isset($result['url'])) {
|
||||
$response = new \Slim\Http\Response(303);
|
||||
$response = $response->withHeader('Location', dirname($request->getUri()->getBasePath()) . '/frontend/' . $result['url']);
|
||||
$response = $response->withHeader('Location', $request->getUri()->getBasePath() . '/' . $result['url']);
|
||||
} else {
|
||||
$template_names = [
|
||||
//'/configure' => 'configure',
|
||||
@@ -77,8 +77,8 @@ if(isset($frontend) && $frontend) {
|
||||
$errorResponse = new \Slim\Http\Response();
|
||||
$params = [
|
||||
'data' => $result,
|
||||
'basepath' => dirname($request->getUri()->getBasePath()) . '/frontend',
|
||||
'bowerpath' => dirname($request->getUri()->getBasePath()) . '/bower_components',
|
||||
'basepath' => $request->getUri()->getBasePath(). '',
|
||||
'bowerpath' => $request->getUri()->getBasePath() . '/bower_components',
|
||||
'path' => $path,
|
||||
'params' => $request->getQueryParams(),
|
||||
'categories' => [], // Filled later
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
|
||||
// Initializes the connection by sending all categories available
|
||||
$app->get('/configure', function ($request, $response, $args) {
|
||||
$app->get('/configure', function ($request, $response, $args) { global $frontend;
|
||||
$params = $request->getQueryParams();
|
||||
|
||||
$category_type = $this->constants['category_type']['addon'];
|
||||
@@ -28,7 +28,9 @@ $app->get('/configure', function ($request, $response, $args) {
|
||||
return $response->withJson([
|
||||
'categories' => $query->fetchAll(),
|
||||
'token' => $token,
|
||||
'login_url' => $_SERVER['HTTP_HOST'] . dirname($request->getUri()->getBasePath()) . 'frontend/login#' . urlencode($token),
|
||||
'login_url' => $_SERVER['HTTP_HOST'] .
|
||||
(isset($frontend) && $frontend ? dirname($request->getUri()->getBasePath()) : $request->getUri()->getBasePath()) .
|
||||
'/login#' . urlencode($token),
|
||||
// ^ TODO: Make those routes actually work
|
||||
], 200);
|
||||
|
||||
|
||||
2
templates/.htaccess
Normal file
2
templates/.htaccess
Normal file
@@ -0,0 +1,2 @@
|
||||
Order allow,deny
|
||||
Deny from all
|
||||
@@ -31,7 +31,7 @@
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/asset-library/frontend">Godot Asset Library</a>
|
||||
<a class="navbar-brand" href="<?php echo $basepath ?>">Godot Asset Library</a>
|
||||
</div>
|
||||
|
||||
<?php global $gPaths; $gPaths = [$basepath, $path]; function make_nav_link($name, $link='#') { global $gPaths; ?>
|
||||
|
||||
Reference in New Issue
Block a user