Skip to content

Commit 99eb990

Browse files
Automaticize
1 parent bbc3331 commit 99eb990

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

engine/kernel/shield.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,17 @@ public static function cargo() {
2626
$results = array(
2727
'config' => $config,
2828
'speak' => $config->speak,
29-
'articles' => $config->articles,
30-
'article' => $config->article,
31-
'pages' => $config->pages,
32-
'page' => $config->page,
3329
'pager' => $config->pagination,
3430
'manager' => Guardian::happy(),
3531
'token' => $token,
3632
'messages' => Notify::read(false),
3733
'message' => Notify::read(false)
3834
);
35+
foreach(glob(POST . DS . '*', GLOB_NOSORT | GLOB_ONLYDIR) as $v) {
36+
$v = File::B($v);
37+
$results[$v . 's'] = isset($config->{$v . 's'}) ? $config->{$v . 's'} : false;
38+
$results[$v] = isset($config->{$v}) ? $config->{$v} : false;
39+
}
3940
Session::set(Guardian::$token, $token);
4041
unset($config, $token);
4142
self::$lot = array_merge(self::$lot, $results);

engine/plug/config.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
// Default(s)
4444
$config['page_title'] = $config['title'];
4545
$config['index_query'] = $config['tag_query'] = $config['archive_query'] = $config['search_query'] = "";
46-
$config['articles'] = $config['article'] = $config['pages'] = $config['page'] = $config['pagination'] = $config['cargo'] = false;
46+
$config['pages'] = $config['page'] = $config['pagination'] = $config['cargo'] = false;
4747

4848
$ss = array();
4949
$folders = array_merge(
@@ -52,7 +52,7 @@
5252
);
5353
foreach($folders as $folder) {
5454
$s = File::B($folder);
55-
$ss[$s][0] = glob($folder . DS . '*.*', GLOB_NOSORT);
55+
$ss[$s][0] = glob($folder . DS . '*.{archive,draft,hold,txt}', GLOB_NOSORT | GLOB_BRACE);
5656
$ss[$s][1] = glob($folder . DS . '*.txt', GLOB_NOSORT);
5757
$config[$s . 's_path'] = $ss[$s][1];
5858
$config['__' . $s . 's_path'] = $ss[$s][0];

0 commit comments

Comments
 (0)