Skip to content

Commit 47499c6

Browse files
authored
Merge pull request #13 from inceptphp/main
updating 0.1
2 parents c233fb5 + eb43ac2 commit 47499c6

42 files changed

Lines changed: 148 additions & 150 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

admin/AdminPackage.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,12 @@ public function error(
122122
$path = $request->getPath('string');
123123
//if not an admin path
124124
if ($path !== static::ROOT_PATH
125-
&& strpos((string) $path, static::ROOT_PATH . '/') !== 0
125+
&& strpos($path, static::ROOT_PATH . '/') !== 0
126126
) {
127127
return;
128128
}
129129

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

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

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

347347
//shorten file
348348
$data['short_file'] = basename($data['file']);
349-
if (strpos((string) $data['file'], INCEPT_CWD) === 0) {
349+
if (strpos($data['file'], INCEPT_CWD) === 0) {
350350
$data['short_file'] = substr($data['file'], strlen(INCEPT_CWD));
351351
}
352352

@@ -373,7 +373,7 @@ protected function errorDebug(
373373

374374
//shorten file
375375
$trace['short_file'] = basename($trace['file']);
376-
if (strpos((string) $data['file'], INCEPT_CWD) === 0) {
376+
if (strpos($data['file'], INCEPT_CWD) === 0) {
377377
$trace['short_file'] = substr($trace['file'], strlen(INCEPT_CWD) + 1);
378378
}
379379

admin/assets/script/_fields.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -525,8 +525,7 @@
525525
//INITITALIZERS
526526
var initTag = function (filter) {
527527
$('a.remove', filter).click(function () {
528-
console.log(filter[0])
529-
filter.remove();
528+
filter.remove();
530529
});
531530

532531
$('a.move-up', filter).click(function () {
@@ -1558,7 +1557,6 @@
15581557
});
15591558

15601559
if ($(target).data('use-select2')) {
1561-
console.log(target)
15621560
$(target).select2();
15631561
}
15641562
}

admin/controller/collection.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
//----------------------------//
5757
// 2. Render Template
5858
$template = dirname(__DIR__) . '/template/collection';
59-
if (is_dir($response->get('page', 'template_root'))) {
59+
if (is_dir($response->get('page', 'template_root') ?? '')) {
6060
$template = $response->get('page', 'template_root');
6161
}
6262

@@ -136,7 +136,7 @@
136136
//----------------------------//
137137
// 2. Render Template
138138
$template = dirname(__DIR__) . '/template/collection';
139-
if (is_dir($response->get('page', 'template_root'))) {
139+
if (is_dir($response->get('page', 'template_root') ?? '')) {
140140
$template = $response->get('page', 'template_root');
141141
}
142142

@@ -230,7 +230,7 @@
230230
//----------------------------//
231231
// 2. Render Template
232232
$template = dirname(__DIR__) . '/template/collection';
233-
if (is_dir($response->get('page', 'template_root'))) {
233+
if (is_dir($response->get('page', 'template_root') ?? '')) {
234234
$template = $response->get('page', 'template_root');
235235
}
236236

@@ -373,7 +373,7 @@
373373
//----------------------------//
374374
// 2. Render Template
375375
$template = dirname(__DIR__) . '/template/object';
376-
if (is_dir($response->get('page', 'template_root'))) {
376+
if (is_dir($response->get('page', 'template_root') ?? '')) {
377377
$template = $response->get('page', 'template_root');
378378
}
379379

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

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

admin/controller/field.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@
207207
//----------------------------//
208208
// 2. Render Template
209209
$template = dirname(__DIR__) . '/template/field';
210-
if (is_dir($response->get('page', 'template_root'))) {
210+
if (is_dir($response->get('page', 'template_root') ?? '')) {
211211
$template = $response->get('page', 'template_root');
212212
}
213213

admin/controller/fieldset.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
$data['title'] = $this('lang')->translate('Fieldsets');
5454

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

@@ -113,7 +113,7 @@
113113
//----------------------------//
114114
// 2. Render Template
115115
$template = dirname(__DIR__) . '/template/fieldset';
116-
if (is_dir($response->get('page', 'template_root'))) {
116+
if (is_dir($response->get('page', 'template_root') ?? '')) {
117117
$template = $response->get('page', 'template_root');
118118
}
119119

@@ -180,7 +180,7 @@
180180
$data = $request->getPost();
181181

182182
//if detail has no value make it null
183-
if (isset($data['detail']) && !trim((string) $data['detail'])) {
183+
if (isset($data['detail']) && !trim($data['detail'])) {
184184
$data['detail'] = null;
185185
}
186186

@@ -238,7 +238,7 @@
238238
//----------------------------//
239239
// 2. Render Template
240240
$template = dirname(__DIR__) . '/template/fieldset';
241-
if (is_dir($response->get('page', 'template_root'))) {
241+
if (is_dir($response->get('page', 'template_root') ?? '')) {
242242
$template = $response->get('page', 'template_root');
243243
}
244244

@@ -302,7 +302,7 @@
302302
//----------------------------//
303303
// 2. Process Data
304304
$template = dirname(__DIR__) . '/template/fieldset';
305-
if (is_dir($response->get('page', 'template_root'))) {
305+
if (is_dir($response->get('page', 'template_root') ?? '')) {
306306
$template = $response->get('page', 'template_root');
307307
}
308308

@@ -469,7 +469,7 @@
469469
//----------------------------//
470470
// 2. Render Template
471471
$template = dirname(__DIR__) . '/template/fieldset';
472-
if (is_dir($response->get('page', 'template_root'))) {
472+
if (is_dir($response->get('page', 'template_root') ?? '')) {
473473
$template = $response->get('page', 'template_root');
474474
}
475475

@@ -496,7 +496,7 @@
496496
//get the content
497497
$fieldset = $request->getStage('fieldset');
498498
//get the type
499-
$type = substr($fieldset, 5, strpos((string) $fieldset, ';base64') - 5);
499+
$type = substr($fieldset, 5, strpos($fieldset, ';base64') - 5);
500500

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

506506
//decode the content
507507
$content = base64_decode(
508-
substr($fieldset, strpos((string) $fieldset, ';base64,') + 8)
508+
substr($fieldset, strpos($fieldset, ';base64,') + 8)
509509
);
510510

511511
//json file?
@@ -587,7 +587,7 @@
587587

588588
//root or not under fieldset?
589589
if ($filename === 'fieldset/'
590-
|| strpos((string) $filename, 'fieldset/') === false
590+
|| strpos($filename, 'fieldset/') === false
591591
) {
592592
continue;
593593
}
@@ -682,7 +682,7 @@
682682
//----------------------------//
683683
// 2. Render Template
684684
$template = dirname(__DIR__) . '/template/fieldset';
685-
if (is_dir($response->get('page', 'template_root'))) {
685+
if (is_dir($response->get('page', 'template_root') ?? '')) {
686686
$template = $response->get('page', 'template_root');
687687
}
688688

@@ -755,7 +755,7 @@
755755
//----------------------------//
756756
// 2. Render Template
757757
$template = dirname(__DIR__) . '/template/fieldset';
758-
if (is_dir($response->get('page', 'template_root'))) {
758+
if (is_dir($response->get('page', 'template_root') ?? '')) {
759759
$template = $response->get('page', 'template_root');
760760
}
761761

@@ -838,7 +838,7 @@
838838
//----------------------------//
839839
// 2. Render Template
840840
$template = dirname(__DIR__) . '/template/fieldset';
841-
if (is_dir($response->get('page', 'template_root'))) {
841+
if (is_dir($response->get('page', 'template_root') ?? '')) {
842842
$template = $response->get('page', 'template_root');
843843
}
844844

@@ -868,7 +868,7 @@
868868
$data = $request->getPost();
869869

870870
//if detail has no value make it null
871-
if (isset($data['detail']) && !trim((string) $data['detail'])) {
871+
if (isset($data['detail']) && !trim($data['detail'])) {
872872
$data['detail'] = null;
873873
}
874874

admin/controller/language.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
//----------------------------//
3636
// 2. Render Template
3737
$template = dirname(__DIR__) . '/template/language';
38-
if (is_dir($response->get('page', 'template_root'))) {
38+
if (is_dir($response->get('page', 'template_root') ?? '')) {
3939
$template = $response->get('page', 'template_root');
4040
}
4141

@@ -110,7 +110,7 @@
110110
//loop through the keys found
111111
foreach ($keys as $key) {
112112
//if blank key
113-
if (!trim((string) $key)) {
113+
if (!trim($key)) {
114114
//skip
115115
continue;
116116
}
@@ -143,7 +143,7 @@
143143
//----------------------------//
144144
// 2. Render Template
145145
$template = dirname(__DIR__) . '/template/language';
146-
if (is_dir($response->get('page', 'template_root'))) {
146+
if (is_dir($response->get('page', 'template_root') ?? '')) {
147147
$template = $response->get('page', 'template_root');
148148
}
149149

@@ -172,7 +172,7 @@
172172

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

@@ -292,7 +292,7 @@
292292
//----------------------------//
293293
// 2. Render Template
294294
$template = dirname(__DIR__) . '/template/language';
295-
if (is_dir($response->get('page', 'template_root'))) {
295+
if (is_dir($response->get('page', 'template_root') ?? '')) {
296296
$template = $response->get('page', 'template_root');
297297
}
298298

@@ -322,7 +322,7 @@
322322

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

@@ -393,7 +393,7 @@
393393
//----------------------------//
394394
// 2. Render Template
395395
$template = dirname(__DIR__) . '/template/object';
396-
if (is_dir($response->get('page', 'template_root'))) {
396+
if (is_dir($response->get('page', 'template_root') ?? '')) {
397397
$template = $response->get('page', 'template_root');
398398
}
399399

admin/controller/object.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
$data['title'] = $schema->getPlural('plural');
9191

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

@@ -310,7 +310,7 @@
310310
//----------------------------//
311311
// 2. Render Template
312312
$template = dirname(__DIR__) . '/template/object';
313-
if (is_dir($response->get('page', 'template_root'))) {
313+
if (is_dir($response->get('page', 'template_root') ?? '')) {
314314
$template = $response->get('page', 'template_root');
315315
}
316316

@@ -500,7 +500,7 @@
500500
//----------------------------//
501501
// 2. Render Template
502502
$template = dirname(__DIR__) . '/template/object';
503-
if (is_dir($response->get('page', 'template_root'))) {
503+
if (is_dir((string) $response->get('page', 'template_root') ?? '')) {
504504
$template = $response->get('page', 'template_root');
505505
}
506506

@@ -796,7 +796,7 @@
796796
//----------------------------//
797797
// 2. Render Template
798798
$template = dirname(__DIR__) . '/template/object';
799-
if (is_dir($response->get('page', 'template_root'))) {
799+
if (is_dir($response->get('page', 'template_root') ?? '')) {
800800
$template = $response->get('page', 'template_root');
801801
}
802802

@@ -910,7 +910,7 @@
910910
//----------------------------//
911911
// 2. Render Template
912912
$template = dirname(__DIR__) . '/template/object';
913-
if (is_dir($response->get('page', 'template_root'))) {
913+
if (is_dir($response->get('page', 'template_root') ?? '')) {
914914
$template = $response->get('page', 'template_root');
915915
}
916916

@@ -1060,7 +1060,7 @@
10601060
}
10611061

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

@@ -1186,7 +1186,7 @@
11861186
}
11871187

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

@@ -1359,7 +1359,7 @@
13591359
//----------------------------//
13601360
// 2. Render Template
13611361
$template = dirname(__DIR__) . '/template/object';
1362-
if (is_dir($response->get('page', 'template_root'))) {
1362+
if (is_dir($response->get('page', 'template_root') ?? '')) {
13631363
$template = $response->get('page', 'template_root');
13641364
}
13651365

0 commit comments

Comments
 (0)