This commit is contained in:
joyqi
2024-01-02 11:16:44 +08:00
committed by GitHub
parent f3299ecb8a
commit 77aebcbd0e
7 changed files with 22 additions and 6 deletions

View File

@@ -44,7 +44,14 @@ while ($parents->next()) {
$permalink = ltrim($permalink, '/');
$permalink = preg_replace("/\[([_a-z0-9-]+)[^\]]*\]/i", "{\\1}", $permalink);
if ($page->have()) {
$permalink = str_replace('{cid}', $page->cid, $permalink);
$permalink = preg_replace_callback(
"/\{(cid)\}/i",
function ($matches) use ($page) {
$key = $matches[1];
return $page->getRouterParam($key);
},
$permalink
);
}
$input = '<input type="text" id="slug" name="slug" autocomplete="off" value="' . htmlspecialchars($page->slug ?? '') . '" class="mono" />';
?>

View File

@@ -33,11 +33,14 @@ $post = \Widget\Contents\Post\Edit::alloc()->prepare();
$permalink = ltrim($permalink, '/');
$permalink = preg_replace("/\[([_a-z0-9-]+)[^\]]*\]/i", "{\\1}", $permalink);
if ($post->have()) {
$permalink = str_replace([
'{cid}', '{category}', '{year}', '{month}', '{day}'
], [
$post->cid, $post->category, $post->year, $post->month, $post->day
], $permalink);
$permalink = preg_replace_callback(
"/\{(cid|category|year|month|day)\}/i",
function ($matches) use ($post) {
$key = $matches[1];
return $post->getRouterParam($key);
},
$permalink
);
}
$input = '<input type="text" id="slug" name="slug" autocomplete="off" value="' . htmlspecialchars($post->slug ?? '') . '" class="mono" />';
?>

View File

@@ -56,6 +56,8 @@ class Admin extends Contents
$this->parentId = $this->request->filter('int')->get('parent', 0);
$this->stack = $this->getRows($this->getChildIds($this->parentId));
}
$this->row = reset($this->stack);
}
/**

View File

@@ -33,6 +33,7 @@ class Rows extends Contents
public function execute()
{
$this->stack = $this->getRows($this->orders, $this->parameter->ignore);
$this->row = reset($this->stack);
}
/**

View File

@@ -32,6 +32,7 @@ class Admin extends Metas
{
$this->parentId = $this->request->filter('int')->get('parent', 0);
$this->stack = $this->getRows($this->getChildIds($this->parentId));
$this->row = reset($this->stack);
}
/**

View File

@@ -34,5 +34,6 @@ class Related extends Metas
});
$this->stack = $this->getRows($ids);
$this->row = reset($this->stack);
}
}

View File

@@ -33,6 +33,7 @@ class Rows extends Metas
public function execute()
{
$this->stack = $this->getRows($this->orders, $this->parameter->ignore);
$this->row = reset($this->stack);
}
/**