Revision 1707
Added by Dietmar about 12 years ago
modify.php | ||
---|---|---|
3 | 3 |
* |
4 | 4 |
* @category admin |
5 | 5 |
* @package pages |
6 |
* @author WebsiteBaker Project |
|
7 |
* @copyright 2004-2009, Ryan Djurovich |
|
8 |
* @copyright 2009-2011, Website Baker Org. e.V. |
|
6 |
* @author Ryan Djurovich, WebsiteBaker Project |
|
7 |
* @copyright 2009-2012, WebsiteBaker Org. e.V. |
|
9 | 8 |
* @link http://www.websitebaker2.org/ |
10 | 9 |
* @license http://www.gnu.org/licenses/gpl.html |
11 | 10 |
* @platform WebsiteBaker 2.8.x |
... | ... | |
14 | 13 |
* @filesource $HeadURL$ |
15 | 14 |
* @lastmodified $Date$ |
16 | 15 |
* |
17 |
*/ |
|
16 |
*/
|
|
18 | 17 |
/* |
19 | 18 |
*/ |
20 | 19 |
// Create new admin object |
... | ... | |
48 | 47 |
|
49 | 48 |
// Get perms |
50 | 49 |
if(!$admin->get_page_permission($page_id,'admin')) { |
51 |
$admin->print_error($MESSAGE['PAGES']['INSUFFICIENT_PERMISSIONS']);
|
|
50 |
$admin->print_error($MESSAGE['PAGES_INSUFFICIENT_PERMISSIONS']);
|
|
52 | 51 |
} |
53 | 52 |
|
54 | 53 |
$sectionId = isset($_GET['wysiwyg']) ? htmlspecialchars($admin->get_get('wysiwyg')) : NULL; |
... | ... | |
67 | 66 |
// $ftan_module = $GLOBALS['ftan_module']; |
68 | 67 |
// Setup template object, parse vars to it, then parse it |
69 | 68 |
// Create new template object |
70 |
$template = new Template(dirname($admin->correct_theme_source('pages_modify.htt'))); |
|
69 |
$template = new Template(dirname($admin->correct_theme_source('pages_modify.htt')),'keep');
|
|
71 | 70 |
// $template->debug = true; |
72 | 71 |
$template->set_file('page', 'pages_modify.htt'); |
73 | 72 |
$template->set_block('page', 'main_block', 'main'); |
... | ... | |
88 | 87 |
'MODIFIED_BY' => $user['display_name'], |
89 | 88 |
'MODIFIED_BY_USERNAME' => $user['username'], |
90 | 89 |
'MODIFIED_WHEN' => $modified_ts, |
91 |
'LAST_MODIFIED' => $MESSAGE['PAGES']['LAST_MODIFIED'], |
|
90 |
// 'LAST_MODIFIED' => $MESSAGE['PAGES_LAST_MODIFIED'], |
|
91 |
'TEXT_LAST_MODIFIED' => $TEXT['LAST_UPDATED_BY'], |
|
92 |
'TEXT_MANAGE_SECTIONS' => $HEADING['MANAGE_SECTIONS'] |
|
92 | 93 |
)); |
93 | 94 |
|
94 | 95 |
$template->set_block('main_block', 'show_modify_block', 'show_modify'); |
... | ... | |
103 | 104 |
} |
104 | 105 |
|
105 | 106 |
// Work-out if we should show the "manage sections" link |
106 |
$sql = 'SELECT `section_id` FROM `'.TABLE_PREFIX.'sections` WHERE `page_id` = '.(int)$page_id.' '; |
|
107 |
$sql .= 'AND `module` = "menu_link"'; |
|
108 |
$query_sections = $database->query($sql); |
|
107 |
//$sql = 'SELECT `section_id` FROM `'.TABLE_PREFIX.'sections` WHERE `page_id` = '.(int)$page_id.' ';
|
|
108 |
//$sql .= 'AND `module` = "menu_link"';
|
|
109 |
//$query_sections = $database->query($sql);
|
|
109 | 110 |
|
111 |
if( $admin->get_permission('pages_settings') ) |
|
112 |
{ |
|
113 |
$template->set_var(array( |
|
114 |
'SETTINGS_LINK_BEFORE' => '<a href="'.ADMIN_URL.'/pages/settings.php?page_id='.$results_array['page_id'].'">', |
|
115 |
'SETTINGS_LINK_AFTER' => '</a>', |
|
116 |
'DISPLAY_MANAGE_SETTINGS' => 'link', |
|
117 |
)); |
|
118 |
} else { |
|
119 |
$template->set_var(array( |
|
120 |
'SETTINGS_LINK_BEFORE' => '<span class="bold grey">', |
|
121 |
'SETTINGS_LINK_AFTER' => '</span>', |
|
122 |
'DISPLAY_MANAGE_SECTIONS' => 'link', |
|
123 |
)); |
|
124 |
} |
|
125 |
|
|
126 |
/*-- workout if we should show the "manage sections" link ------------------------------*/ |
|
127 |
$sql = 'SELECT COUNT(*) FROM `'.TABLE_PREFIX.'sections` ' |
|
128 |
. 'WHERE `page_id`='.$page_id.' AND `module`=\'menu_link\''; |
|
129 |
$bIsMenuLink = (intval($database->get_one($sql)) != 0); |
|
130 |
// $oTpl->set_block('main_block', 'show_manage_sections_block', 'show_manage_sections'); |
|
131 |
// if(!$bIsMenuLink && (MANAGE_SECTIONS == true) && $admin->get_permission('pages_add') ) |
|
132 |
if((MANAGE_SECTIONS == true) && $admin->get_permission('pages_add') ) |
|
133 |
{ |
|
134 |
// $oTpl->parse('show_manage_sections', 'show_manage_sections_block', true); |
|
135 |
$template->set_var(array( |
|
136 |
'SECTIONS_LINK_BEFORE' => '<a href="'.ADMIN_URL.'/pages/sections.php?page_id='.$results_array['page_id'].'">', |
|
137 |
'SECTIONS_LINK_AFTER' => '</a>', |
|
138 |
'DISPLAY_MANAGE_SECTIONS' => 'link', |
|
139 |
)); |
|
140 |
}else { |
|
141 |
// $oTpl->set_block('show_manage_sections', ''); |
|
142 |
$template->set_var(array( |
|
143 |
'SECTIONS_LINK_BEFORE' => '<span class="bold grey">', |
|
144 |
'SECTIONS_LINK_AFTER' => '</span>', |
|
145 |
'DISPLAY_MANAGE_SECTIONS' => 'link', |
|
146 |
)); |
|
147 |
} |
|
148 |
|
|
149 |
/* |
|
110 | 150 |
$template->set_block('main_block', 'show_section_block', 'show_section'); |
111 | 151 |
if($query_sections->numRows() > 0) |
112 | 152 |
{ |
... | ... | |
124 | 164 |
$template->set_var('DISPLAY_MANAGE_SECTIONS', 'display:none;'); |
125 | 165 |
|
126 | 166 |
} |
127 |
|
|
167 |
*/ |
|
128 | 168 |
// Insert language TEXT |
129 | 169 |
$template->set_var(array( |
130 | 170 |
'TEXT_CURRENT_PAGE' => $TEXT['CURRENT_PAGE'], |
Also available in: Unified diff
! update folder admin/pages, admin/skel/htt
! change multi-dimensional arrays (variables) to similar arrays
! change default templates, change code to new templates