示例#1
0
				$modified_config->value = $param_value;
				if($modified_config->update() === FALSE){
					$error_msg .= "Error updating configuration paramenter: $param_name\n";
					debug_message($modified_config->getLastError());
					break;
				}
			}
		}
	}
	if(empty($error_msg)){
		header("Location: ".getCurrentURL()."\r\n");
		exit();
	}
}

$config_items = $config->retrieveSet("ORDER BY name");
if($config_items === FALSE){
	$error_msg .= "Error getting configuration items!\n";
	debug_message($config->getLastError());
}

$title = "Global Configuration";

require('header.php') ?>
<form action="<?php 
echo $_SERVER['PHP_SELF'];
?>
" method="post">
<div class="tableContainer">
<a href="javascript:;" class="tCollapse" onclick="toggleGrid(this)"><img src="images/arrow_down.jpg" alt="Hide table" />Configuration</a><div>
<table border="0" cellspacing="0" cellpadding="0" class="dg_table">
示例#2
0
	function getAppConfig(){
		$config = new SI_Config();
		$config_items = $config->retrieveSet();
		if($config_items === FALSE || !is_array($config_items)){
			trigger_error("Could not retrieve configuration settings from database!", E_USER_ERROR);
			return FALSE;
		}
		
		$config_hash = array();
		foreach($config_items as $item){
			$config_hash[$item->name] = $item->value;
		}

		return $config_hash;
	}