Changeset 934:1ab99955f080 for inc/core/class.dc.settings.php
- Timestamp:
- 10/29/12 14:46:58 (13 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/core/class.dc.settings.php
r301 r934 92 92 return $this->namespaces[$ns]; 93 93 } 94 95 /** 96 Rename a namespace. 97 98 @param oldNs <b>string</b> Old namespace name 99 @param newNs <b>string</b> New namespace name 100 @return <b>boolean</b> 101 */ 102 public function renNamespace($oldNs,$newNs) 103 { 104 if (!array_key_exists($oldNs, $this->namespaces) || array_key_exists($newNs, $this->namespaces)) { 105 return false; 106 } 107 108 // Rename the namespace in the namespace array 109 $this->namespaces[$newNs] = $this->namespaces[$oldNs]; 110 unset($this->namespaces[$oldNs]); 111 112 // Rename the namespace in the database 113 $strReq = 'UPDATE '.$this->table. 114 " SET setting_ns = '".$this->con->escape($newNs)."' ". 115 " WHERE setting_ns = '".$this->con->escape($oldNs)."' "; 116 $this->con->execute($strReq); 117 return true; 118 } 119 120 /** 121 Delete a whole namespace with all settings pertaining to it. 122 123 @param ns <b>string</b> Namespace name 124 @return <b>boolean</b> 125 */ 126 public function delNamespace($ns) 127 { 128 if (!array_key_exists($ns, $this->namespaces)) { 129 return false; 130 } 131 132 // Remove the namespace from the namespace array 133 unset($this->namespaces[$ns]); 134 135 // Delete all settings from the namespace in the database 136 $strReq = 'DELETE FROM '.$this->table. 137 " WHERE setting_ns = '".$this->con->escape($ns)."' "; 138 $this->con->execute($strReq); 139 return true; 140 } 94 141 95 142 /**
Note: See TracChangeset
for help on using the changeset viewer.