public function remove($Name)
{
// Make sure this source' config settings are in the right format
if (!is_array($this->Settings)) {
$this->Settings = array();
}
$Found = false;
$Keys = explode('.', $Name);
// If splitting is off, HANDLE IT
if (!$this->Splitting) {
$FirstKey = val(0, $Keys);
if ($FirstKey == $this->Group) {
$Keys = array(array_shift($Keys), implode('.', $Keys));
} else {
$Keys = array($Name);
}
}
$KeyCount = count($Keys);
$Settings =& $this->Settings;
for ($i = 0; $i < $KeyCount; ++$i) {
$Key = $Keys[$i];
// Key will always be in here if it is anywhere at all
if (array_key_exists($Key, $Settings)) {
if ($i == $KeyCount - 1) {
// We are at the setting, so unset it.
$Found = true;
unset($Settings[$Key]);
$this->Dirty = true;
} else {
// Advance the pointer
$Settings =& $Settings[$Key];
}
} else {
$Found = false;
break;
}
}
return $Found;
}