Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
taufik-nurrohman committed Feb 5, 2021
1 parent 52112b4 commit de738d3
Show file tree
Hide file tree
Showing 33 changed files with 1,146 additions and 1,092 deletions.
4 changes: 2 additions & 2 deletions panel/engine/f/route.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function __state($_) {
\_\lot\x\panel\to\fresh(\LOT . \DS . 'x' . \DS . 'panel' . \DS . 'state.php');
$_['form']['lot']['kick'] = $url . ($_['/'] = $def) . '/::g::/.state' . $url->query;
}
$_['lot'] = \array_replace_recursive($_['lot'] ?? [], require __DIR__ . \DS . '..' . \DS . 'r' . \DS . 'type' . \DS . 'state.php');
$_ = \array_replace_recursive($_ ?? [], require __DIR__ . \DS . '..' . \DS . 'r' . \DS . 'type' . \DS . 'state.php');
// `http://127.0.0.1/panel/::g::/.state`
if (1 === \count($_['chops'])) {
$panes = $paths = [];
Expand Down Expand Up @@ -122,7 +122,7 @@ function __state($_) {
}
return $zones;
}, '1 year');
$_['lot'] = \array_replace_recursive($_['lot'], [
$_['lot'] = \array_replace_recursive($_['lot'] ?? [], [
'bar' => [
'lot' => [
0 => [
Expand Down
6 changes: 3 additions & 3 deletions panel/engine/r/lot/page.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
'../' => ""
]);

if (is_file($lot = __DIR__ . DS . '..' . DS . 'type' . DS . $type . '.php')) {
return require $lot;
if (is_file($f = __DIR__ . DS . '..' . DS . 'type' . DS . $type . '.php')) {
$_ = (array) require $f;
}

return [ /* TODO: Error type does not exist */ ];
return $_;
4 changes: 3 additions & 1 deletion panel/engine/r/lot/page/.state.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
// `http://127.0.0.1/panel/::g::/.state`
$_['type'] = 'state';

return require __DIR__ . DS . '..' . DS . 'page.php';
$_ = require __DIR__ . DS . '..' . DS . 'page.php';

return $_;
4 changes: 2 additions & 2 deletions panel/engine/r/lot/page/comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
'page' => 'page/comment'
][pathinfo($_['f'], PATHINFO_EXTENSION)] ?? $_['type'];

$lot = require __DIR__ . DS . '..' . DS . 'page.php';
$_ = require __DIR__ . DS . '..' . DS . 'page.php';

// TODO

return $lot;
return $_;
4 changes: 3 additions & 1 deletion panel/engine/r/lot/page/layout.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?php

$_ = require __DIR__ . DS . '..' . DS . 'page.php';

if ('post' !== $_['form']['type'] && 'php' === pathinfo($_['f'], PATHINFO_EXTENSION)) {
$_['alert']['warning'][md5(__FILE__)] = 'Unless you are very familiar with what you are doing, I advise you not to edit the layout files directly through the control panel interface. It might prevent your page from loading completely when you make some mistakes.';
}

return require __DIR__ . DS . '..' . DS . 'page.php';
return $_;
4 changes: 3 additions & 1 deletion panel/engine/r/lot/page/page.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@
'page' => 'page/page'
][pathinfo($_['f'], PATHINFO_EXTENSION)] ?? $_['type'];

return require __DIR__ . DS . '..' . DS . 'page.php';
$_ = require __DIR__ . DS . '..' . DS . 'page.php';

return $_;
4 changes: 3 additions & 1 deletion panel/engine/r/lot/page/tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@
'page' => 'page/tag'
][pathinfo($_['f'], PATHINFO_EXTENSION)] ?? $_['type'];

return require __DIR__ . DS . '..' . DS . 'page.php';
$_ = require __DIR__ . DS . '..' . DS . 'page.php';

return $_;
10 changes: 5 additions & 5 deletions panel/engine/r/lot/page/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
'page' => 'page/user'
][pathinfo($_['f'], PATHINFO_EXTENSION)] ?? $_['type'];

$lot = require __DIR__ . DS . '..' . DS . 'page.php';
$_ = require __DIR__ . DS . '..' . DS . 'page.php';

$status = $user['status'];
$i = $page['status'];
Expand All @@ -21,18 +21,18 @@
}

// No use. This field was added only to hide the `pass` data from file list
$lot['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['data']['lot']['fields']['lot']['pass'] = [
$_['lot']['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['data']['lot']['fields']['lot']['pass'] = [
'skip' => true,
'name' => 'data[pass]'
];

// No use. This field was added only to hide the `pass` data from file list
$lot['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['data']['lot']['fields']['lot']['token'] = [
$_['lot']['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['data']['lot']['fields']['lot']['token'] = [
'skip' => true,
'name' => 'data[token]'
];

// Modify user status list
$lot['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['data']['lot']['fields']['lot']['status']['lot'] = $any;
$_['lot']['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['data']['lot']['fields']['lot']['status']['lot'] = $any;

return $lot;
return $_;
6 changes: 3 additions & 3 deletions panel/engine/r/lot/page/x.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

$lot = require __DIR__ . DS . '..' . DS . 'page.php';
$_ = require __DIR__ . DS . '..' . DS . 'page.php';

$uses = [
'alert' => 1,
Expand All @@ -13,11 +13,11 @@
];

if (isset($uses[$_['chops'][1]])) {
$lot['desk']['lot']['form']['lot'][2]['lot']['fields']['lot'][0]['lot']['tasks']['lot']['l']['skip'] = true;
$_['lot']['desk']['lot']['form']['lot'][2]['lot']['fields']['lot'][0]['lot']['tasks']['lot']['l']['skip'] = true;
}

if ('post' !== $_['form']['type'] && 'php' === pathinfo($_['f'], PATHINFO_EXTENSION)) {
$_['alert']['warning'][md5(__FILE__)] = 'Unless you are very familiar with what you are doing, I advise you not to edit the extension files directly through the control panel interface. It might prevent your page from loading completely when you make some mistakes.';
}

return $lot;
return $_;
6 changes: 3 additions & 3 deletions panel/engine/r/lot/pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
'../' => ""
]);

if (is_file($lot = __DIR__ . DS . '..' . DS . 'type' . DS . $type . 's.php')) {
return require $lot;
if (is_file($f = __DIR__ . DS . '..' . DS . 'type' . DS . $type . 's.php')) {
$_ = (array) require $f;
}

return [ /* TODO: Error type does not exist */ ];
return $_;
16 changes: 8 additions & 8 deletions panel/engine/r/lot/pages/cache.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<?php

$lot = require __DIR__ . DS . 'trash.php';
$_ = require __DIR__ . DS . 'trash.php';

if (!empty($lot['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['files']['lot']['files']['lot'])) {
foreach ($lot['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['files']['lot']['files']['lot'] as $k => &$v) {
if (!empty($_['lot']['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['files']['lot']['files']['lot'])) {
foreach ($_['lot']['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['files']['lot']['files']['lot'] as $k => &$v) {
unset($v['tasks']['restore']);
}
}

$lot['desk']['lot']['form']['lot'][0]['lot']['tasks']['lot']['blob']['skip'] = true;
$lot['desk']['lot']['form']['lot'][0]['lot']['tasks']['lot']['file']['skip'] = true;
$lot['desk']['lot']['form']['lot'][0]['lot']['tasks']['lot']['folder']['skip'] = true;
$_['lot']['desk']['lot']['form']['lot'][0]['lot']['tasks']['lot']['blob']['skip'] = true;
$_['lot']['desk']['lot']['form']['lot'][0]['lot']['tasks']['lot']['file']['skip'] = true;
$_['lot']['desk']['lot']['form']['lot'][0]['lot']['tasks']['lot']['folder']['skip'] = true;

$lot['desk']['lot']['form']['lot'][0]['lot']['tasks']['lot']['l'] = [
$_['lot']['desk']['lot']['form']['lot'][0]['lot']['tasks']['lot']['l'] = [
'title' => 'Refresh',
'description' => 'Refresh all cache',
'icon' => 'M19,8L15,12H18A6,6 0 0,1 12,18C11,18 10.03,17.75 9.2,17.3L7.74,18.76C8.97,19.54 10.43,20 12,20A8,8 0 0,0 20,12H23M6,12A6,6 0 0,1 12,6C13,6 13.97,6.25 14.8,6.7L16.26,5.24C15.03,4.46 13.57,4 12,4A8,8 0 0,0 4,12H1L5,16L9,12',
Expand All @@ -26,4 +26,4 @@
'stack' => 10
];

return $lot;
return $_;
22 changes: 11 additions & 11 deletions panel/engine/r/lot/pages/comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
// `http://127.0.0.1/panel/::g::/comment/1`
$_['type'] = 'page';

$lot = require __DIR__ . DS . '..' . DS . 'pages.php';
$_ = require __DIR__ . DS . '..' . DS . 'pages.php';

$lot['desk']['lot']['form']['lot'][1]['title'] = ($r = false === strpos($_['path'], '/')) ? ['Recent %s', 'Comments'] : null;
$lot['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['pages']['title'] = 'Comments';
$_['lot']['desk']['lot']['form']['lot'][1]['title'] = ($r = false === strpos($_['path'], '/')) ? ['Recent %s', 'Comments'] : null;
$_['lot']['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['pages']['title'] = 'Comments';

$d = strtr($_['f'], [LOT . DS . 'comment' . DS => LOT . DS . 'page' . DS]);
if (!$r && $f = File::exist([
Expand All @@ -15,7 +15,7 @@
$d . '.page'
])) {
$page = new Page($f);
$lot['desk']['lot']['form']['lot'][1]['title'] = i('Page') . ': <a href="' . $url . $_['/'] . '/::g::/' . strtr($f, [LOT . DS => "", DS => '/']) . '">' . $page->title . '</a>';
$_['lot']['desk']['lot']['form']['lot'][1]['title'] = i('Page') . ': <a href="' . $url . $_['/'] . '/::g::/' . strtr($f, [LOT . DS => "", DS => '/']) . '">' . $page->title . '</a>';
}

$files = $pages = [];
Expand Down Expand Up @@ -110,17 +110,17 @@
$p = new Anemon($pages);
$pages = $p->sort($_['sort'], true)->chunk($_['chunk'], ($_['i'] ?? 1) - 1)->get();
unset($p);
$lot['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['pages']['lot']['pages']['lot'] = $pages;
$lot['desk']['lot']['form']['lot'][2]['lot']['pager']['count'] = $count;
$_['lot']['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['pages']['lot']['pages']['lot'] = $pages;
$_['lot']['desk']['lot']['form']['lot'][2]['lot']['pager']['count'] = $count;
}

$lot['desk']['lot']['form']['lot'][0]['lot']['tasks']['lot']['page']['url'] = $url . $_['/'] . '/::s::/' . $_['path'] . $url->query('&', [
$_['lot']['desk']['lot']['form']['lot'][0]['lot']['tasks']['lot']['page']['url'] = $url . $_['/'] . '/::s::/' . $_['path'] . $url->query('&', [
'tab' => false,
'type' => 'page/comment'
]) . $url->hash;

$lot['desk']['lot']['form']['lot'][0]['lot']['tasks']['lot']['parent']['skip'] = true;
$lot['desk']['lot']['form']['lot'][0]['lot']['tasks']['lot']['page']['skip'] = true;
$lot['desk']['lot']['form']['lot'][0]['lot']['tasks']['lot']['data']['skip'] = true;
$_['lot']['desk']['lot']['form']['lot'][0]['lot']['tasks']['lot']['parent']['skip'] = true;
$_['lot']['desk']['lot']['form']['lot'][0]['lot']['tasks']['lot']['page']['skip'] = true;
$_['lot']['desk']['lot']['form']['lot'][0]['lot']['tasks']['lot']['data']['skip'] = true;

return $lot;
return $_;
15 changes: 8 additions & 7 deletions panel/engine/r/lot/pages/layout.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

$zip = extension_loaded('zip');

// `http://127.0.0.1/panel/::g::/layout/1`
$lot = require __DIR__ . DS . '..' . DS . 'pages.php';

$_ = require __DIR__ . DS . '..' . DS . 'pages.php';

$zip = extension_loaded('zip');

if (1 === count($_['chops'])) {
$lot['desk']['lot']['form']['lot'][0]['lot']['tasks']['lot']['import'] = [
$_['lot']['desk']['lot']['form']['lot'][0]['lot']['tasks']['lot']['import'] = [
'active' => $zip,
'title' => 'Replace',
'description' => 'Replace layout files with the new ones.',
Expand Down Expand Up @@ -35,7 +36,7 @@
] as $p) {
$lot['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['files']['lot']['files']['lot'][$p]['skip'] = true;
}
$lot['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['info'] = [
$_['lot']['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['info'] = [
'title' => 'Info',
'lot' => [
0 => [
Expand All @@ -50,7 +51,7 @@
];
}
if (is_file($f = $d . DS . 'LICENSE')) {
$lot['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['license'] = [
$_['lot']['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['license'] = [
'icon' => false === strpos(file_get_contents($f), '://fsf.org') ? 'M9 10A3.04 3.04 0 0 1 12 7A3.04 3.04 0 0 1 15 10A3.04 3.04 0 0 1 12 13A3.04 3.04 0 0 1 9 10M12 19L16 20V16.92A7.54 7.54 0 0 1 12 18A7.54 7.54 0 0 1 8 16.92V20M12 4A5.78 5.78 0 0 0 7.76 5.74A5.78 5.78 0 0 0 6 10A5.78 5.78 0 0 0 7.76 14.23A5.78 5.78 0 0 0 12 16A5.78 5.78 0 0 0 16.24 14.23A5.78 5.78 0 0 0 18 10A5.78 5.78 0 0 0 16.24 5.74A5.78 5.78 0 0 0 12 4M20 10A8.04 8.04 0 0 1 19.43 12.8A7.84 7.84 0 0 1 18 15.28V23L12 21L6 23V15.28A7.9 7.9 0 0 1 4 10A7.68 7.68 0 0 1 6.33 4.36A7.73 7.73 0 0 1 12 2A7.73 7.73 0 0 1 17.67 4.36A7.68 7.68 0 0 1 20 10Z' : null,
'lot' => [
0 => [
Expand All @@ -64,4 +65,4 @@
}
}

return $lot;
return $_;
10 changes: 5 additions & 5 deletions panel/engine/r/lot/pages/page.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
// `http://127.0.0.1/panel/::g::/page/1`
$_['type'] = 'page';

$lot = require __DIR__ . DS . '..' . DS . 'pages.php';
$_ = require __DIR__ . DS . '..' . DS . 'pages.php';

$g = 1 !== $user['status'];
$author = $user->user;
$comments = null !== State::get('x.comment');

if (isset($lot['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['pages']['lot']['pages']['lot'])) {
if (isset($_['lot']['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['pages']['lot']['pages']['lot'])) {
$before = $url . $_['/'] . '/::';
foreach ($lot['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['pages']['lot']['pages']['lot'] as $k => &$v) {
foreach ($_['lot']['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['pages']['lot']['pages']['lot'] as $k => &$v) {
$after = '::' . strtr($k, [
LOT => "",
DS => '/'
Expand All @@ -37,9 +37,9 @@
}
}

$lot['desk']['lot']['form']['lot'][0]['lot']['tasks']['lot']['page']['url'] = $url . $_['/'] . '/::s::/' . $_['path'] . $url->query('&', [
$_['lot']['desk']['lot']['form']['lot'][0]['lot']['tasks']['lot']['page']['url'] = $url . $_['/'] . '/::s::/' . $_['path'] . $url->query('&', [
'tab' => false,
'type' => 'page/page'
]) . $url->hash;

return $lot;
return $_;
14 changes: 7 additions & 7 deletions panel/engine/r/lot/pages/tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
// `http://127.0.0.1/panel/::g::/tag/1`
$_['type'] = 'page';

$lot = require __DIR__ . DS . '..' . DS . 'pages.php';
$_ = require __DIR__ . DS . '..' . DS . 'pages.php';

$g = 1 !== $user['status'];
$author = $user->user;

if (isset($lot['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['pages']['lot']['pages']['lot'])) {
foreach ($lot['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['pages']['lot']['pages']['lot'] as $k => &$v) {
if (isset($_['lot']['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['pages']['lot']['pages']['lot'])) {
foreach ($_['lot']['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['pages']['lot']['pages']['lot'] as $k => &$v) {
unset($v['link'], $v['url']);
// Disable page children feature
$v['tasks']['enter']['skip'] = true;
Expand All @@ -20,11 +20,11 @@
}
}

$lot['desk']['lot']['form']['lot'][0]['lot']['tasks']['lot']['page']['title'] = 'Tag';
$lot['desk']['lot']['form']['lot'][0]['lot']['tasks']['lot']['page']['description'][1] = 'Tag';
$lot['desk']['lot']['form']['lot'][0]['lot']['tasks']['lot']['page']['url'] = $url . $_['/'] . '/::s::/' . $_['path'] . $url->query('&', [
$_['lot']['desk']['lot']['form']['lot'][0]['lot']['tasks']['lot']['page']['title'] = 'Tag';
$_['lot']['desk']['lot']['form']['lot'][0]['lot']['tasks']['lot']['page']['description'][1] = 'Tag';
$_['lot']['desk']['lot']['form']['lot'][0]['lot']['tasks']['lot']['page']['url'] = $url . $_['/'] . '/::s::/' . $_['path'] . $url->query('&', [
'tab' => false,
'type' => 'page/tag'
]) . $url->hash;

return $lot;
return $_;
16 changes: 8 additions & 8 deletions panel/engine/r/lot/pages/trash.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

$lot = require __DIR__ . DS . '..' . DS . 'pages.php';
$_ = require __DIR__ . DS . '..' . DS . 'pages.php';

if (!empty($lot['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['files']['lot']['files']['lot'])) {
if (!empty($_['lot']['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['files']['lot']['files']['lot'])) {
$root = 1 === count($_['chops']);
foreach ($lot['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['files']['lot']['files']['lot'] as $k => &$v) {
foreach ($_['lot']['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['files']['lot']['files']['lot'] as $k => &$v) {
unset($v['tasks']['g']);
if (isset($v['tasks']['l']['url']) && false !== strpos($v['tasks']['l']['url'], '&trash=')) {
$v['tasks']['l']['icon'] = 'M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19M8.46,11.88L9.87,10.47L12,12.59L14.12,10.47L15.53,11.88L13.41,14L15.53,16.12L14.12,17.53L12,15.41L9.88,17.53L8.47,16.12L10.59,14L8.46,11.88M15.5,4L14.5,3H9.5L8.5,4H5V6H19V4H15.5Z';
Expand All @@ -27,11 +27,11 @@
}
}

$lot['desk']['lot']['form']['lot'][0]['lot']['tasks']['lot']['blob']['skip'] = true;
$lot['desk']['lot']['form']['lot'][0]['lot']['tasks']['lot']['file']['skip'] = true;
$lot['desk']['lot']['form']['lot'][0]['lot']['tasks']['lot']['folder']['skip'] = true;
$_['lot']['desk']['lot']['form']['lot'][0]['lot']['tasks']['lot']['blob']['skip'] = true;
$_['lot']['desk']['lot']['form']['lot'][0]['lot']['tasks']['lot']['file']['skip'] = true;
$_['lot']['desk']['lot']['form']['lot'][0]['lot']['tasks']['lot']['folder']['skip'] = true;

$lot['desk']['lot']['form']['lot'][0]['lot']['tasks']['lot']['l'] = [
$_['lot']['desk']['lot']['form']['lot'][0]['lot']['tasks']['lot']['l'] = [
'title' => 'Empty',
'description' => 'Empty the trash folder',
'icon' => 'M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z',
Expand All @@ -45,4 +45,4 @@
'stack' => 10
];

return $lot;
return $_;
Loading

0 comments on commit de738d3

Please sign in to comment.