mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 09:19:22 +02:00
* added links to edit/delete/hide custom page directly from page
This commit is contained in:
parent
1610a4ab91
commit
72212f8256
@ -283,7 +283,7 @@ if($load_it)
|
||||
|
||||
$query =
|
||||
$db->query(
|
||||
'SELECT `title`, `body`, `php`' .
|
||||
'SELECT `id`, `title`, `body`, `php`, `hidden`' .
|
||||
' FROM `' . TABLE_PREFIX . 'pages`' .
|
||||
' WHERE `name` LIKE ' . $db->quote($page) . ' AND `hidden` != 1 AND `access` <= ' . $db->quote($logged_access));
|
||||
if($query->rowCount() > 0) // found page
|
||||
@ -323,6 +323,12 @@ if($load_it)
|
||||
}
|
||||
else
|
||||
$content .= $query['body']; // plain html
|
||||
|
||||
if(hasFlag(FLAG_CONTENT_PAGES) || superAdmin()) {
|
||||
$content = $twig->render('admin.pages.links.html.twig', array(
|
||||
'page' => array('id' => $query['id'], 'hidden' => $query['hidden'])
|
||||
)) . $content;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -56,7 +56,8 @@ if(!empty($action))
|
||||
}
|
||||
}
|
||||
else if($action == 'delete') {
|
||||
Pages::delete($id, $errors);
|
||||
if(Pages::delete($id, $errors))
|
||||
success('Page with id ' . $id . ' has been deleted');
|
||||
}
|
||||
else if($action == 'edit')
|
||||
{
|
||||
|
12
system/templates/admin.pages.links.html.twig
Normal file
12
system/templates/admin.pages.links.html.twig
Normal file
@ -0,0 +1,12 @@
|
||||
<div style="text-align: right;">
|
||||
<a href="admin/?p=pages&action=edit&id={{ page.id }}" title="Edit in Admin Panel" target="_blank">
|
||||
<img src="images/edit.png"/>Edit
|
||||
</a>
|
||||
<a id="delete" href="admin/?p=pages&action=delete&id={{ page.id }}" onclick="return confirm('Are you sure?');" title="Delete in Admin Panel" target="_blank">
|
||||
<img src="images/del.png"/>Delete
|
||||
</a>
|
||||
<a href="admin/?p=pages&action=hide&id={{ page.id }}" title="{% if page.hidden != 1 %}Hide{% else %}Show{% endif %} in Admin Panel" target="_blank">
|
||||
<img src="images/{% if page.hidden != 1 %}success{% else %}error{% endif %}.png"/>{% if page.hidden != 1 %}Hide{% else %}Show{% endif %}
|
||||
</a>
|
||||
<br/>
|
||||
</div>
|
Loading…
x
Reference in New Issue
Block a user