filelist

Modules

 enum UTY_FILELIST_SELECT_

Functions

 uty_filelist ($properties)
 uty_filecombo ($properties)
 uty_filelist_request ()
 uty_filelist_response ($request)

Function Documentation

uty_filecombo ( properties  ) 

render the html for a filecombo widget (javascript object: utyFileCombo)

Parameters:
properties array ( 'id' => (MANDATORY), 'path' => (MANDATORY), 'root' => (MANDATORY), 'name' => "", 'error' => null, 'show-select' => UTY_FILELIST_SELECT_NONE, 'show-edit' => false, 'show-remove' => false, 'show-download' => false, 'show-upload' => false, 'dir-only' => false, 'multi-select' => false, 'list-title' => "filecombo" 'list-width' => null, 'list-height' => null, 'disabled' => false );
  • id (string) html element id + javascript var name NB: contained html elemnts id are in the form : id_xxx
  • name (string) html form name. default: $id
  • path (string) filesystem path
  • root (string) filesystem root
  • error (string) ';' separated errors decription for gentle handling
  • show-select (int) one of UTYFILELIST_SELECT_XXX (see above). Show inline selection button (shortcut=dblclick if file)
  • show-edit (boolean) show edit tools (rename inline button + mkdir tool)
  • show-remove (boolean) show inline remove button
  • show-download (boolean) show inline download button
  • show-upload (boolean) show upload tools
  • dir-only (boolean) TODO
  • multi-select (boolean) allow ';' separated multiple files selection
  • list-width (string) list width with unit. e.g.: '100', '400px' NB: width affects the entire element and should be >= 400
  • list-height (string) list height with unit. e.g.: '100', '400px' NB: height refers to list only <=> total height = height + toolbar + statusbar
  • list-title (string) default: "filecombo"
  • disabled (boolean) if true html element.disabled='disabled'

NB: the inner filelist id will be $id_filelist. (remember this if you need to check id on ajax requests!!!)

uty_filelist ( properties  ) 

render the filelist widget (javascript object: utyFileList)

Parameters:
properties array ( 'id' => (MANDATORY), 'path' => (MANDATORY), 'root' => (MANDATORY), 'error' => NULL, 'show-select' => UTY_FILELIST_SELECT_NONE, 'show-edit' => FALSE, 'show-remove' => FALSE, 'show-download' => FALSE, 'show-upload' => FALSE, 'dir-only' => FALSE, 'multi-select' => FALSE, 'onselchange' => NULL, 'onrowsubmit' => NULL, 'width' => NULL, 'height' => NULL, 'sortkey' => 'basename' );
  • id (string) html element id + javascript var name NB: contained html elements id are in the form : id_xxx
  • path (string) filesystem path
  • root (string) filesystem root
  • error (string) ';' separated errors decription for gentle handling
  • show-select (int) one of UTY_FILELIST_SELECT_* enum values. Show inline selection button (shortcut=dblclick if file)
  • show-edit (boolean) show edit tools (rename inline button + mkdir tool)
  • show-remove (boolean) show inline remove button
  • show-download (boolean) show inline download button
  • show-upload (boolean) show upload tools
  • dir-onnly (boolean) TODO
  • sortkey (string) 'basename', 'size' or 'ctime'
  • sortorder (int) UTY_SORT_ASC or UTY_SORT_DESC (default = UTY_SORT_ASC)
  • inner utylistview properties ----------------------
  • list-onselchange (string) javascript evaluable expression e.g.: "filelist1_onselchange"
  • list-onrowsubmit (string) javascript evaluable expression e.g.: "filelist1_onrowsubmit"
  • list-width (string) list width with unit. e.g.: '100', '400px' NB: width affects the entire element and should be >= 400
  • list-height (string) list height with unit. e.g.: '100', '400px' NB: height refers to list only <=> total height = height + toolbar + statusbar
  • load-list (bool) if false list in not filled with selected path dirlist (default = false) this is set true by uty_filecombo for ajax loading on first dropdown
uty_filelist_request (  ) 

Parse incoming ajax request. MUST BE CALLED BEFORE ANY OUTPUT (handles response headers) if return value != NULL you must handle request and call uty_filelist_response

Returns:
NULL (if it's not a filelist request), or array ( 'action' => one of 'browse', 'download', 'mkdir', 'rename', 'remove', 'upload', 'copy', 'move' 'id' => element id and javascript variable 'path' => current path, 'error' => if any parse error ....... additional specific parameters // user params 'root' => false, (**** YOU NUST SET THIS ONE TO YOUR BROWSABLE PATH *******) 'error' => $request["error"], (defaults to request error, you can override whit custom error) 'whitelist' => null, 'black' => null, 'show-select' => UTY_FILELIST_SELECT_NONE; 'show-edit' => false; 'show-remove' => false; 'show-download' => false; )

you can check ["error"] !== false => ["error"] = error message you can put an ["error"] message yourself you MUST call uty_filelist_response anyway, for gentle error handling

uty_filelist_response ( request  ) 

respond to ajax request NB: will exit after execution

Parameters:
request (array) the parsed request
 All Classes Files Functions Variables Enumerations

Copyright © 2010 Attilio Pavone - www.utillyty.eu