Project

General

Profile

« Previous | Next » 

Revision 1222

Added by Dietmar over 14 years ago

change page_title to menu_title in dropdown list
validate code

View differences:

modify.php
1 1
<?php
2
/***************************************************************************
3
* SVN Version information:
4
*
5
* $Id$
6
*
7
*****************************************************************************
8
*                          WebsiteBaker
9
*
10
* WebsiteBaker Project <http://www.websitebaker2.org/>
11
* Copyright (C) 2009, Website Baker Org. e.V.
12
*         http://start.websitebaker2.org/impressum-datenschutz.php
13
* Copyright (C) 2004-2009, Ryan Djurovich
14
*
15
*                        About WebsiteBaker
16
*
17
* Website Baker is a PHP-based Content Management System (CMS)
18
* designed with one goal in mind: to enable its users to produce websites
19
* with ease.
20
*
21
*****************************************************************************
22
*
23
*****************************************************************************
24
*                        LICENSE INFORMATION
25
*
26
* WebsiteBaker is free software; you can redistribute it and/or
27
* modify it under the terms of the GNU General Public License
28
* as published by the Free Software Foundation; either version 2
29
* of the License, or (at your option) any later version.
30
*
31
* WebsiteBaker is distributed in the hope that it will be useful,
32
* but WITHOUT ANY WARRANTY; without even the implied warranty of
33
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
34
* See the GNU General Public License for more details.
35
*
36
* You should have received a copy of the GNU General Public License
37
* along with this program; if not, write to the Free Software
38
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
39
****************************************************************************
40
*
41
*****************************************************************************
42
*                   WebsiteBaker Extra Information
43
*
44
*
45
*
46
*
47
*****************************************************************************/
2 48

  
3
// $Id$
49
/**
50
 *
51
 * @category     modules
52
 * @package      menu_link
53
 * @author       Ryan Djurovich
54
 * @copyright    2004-2009, Ryan Djurovich
55
 * @copyright    2009, Website Baker Org. e.V.
56
 * @version      $Id$
57
 * @platform     WebsiteBaker 2.8.x
58
 * @requirements >= PHP 4.3.4
59
 * @license      http://www.gnu.org/licenses/gpl.html
60
 *
61
 *
62
 */
4 63

  
5
/*
6

  
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2009, Ryan Djurovich
9

  
10
 Website Baker is free software; you can redistribute it and/or modify
11
 it under the terms of the GNU General Public License as published by
12
 the Free Software Foundation; either version 2 of the License, or
13
 (at your option) any later version.
14

  
15
 Website Baker is distributed in the hope that it will be useful,
16
 but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 GNU General Public License for more details.
19

  
20
 You should have received a copy of the GNU General Public License
21
 along with Website Baker; if not, write to the Free Software
22
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23

  
24
*/
25

  
26 64
// Must include code to stop this file being accessed directly
27 65
if(defined('WB_PATH') == false) { exit("Cannot access this file directly"); }
28 66

  
......
43 81
$r_type = $sql_row['redirect_type'];
44 82
$extern = $sql_row['extern'];
45 83
$anchor = $sql_row['anchor'];
46
$sel = ' selected';
84
$sel = ' selected="selected"';
47 85

  
48 86
// Get list of all visible pages and build a page-tree
49 87

  
......
73 111
global $menulink_titles;
74 112
$menulink_titles = array();
75 113
$table_p = TABLE_PREFIX."pages";
76
if($query_page = $database->query("SELECT `page_id`,`page_title` FROM `$table_p`")) {
114
if($query_page = $database->query("SELECT `page_id`,`menu_title` FROM `$table_p`")) {
77 115
	while($page = $query_page->fetchRow())
78
		$menulink_titles[$page['page_id']] = $page['page_title'];
116
		$menulink_titles[$page['page_id']] = $page['menu_title'];
79 117
}
80 118
// now get the tree
81 119
$links = array();
......
116 154

  
117 155
// script for target-select-box
118 156
?>
119
<script type="text/javascript">
157
<script language="JavaScript" type="text/javascript">
158
/*<![CDATA[*/
120 159
	function populate() {
121
		o=document.getElementById('page_link');
160
		o=document.getElementById('menu_link');
122 161
		d=document.getElementById('page_target');
123 162
		e=document.getElementById('extern');
124
		if(!d){return;}			
163
		if(!d){return;}
125 164
		var mitems=new Array();
126 165
		mitems['0']=[' ','0'];
127 166
		mitems['-1']=[' ','0'];
......
151 190
			d.options[j].text=cur[i];
152 191
			d.options[j++].value=cur[i+1];
153 192
		}
154
		
193

  
155 194
		if(o.value=='-1') {
156 195
			e.disabled = false;
157 196
		} else {
158 197
			e.disabled = true;
159 198
		}
160 199
	}
200

  
201
/*]]>*/
161 202
</script>
162

  
163 203
<form name="menulink" action="<?php echo WB_URL ?>/modules/menu_link/save.php" method="post">
164 204
<input type="hidden" name="page_id" value="<?php echo $page_id ?>" />
165 205
<input type="hidden" name="section_id" value="<?php echo $section_id ?>" />
......
169 209
		<?php echo $TEXT['LINK'].':' ?>
170 210
	</td>
171 211
	<td>
172
		<select name="page_link" id="page_link" onchange="populate()" style="width:250px;" />
212
		<select name="menu_link" id="menu_link" onchange="populate()" style="width:250px;" >
173 213
			<option value="0"<?php echo $target_page_id=='0'?$sel:''?>><?php echo $TEXT['PLEASE_SELECT']; ?></option>
174 214
			<option value="-1"<?php echo $target_page_id=='-1'?$sel:''?>><?php echo $MOD_MENU_LINK['EXTERNAL_LINK']; ?></option>
175 215
			<?php foreach($links AS $pid=>$link) {
176 216
				if ($pid == $page_id)  // Display current page with selection disabled
177
					echo "<option value=\"$pid\" disabled=\"disabled\">$link *</option>";
217
					echo "<option value=\"$pid\" disabled=\"disabled\">$link *</option>\n";
178 218
				else
179
					echo "<option value=\"$pid\" ".($target_page_id==$pid?$sel:'').">$link</option>";
219
					echo "<option value=\"$pid\" ".($target_page_id==$pid?$sel:'').">$link</option>\n";
180 220
			} ?>
181 221
		</select>
182 222
		&nbsp;
......
188 228
		<?php echo $TEXT['ANCHOR'].':' ?>
189 229
	</td>
190 230
	<td>
191
		<select name="page_target" id="page_target" onfocus="populate()" style="width:250px;" />
192
			<option value="<?php echo $anchor ?>" selected><?php echo $anchor=='0'?' ':'#'.$anchor ?></option>
231
		<select name="page_target" id="page_target" onfocus="populate()" style="width:250px;" >
232
			<option value="<?php echo $anchor ?>" selected="selected"><?php echo $anchor=='0'?' ':'#'.$anchor ?></option>
193 233
		</select>
194 234
	</td>
195 235
</tr>
......
198 238
		<?php echo $TEXT['TARGET'].':' ?>
199 239
	</td>
200 240
	<td>
201
		<select name="target" style="width:250px;" />
241
		<select name="target" style="width:250px;" >
202 242
			<option value="_blank"<?php if($target=='_blank') echo ' selected="selected"'; ?>><?php echo $TEXT['NEW_WINDOW'] ?></option>
203 243
			<option value="_self"<?php if($target=='_self') echo ' selected="selected"'; ?>><?php echo $TEXT['SAME_WINDOW'] ?></option>
204 244
			<option value="_top"<?php if($target=='_top') echo ' selected="selected"'; ?>><?php echo $TEXT['TOP_FRAME'] ?></option>
......
210 250
		<?php echo $MOD_MENU_LINK['R_TYPE'].':' ?>
211 251
	</td>
212 252
	<td>
213
		<select name="r_type" style="width:250px;" />
253
		<select name="r_type" style="width:250px;" >
214 254
			<option value="301"<?php if($r_type=='301') echo ' selected="selected"'; ?>>301</option>
215 255
			<option value="302"<?php if($r_type=='302') echo ' selected="selected"'; ?>>302</option>
216 256
		</select>
......
226 266
		<input type="submit" value="<?php echo $TEXT['SAVE'] ?>" style="width: 100px; margin-top: 5px;" />
227 267
	</td>
228 268
	<td align="right">
229
		</form>
230 269
		<input type="button" value="<?php echo $TEXT['CANCEL'] ?>" onclick="javascript: window.location = 'index.php';" style="width: 100px; margin-top: 5px;" />
231 270
	</td>
232 271
</tr>
233 272
</table>
234 273

  
235 274
</form>
236

  

Also available in: Unified diff