Example #1
0
 public function folder_options()
 {
     $fs = new CmsFilesystem();
     $dir = $fs->defaultFileStore . $fs->relativepath;
     $options = content_tag("option", "Your Folder", array("value" => $fs->relativepath));
     $folders = File::get_folders($dir);
     if (is_array($folders)) {
         foreach ($folders as $folder) {
             $path = str_replace(PUBLIC_DIR, "", $folder["path"]);
             $options .= content_tag("option", $folder["name"], array("value" => $path));
         }
     }
     return $options;
 }
 public function synchronise()
 {
     set_time_limit(0);
     if ($_POST && $_POST['sync'] == "go") {
         $fs = new CmsFilesystem();
         $scan = File::get_folders($fs->defaultFileStore . $fs->relativepath);
         if (is_array($scan)) {
             foreach ($scan as $folder) {
                 $rel = str_replace($fs->defaultFileStore, "", $folder['path']);
                 $fs->databaseSync($folder['path'], $rel);
             }
         }
         exit;
     }
 }