Updated templates to relative paths
This commit is contained in:
parent
b028bfc0d2
commit
1b639708b2
|
@ -13,8 +13,8 @@ $utopia->init(function () use ($layout, $utopia) {
|
|||
});
|
||||
|
||||
$utopia->shutdown(function() use ($utopia, $response, $request, $layout, $version) {
|
||||
$header = new View('../app/views/console/comps/header.phtml');
|
||||
$footer = new View('../app/views/console/comps/footer.phtml');
|
||||
$header = new View(__DIR__ . '/../../views/console/comps/header.phtml');
|
||||
$footer = new View(__DIR__ . '/../../views/console/comps/footer.phtml');
|
||||
|
||||
$layout
|
||||
->setParam('header', [$header])
|
||||
|
@ -38,7 +38,7 @@ $utopia->get('/error/:code')
|
|||
->param('code', null, new \Utopia\Validator\Numeric(), 'Valid status code number', false)
|
||||
->action(function($code) use ($layout)
|
||||
{
|
||||
$page = new View('../app/views/error.phtml');
|
||||
$page = new View(__DIR__ . '/../../views/error.phtml');
|
||||
|
||||
$page
|
||||
->setParam('code', $code)
|
||||
|
@ -54,7 +54,7 @@ $utopia->get('/console')
|
|||
->label('scope', 'console')
|
||||
->action(function() use ($layout)
|
||||
{
|
||||
$page = new View('../app/views/console/index.phtml');
|
||||
$page = new View(__DIR__ . '/../../views/console/index.phtml');
|
||||
|
||||
$layout
|
||||
->setParam('title', APP_NAME . ' - ' . Locale::getText('console.title'))
|
||||
|
@ -66,9 +66,9 @@ $utopia->get('/console/account')
|
|||
->label('scope', 'console')
|
||||
->action(function() use ($layout)
|
||||
{
|
||||
$page = new View('../app/views/console/account/index.phtml');
|
||||
$page = new View(__DIR__ . '/../../views/console/account/index.phtml');
|
||||
|
||||
$cc = new View('../app/views/console/forms/credit-card.phtml');
|
||||
$cc = new View(__DIR__ . '/../../views/console/forms/credit-card.phtml');
|
||||
|
||||
$page
|
||||
->setParam('cc', $cc)
|
||||
|
@ -85,7 +85,7 @@ $utopia->get('/console/notifications')
|
|||
->label('scope', 'console')
|
||||
->action(function() use ($layout)
|
||||
{
|
||||
$page = new View('../app/views/v1/console/notifications/index.phtml');
|
||||
$page = new View(__DIR__ . '/../../views/v1/console/notifications/index.phtml');
|
||||
|
||||
$layout
|
||||
->setParam('title', APP_NAME . ' - ' . Locale::getText('console.notifications.title'))
|
||||
|
@ -98,7 +98,7 @@ $utopia->get('/console/home')
|
|||
->label('scope', 'console')
|
||||
->action(function() use ($layout)
|
||||
{
|
||||
$page = new View('../app/views/console/home/index.phtml');
|
||||
$page = new View(__DIR__ . '/../../views/console/home/index.phtml');
|
||||
|
||||
$layout
|
||||
->setParam('title', APP_NAME . ' - ' . Locale::getText('console.home.title'))
|
||||
|
@ -111,7 +111,7 @@ $utopia->get('/console/platforms/web')
|
|||
->label('scope', 'console')
|
||||
->action(function() use ($layout)
|
||||
{
|
||||
$page = new View('../app/views/console/platforms/web.phtml');
|
||||
$page = new View(__DIR__ . '/../../views/console/platforms/web.phtml');
|
||||
|
||||
$layout
|
||||
->setParam('title', APP_NAME . ' - ' . Locale::getText('console.home.title'))
|
||||
|
@ -124,7 +124,7 @@ $utopia->get('/console/settings')
|
|||
->label('scope', 'console')
|
||||
->action(function() use ($layout)
|
||||
{
|
||||
$page = new View('../app/views/console/settings/index.phtml');
|
||||
$page = new View(__DIR__ . '/../../views/console/settings/index.phtml');
|
||||
|
||||
$layout
|
||||
->setParam('title', APP_NAME . ' - ' . Locale::getText('console.settings.title'))
|
||||
|
@ -137,7 +137,7 @@ $utopia->get('/console/database')
|
|||
->label('scope', 'console')
|
||||
->action(function() use ($layout)
|
||||
{
|
||||
$page = new View('../app/views/console/database/index.phtml');
|
||||
$page = new View(__DIR__ . '/../../views/console/database/index.phtml');
|
||||
|
||||
$layout
|
||||
->setParam('title', APP_NAME . ' - ' . Locale::getText('console.database.title'))
|
||||
|
@ -150,7 +150,7 @@ $utopia->get('/console/storage')
|
|||
->label('scope', 'console')
|
||||
->action(function() use ($layout)
|
||||
{
|
||||
$page = new View('../app/views/console/storage/index.phtml');
|
||||
$page = new View(__DIR__ . '/../../views/console/storage/index.phtml');
|
||||
|
||||
$layout
|
||||
->setParam('title', APP_NAME . ' - ' . Locale::getText('console.storage.title'))
|
||||
|
@ -163,7 +163,7 @@ $utopia->get('/console/users')
|
|||
->label('scope', 'console')
|
||||
->action(function() use ($layout, $providers)
|
||||
{
|
||||
$page = new View('../app/views/console/users/index.phtml');
|
||||
$page = new View(__DIR__ . '/../../views/console/users/index.phtml');
|
||||
|
||||
$page->setParam('providers', $providers);
|
||||
|
||||
|
@ -178,7 +178,7 @@ $utopia->get('/console/users/view')
|
|||
->label('scope', 'console')
|
||||
->action(function() use ($layout, $providers)
|
||||
{
|
||||
$page = new View('../app/views/console/users/view.phtml');
|
||||
$page = new View(__DIR__ . '/../../views/console/users/view.phtml');
|
||||
|
||||
$layout
|
||||
->setParam('title', APP_NAME . ' - ' . Locale::getText('console.users.title'))
|
||||
|
|
|
@ -33,7 +33,7 @@ $utopia->get('/auth/signin')
|
|||
->label('scope', 'home')
|
||||
->action(function() use ($layout)
|
||||
{
|
||||
$page = new View('../app/views/home/auth/signin.phtml');
|
||||
$page = new View(__DIR__ . '/../../views/home/auth/signin.phtml');
|
||||
|
||||
$layout
|
||||
->setParam('title', Locale::getText('home.auth.signin.title') . ' - ' . APP_NAME)
|
||||
|
@ -46,7 +46,7 @@ $utopia->get('/auth/signup')
|
|||
->label('scope', 'home')
|
||||
->action(function() use ($layout)
|
||||
{
|
||||
$page = new View('../app/views/home/auth/signup.phtml');
|
||||
$page = new View(__DIR__ . '/../../views/home/auth/signup.phtml');
|
||||
|
||||
$layout
|
||||
->setParam('title', Locale::getText('home.auth.signup.title') . ' - ' . APP_NAME)
|
||||
|
@ -59,7 +59,7 @@ $utopia->get('/auth/recovery')
|
|||
->label('scope', 'home')
|
||||
->action(function() use ($request, $layout)
|
||||
{
|
||||
$page = new View('../app/views/home/auth/recovery.phtml');
|
||||
$page = new View(__DIR__ . '/../../views/home/auth/recovery.phtml');
|
||||
|
||||
$layout
|
||||
->setParam('title', Locale::getText('home.auth.recovery.title') . ' - ' . APP_NAME)
|
||||
|
@ -72,7 +72,7 @@ $utopia->get('/auth/confirm')
|
|||
->label('scope', 'home')
|
||||
->action(function() use ($layout)
|
||||
{
|
||||
$page = new View('../app/views/home/auth/confirm.phtml');
|
||||
$page = new View(__DIR__ . '/../../views/home/auth/confirm.phtml');
|
||||
|
||||
$layout
|
||||
->setParam('title', Locale::getText('home.auth.confirm.title') . ' - ' . APP_NAME)
|
||||
|
@ -85,7 +85,7 @@ $utopia->get('/auth/join')
|
|||
->label('scope', 'home')
|
||||
->action(function() use ($layout)
|
||||
{
|
||||
$page = new View('../app/views/home/auth/join.phtml');
|
||||
$page = new View(__DIR__ . '/../../views/home/auth/join.phtml');
|
||||
|
||||
$layout
|
||||
->setParam('title', Locale::getText('home.auth.join.title') . ' - ' . APP_NAME)
|
||||
|
@ -98,7 +98,7 @@ $utopia->get('/auth/recovery/reset')
|
|||
->label('scope', 'home')
|
||||
->action(function() use ($layout)
|
||||
{
|
||||
$page = new View('../app/views/home/auth/recovery/reset.phtml');
|
||||
$page = new View(__DIR__ . '/../../views/home/auth/recovery/reset.phtml');
|
||||
|
||||
$layout
|
||||
->setParam('title', Locale::getText('home.auth.reset.title') . ' - ' . APP_NAME)
|
||||
|
@ -112,7 +112,7 @@ $utopia->get('/error/:code')
|
|||
->param('code', null, new \Utopia\Validator\Numeric(), 'Valid status code number', false)
|
||||
->action(function($code) use ($layout)
|
||||
{
|
||||
$page = new View('../app/views/error.phtml');
|
||||
$page = new View(__DIR__ . '/../../views/error.phtml');
|
||||
|
||||
$page
|
||||
->setParam('code', $code)
|
||||
|
|
|
@ -11,11 +11,11 @@ $roles = [
|
|||
'admin' => Locale::getText('general.roles.admin'),
|
||||
];
|
||||
|
||||
$layout = new View('../app/views/layouts/default.phtml');
|
||||
$layout = new View(__DIR__ . '/../../views/layouts/default.phtml');
|
||||
|
||||
/* AJAX check */
|
||||
if(!empty($request->getQuery('version', ''))) {
|
||||
$layout->setPath('../app/views/layouts/empty.phtml');
|
||||
$layout->setPath(__DIR__ . '/../../views/layouts/empty.phtml');
|
||||
}
|
||||
|
||||
$layout
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
<?php
|
||||
|
||||
// Init
|
||||
require_once __DIR__ . '/../vendor/autoload.php';
|
||||
if(file_exists(__DIR__ . '/../vendor/autoload.php')) {
|
||||
require_once __DIR__ . '/../vendor/autoload.php';
|
||||
}
|
||||
|
||||
use Utopia\App;
|
||||
use Utopia\Request;
|
||||
|
|
|
@ -24,11 +24,11 @@ $version = array_shift($path);
|
|||
switch ($version) { // Switch between API version
|
||||
case 'v1':
|
||||
$service = $version . '/' . array_shift($path);
|
||||
include '../app/app.php';
|
||||
include __DIR__ . '/../app/app.php';
|
||||
break;
|
||||
case 'console':
|
||||
default:
|
||||
$service = $version . '/';
|
||||
include '../app/app.php';
|
||||
include __DIR__ . '/../app/app.php';
|
||||
break;
|
||||
}
|
Loading…
Reference in a new issue