Changeset 11 for pro-bachkim-filespace/sourcecode/application/modules/ajax/controllers/privatecontent.php
- Timestamp:
- Jun 4, 2014 5:53:33 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-bachkim-filespace/sourcecode/application/modules/ajax/controllers/privatecontent.php
r10 r11 9 9 class PrivateContent extends MX_Controller 10 10 { 11 12 public function __construct() { 13 parent::__construct(); 14 } 15 16 public function getContent () { 17 $aryDir = array( 11 /* private $_aryDir = array( 18 12 0 => array ('id' => 1, 'name' => 'Dir 1', 'parentID' => 0), 19 13 1 => array ('id' => 2, 'name' => 'Dir 2', 'parentID' => 0), … … 25 19 7 => array ('id' => 8, 'name' => 'Dir 3.1', 'parentID' => 7) 26 20 ); 27 28 $aryFile = array(21 22 private $_aryFile = array( 29 23 0 => array('id' => 1, 'name' => 'File 1', 'minetype' => 'text', 'size' => '1.5MB', 'parentID' => 1), 30 24 1 => array('id' => 2, 'name' => 'File 2', 'minetype' => 'text', 'size' => '1.6MB', 'parentID' => 1), … … 34 28 5 => array('id' => 6, 'name' => 'File 6', 'minetype' => 'text', 'size' => '1.8MB', 'parentID' => 3), 35 29 5 => array('id' => 7, 'name' => 'File 7', 'minetype' => 'text', 'size' => '1.8MB', 'parentID' => 5) 36 ); 37 38 $aryData = array('DIRECTORIES' => $aryDir, 'FILES' => $aryFile); 39 30 ); */ 31 32 public function __construct() { 33 parent::__construct(); 34 $this->load->model('Directory_model', 'objDirectory', TRUE); 35 } 36 37 public function getContent () { 38 $aryData = array('DIRECTORIES' => $this->objDirectory->getAllDirectory() , 'FILES' => $this->objDirectory->getAllFile()); 40 39 echo json_encode($aryData); 41 40 } 42 41 43 42 public function createDir () { 43 $parentDir = $this->input->post('parentID',TRUE); 44 $name = $this->input->post('name',TRUE); 44 45 46 if (!is_null($parentDir) && !is_null($name)) { 47 48 $maxID = $this->objDirectory->getMaxID (true); 49 $aryDir = array('id' => (int)$maxID + 1, 'name' => $name, 'parentID' => $parentDir, 'maxID' => $maxID); 50 51 $result = $this->objDirectory->createDir($aryDir); 52 echo json_encode($aryDir); 53 } 45 54 } 46 55 47 56 public function deleteDir () { 57 $dirID = $this->input->post('id',TRUE); 58 $delAllChild = $this->input->post('delallchild',TRUE); 48 59 60 $aryChild = $this->objDirectory->getAllChild($dirID); 61 echo json_encode($aryChild); 49 62 } 50 63
Note: See TracChangeset
for help on using the changeset viewer.