1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-21 13:52:35 +02:00

Fixes #1186 - Added edit button for custom pages. Improved debugging of shortcodes and shortcode wrappers.

This commit is contained in:
Cameron
2016-04-02 10:51:18 -07:00
parent ec3e92b0d6
commit 46b2518e82
5 changed files with 78 additions and 10 deletions

View File

@@ -533,6 +533,31 @@ class cpage_shortcodes extends e_shortcode
}
function sc_cpageedit($parm=array())
{
if(!ADMIN || !getperms('5'))
{
return null;
}
$tp = e107::getParser();
if(!empty($parm['modal']))
{
$modal = 'e-modal';
$iframe = '&iframe=1';
}
else
{
$modal = '';
$iframe = '';
}
$icon = deftrue('FONTAWESOME') ? $tp->toGlyph('fa-edit') : "<img src='".e_IMAGE_ABS."/admin_images/edit_16.png' alt='edit' style='border: 0px none; height: 16px; width: 16px;' />";
return "<a rel='external' title=\"".LAN_EDIT."\" data-modal-caption=\"".LAN_EDIT."\" class='btn btn-default ".$modal."' href='".e_ADMIN_ABS."cpage.php?action=edit&id=".$this->var['page_id'].$iframe."' >".$icon."</a>";
}
}

View File

@@ -9,7 +9,8 @@
*/
if (!defined('e107_INIT')) { exit; }
$PAGE_WRAPPER = array();
global $sc_style;
$sc_style['CPAGEAUTHOR|default']['pre'] = '';
@@ -49,8 +50,11 @@ $sc_style['CPAGENAV|default']['post'] = '</div>';
<div class="clear"><!-- --></div>
{CPAGERATING|default}
{CPAGEEDIT}
';
$PAGE_WRAPPER['default']['CPAGEEDIT'] = "<div class='text-right'>{---}</div>";
// used only when password authorization is required
$PAGE_TEMPLATE['default']['authorize'] = '
<div class="cpage-restrict ">