Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision f0e61977

Von Werner Hahn vor mehr als 8 Jahren hinzugefügt

  • ID f0e619775dbc66b8e9f921c9dda5e4448dd337bf
  • Vorgänger 3c407887
  • Nachfolger a2a746b0

Fileuploader: löschen und ändern anfang

Unterschiede anzeigen:

js/kivi.FileUploader.js
1 1
namespace('kivi.FileUploader', function(ns) {
2 2
  //opens a popupdialog for fileupload
3
  //controller_action is passed to the popup_dialog fileupload form and can/will be called from the form to deal with the uploaded file
4
  ns.add_file = function(id,modul,controller_action,allowed_filetypes) {
3

  
4
  //id                  = id of the id in the table files
5
  //trans_id            = id of the object (part_id, shoppart_id, project_id,...) where the file belongs to
6
  //modul               = name where the file belongs to like IC, shop_part, CV ....
7
  //controller_action   = Controller/Action wich will be called by button save in popupdialog the todo whatever you want to to with the file(save it to db, save it to webdav)
8
  //                      controller_action is passed to the popup_dialog fileupload form and can/will be called from the form to deal with the uploaded file
9
  //allowed_filetypes   = must be seperated by | like jpg|gif|pdf
10
  ns.add_file = function(id,trans_id,modul,controller_action,allowed_filetypes) {
5 11
    kivi.popup_dialog({
6 12
        url :           'controller.pl?action=FileUploader/ajax_add_file',
7
        data:           'id=' + id + '&modul=' + modul + '&ca=' + controller_action + '&aft=' + allowed_filetypes,
13
        data:           'id=' + id + '&trans_id=' + trans_id + '&modul=' + modul + '&ca=' + controller_action + '&aft=' + allowed_filetypes,
8 14
        dialog:         { title: kivi.t8('File upload') }
9 15
    } );
10 16
    return true;
11 17
  };
18

  
19
  ns.delete_file = function(id) {
20
    alert ("ID: "+id);
21
  };
12 22
});

Auch abrufbar als: Unified diff