Project

General

Profile

« Previous | Next » 

Revision 195

Added by ryan about 19 years ago

Fixed some minor bugs with settings

View differences:

trunk/wb/admin/settings/index.php
219 219
	while($addon = $result->fetchRow()) {
220 220
		$template->set_var('FILE', $addon['directory']);
221 221
		$template->set_var('NAME', $addon['name']);
222
		if($file == DEFAULT_TEMPLATE ? $selected = ' selected' : $selected = '');
222
		if(($addon['directory'] == DEFAULT_TEMPLATE) ? $selected = ' selected' : $selected = '');
223 223
		$template->set_var('SELECTED', $selected);
224 224
		$template->parse('template_list', 'template_list_block', true);
225 225
	}
226 226
}
227 227

  
228
// Insert templates
228
// Insert WYSIWYG modules
229 229
$template->set_block('main_block', 'editor_list_block', 'editor_list');
230
$file='none';
231
$module_name='None';
232
$template->set_var('FILE', $file);
233
$template->set_var('NAME', $module_name);
234
if((!defined('WYSIWYG_EDITOR') OR $file == WYSIWYG_EDITOR) ? $selected = ' selected' : $selected = '');
235
$template->set_var('SELECTED', $selected);
236
$template->parse('editor_list', 'editor_list_block', true);
237
if($handle = opendir(WB_PATH.'/modules/')) {
238
	while (false !== ($file = readdir($handle))) {
239
		if($file != "." AND $file != ".." AND $file != ".svn" AND is_dir(WB_PATH."/modules/$file") AND file_exists(WB_PATH."/modules/$file/info.php")) {
240
			include(WB_PATH."/modules/$file/info.php");
241
			if ($module_type == 'WYSIWYG') {
242
				$template->set_var('FILE', $file);
243
				$template->set_var('NAME', $module_name);
244
				if((defined('WYSIWYG_EDITOR') AND $file == WYSIWYG_EDITOR) ? $selected = ' selected' : $selected = '');
245
				$template->set_var('SELECTED', $selected);
246
				$template->parse('editor_list', 'editor_list_block', true);
247
			}
248
		}
230
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND function = 'wysiwyg'");
231
if($result->numRows() > 0) {
232
	while($addon = $result->fetchRow()) {
233
		$template->set_var('FILE', $addon['directory']);
234
		$template->set_var('NAME', $addon['name']);
235
		if((defined('WYSIWYG_EDITOR') AND $addon['directory'] == WYSIWYG_EDITOR) ? $selected = ' selected' : $selected = '');
236
		$template->set_var('SELECTED', $selected);
237
		$template->parse('editor_list', 'editor_list_block', true);
249 238
	}
250 239
}
251 240

  
252

  
253 241
// Insert templates for search settings
254 242
$template->set_block('main_block', 'search_template_list_block', 'search_template_list');
255 243
if($search_template == '') { $selected = ' selected'; } else { $selected = ''; }
256 244
$template->set_var(array('FILE' => '', 'NAME' => $TEXT['SYSTEM_DEFAULT'], 'SELECTED' => $selected));
257 245
$template->parse('search_template_list', 'search_template_list_block', true);
258
if($handle = opendir(WB_PATH.'/templates/')) {
259
	while (false !== ($file = readdir($handle))) {
260
		if($file != "." AND $file != ".." AND $file != ".svn" AND is_dir(WB_PATH."/templates/$file") AND file_exists(WB_PATH."/templates/$file/info.php")) {
261
			include(WB_PATH."/templates/$file/info.php");
262
			$template->set_var('FILE', $file);
263
			$template->set_var('NAME', $template_name);
264
			if($file == $search_template ? $selected = ' selected' : $selected = '');
265
			$template->set_var('SELECTED', $selected);
266
			$template->parse('search_template_list', 'search_template_list_block', true);
267
		}
246
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template'");
247
if($result->numRows() > 0) {
248
	while($addon = $result->fetchRow()) {
249
		$template->set_var('FILE', $addon['directory']);
250
		$template->set_var('NAME', $addon['name']);
251
		if($addon['directory'] == $search_template ? $selected = ' selected' : $selected = '');
252
		$template->set_var('SELECTED', $selected);
253
		$template->parse('search_template_list', 'search_template_list_block', true);
268 254
	}
269 255
}
270 256

  

Also available in: Unified diff