KWeb  6.4
KWebAttribute_File Class Reference

Podstawowa klasa do implementowania atrybutow. More...

Inheritance diagram for KWebAttribute_File:
KWebAttribute KWebAttribute_Interface KWebAttribute_Image KWebAttribute_Media

Public Member Functions

 __construct ($id, $title, $opt=array())
 getType ()
 Zwraca nazwę typu .
 onFormPosted (KWebAttribute_Table_Form $form)
 Called from KWebAttribute_Table_Form::setPostedData Attribute can change the data on the form, but should not yet convert or validate it...
 getFileFormId (KWebObject_Attributable $object)
 getPathTypeAccessRight ($type)
 getFileUploadObject ()
 checkPostedFile (KWebObject_Attributable $object, &$value, $lang=false)
 convertData ($value, $format, $conversion)
 getTempFilePath (KWebAttribute_Table_Form $form, $full=false)
 buildTempFilePath ($fileTmp, $full=false)
 storePostedFormData (KWebAttribute_Table_Form $form, $value)
 Stores attribute's data in the object...
 generateFilepath (KWebObject_Attributable $object, $filename)
 Returns unique filepath in the upload dir.
 setFileFromTemp (KWebObject_Attributable $object, $tmpPath, $destName=null, $move=true)
 setFilePath (KWebObject_Attributable $object, $path, $type=KWebPath::FILE, $lang=false)
 getFileExt (KWebObject_Attributable $object, $lang=false)
 getFileValue (KWebObject_Attributable $object, $lang=false)
 Zwraca wartość atrybutu bez typu (nie dotyczy URL)
 getPath (KWebObject_Attributable $object, $lang=false)
 getFilePath (KWebObject_Attributable $object, $lang=false)
 Returns null or KWebPath (usefull for checking existence, otherwise use getPath())
 getFileUrl (KWebObject_Attributable $object, $lang=false, $useMirror=true)
 canMirrorFile ()
 getFileMirrors (KWebObject_Attributable $object, $lang=false)
 getFilePathType (KWebObject_Attributable $object, $lang=false)
 Zwraca typ ścieżki, dla wskazanej ścieżki, lub przypisanej do atrybutu.
 getFileSize (KWebObject_Attributable $object, $lang=false)
 isValidLocalFile (KWebObject_Attributable $object, $lang=false)
 isUrl (KWebObject_Attributable $object, $lang=false)
 getFileSizeLimit ()
 getUploadPath ()
 getFileDenyExt ()
 getFileAcceptExt ()
 checkFile (&$file)
 checkUrl (KWebObject_Attributable $object, &$url)
 checkScript ($mask)
 isTranslated (KWebObject_Attributable $object, $lang=false)
 getImageSrc (KWebObject_Attributable $object, $prev)
 Zwraca ścieżkę do przygotowanego pliku.
 getPreview (KWebObject_Attributable $object, $imgPreview, array $options=array(), $lang=false)
 Returns preview result for this file.

Static Public Member Functions

static extractFileExt ($url)

Data Fields

 $r_type_file = 0
 $r_type_url = 0
 $r_type_script = -1
 $extAccept = false
 $extDeny = false
 $uploadSubdir = false
 Subdirectory KScript, which will be appended to getUploadPath() Examples: '{{ objectData | item_type }}/{{strftime | Y/m}}/' => 'image/'.

Detailed Description

Podstawowa klasa do implementowania atrybutow.


Constructor & Destructor Documentation

KWebAttribute_File::__construct ( id,
title,
opt = array() 
)

Reimplemented from KWebAttribute.

Reimplemented in KWebAttribute_Media, and KWebAttribute_Image.


Member Function Documentation

KWebAttribute_File::buildTempFilePath ( fileTmp,
full = false 
)
KWebAttribute_File::canMirrorFile ( )

Reimplemented in KWebAttribute_Media, and KWebAttribute_Image.

KWebAttribute_File::checkFile ( &$  file)
KWebAttribute_File::checkPostedFile ( KWebObject_Attributable object,
&$  value,
lang = false 
)
KWebAttribute_File::checkScript ( mask)
KWebAttribute_File::checkUrl ( KWebObject_Attributable object,
&$  url 
)

Reimplemented in KWebAttribute_Media.

KWebAttribute_File::convertData ( value,
format,
conversion 
)
Parameters:
$conversiontrue (CONVERT_TO) - dane mają być pokazane W formularzu, false (CONVERT_FROM) - dane pochodzą Z formularza

Reimplemented from KWebAttribute.

static KWebAttribute_File::extractFileExt ( url) [static]
KWebAttribute_File::generateFilepath ( KWebObject_Attributable object,
filename 
)

