Changeset View
Changeset View
Standalone View
Standalone View
core/units/forms/forms/forms_tp.php
Show All 12 Lines | |||||
*/ | */ | ||||
defined('FULL_PATH') or die('restricted access!'); | defined('FULL_PATH') or die('restricted access!'); | ||||
class FormsTagProcessor extends kDBTagProcessor{ | class FormsTagProcessor extends kDBTagProcessor{ | ||||
function CheckBox($params) | function CheckBox($params) | ||||
{ | { | ||||
/** @var kDBItem $object */ | |||||
$object = $this->getObject($params); | $object = $this->getObject($params); | ||||
/* @var $object kDBItem */ | |||||
$value = $object->GetDBField($this->SelectParam($params, 'name,field')); | $value = $object->GetDBField($this->SelectParam($params, 'name,field')); | ||||
if ( $value ) { | if ( $value ) { | ||||
return 'checked'; | return 'checked'; | ||||
} | } | ||||
if ( is_null($value) ) { | if ( is_null($value) ) { | ||||
return $params['default']; | return $params['default']; | ||||
} | } | ||||
return ''; | return ''; | ||||
} | } | ||||
function MaxUploadSize($params) | function MaxUploadSize($params) | ||||
{ | { | ||||
return round(MAX_UPLOAD_SIZE / 1024 / 1024) . ' Mb'; | return round(MAX_UPLOAD_SIZE / 1024 / 1024) . ' Mb'; | ||||
} | } | ||||
} | } | ||||
No newline at end of file | No newline at end of file |