As simple as it gets. This Tweak adds:
1. "Go to Backend" Button
2. "New structure" (below active structure) button
3. "New article" (into active structure) button
Installation:
1. create "more_fe_links.php" and paste the code below
2. put the file into "template/inc_script/frontend_render/"
The box is only visible to logged in admin, also requires the frontend editor to be enabled
Code: Select all
<?php
// =========================================================================
//
// ADMIN-BOX V1.0
// 10.10.2011
// www.enym.com - Konstantin Schultes
//
// This script enhances the frontend-Editor. Just create a file like
// "more_fe_links.php" and put it into "template/inc_script/frontend_render/"
// Basic editing tasks will be much easier then! Enjoy :)
//
// What it does:
// Adds: "Go to Backend" Button
// Adds: "New structure" (below active structure) button
// Adds: "New article" (into active structure) button
//
//==========================================================================
// ----------------------------------------------------------------
// obligate check for phpwcms constants
if (!defined('PHPWCMS_ROOT')) {
die("You Cannot Access This Script Directly, Have a Nice Day."); }
// ----------------------------------------------------------------
if(FE_EDIT_LINK && $_SESSION['wcs_user_admin']=='1') {
//ADD SOME CSS for (THE ADMIN BOX
$block['custom_htmlhead']['mycss'] = '<style type="text/css">
#admin_box1 {
position: absolute;
right: 80px;
top: 3px;
color: white;
border: 1px solid #030;
padding: 3px;
background-position: center center;
background-repeat: no-repeat;
height: 16px;
width: 16px;
cursor: pointer;
z-index: 10000;
background-color:#8cb963;
}
#admin_box2 {
position: absolute;
right: 31px;
top: 3px;
color: white;
border: 1px solid #030;
padding: 3px;
background-position: center center;
background-repeat: no-repeat;
height: 16px;
width: 37px;
cursor: pointer;
z-index: 10000;
background-color:#fff58a;
}
</style>';
//ADD THE ADMIN BOX
$content['all'] .= '<div id="admin_box1"><a href="phpwcms.php?do=admin&p=6"><img src="img/famfamfam/action_go.gif" title="Administration" border="0"></a></div>';
$content['all'] .= '<div id="admin_box2"><a href="phpwcms.php?do=admin&p=6&struct='.$GLOBALS ['content']['cat_id'].'"><img src="img/famfamfam/page_white_add.gif" style="margin-right:3px;" title="New structure" border="0"></a>';
$content['all'] .= '<a href="phpwcms.php?do=articles&p=1&struct='.$GLOBALS ['content']['cat_id'].'"><img src="img/famfamfam/layout_add.png" title="New article" border="0"></a></div>';
}
?>