Class PolarUpload

Description

Class to process files after upload by jupload applet

Located in /class/PolarUpload.class.php (line 41)


	
			
Variable Summary
array $sports
integer $userId
Method Summary
void PolarUpload (integer $user_id)
integer copy_selected_files (array $files, array $selection)
boolean display_table (array $files, array $person, array $days)
array gen_files_status (array $jupload_tab, array &$person, array &$days)
void _action_row ()
integer _get_file_strings (integer $f_ind, array $file, string &$type, string &$status, string &$checkbox, array &$sum_file_by_status, array &$sum_file_by_type)
void _table_header ()
Variables
array $sports (line 54)

List of sports (From database)

  • var: Index is sport ID, element: array('name' => name, 'abbrev' => abbreviation)
integer $userId (line 47)

User ID (as in database)

Methods
Constructor PolarUpload (line 62)

Class constructor

void PolarUpload (integer $user_id)
  • integer $user_id: User ID (as in database)
copy_selected_files (line 271)

Copy selected files from upload directory to user data directory

If there is some problem with creating files, try to create in temp directory of web server. Copy one by one (option : 10 by 10)

data directory structure is : <user_id>/<year>. Directory are created if needed.

  • return: Number of files successfully copied
integer copy_selected_files (array $files, array $selection)
  • array $files: Contains information on uploaded files. See gen_files_status() for structure.
  • array $selection: Array of selected files in $files to copy
display_table (line 323)

Display HTML table / form to copy uploaded files

  • return: true if at least one file, else false
boolean display_table (array $files, array $person, array $days)
  • array $files: Contains information on uploaded files. See gen_files_status() for structure.
  • array $person: Index of ppd file in $files if any
  • array $days: Array indexed by day 'YYYYMMDD' which contains information for every day: 'info': day information, 'exes': exercises. 'info' structure :
    • 'f_ind' : Index to pdd file in $files
    • 'description' : Day comment
    'exes' structure :
    • 'f_ind' : Index to hrm file in $files
    • 'title' : Exercise title
    • 'sport_id' : Sport ID (user specific)
    • 'start_time' : Start time (HHMM)
    • 'total_time' : Duration of exercise in seconds * 10
    • 'real_distance' : Distance in meters
    • 'ascend' : Ascend in meters
    • 'description' : Exercise comment
gen_files_status (line 84)

Generate array of uploaded files with status and some data

  • return: Array of uploaded files with additional info, structure:
    • 'type' : Type of file in ('ppd','pdd','hrm')
    • 'status' : File status in ('new','update','unchanged')
    • 'src' : Source path name (directory / name)
    • 'name' : File name
    • 'dst' : Destination directory
    • 'year' : Year (if type is 'pdd' or 'hrm')
    • 'size' : Size of file in bytes
  • todo: Add 'gpx' type for GPS data
array gen_files_status (array $jupload_tab, array &$person, array &$days)
  • array $jupload_tab: Array of files ($_SESSION['juvar.files'])
  • array &$person: Structure with person data (if any)
  • array &$days: Array of days and exercises
_action_row (line 487)

Display multiple selection row

void _action_row ()
_get_file_strings (line 534)

Get localized strings common to all types of files and return file size

  • return: File size in bytes
integer _get_file_strings (integer $f_ind, array $file, string &$type, string &$status, string &$checkbox, array &$sum_file_by_status, array &$sum_file_by_type)
  • integer $f_ind: Index of file in files array
  • array $file: File structure
  • string &$type: File type
  • string &$status: File status
  • string &$checkbox: Checkbox HTML input
  • array &$sum_file_by_status: in/out : add file size to status
  • array &$sum_file_by_type: in/out : add file size to type
_table_header (line 510)

Display table header or footer

void _table_header ()

Documentation generated on Sat, 28 Mar 2009 23:17:11 +0000 by phpDocumentor 1.4.1