PATH:
home
/
letacommog
/
letaweb
/
protected
/
modules
/
helpSystem
/
extensions
/
dmEditor
/
controllers
<?php class ImageBrowserController extends CController{ public function actionBrowse(){ $this->layout = "/layouts/imageBrowse"; $this->render("browse"); } public function actionBrowseResponse(){ $imageList = $this->getImageFiles(); print CJSON::encode($imageList); Yii::app()->end(); } private function getImageFiles(){ $dir_path = $this->module->imageUploadPath; $fileList = array(); if (is_dir($dir_path)) { if ($dir_handler = opendir($dir_path)) { while (($file = readdir($dir_handler)) !== false) { if(is_file($dir_path."/".$file)){ $fileList[] = array("fileName"=>$file,"src"=>$dir_path."/".$file); } } closedir($dir_handler); } } return $fileList; } }
[+]
..
[-] ImageBrowserController.php
[edit]
[-] ImageUploadController.php
[edit]