Revision 1718
Added by Luisehahne about 13 years ago
| admin.php | ||
|---|---|---|
| 4 | 4 |
* @category backend |
| 5 | 5 |
* @package modules |
| 6 | 6 |
* @author WebsiteBaker Project |
| 7 |
* @copyright 2009-2010, Website Baker Org. e.V.
|
|
| 7 |
* @copyright 2009-2012, WebsiteBaker Org. e.V.
|
|
| 8 | 8 |
* @link http://www.websitebaker2.org/ |
| 9 | 9 |
* @license http://www.gnu.org/licenses/gpl.html |
| 10 | 10 |
* @platform WebsiteBaker 2.8.x |
| ... | ... | |
| 13 | 13 |
* @filesource $HeadURL$ |
| 14 | 14 |
* @lastmodified $Date$ |
| 15 | 15 |
* |
| 16 |
*/ |
|
| 16 |
*/
|
|
| 17 | 17 |
|
| 18 | 18 |
// Stop this file being access directly |
| 19 | 19 |
if(defined('WB_PATH') == false)
|
| 20 | 20 |
{
|
| 21 |
die('<head><title>Access denied</title></head><body><h2 style="color:red;margin:3em auto;text-align:center;">Cannot access this file directly</h2></body></html>');
|
|
| 21 |
die('<h2 style="color:red;margin:3em auto;text-align:center;">Cannot access this file directly</h2>');
|
|
| 22 | 22 |
} |
| 23 | 23 |
|
| 24 | 24 |
// Get page id |
| ... | ... | |
| 53 | 53 |
// Get perms |
| 54 | 54 |
// unset($admin_header); |
| 55 | 55 |
|
| 56 |
$page = $admin->get_page_details($page_id,ADMIN_URL.'/pages/index.php' ); |
|
| 56 |
$page = $admin->get_page_details($page_id, ADMIN_URL.'/pages/index.php' );
|
|
| 57 | 57 |
|
| 58 | 58 |
$old_admin_groups = explode(',', str_replace('_', '', $page['admin_groups']));
|
| 59 | 59 |
$old_admin_users = explode(',', str_replace('_', '', $page['admin_users']));
|
| ... | ... | |
| 68 | 68 |
if((!$in_group) && !is_numeric(array_search($admin->get_user_id(), $old_admin_users))) {
|
| 69 | 69 |
print $admin->get_group_id().$admin->get_user_id(); |
| 70 | 70 |
// print_r ($old_admin_groups); |
| 71 |
$admin->print_error($MESSAGE['PAGES']['INSUFFICIENT_PERMISSIONS']);
|
|
| 71 |
$admin->print_error($MESSAGE['PAGES_INSUFFICIENT_PERMISSIONS']);
|
|
| 72 | 72 |
} |
| 73 | 73 |
|
| 74 | 74 |
// some additional security checks: |
| ... | ... | |
| 77 | 77 |
$section = $admin->get_section_details($section_id,ADMIN_URL.'/pages/index.php'); |
| 78 | 78 |
if (!$admin->get_permission($section['module'], 'module')) |
| 79 | 79 |
{
|
| 80 |
$admin->print_error($MESSAGE['PAGES']['INSUFFICIENT_PERMISSIONS']);
|
|
| 80 |
$admin->print_error($MESSAGE['PAGES_INSUFFICIENT_PERMISSIONS']);
|
|
| 81 | 81 |
} |
| 82 | 82 |
} |
| 83 | 83 |
|
| ... | ... | |
| 97 | 97 |
|
| 98 | 98 |
// Setup template object, parse vars to it, then parse it |
| 99 | 99 |
// Create new template object |
| 100 |
$template = new Template(dirname($admin->correct_theme_source('pages_modify.htt')));
|
|
| 100 |
$template = new Template(dirname($admin->correct_theme_source('pages_modify.htt')),'keep');
|
|
| 101 | 101 |
// $template->debug = true; |
| 102 | 102 |
$template->set_file('page', 'pages_modify.htt');
|
| 103 | 103 |
$template->set_block('page', 'main_block', 'main');
|
| ... | ... | |
| 116 | 116 |
|
| 117 | 117 |
$template->set_var(array( |
| 118 | 118 |
'MODIFIED_BY' => $user['display_name'], |
| 119 |
'TEXT_LAST_MODIFIED' => $TEXT['LAST_UPDATED_BY'], |
|
| 119 | 120 |
'MODIFIED_BY_USERNAME' => $user['username'], |
| 120 | 121 |
'MODIFIED_WHEN' => $modified_ts, |
| 121 |
'LAST_MODIFIED' => $MESSAGE['PAGES']['LAST_MODIFIED'], |
|
| 122 |
)); |
|
| 122 |
'LAST_MODIFIED' => $MESSAGE['PAGES_LAST_MODIFIED'], |
|
| 123 |
'TEXT_MANAGE_SECTIONS' => $HEADING['MANAGE_SECTIONS'] |
|
| 124 |
)); |
|
| 123 | 125 |
|
| 124 | 126 |
$template->set_block('main_block', 'show_modify_block', 'show_modify');
|
| 125 | 127 |
if($modified_ts == 'Unknown') |
| ... | ... | |
| 133 | 135 |
} |
| 134 | 136 |
|
| 135 | 137 |
// Work-out if we should show the "manage sections" link |
| 136 |
$sql = 'SELECT `section_id` FROM `'.TABLE_PREFIX.'sections` WHERE `page_id` = '.(int)$page_id.' '; |
|
| 137 |
$sql .= 'AND `module` = "menu_link"'; |
|
| 138 |
$query_sections = $database->query($sql); |
|
| 138 |
// $sql = 'SELECT `section_id` FROM `'.TABLE_PREFIX.'sections` WHERE `page_id` = '.(int)$page_id.' '; |
|
| 139 |
// $sql .= 'AND `module` = "menu_link"'; |
|
| 140 |
// $query_sections = $database->query($sql); |
|
| 141 |
/*-- workout if we should show the "manage sections" link ------------------------------*/ |
|
| 142 |
$sql = 'SELECT COUNT(*) FROM `'.TABLE_PREFIX.'sections` ' |
|
| 143 |
. 'WHERE `page_id`='.$page_id.' AND `module`=\'menu_link\''; |
|
| 144 |
$bIsMenuLink = (intval($database->get_one($sql)) != 0); |
|
| 145 |
// if(!$bIsMenuLink && (MANAGE_SECTIONS == true) && $admin->get_permission('pages_add') )
|
|
| 146 |
if((MANAGE_SECTIONS == true) && $admin->get_permission('pages_add') )
|
|
| 147 |
{
|
|
| 148 |
$template->set_var(array( |
|
| 149 |
'SECTIONS_LINK_BEFORE' => '<a href="'.ADMIN_URL.'/pages/sections.php?page_id='.$page['page_id'].'">', |
|
| 150 |
'SECTIONS_LINK_AFTER' => '</a>', |
|
| 151 |
'DISPLAY_MANAGE_SECTIONS' => 'link', |
|
| 152 |
)); |
|
| 153 |
}else {
|
|
| 154 |
// $oTpl->set_block('show_manage_sections', '');
|
|
| 155 |
$template->set_var(array( |
|
| 156 |
'SECTIONS_LINK_BEFORE' => '<span class="bold grey">', |
|
| 157 |
'SECTIONS_LINK_AFTER' => '</span>', |
|
| 158 |
'DISPLAY_MANAGE_SECTIONS' => 'link', |
|
| 159 |
)); |
|
| 160 |
} |
|
| 139 | 161 |
|
| 162 |
if( $admin->get_permission('pages_settings') )
|
|
| 163 |
{
|
|
| 164 |
$template->set_var(array( |
|
| 165 |
'SETTINGS_LINK_BEFORE' => '<a href="'.ADMIN_URL.'/pages/settings.php?page_id='.$page['page_id'].'">', |
|
| 166 |
'SETTINGS_LINK_AFTER' => '</a>', |
|
| 167 |
'DISPLAY_MANAGE_SETTINGS' => 'link', |
|
| 168 |
)); |
|
| 169 |
} else {
|
|
| 170 |
$template->set_var(array( |
|
| 171 |
'SETTINGS_LINK_BEFORE' => '<span class="bold grey">', |
|
| 172 |
'SETTINGS_LINK_AFTER' => '</span>', |
|
| 173 |
'DISPLAY_MANAGE_SECTIONS' => 'link', |
|
| 174 |
)); |
|
| 175 |
} |
|
| 176 |
/* |
|
| 140 | 177 |
$template->set_block('main_block', 'show_section_block', 'show_section');
|
| 141 | 178 |
if($query_sections->numRows() > 0) |
| 142 | 179 |
{
|
| ... | ... | |
| 154 | 191 |
$template->set_var('DISPLAY_MANAGE_SECTIONS', 'display:none;');
|
| 155 | 192 |
|
| 156 | 193 |
} |
| 157 |
|
|
| 194 |
*/ |
|
| 158 | 195 |
// Insert language TEXT |
| 159 | 196 |
$template->set_var(array( |
| 160 | 197 |
'TEXT_CURRENT_PAGE' => $TEXT['CURRENT_PAGE'], |
| ... | ... | |
| 173 | 210 |
{
|
| 174 | 211 |
$block_name = htmlentities(strip_tags($block[$section['block']])); |
| 175 | 212 |
} else {
|
| 176 |
if ($section['block'] == 1) |
|
| 177 |
{
|
|
| 213 |
if ($section['block'] == 1) {
|
|
| 178 | 214 |
$block_name = $TEXT['MAIN']; |
| 179 | 215 |
} else {
|
| 180 | 216 |
$block_name = '#' . (int) $section['block']; |
| ... | ... | |
| 182 | 218 |
} |
| 183 | 219 |
|
| 184 | 220 |
$sec_anchor = (defined( 'SEC_ANCHOR' ) && ( SEC_ANCHOR != '' ) ? 'id="'.SEC_ANCHOR.$section['section_id'].'"' : ''); |
| 185 |
print '<div class="section-info" '.$sec_anchor.' ><b>' . $TEXT['BLOCK'] . ': </b>' . $block_name;
|
|
| 221 |
print '<div class="section-info" ><b>' . $TEXT['BLOCK'] . ': </b>' . $block_name; |
|
| 186 | 222 |
print '<b> Modul: </b>' . $section['module']." "; |
| 187 |
print '<b> ID: </b>' . $section_id."</div>\n";
|
|
| 223 |
print '<b> ID: </b><a' . $section_id."></a></div>\n";
|
|
| 188 | 224 |
} |
| 189 | 225 |
|
| 190 | 226 |
} // |
Also available in: Unified diff
! update headerinfo
! change multi-dimensional arrays (variables) to similar arrays