hotfix for editor img uploads, formatting tweaks

beta
Are0h 3 years ago
commit c546aa7b63

@ -4,6 +4,7 @@ namespace brain\api\v1;
use brain\data\Member; use brain\data\Member;
use brain\data\Settings; use brain\data\Settings;
use brain\utility\FileUploader;
class ImagesAPI class ImagesAPI
{ {

@ -158,9 +158,9 @@ class DashControl
$page = $book->findPageById($uuid); $page = $book->findPageById($uuid);
$pageOptions = Sorting::page($page); $pageOptions = Sorting::page($page);
$preview = $preview =
$settings['global']['theme']. $settings['global']['theme'] .
'/'. '/' .
$page['layout']. $page['layout'] .
'.twig'; '.twig';
$html = $display->render($preview, $pageOptions); $html = $display->render($preview, $pageOptions);
$response->getBody()->write($html); $response->getBody()->write($html);

@ -5,7 +5,6 @@ namespace brain\init;
use brain\utility\HandleCors; use brain\utility\HandleCors;
use Slim\Factory\AppFactory; use Slim\Factory\AppFactory;
use Slim\Views\Twig; use Slim\Views\Twig;
// Fipamo Core Classes
use Slim\Views\TwigMiddleware; use Slim\Views\TwigMiddleware;
class App class App

@ -2,6 +2,7 @@
<html> <html>
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="theme-color" content="#FFFFFF"/>
<title> <title>
{% block title %} {% block title %}
{{ title }} {{ title }}

@ -37,9 +37,9 @@
{% block stylesheets %} {% block stylesheets %}
<link rel="stylesheet" type="text/css" href="/assets/css/dash.css?=vbhj"> <link rel="stylesheet" type="text/css" href="/assets/css/dash.css?=vbhj">
{% endblock %} {% endblock %}
{% block mainContent %} {% block mainContent %}
<div id="post-edit-index" data-index="{{ id }}" data-uuid="{{ uuid }}" data-slug="{{ slug }}" data-layout="{{ layout }}"> <div id="post-edit-index" data-index="{{ id }}" data-uuid="{{ uuid }}" data-slug="{{ slug }}" data-layout="{{ layout }}">
<div id="post-edit-index-wrapper"> <div id="post-edit-index-wrapper">
<div id="post-feature"> <div id="post-feature">
@ -174,8 +174,8 @@
</div> </div>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}
{% block javascripts %} {% block javascripts %}
<script src="/assets/scripts/Start.js?=erty" type="text/javascript"></script> <script src="/assets/scripts/Start.js?=dfdfvd" type="text/javascript"></script>
{% endblock %} {% endblock %}

@ -13,13 +13,13 @@
{{ title }} {{ title }}
{% endblock %} {% endblock %}
</title> </title>
<meta charset="UTF-8" /> <meta charset="UTF-8"/>
<meta name='viewport' content='width=device-width, initial-scale=1.0' /> <meta name='viewport' content='width=device-width, initial-scale=1.0'/>
<meta name="keywords" content="{{ info['keywords'] }}" /> <meta name="keywords" content="{{ info['keywords'] }}"/>
<meta name="description" content="{{info['description']}} " /> <meta name="description" content="{{info['description']}} "/>
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta property="og:image" content="{{info["image"]}}" /> <meta property="og:image" content="{{info["image"]}}"/>
<meta name="twitter:image" content="{{info["image"]}}" /> <meta name="twitter:image" content="{{info["image"]}}"/>
<link rel="stylesheet" type="text/css" href="{{ assetPath~"css/base.css?=dfvbghh" }}"> <link rel="stylesheet" type="text/css" href="{{ assetPath~"css/base.css?=dfvbghh" }}">
</head> </head>
<body> <body>
@ -65,7 +65,7 @@
{% apply spaceless %} {% apply spaceless %}
<div class="left"> <div class="left">
<a href="/" class="logo-link"> <a href="/" class="logo-link">
<img id="logo" src="{{ assetPath~"/images/global/the-logo.svg" }}" /> <img id="logo" src="{{ assetPath~"/images/global/the-logo.svg" }}"/>
</a> </a>
</div> </div>
<div class="right"> <div class="right">
@ -73,12 +73,12 @@
{% for link in menu %} {% for link in menu %}
{% if dynamicRender is defined %} {% if dynamicRender is defined %}
{% if dynamicRender == 'true' %} {% if dynamicRender == 'true' %}
<a href="{{"/"~link.slug}}" class="menu-link">{{link.title}}</a><br /> <a href="{{"/"~link.slug}}" class="menu-link">{{link.title}}</a><br/>
{% else %} {% else %}
<a href="{{"/"~link.slug~".html"}}" class="menu-link">{{link.title}}</a><br /> <a href="{{"/"~link.slug~".html"}}" class="menu-link">{{link.title}}</a><br/>
{% endif %} {% endif %}
{% else %} {% else %}
<a href="{{"/"~link.slug~".html"}}" class="menu-link">{{link.title}}</a><br /> <a href="{{"/"~link.slug~".html"}}" class="menu-link">{{link.title}}</a><br/>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% endif %} {% endif %}
@ -97,12 +97,12 @@
<div class="inner"> <div class="inner">
{% if dynamicRender is defined %} {% if dynamicRender is defined %}
{% if dynamicRender == 'true' %} {% if dynamicRender == 'true' %}
<a href="/archives">Archives</a><br /> <a href="/archives">Archives</a><br/>
{% else %} {% else %}
<a href="/archives.html">Archives</a><br /> <a href="/archives.html">Archives</a><br/>
{% endif %} {% endif %}
{% else %} {% else %}
<a href="/archives.html">Archives</a><br /> <a href="/archives.html">Archives</a><br/>
{% endif %} {% endif %}
© 2020 By Fipamo © 2020 By Fipamo
</div> </div>

