public function actionListImages() { $uploadPath = Yii::app()->basePath . '/../uploads/'; if (Settings::get('gallery', 'upload_path')) { $uploadPath = '/' . trim(Settings::get('gallery', 'upload_path'), '/') . '/'; } $array = Awecms::rglob($uploadPath, '*.{jpg,png,gif}', GLOB_BRACE); echo stripslashes(json_encode($array)); }