@@ -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" />';
|
||||
?>
|
||||
|
||||
@@ -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" />';
|
||||
?>
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -34,5 +34,6 @@ class Related extends Metas
|
||||
});
|
||||
|
||||
$this->stack = $this->getRows($ids);
|
||||
$this->row = reset($this->stack);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user