1
0
Fork 0
mirror of synced 2024-05-20 04:32:37 +12:00

fix: utopia view

This commit is contained in:
Torsten Dittmann 2021-12-14 10:11:34 +01:00
parent 3f0d4a64c0
commit a7ee99dcef
9 changed files with 61 additions and 39 deletions

View file

@ -5,7 +5,7 @@ require_once __DIR__.'/../init.php';
use Utopia\App;
use Utopia\Swoole\Request;
use Appwrite\Utopia\Response;
use Utopia\View;
use Appwrite\Utopia\View;
use Utopia\Exception;
use Utopia\Config\Config;
use Utopia\Domains\Domain;
@ -298,7 +298,7 @@ App::error(function ($error, $utopia, $request, $response, $layout, $project) {
/** @var Utopia\App $utopia */
/** @var Utopia\Swoole\Request $request */
/** @var Appwrite\Utopia\Response $response */
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
/** @var Utopia\Database\Document $project */
if ($error instanceof PDOException) {

View file

@ -7,7 +7,7 @@ App::init(function ($utopia, $request, $response, $layout) {
/** @var Utopia\App $utopia */
/** @var Utopia\Swoole\Request $request */
/** @var Appwrite\Utopia\Response $response */
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
/* AJAX check */
if (!empty($request->getQuery('version', ''))) {

View file

@ -1,14 +1,14 @@
<?php
use Appwrite\Utopia\View;
use Utopia\App;
use Utopia\View;
use Utopia\Config\Config;
use Utopia\Domains\Domain;
use Utopia\Database\Validator\UID;
use Utopia\Storage\Storage;
App::init(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$layout
->setParam('description', 'Appwrite Console allows you to easily manage, monitor, and control your entire backend API and tools.')
@ -18,7 +18,7 @@ App::init(function ($layout) {
App::shutdown(function ($response, $layout) {
/** @var Appwrite\Utopia\Response $response */
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$header = new View(__DIR__.'/../../views/console/comps/header.phtml');
$footer = new View(__DIR__.'/../../views/console/comps/footer.phtml');
@ -43,7 +43,7 @@ App::get('/error/:code')
->param('code', null, new \Utopia\Validator\Numeric(), 'Valid status code number', false)
->inject('layout')
->action(function ($code, $layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/error.phtml');
@ -62,7 +62,7 @@ App::get('/console')
->label('scope', 'console')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/console/index.phtml');
@ -81,7 +81,7 @@ App::get('/console/account')
->label('scope', 'console')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/console/account/index.phtml');
@ -102,7 +102,7 @@ App::get('/console/notifications')
->label('scope', 'console')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/v1/console/notifications/index.phtml');
@ -117,7 +117,7 @@ App::get('/console/home')
->label('scope', 'console')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/console/home/index.phtml');
$page
@ -133,7 +133,7 @@ App::get('/console/settings')
->label('scope', 'console')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$target = new Domain(App::getEnv('_APP_DOMAIN_TARGET', ''));
@ -157,7 +157,7 @@ App::get('/console/webhooks')
->label('scope', 'console')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/console/webhooks/index.phtml');
@ -176,7 +176,7 @@ App::get('/console/keys')
->label('scope', 'console')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$scopes = array_keys(Config::getParam('scopes'));
$page = new View(__DIR__.'/../../views/console/keys/index.phtml');
@ -194,7 +194,7 @@ App::get('/console/database')
->label('scope', 'console')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/console/database/index.phtml');
@ -212,7 +212,7 @@ App::get('/console/database/collection')
->inject('layout')
->action(function ($id, $response, $layout) {
/** @var Appwrite\Utopia\Response $response */
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$logs = new View(__DIR__.'/../../views/console/comps/logs.phtml');
@ -247,7 +247,7 @@ App::get('/console/database/document')
->param('collection', '', new UID(), 'Collection unique ID.')
->inject('layout')
->action(function ($collection, $layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$logs = new View(__DIR__.'/../../views/console/comps/logs.phtml');
@ -280,7 +280,7 @@ App::get('/console/database/document/new')
->param('collection', '', new UID(), 'Collection unique ID.')
->inject('layout')
->action(function ($collection, $layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/console/database/document.phtml');
@ -301,7 +301,7 @@ App::get('/console/storage')
->label('scope', 'console')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/console/storage/index.phtml');
$page
@ -321,7 +321,7 @@ App::get('/console/users')
->label('scope', 'console')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/console/users/index.phtml');
@ -342,7 +342,7 @@ App::get('/console/users/user')
->label('scope', 'console')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/console/users/user.phtml');
@ -357,7 +357,7 @@ App::get('/console/users/teams/team')
->label('scope', 'console')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/console/users/team.phtml');

View file

@ -3,15 +3,15 @@
use Appwrite\Specification\Format\OpenAPI3;
use Appwrite\Specification\Format\Swagger2;
use Appwrite\Specification\Specification;
use Appwrite\Utopia\View;
use Utopia\App;
use Utopia\View;
use Utopia\Config\Config;
use Utopia\Exception;
use Utopia\Validator\Range;
use Utopia\Validator\WhiteList;
App::init(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$header = new View(__DIR__.'/../../views/home/comps/header.phtml');
$footer = new View(__DIR__.'/../../views/home/comps/footer.phtml');
@ -32,7 +32,7 @@ App::init(function ($layout) {
App::shutdown(function ($response, $layout) {
/** @var Appwrite\Utopia\Response $response */
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$response->html($layout->render());
}, ['response', 'layout'], 'home');
@ -76,7 +76,7 @@ App::get('/auth/signin')
->label('scope', 'home')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/home/auth/signin.phtml');
@ -95,7 +95,7 @@ App::get('/auth/signup')
->label('scope', 'home')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/home/auth/signup.phtml');
$page
@ -113,7 +113,7 @@ App::get('/auth/recovery')
->label('scope', 'home')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/home/auth/recovery.phtml');
@ -132,7 +132,7 @@ App::get('/auth/confirm')
->label('scope', 'home')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/home/auth/confirm.phtml');
@ -147,7 +147,7 @@ App::get('/auth/join')
->label('scope', 'home')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/home/auth/join.phtml');
@ -162,7 +162,7 @@ App::get('/auth/recovery/reset')
->label('scope', 'home')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/home/auth/recovery/reset.phtml');
@ -177,7 +177,7 @@ App::get('/auth/oauth2/success')
->label('scope', 'home')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/home/auth/oauth2.phtml');
@ -195,7 +195,7 @@ App::get('/auth/magic-url')
->label('scope', 'home')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/home/auth/magicURL.phtml');
@ -213,7 +213,7 @@ App::get('/auth/oauth2/failure')
->label('scope', 'home')
->inject('layout')
->action(function ($layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/home/auth/oauth2.phtml');
@ -232,7 +232,7 @@ App::get('/error/:code')
->param('code', null, new \Utopia\Validator\Numeric(), 'Valid status code number', false)
->inject('layout')
->action(function ($code, $layout) {
/** @var Utopia\View $layout */
/** @var Appwrite\Utopia\View $layout */
$page = new View(__DIR__.'/../../views/error.phtml');

View file

@ -27,8 +27,8 @@ use Appwrite\Network\Validator\IP;
use Appwrite\Network\Validator\URL;
use Appwrite\OpenSSL\OpenSSL;
use Appwrite\Stats\Stats;
use Appwrite\Utopia\View;
use Utopia\App;
use Utopia\View;
use Utopia\Config\Config;
use Utopia\Locale\Locale;
use Utopia\Registry\Registry;

View file

@ -5,10 +5,10 @@ global $cli;
use Appwrite\Auth\Auth;
use Appwrite\Docker\Compose;
use Appwrite\Docker\Env;
use Appwrite\Utopia\View;
use Utopia\Analytics\GoogleAnalytics;
use Utopia\CLI\Console;
use Utopia\Config\Config;
use Utopia\View;
use Utopia\Validator\Text;
$cli

View file

@ -1,6 +1,6 @@
<?php
use Utopia\View;
use Appwrite\Utopia\View;
$collection = $this->getParam('collection', null);
$collections = $this->getParam('collections', []);

View file

@ -2,8 +2,8 @@
namespace Appwrite\Template;
use Appwrite\Utopia\View;
use Exception;
use Utopia\View;
class Template extends View
{

View file

@ -0,0 +1,22 @@
<?php
namespace Appwrite\Utopia;
use Utopia\View as OldView;
class View extends OldView
{
/**
* Escape
*
* Convert all applicable characters to HTML entities
*
* @param string $str
* @return string
* @deprecated Use print method with escape filter
*/
public function escape($str)
{
return \htmlentities($str, ENT_QUOTES, 'UTF-8');
}
}