Returns unique filepath in the upload dir.

KWebAttribute_File::getFileAcceptExt ( )

Reimplemented in KWebAttribute_Media, and KWebAttribute_Image.

KWebAttribute_File::getFileDenyExt ( )
KWebAttribute_File::getFileExt ( KWebObject_Attributable object,
lang = false 
)
KWebAttribute_File::getFileFormId ( KWebObject_Attributable object)
KWebAttribute_File::getFileMirrors ( KWebObject_Attributable object,
lang = false 
)
KWebAttribute_File::getFilePath ( KWebObject_Attributable object,
lang = false 
)

Returns null or KWebPath (usefull for checking existence, otherwise use getPath())

Returns:
KWebPath
KWebAttribute_File::getFilePathType ( KWebObject_Attributable object,
lang = false 
)

Zwraca typ ścieżki, dla wskazanej ścieżki, lub przypisanej do atrybutu.

KWebAttribute_File::getFileSize ( KWebObject_Attributable object,
lang = false 
)
KWebAttribute_File::getFileSizeLimit ( )

Reimplemented in KWebAttribute_Media, and KWebAttribute_Image.

KWebAttribute_File::getFileUploadObject ( )
Returns:
KFileUpload

Reimplemented in KWebAttribute_Image.

KWebAttribute_File::getFileUrl ( KWebObject_Attributable object,
lang = false,
useMirror = true 
)
KWebAttribute_File::getFileValue ( KWebObject_Attributable object,
lang = false 
)

Zwraca wartość atrybutu bez typu (nie dotyczy URL)

KWebAttribute_File::getImageSrc ( KWebObject_Attributable object,
prev 
)

Zwraca ścieżkę do przygotowanego pliku.

Returns:
ImgPreviewResult
KWebAttribute_File::getPath ( KWebObject_Attributable object,
lang = false 
)
Returns:
KWebPath
KWebAttribute_File::getPathTypeAccessRight ( type)
KWebAttribute_File::getPreview ( KWebObject_Attributable object,
imgPreview,
array $  options = array(),
lang = false 
)

Returns preview result for this file.

Parameters:
$imgPreviewImgPreview instance, or instance name
Returns:
ImgPreviewResult

Reimplemented in KWebAttribute_Media.

KWebAttribute_File::getTempFilePath ( KWebAttribute_Table_Form form,
full = false 
)
KWebAttribute_File::getType ( )

Zwraca nazwę typu .

Reimplemented from KWebAttribute.

Reimplemented in KWebAttribute_Media, and KWebAttribute_Image.

KWebAttribute_File::getUploadPath ( )

Reimplemented in KWebAttribute_Media, and KWebAttribute_Image.

KWebAttribute_File::isTranslated ( KWebObject_Attributable object,
lang = false 
)

Reimplemented from KWebAttribute.

KWebAttribute_File::isUrl ( KWebObject_Attributable object,
lang = false 
)
KWebAttribute_File::isValidLocalFile ( KWebObject_Attributable object,
lang = false 
)
KWebAttribute_File::onFormPosted ( KWebAttribute_Table_Form form)

Called from KWebAttribute_Table_Form::setPostedData Attribute can change the data on the form, but should not yet convert or validate it...

In case of error, an Exception should be thrown

Returns:
FALSE to skip this attribute from form processing, TRUE to include it in conversion->validation phase

Reimplemented from KWebAttribute.

KWebAttribute_File::setFileFromTemp ( KWebObject_Attributable object,
tmpPath,
destName = null,
move = true 
)
KWebAttribute_File::setFilePath ( KWebObject_Attributable object,
path,
type = KWebPath::FILE,
lang = false 
)
KWebAttribute_File::storePostedFormData ( KWebAttribute_Table_Form form,
value 
)

Stores attribute's data in the object...

Data is already validated and converted to FORMAT_INTERNAL. This function is called for EVERY attribute with an id, even those, that were not posted.

You should check if it is posted ($form->isAttributedPosted()), and act accordingly.

Data is in FORMAT_INTERNAL

Reimplemented from KWebAttribute.


Field Documentation

KWebAttribute_File::$extAccept = false
KWebAttribute_File::$extDeny = false
KWebAttribute_File::$r_type_file = 0
KWebAttribute_File::$r_type_script = -1
KWebAttribute_File::$r_type_url = 0
KWebAttribute_File::$uploadSubdir = false

Subdirectory KScript, which will be appended to getUploadPath() Examples: '{{ objectData | item_type }}/{{strftime | Y/m}}/' => 'image/'.


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