@ -4,7 +4,7 @@
{{ title }} {{ title }}
{% endblock %} {% endblock %}
{% block mainContent %} {% block mainContent %}
<section> <section>
<div class="page-title"> <div class="page-title">
<span>{{title}}</span> <span>{{title}}</span>
@ -39,8 +39,11 @@
</div> </div>
<br/> <br/>
{{meta['who']}} dropped this {{ meta['when'] }}<br /> {{meta['who']}}
<strong>tags: </strong> dropped this
{{ meta['when'] }}<br/>
<strong>tags:
</strong>
{% for tag in meta['tags'] %} {% for tag in meta['tags'] %}
{% if dynamicRender is defined %} {% if dynamicRender is defined %}
{% if dynamicRender == 'true' %} {% if dynamicRender == 'true' %}
@ -56,4 +59,4 @@
</div> </div>
</div> </div>
</article> </article>
{% endblock %} {% endblock %}

@ -0,0 +1,156 @@
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="PHP_CodeSniffer" xsi:noNamespaceSchemaLocation="phpcs.xsd">
<description>The coding standard for PHP_CodeSniffer itself.</description>
<file>autoload.php</file>
<file>bin</file>
<file>scripts</file>
<file>src</file>
<file>tests</file>
<exclude-pattern>*/src/Standards/*/Tests/*\.(inc|css|js)$</exclude-pattern>
<exclude-pattern>*/tests/Core/*/*\.(inc|css|js)$</exclude-pattern>
<arg name="basepath" value="."/>
<arg name="colors"/>
<arg name="parallel" value="75"/>
<arg value="np"/>
<!-- Don't hide tokenizer exceptions -->
<rule ref="Internal.Tokenizer.Exception">
<type>error</type>
</rule>
<!-- Include the whole PEAR standard -->
<rule ref="PEAR">
<exclude name="PEAR.NamingConventions.ValidFunctionName"/>
<exclude name="PEAR.NamingConventions.ValidVariableName"/>
<exclude name="PEAR.Commenting.ClassComment"/>
<exclude name="PEAR.Commenting.FileComment.MissingCategoryTag"/>
<exclude name="PEAR.Commenting.FileComment.MissingPackageTag"/>
<exclude name="PEAR.Commenting.FileComment.MissingLinkTag"/>
<exclude name="PEAR.Commenting.FileComment.MissingVersion"/>
<exclude name="PEAR.Commenting.InlineComment"/>
</rule>
<!-- Include some sniffs from other standards that don't conflict with PEAR -->
<rule ref="Squiz.Arrays.ArrayBracketSpacing"/>
<rule ref="Squiz.Arrays.ArrayDeclaration"/>
<rule ref="Squiz.Commenting.ClosingDeclarationComment"/>
<rule ref="Squiz.ControlStructures.ControlSignature"/>
<rule ref="Squiz.ControlStructures.ElseIfDeclaration"/>
<rule ref="Squiz.Commenting.BlockComment"/>
<rule ref="Squiz.Commenting.DocCommentAlignment"/>
<rule ref="Squiz.Commenting.EmptyCatchComment"/>
<rule ref="Squiz.Commenting.InlineComment"/>
<rule ref="Squiz.Commenting.LongConditionClosingComment"/>
<rule ref="Squiz.Commenting.PostStatementComment"/>
<rule ref="Squiz.Commenting.VariableComment"/>
<rule ref="Squiz.Formatting.OperatorBracket"/>
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing"/>
<rule ref="Squiz.Operators.ComparisonOperatorUsage"/>
<rule ref="Squiz.PHP.DisallowInlineIf"/>
<rule ref="Squiz.Scope.MethodScope"/>
<rule ref="Squiz.Strings.ConcatenationSpacing">
<severity>0</severity>
</rule>
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing"/>
<rule ref="Squiz.WhiteSpace.FunctionClosingBraceSpace"/>
<rule ref="Squiz.WhiteSpace.FunctionSpacing"/>
<rule ref="Squiz.WhiteSpace.MemberVarSpacing"/>
<rule ref="Squiz.WhiteSpace.OperatorSpacing"/>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/>
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
<rule ref="Generic.Commenting.Todo"/>
<rule ref="Generic.ControlStructures.DisallowYodaConditions"/>
<rule ref="Generic.ControlStructures.InlineControlStructure"/>
<rule ref="Generic.Formatting.DisallowMultipleStatements"/>
<rule ref="Generic.Formatting.SpaceAfterCast"/>
<rule ref="Generic.NamingConventions.ConstructorName"/>
<rule ref="Generic.PHP.DeprecatedFunctions"/>
<rule ref="Generic.PHP.LowerCaseKeyword"/>
<rule ref="Generic.Strings.UnnecessaryStringConcat"/>
<rule ref="Generic.WhiteSpace.IncrementDecrementSpacing"/>
<rule ref="PSR2.Classes.PropertyDeclaration"/>
<rule ref="PSR2.Methods.MethodDeclaration"/>
<rule ref="PSR2.Files.EndFileNewline"/>
<rule ref="PSR12.Files.OpenTag"/>
<rule ref="Zend.Files.ClosingTag"/>
<!-- PEAR uses warnings for inline control structures, so switch back to errors -->
<rule ref="Generic.ControlStructures.InlineControlStructure">
<properties>
<property name="error" value="true"/>
</properties>
</rule>
<!-- We use custom indent rules for arrays -->
<rule ref="Generic.Arrays.ArrayIndent"/>
<rule ref="Squiz.Arrays.ArrayDeclaration.KeyNotAligned">
<severity>0</severity>
</rule>
<rule ref="Squiz.Arrays.ArrayDeclaration.ValueNotAligned">
<severity>0</severity>
</rule>
<rule ref="Squiz.Arrays.ArrayDeclaration.CloseBraceNotAligned">
<severity>0</severity>
</rule>
<rule ref="Squiz.Arrays.ArrayDeclaration.CloseBraceNewLine">
<severity>0</severity>
</rule>
<!-- Check var names, but we don't want leading underscores for private vars -->
<rule ref="Squiz.NamingConventions.ValidVariableName"/>
<rule ref="Squiz.NamingConventions.ValidVariableName.PrivateNoUnderscore">
<severity>0</severity>
</rule>
<!-- Only one argument per line in multi-line function calls -->
<rule ref="PEAR.Functions.FunctionCallSignature">
<properties>
<property name="allowMultipleArguments" value="false"/>
</properties>
</rule>
<!-- Have 12 chars padding maximum and always show as errors -->
<rule ref="Generic.Formatting.MultipleStatementAlignment">
<properties>
<property name="maxPadding" value="12"/>
<property name="error" value="true"/>
</properties>
</rule>
<!-- Ban some functions -->
<rule ref="Generic.PHP.ForbiddenFunctions">
<properties>
<property name="forbiddenFunctions" type="array">
<element key="sizeof" value="count"/>
<element key="delete" value="unset"/>
<element key="print" value="echo"/>
<element key="is_null" value="null"/>
<element key="create_function" value="null"/>
</property>
</properties>
</rule>
<!-- Private methods MUST not be prefixed with an underscore -->
<rule ref="PSR2.Methods.MethodDeclaration.Underscore">
<type>error</type>
</rule>
<!-- Private properties MUST not be prefixed with an underscore -->
<rule ref="PSR2.Classes.PropertyDeclaration.Underscore">
<type>error</type>
</rule>
<!-- The testing bootstrap file uses string concats to stop IDEs seeing the class aliases -->
<rule ref="Generic.Strings.UnnecessaryStringConcat">
<exclude-pattern>tests/bootstrap\.php</exclude-pattern>
</rule>
<!-- This test file specifically *needs* Windows line endings for testing purposes. -->
<rule ref="Generic.Files.LineEndings.InvalidEOLChar">
<exclude-pattern>tests/Core/Tokenizer/StableCommentWhitespaceWinTest\.php</exclude-pattern>
</rule>
</ruleset>

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save