Changeset 16 for pro-bachkim-filespace/sourcecode/application/modules/ajax/models/directory_model.php
- Timestamp:
- Jun 26, 2014 5:37:23 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-bachkim-filespace/sourcecode/application/modules/ajax/models/directory_model.php
r12 r16 154 154 if (file_exists($file) && count($aryDataSet) > 0) { 155 155 $h = fopen ($file, $flag); 156 foreach ($aryDataSet as $key => $ line) {156 foreach ($aryDataSet as $key => $aryTmp) { 157 157 $line = implode(',',$aryTmp); 158 fwrite($ line."\n", $h);158 fwrite($h, $line."\n"); 159 159 } 160 160 fclose ($h); … … 176 176 } 177 177 178 public function rename ($id, $newName, $type = 'directory') { 179 180 if (!$newName || !$id) return FALSE; 181 $aryObj = $type == 'directory' ? $this->getAllDirectory() : $this->getAllFile(); 182 $dbFile = $type == 'directory' ? $dbFile = 'directory.db' : $dbFile = 'file.db'; 183 184 if (count($aryObj) > 0) { 185 foreach ($aryObj as $key => $obj) { 186 if ($obj['id'] == $id) break; 187 } 188 189 $aryObj[$key]['name'] = $newName; 190 191 return $this->writeDB($dbFile, $aryObj); 192 } 193 194 return FALSE; 195 } 196 178 197 }
Note: See TracChangeset
for help on using the changeset viewer.