Example #1
0
 function page_admin_collections_create()
 {
     if (isset($_POST['path'])) {
         $success = true;
         $collection = new Collection();
         $collection->path = $_POST['path'];
         if ($collection->validate_path()) {
             if ($collection->save()) {
                 $this->flash_success('Collection added');
             } else {
                 $this->flash_error('Unable to save collection to database.');
             }
         } else {
             $this->smarty->assign('path', $_POST['path']);
             $this->flash_error('Collection could not be added. Check path.');
         }
     }
     $this->content = './tpl/admin/collections/create.tpl';
 }