- // The getIntValue parses an integer value from the source config string.
- function getIntValue($name) {
+ // setDefinedValue either sets or deletes a defined value identified by name.
+ function setDefinedValue($name, $set = true) {
+ if ($set) {
+ // Setting part.
+ if (!$this->getDefinedValue($name)) {
+ $this->config_array[] = $name;
+ $this->config = implode(',', $this->config_array);
+ return;
+ }
+ } else {
+ // Deleting part.
+ if ($this->config_array) {
+ foreach ($this->config_array as $key => $value) {
+ if ($value === $name) {
+ unset($this->config_array[$key]);
+ $this->config = implode(',', $this->config_array);
+ return;
+ }
+ }
+ }
+ }
+ }
+
+ // The getIntValue parses an integer value from the source config array.
+ function getIntValue($name, $defaultVal = 0) {