ultimix
file_input_view_1_0_0 Class Reference

Public Member Functions

 __construct ()
 pre_generation ($Options)
 download ($Options)
 view ($Options)

Data Fields

 $PageCSS = false
 $PageJS = false
 $Security = false

Detailed Description

View.

Author
Dodonov A.A.

Definition at line 26 of file file_input_view.php.

Constructor & Destructor Documentation

__construct ( )

Constructor.

Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 56 of file file_input_view.php.

{
try
{
$this->PageCSS = get_package( 'page::page_css' , 'last' , __FILE__ );
$this->PageJS = get_package( 'page::page_js' , 'last' , __FILE__ );
$this->Security = get_package( 'security' , 'last' , __FILE__ );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Member Function Documentation

download (   $Options)

Function starts file download.

Parameters
$Options- Settings.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 198 of file file_input_view.php.

{
try
{
$Fid = $this->Security->get_gp( 'fid' , 'integer' , false );
if( $Fid !== false )
{
$FileInputAlgorithms = get_package( 'file_input::file_input_algorithms' , 'last' , __FILE__ );
$File = $FileInputAlgorithms->get_by_id( );
$FileSize = filesize( get_field( $File , 'file_path' ) );
$FileName = get_field( $File , 'original_file_name' );
$this->file_headers( $FileSize , $FileName );
readfile( get_field( $File , 'file_path' ) );
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
pre_generation (   $Options)

Function executes before any page generating actions took place.

Parameters
$Options- Settings.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 122 of file file_input_view.php.

{
try
{
$Path = '{http_host}/'._get_package_relative_path_ex( 'file_input::file_input_view' , '1.0.0' );
$this->PageJS->add_javascript( $Path.'/include/swfupload.js' );
$this->upload_plugins( $Path );
$this->PageJS->add_javascript( $Path.'/include/js/file_input_view.js' );
$this->PageCSS->add_stylesheet( $Path.'/res/css/default.css' );
$Lang = get_package( 'lang' , 'last' , __FILE__ );
$Lang->include_strings_js( 'file_input::file_input_view' );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
view (   $Options)

Component's view.

Parameters
$Options- Settings.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 241 of file file_input_view.php.

{
try
{
if( $Options->get_setting( 'download' , false ) )
{
$this->download( $Options );
}
return( '' );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Field Documentation

$PageCSS = false

Cached packages.

Author
Dodonov A.A.

Definition at line 38 of file file_input_view.php.

$PageJS = false

Definition at line 39 of file file_input_view.php.

$Security = false

Definition at line 40 of file file_input_view.php.


The documentation for this class was generated from the following file: