Project

General

Profile

« Previous | Next » 

Revision 1289

Added by kweitzel over 14 years ago

Branch 2.8.1 merged back into Trunk

View differences:

modify.php
1 1
<?php
2

  
3
// $Id$
4

  
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

  
2
/**
3
 *
4
 * @category        modules
5
 * @package         menu_link
6
 * @author          WebsiteBaker Project
7
 * @copyright       2004-2009, Ryan Djurovich
8
 * @copyright       2009-2010, Website Baker Org. e.V.
9
 * @link			http://www.websitebaker2.org/
10
 * @license         http://www.gnu.org/licenses/gpl.html
11
 * @platform        WebsiteBaker 2.8.x
12
 * @requirements    PHP 4.3.4 and higher
13
 * @version         $Id$
14
 * @filesource		$HeadURL$
15
 * @lastmodified    $Date$
16
 *
24 17
*/
25 18

  
26 19
// Must include code to stop this file being accessed directly
......
43 36
$r_type = $sql_row['redirect_type'];
44 37
$extern = $sql_row['extern'];
45 38
$anchor = $sql_row['anchor'];
46
$sel = ' selected';
39
$sel = ' selected="selected"';
47 40

  
48 41
// Get list of all visible pages and build a page-tree
49 42

  
......
73 66
global $menulink_titles;
74 67
$menulink_titles = array();
75 68
$table_p = TABLE_PREFIX."pages";
76
if($query_page = $database->query("SELECT `page_id`,`page_title` FROM `$table_p`")) {
69
if($query_page = $database->query("SELECT `page_id`,`menu_title` FROM `$table_p`")) {
77 70
	while($page = $query_page->fetchRow())
78
		$menulink_titles[$page['page_id']] = $page['page_title'];
71
		$menulink_titles[$page['page_id']] = $page['menu_title'];
79 72
}
80 73
// now get the tree
81 74
$links = array();
......
116 109

  
117 110
// script for target-select-box
118 111
?>
119
<script type="text/javascript">
112
<script language="JavaScript" type="text/javascript">
113
/*<![CDATA[*/
120 114
	function populate() {
121
		o=document.getElementById('page_link');
115
		o=document.getElementById('menu_link');
122 116
		d=document.getElementById('page_target');
123 117
		e=document.getElementById('extern');
124
		if(!d){return;}			
118
		if(!d){return;}
125 119
		var mitems=new Array();
126 120
		mitems['0']=[' ','0'];
127 121
		mitems['-1']=[' ','0'];
......
151 145
			d.options[j].text=cur[i];
152 146
			d.options[j++].value=cur[i+1];
153 147
		}
154
		
148

  
155 149
		if(o.value=='-1') {
156 150
			e.disabled = false;
157 151
		} else {
158 152
			e.disabled = true;
159 153
		}
160 154
	}
155

  
156
/*]]>*/
161 157
</script>
162

  
163 158
<form name="menulink" action="<?php echo WB_URL ?>/modules/menu_link/save.php" method="post">
164 159
<input type="hidden" name="page_id" value="<?php echo $page_id ?>" />
165 160
<input type="hidden" name="section_id" value="<?php echo $section_id ?>" />
......
169 164
		<?php echo $TEXT['LINK'].':' ?>
170 165
	</td>
171 166
	<td>
172
		<select name="page_link" id="page_link" onchange="populate()" style="width:250px;" />
167
		<select name="menu_link" id="menu_link" onchange="populate()" style="width:250px;" >
173 168
			<option value="0"<?php echo $target_page_id=='0'?$sel:''?>><?php echo $TEXT['PLEASE_SELECT']; ?></option>
174 169
			<option value="-1"<?php echo $target_page_id=='-1'?$sel:''?>><?php echo $MOD_MENU_LINK['EXTERNAL_LINK']; ?></option>
175 170
			<?php foreach($links AS $pid=>$link) {
176 171
				if ($pid == $page_id)  // Display current page with selection disabled
177
					echo "<option value=\"$pid\" disabled=\"disabled\">$link *</option>";
172
					echo "<option value=\"$pid\" disabled=\"disabled\">$link *</option>\n";
178 173
				else
179
					echo "<option value=\"$pid\" ".($target_page_id==$pid?$sel:'').">$link</option>";
174
					echo "<option value=\"$pid\" ".($target_page_id==$pid?$sel:'').">$link</option>\n";
180 175
			} ?>
181 176
		</select>
182 177
		&nbsp;
......
188 183
		<?php echo $TEXT['ANCHOR'].':' ?>
189 184
	</td>
190 185
	<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>
186
		<select name="page_target" id="page_target" onfocus="populate()" style="width:250px;" >
187
			<option value="<?php echo $anchor ?>" selected="selected"><?php echo $anchor=='0'?' ':'#'.$anchor ?></option>
193 188
		</select>
194 189
	</td>
195 190
</tr>
......
198 193
		<?php echo $TEXT['TARGET'].':' ?>
199 194
	</td>
200 195
	<td>
201
		<select name="target" style="width:250px;" />
196
		<select name="target" style="width:250px;" >
202 197
			<option value="_blank"<?php if($target=='_blank') echo ' selected="selected"'; ?>><?php echo $TEXT['NEW_WINDOW'] ?></option>
203 198
			<option value="_self"<?php if($target=='_self') echo ' selected="selected"'; ?>><?php echo $TEXT['SAME_WINDOW'] ?></option>
204 199
			<option value="_top"<?php if($target=='_top') echo ' selected="selected"'; ?>><?php echo $TEXT['TOP_FRAME'] ?></option>
......
210 205
		<?php echo $MOD_MENU_LINK['R_TYPE'].':' ?>
211 206
	</td>
212 207
	<td>
213
		<select name="r_type" style="width:250px;" />
208
		<select name="r_type" style="width:250px;" >
214 209
			<option value="301"<?php if($r_type=='301') echo ' selected="selected"'; ?>>301</option>
215 210
			<option value="302"<?php if($r_type=='302') echo ' selected="selected"'; ?>>302</option>
216 211
		</select>
......
226 221
		<input type="submit" value="<?php echo $TEXT['SAVE'] ?>" style="width: 100px; margin-top: 5px;" />
227 222
	</td>
228 223
	<td align="right">
229
		</form>
230 224
		<input type="button" value="<?php echo $TEXT['CANCEL'] ?>" onclick="javascript: window.location = 'index.php';" style="width: 100px; margin-top: 5px;" />
231 225
	</td>
232 226
</tr>
233 227
</table>
234 228

  
235 229
</form>
236

  
237 230

  

Also available in: Unified diff