Skip to content

Commit

Permalink
Merge pull request #13 from inceptphp/main
Browse files Browse the repository at this point in the history
updating 0.1
  • Loading branch information
cblanquera authored Jun 25, 2022
2 parents c233fb5 + eb43ac2 commit 47499c6
Show file tree
Hide file tree
Showing 42 changed files with 148 additions and 150 deletions.
10 changes: 5 additions & 5 deletions admin/AdminPackage.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ public function error(
$path = $request->getPath('string');
//if not an admin path
if ($path !== static::ROOT_PATH
&& strpos((string) $path, static::ROOT_PATH . '/') !== 0
&& strpos($path, static::ROOT_PATH . '/') !== 0
) {
return;
}

$debug = strpos((string) $path, static::ROOT_SPA . '/') === false ? 'page': 'spa';
$debug = strpos($path, static::ROOT_SPA . '/') === false ? 'page': 'spa';

//if it was a call for an actual file
if (preg_match('/\.[a-zA-Z0-9]{1,4}$/', $path)) {
Expand All @@ -136,7 +136,7 @@ public function error(

//if this is not an html page
$type = $response->getHeaders('Content-Type');
if (strpos((string) $type, 'html') === false) {
if (strpos($type, 'html') === false) {
//don't make it pretty
return $this->errorDebug($request, $response, $error, $debug);
}
Expand Down Expand Up @@ -346,7 +346,7 @@ protected function errorDebug(

//shorten file
$data['short_file'] = basename($data['file']);
if (strpos((string) $data['file'], INCEPT_CWD) === 0) {
if (strpos($data['file'], INCEPT_CWD) === 0) {
$data['short_file'] = substr($data['file'], strlen(INCEPT_CWD));
}

Expand All @@ -373,7 +373,7 @@ protected function errorDebug(

//shorten file
$trace['short_file'] = basename($trace['file']);
if (strpos((string) $data['file'], INCEPT_CWD) === 0) {
if (strpos($data['file'], INCEPT_CWD) === 0) {
$trace['short_file'] = substr($trace['file'], strlen(INCEPT_CWD) + 1);
}

Expand Down
4 changes: 1 addition & 3 deletions admin/assets/script/_fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,7 @@
//INITITALIZERS
var initTag = function (filter) {
$('a.remove', filter).click(function () {
console.log(filter[0])
filter.remove();
filter.remove();
});

$('a.move-up', filter).click(function () {
Expand Down Expand Up @@ -1558,7 +1557,6 @@
});

if ($(target).data('use-select2')) {
console.log(target)
$(target).select2();
}
}
Expand Down
10 changes: 5 additions & 5 deletions admin/controller/collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
//----------------------------//
// 2. Render Template
$template = dirname(__DIR__) . '/template/collection';
if (is_dir($response->get('page', 'template_root'))) {
if (is_dir($response->get('page', 'template_root') ?? '')) {
$template = $response->get('page', 'template_root');
}

Expand Down Expand Up @@ -136,7 +136,7 @@
//----------------------------//
// 2. Render Template
$template = dirname(__DIR__) . '/template/collection';
if (is_dir($response->get('page', 'template_root'))) {
if (is_dir($response->get('page', 'template_root') ?? '')) {
$template = $response->get('page', 'template_root');
}

Expand Down Expand Up @@ -230,7 +230,7 @@
//----------------------------//
// 2. Render Template
$template = dirname(__DIR__) . '/template/collection';
if (is_dir($response->get('page', 'template_root'))) {
if (is_dir($response->get('page', 'template_root') ?? '')) {
$template = $response->get('page', 'template_root');
}

Expand Down Expand Up @@ -373,7 +373,7 @@
//----------------------------//
// 2. Render Template
$template = dirname(__DIR__) . '/template/object';
if (is_dir($response->get('page', 'template_root'))) {
if (is_dir($response->get('page', 'template_root') ?? '')) {
$template = $response->get('page', 'template_root');
}

Expand Down Expand Up @@ -571,7 +571,7 @@
$data['title'] = $schema->getPlural('plural');

$template = dirname(__DIR__) . '/template/collection';
if (is_dir($response->get('page', 'template_root'))) {
if (is_dir($response->get('page', 'template_root') ?? '')) {
$template = $response->get('page', 'template_root');
}

Expand Down
2 changes: 1 addition & 1 deletion admin/controller/field.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
//----------------------------//
// 2. Render Template
$template = dirname(__DIR__) . '/template/field';
if (is_dir($response->get('page', 'template_root'))) {
if (is_dir($response->get('page', 'template_root') ?? '')) {
$template = $response->get('page', 'template_root');
}

Expand Down
26 changes: 13 additions & 13 deletions admin/controller/fieldset.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
$data['title'] = $this('lang')->translate('Fieldsets');

$template = dirname(__DIR__) . '/template/fieldset';
if (is_dir($response->get('page', 'template_root'))) {
if (is_dir($response->get('page', 'template_root') ?? '')) {
$template = $response->get('page', 'template_root');
}

Expand Down Expand Up @@ -113,7 +113,7 @@
//----------------------------//
// 2. Render Template
$template = dirname(__DIR__) . '/template/fieldset';
if (is_dir($response->get('page', 'template_root'))) {
if (is_dir($response->get('page', 'template_root') ?? '')) {
$template = $response->get('page', 'template_root');
}

Expand Down Expand Up @@ -180,7 +180,7 @@
$data = $request->getPost();

//if detail has no value make it null
if (isset($data['detail']) && !trim((string) $data['detail'])) {
if (isset($data['detail']) && !trim($data['detail'])) {
$data['detail'] = null;
}

Expand Down Expand Up @@ -238,7 +238,7 @@
//----------------------------//
// 2. Render Template
$template = dirname(__DIR__) . '/template/fieldset';
if (is_dir($response->get('page', 'template_root'))) {
if (is_dir($response->get('page', 'template_root') ?? '')) {
$template = $response->get('page', 'template_root');
}

Expand Down Expand Up @@ -302,7 +302,7 @@
//----------------------------//
// 2. Process Data
$template = dirname(__DIR__) . '/template/fieldset';
if (is_dir($response->get('page', 'template_root'))) {
if (is_dir($response->get('page', 'template_root') ?? '')) {
$template = $response->get('page', 'template_root');
}

Expand Down Expand Up @@ -469,7 +469,7 @@
//----------------------------//
// 2. Render Template
$template = dirname(__DIR__) . '/template/fieldset';
if (is_dir($response->get('page', 'template_root'))) {
if (is_dir($response->get('page', 'template_root') ?? '')) {
$template = $response->get('page', 'template_root');
}

Expand All @@ -496,7 +496,7 @@
//get the content
$fieldset = $request->getStage('fieldset');
//get the type
$type = substr($fieldset, 5, strpos((string) $fieldset, ';base64') - 5);
$type = substr($fieldset, 5, strpos($fieldset, ';base64') - 5);

//invalid file?
if ($type !== 'application/json' && $type !== 'application/zip') {
Expand All @@ -505,7 +505,7 @@

//decode the content
$content = base64_decode(
substr($fieldset, strpos((string) $fieldset, ';base64,') + 8)
substr($fieldset, strpos($fieldset, ';base64,') + 8)
);

//json file?
Expand Down Expand Up @@ -587,7 +587,7 @@

//root or not under fieldset?
if ($filename === 'fieldset/'
|| strpos((string) $filename, 'fieldset/') === false
|| strpos($filename, 'fieldset/') === false
) {
continue;
}
Expand Down Expand Up @@ -682,7 +682,7 @@
//----------------------------//
// 2. Render Template
$template = dirname(__DIR__) . '/template/fieldset';
if (is_dir($response->get('page', 'template_root'))) {
if (is_dir($response->get('page', 'template_root') ?? '')) {
$template = $response->get('page', 'template_root');
}

Expand Down Expand Up @@ -755,7 +755,7 @@
//----------------------------//
// 2. Render Template
$template = dirname(__DIR__) . '/template/fieldset';
if (is_dir($response->get('page', 'template_root'))) {
if (is_dir($response->get('page', 'template_root') ?? '')) {
$template = $response->get('page', 'template_root');
}

Expand Down Expand Up @@ -838,7 +838,7 @@
//----------------------------//
// 2. Render Template
$template = dirname(__DIR__) . '/template/fieldset';
if (is_dir($response->get('page', 'template_root'))) {
if (is_dir($response->get('page', 'template_root') ?? '')) {
$template = $response->get('page', 'template_root');
}

Expand Down Expand Up @@ -868,7 +868,7 @@
$data = $request->getPost();

//if detail has no value make it null
if (isset($data['detail']) && !trim((string) $data['detail'])) {
if (isset($data['detail']) && !trim($data['detail'])) {
$data['detail'] = null;
}

Expand Down
14 changes: 7 additions & 7 deletions admin/controller/language.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
//----------------------------//
// 2. Render Template
$template = dirname(__DIR__) . '/template/language';
if (is_dir($response->get('page', 'template_root'))) {
if (is_dir($response->get('page', 'template_root') ?? '')) {
$template = $response->get('page', 'template_root');
}

Expand Down Expand Up @@ -110,7 +110,7 @@
//loop through the keys found
foreach ($keys as $key) {
//if blank key
if (!trim((string) $key)) {
if (!trim($key)) {
//skip
continue;
}
Expand Down Expand Up @@ -143,7 +143,7 @@
//----------------------------//
// 2. Render Template
$template = dirname(__DIR__) . '/template/language';
if (is_dir($response->get('page', 'template_root'))) {
if (is_dir($response->get('page', 'template_root') ?? '')) {
$template = $response->get('page', 'template_root');
}

Expand Down Expand Up @@ -172,7 +172,7 @@

//----------------------------//
// 2. Validate Data
if (!isset($data['filename']) || !trim((string) $data['filename'])) {
if (!isset($data['filename']) || !trim($data['filename'])) {
return $response->setError(true, 'Language code is required');
}

Expand Down Expand Up @@ -292,7 +292,7 @@
//----------------------------//
// 2. Render Template
$template = dirname(__DIR__) . '/template/language';
if (is_dir($response->get('page', 'template_root'))) {
if (is_dir($response->get('page', 'template_root') ?? '')) {
$template = $response->get('page', 'template_root');
}

Expand Down Expand Up @@ -322,7 +322,7 @@

//----------------------------//
// 2. Validate Data
if (!isset($data['filename']) || !trim((string) $data['filename'])) {
if (!isset($data['filename']) || !trim($data['filename'])) {
return $response->setError(true, 'Language code is required');
}

Expand Down Expand Up @@ -393,7 +393,7 @@
//----------------------------//
// 2. Render Template
$template = dirname(__DIR__) . '/template/object';
if (is_dir($response->get('page', 'template_root'))) {
if (is_dir($response->get('page', 'template_root') ?? '')) {
$template = $response->get('page', 'template_root');
}

Expand Down
16 changes: 8 additions & 8 deletions admin/controller/object.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
$data['title'] = $schema->getPlural('plural');

$template = dirname(__DIR__) . '/template/object';
if (is_dir($response->get('page', 'template_root'))) {
if (is_dir($response->get('page', 'template_root') ?? '')) {
$template = $response->get('page', 'template_root');
}

Expand Down Expand Up @@ -310,7 +310,7 @@
//----------------------------//
// 2. Render Template
$template = dirname(__DIR__) . '/template/object';
if (is_dir($response->get('page', 'template_root'))) {
if (is_dir($response->get('page', 'template_root') ?? '')) {
$template = $response->get('page', 'template_root');
}

Expand Down Expand Up @@ -500,7 +500,7 @@
//----------------------------//
// 2. Render Template
$template = dirname(__DIR__) . '/template/object';
if (is_dir($response->get('page', 'template_root'))) {
if (is_dir((string) $response->get('page', 'template_root') ?? '')) {
$template = $response->get('page', 'template_root');
}

Expand Down Expand Up @@ -796,7 +796,7 @@
//----------------------------//
// 2. Render Template
$template = dirname(__DIR__) . '/template/object';
if (is_dir($response->get('page', 'template_root'))) {
if (is_dir($response->get('page', 'template_root') ?? '')) {
$template = $response->get('page', 'template_root');
}

Expand Down Expand Up @@ -910,7 +910,7 @@
//----------------------------//
// 2. Render Template
$template = dirname(__DIR__) . '/template/object';
if (is_dir($response->get('page', 'template_root'))) {
if (is_dir($response->get('page', 'template_root') ?? '')) {
$template = $response->get('page', 'template_root');
}

Expand Down Expand Up @@ -1060,7 +1060,7 @@
}

$template = dirname(__DIR__) . '/template/object';
if (is_dir($response->get('page', 'template_root'))) {
if (is_dir($response->get('page', 'template_root') ?? '')) {
$template = $response->get('page', 'template_root');
}

Expand Down Expand Up @@ -1186,7 +1186,7 @@
}

$template = dirname(__DIR__) . '/template/object';
if (is_dir($response->get('page', 'template_root'))) {
if (is_dir($response->get('page', 'template_root') ?? '')) {
$template = $response->get('page', 'template_root');
}

Expand Down Expand Up @@ -1359,7 +1359,7 @@
//----------------------------//
// 2. Render Template
$template = dirname(__DIR__) . '/template/object';
if (is_dir($response->get('page', 'template_root'))) {
if (is_dir($response->get('page', 'template_root') ?? '')) {
$template = $response->get('page', 'template_root');
}

Expand Down
Loading

0 comments on commit 47499c6

Please sign in to comment.