Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
taufik-nurrohman committed Feb 28, 2021
1 parent a1712e7 commit b1fbc0d
Show file tree
Hide file tree
Showing 12 changed files with 86 additions and 15 deletions.
2 changes: 1 addition & 1 deletion panel/.source/-/lot/asset/scss/index/lot/files.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
> * {
margin: 0 ($x / 8);
}
> .lot\:task {
> .lot\:tasks {
margin-right: (-$x / 4);
}
}
Expand Down
2 changes: 1 addition & 1 deletion panel/engine/r/task/l.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

if ('post' === $_['form']['type'] || empty($_['form']['lot']['token'])) {
// TODO: Show 404 page?
\Guard::kick(\str_replace('::l::', '::g::', $url->current));
\Guard::kick(\strtr($url->current, ['::l::' => '::g::']));
}

// Prevent user(s) from deleting file(s) above the `.\lot\*` level
Expand Down
6 changes: 3 additions & 3 deletions panel/engine/r/task/s.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function blob($_) {
$_['ff'][] = $f;
// Extract package
if (
!empty($_['form']['lot']['o']['extract']) &&
!empty($_['form']['lot']['options']['extract']) &&
\extension_loaded('zip') &&
('zip' === $x || 'application/zip' === $type)
) {
Expand All @@ -67,7 +67,7 @@ function blob($_) {
\DS => '/'
]) . \To::query([
'kick' => \explode('?', \str_replace('::s::', '::g::', $url->current), 2)[0] . '/1',
'let' => !empty($_['form']['lot']['o']['let']) ? 1 : false,
'let' => !empty($_['form']['lot']['options']['let']) ? 1 : false,
'token' => $_['token']
]);
}
Expand Down Expand Up @@ -181,7 +181,7 @@ function folder($_) {
} else {
\mkdir($f, \octdec($_['form']['lot']['folder']['seal'] ?? '0755'), true);
$_['alert']['success'][] = ['Folder %s successfully created.', '<code>' . \_\lot\x\panel\from\path($f) . '</code>'];
if (!empty($_['form']['lot']['o']['kick'])) {
if (!empty($_['form']['lot']['options']['kick'])) {
$_['kick'] = $_['form']['lot']['kick'] ?? $url . $_['/'] . '/::g::' . \strtr($f, [
\LOT => "",
\DS => '/'
Expand Down
2 changes: 1 addition & 1 deletion panel/engine/r/type/blob.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
'focus' => true,
'stack' => 10
],
'o' => [
'options' => [
'title' => "",
'type' => 'items',
'lot' => $items,
Expand Down
10 changes: 5 additions & 5 deletions panel/engine/r/type/blob/x.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@
}

// Force extract package
$_['lot']['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['blob']['lot']['fields']['lot']['o']['skip'] = true;
$_['lot']['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['blob']['lot']['fields']['lot']['o:extract'] = [
$_['lot']['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['blob']['lot']['fields']['lot']['options']['skip'] = true;
$_['lot']['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['blob']['lot']['fields']['lot']['options:extract'] = [
'type' => 'hidden',
'name' => 'o[extract]',
'name' => 'options[extract]',
'value' => 1
];

// Force delete package
$_['lot']['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['blob']['lot']['fields']['lot']['o:let'] = [
$_['lot']['desk']['lot']['form']['lot'][1]['lot']['tabs']['lot']['blob']['lot']['fields']['lot']['options:let'] = [
'type' => 'hidden',
'name' => 'o[let]',
'name' => 'options[let]',
'value' => 1
];

Expand Down
2 changes: 1 addition & 1 deletion panel/engine/r/type/folder.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
'width' => true,
'stack' => 10
],
'o' => [
'options' => [
'title' => "",
'type' => 'items',
'block' => true,
Expand Down
2 changes: 1 addition & 1 deletion panel/lot/asset/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -1532,7 +1532,7 @@ label.not\:active {
margin: 0 3px;
}

.lot\:files li > .lot\:task, .lot\:pages li > .lot\:task {
.lot\:files li > .lot\:tasks, .lot\:pages li > .lot\:tasks {
margin-right: -6px;
}

Expand Down
2 changes: 1 addition & 1 deletion panel/lot/asset/css/index.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test.panel/engine/f/route.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function __test($_) {
require __DIR__ . \DS . 'route' . \DS . 'files.php';
require __DIR__ . \DS . 'route' . \DS . 'fields.php';
require __DIR__ . \DS . 'route' . \DS . 'menu.php';
require __DIR__ . \DS . 'route' . \DS . 'pager.php';
require __DIR__ . \DS . 'route' . \DS . 'pages.php';
require __DIR__ . \DS . 'route' . \DS . 'section.php';
require __DIR__ . \DS . 'route' . \DS . 'separator.php';
Expand Down
16 changes: 16 additions & 0 deletions test.panel/engine/f/route/pager.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php namespace _\lot\x\panel\route\__test;

function pager($_) {
$_['title'] = 'Pager';
$lot = [
'pager-0' => [
'type' => 'pager',
'count' => 1000,
'chunk' => 10,
'current' => $_['i'] ?? 1,
'stack' => 10
]
];
$_['lot']['desk']['lot']['form']['lot'][1]['lot'] = $lot;
return $_;
}
54 changes: 54 additions & 0 deletions test.panel/engine/f/route/pages.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?php namespace _\lot\x\panel\route\__test;

function pages($_) {
$_['title'] = 'Pages';
$item = static function($title = null, $description = null, $type = 'page', $stack = 10) {
return [
'title' => $title,
'description' => $description,
'type' => $type,
'url' => '/',
'tasks' => [
0 => [
'title' => 'Task 1',
'description' => 'Task 1.',
'icon' => 'M5,3C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19H5V5H12V3H5M17.78,4C17.61,4 17.43,4.07 17.3,4.2L16.08,5.41L18.58,7.91L19.8,6.7C20.06,6.44 20.06,6 19.8,5.75L18.25,4.2C18.12,4.07 17.95,4 17.78,4M15.37,6.12L8,13.5V16H10.5L17.87,8.62L15.37,6.12Z',
'url' => '/',
'stack' => 10
],
1 => [
'title' => 'Task 2',
'description' => 'Task 2.',
'icon' => 'M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19M8,9H16V19H8V9M15.5,4L14.5,3H9.5L8.5,4H5V6H19V4H15.5Z',
'url' => '/',
'stack' => 20
]
],
'stack' => $stack
];
};
$lot = [
'pages' => [
'type' => 'pages',
'sort' => \Get::get('sort'),
'lot' => [
$item('Default Page Example', 'Page description goes here.', 'page', 10),
\array_replace($item('Page Example with Image', 'Image placeholder provided by <a href="https://placekitten.com" rel="nofollow" target="_blank">Placekitten</a> service.', 'page', 10.1), [
'image' => 'https://placekitten.com/100/100?image=3'
]),
\array_replace($item('Hidden Image View', 'Disabling the thumbnail view.', 'page', 10.2), [
'image' => false
]),
\array_replace($item('Disabled Page Example', 'Page description goes here.', 'page', 10.3), [
'active' => false
]),
\array_replace($item('Current Page Example', 'Page description goes here.', 'page', 20.1), [
'current' => true
])
],
'stack' => 10
]
];
$_['lot']['desk']['lot']['form']['lot'][1]['lot'] = $lot;
return $_;
}
2 changes: 1 addition & 1 deletion test.panel/engine/f/route/tabs.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function tabs($_) {
'lot' => [
'tabs-0' => $tabs_0,
'tabs-1' => $tabs_1,
'tabs-2' => $tabs_2,
'tabs-2' => $tabs_2
]
];
return $_;
Expand Down

0 comments on commit b1fbc0d

Please sign in to comment.