Example #1
0
 /**
  * @param $args
  * GET: /file-tiny-mce/index
  */
 public function index($args)
 {
     $model = new FileIndexModel('');
     $model->parentFolders = array();
     $path = '/file-tiny-mce/index/content';
     $model->parentFolders[0] = array($path, '..');
     for ($i = 1; $i < count($args); $i++) {
         $path .= '/' . $args[$i];
         $model->parentFolders[$i] = array($path, $args[$i]);
     }
     $model->path = implode('/', $args) . (count($args) > 0 ? '/' : '');
     $dir = $_SERVER['DOCUMENT_ROOT'] . Config::$SUB_FOLDER . '/' . $model->path;
     $model->files = scandir($dir);
     parent::viewPopup(new Index(), $model);
 }