コード例 #1
0
 public function index()
 {
     // No required if you have set timezone already... :)
     if (!ini_get('date.timezone')) {
         date_default_timezone_set('GMT');
     }
     try {
         $crud = new Grocery_CRUD_Multiuploader();
         $this->db = $this->load->database("default", true);
         $crud->set_table('multi_uploader_gallery');
         $crud->set_subject('Document');
         $col = array("title", "my_pictures", "my_files", "my_mail_attachments");
         $crud->fields($col);
         $crud->columns($col);
         $config = array("path_to_directory" => 'assets/grocery_crud_multiuploader/GC_uploads/pictures/', "allowed_types" => 'gif|jpeg|jpg|png', "show_allowed_types" => true, "no_file_text" => 'No Pictures', "enable_full_path" => false, "enable_download_button" => true, "download_allowed" => 'jpg');
         $crud->new_multi_upload("my_pictures", $config);
         $config = array("path_to_directory" => 'assets/grocery_crud_multiuploader/GC_uploads/files/', "allowed_types" => 'pdf|doc|html', "show_allowed_types" => true, "no_file_text" => 'No files', "enable_full_path" => false, "enable_download_button" => true, "download_allowed" => 'pdf');
         $crud->new_multi_upload("my_files", $config);
         $config = array("path_to_directory" => 'assets/grocery_crud_multiuploader/GC_uploads/mail/', "allowed_types" => 'txt|dat', "show_allowed_types" => true, "no_file_text" => 'No attachments', "enable_full_path" => false, "enable_download_button" => true, "download_allowed" => 'dat');
         $crud->new_multi_upload("my_mail_attachments", $config);
         $output = $crud->render();
         $this->Output_HTML($output);
     } catch (Exception $e) {
         show_error($e->getMessage() . ' --- ' . $e->getTraceAsString());
     }
 }
コード例 #2
0
ファイル: Examples.php プロジェクト: absmugz/creativeroom
 public function portfolio_management()
 {
     $crud = new grocery_CRUD();
     $crud = new Grocery_CRUD_Multiuploader();
     //$crud->new_multi_upload('images');
     $this->config->set_item('grocery_crud_file_upload_allow_file_types', 'gif|jpeg|jpg|png');
     $crud->set_table('portfolio_items');
     //$crud->set_relation_n_n('Categories', 'Portfolio_categories', 'Categories', 'portfolio_id', 'categories_id', 'category_name');
     //$crud->set_relation_n_n('Categories', 'Portfolio_categories', 'Categories', 'categories_id', 'portfolio_id', 'category_name');
     $crud->set_relation_n_n('categories', 'portfolio_categories', 'categories', 'portfolio_id', 'categories_id', 'category_name');
     //$crud->set_relation('images_id', 'images', 'images_url');
     //$crud->set_relation('images_id','images','images_url');
     //$crud->set_relation_n_n('images', 'portfolio_images', 'images', 'portfolio_id', 'images_id', 'images_url');
     $config = array("path_to_directory" => 'assets/grocery_crud_multiuploader/GC_uploads/pictures/', "allowed_types" => 'gif|jpeg|jpg|png', "show_allowed_types" => true, "no_file_text" => 'No Pictures', "enable_full_path" => false, "enable_download_button" => true, "download_allowed" => 'jpg');
     //$crud->new_multi_upload("images_url",$config);
     //$crud->new_multi_upload("images",$config);
     //$crud->set_field_upload('images_url','assets/uploads/files');
     $crud->set_field_upload('images_url', 'assets/uploads/images');
     $crud->callback_after_upload(array($this, 'example_callback_after_upload'));
     $output = $crud->render();
     $this->_example_output($output);
 }