Permalink
Browse files

root

  • Loading branch information...
1 parent c1d81bd commit 47ef46be644b1244b657461ab2e7c2896df58c48 Falcon Yin committed Mar 19, 2012
Showing with 17 additions and 6 deletions.
  1. +17 −6 application/controllers/drop_box.php
@@ -53,13 +53,24 @@ public function root()
$this->load->library('dropbox', $params);
$folder_data = $this->dropbox->metadata('/');
- foreach ($folder_data->contents as $folder) {
- $name = str_replace('/' ,'', $folder->path);
- echo "{$name}<br>";
- //var_dump($folder);
- //echo "\n\n\n";
+ echo "<ol>"
+ foreach ($folder_data->contents as $item) {
+ if ($item->is_dir) {
+ echo "<li><a href=\"folder/{$item->path}\">{$item->path}</a></li>";
+ } else {
+ echo "<li><a href=\"file/{$item->path}\">{$item->path}</a></li>";
+ }
}
- var_dump($folder_data);
+ echo "</ol>"
+// var_dump($folder_data);
+ }
+
+ public function folder($path) {
+ echo $path;
+ }
+
+ public function file($path) {
+ echo $path;
}
public function index() {

0 comments on commit 47ef46b

Please sign in to comment.