$sOptions
BLAH;
return $sCode;
}
function genInputCaptcha(&$aInput)
{
$aAttrs = empty($aInput['attrs']) ? array() : $aInput['attrs'];
// for inputs with labels generate id
if (isset($aInput['label']))
$aAttrs['id'] = $this->getInputId($aInput);
$sAttrs = bx_convert_array2attrs($aAttrs, "bx-form-input-{$aInput['type']}");
$oCaptcha = BxDolCaptcha::getObjectInstance();
return "" . ($oCaptcha ? $oCaptcha->display($this->_bDynamicMode) : _t('_sys_txt_captcha_not_available')) . "
";
}
/**
* Generate Label Element
*
* @param string $sLabel Text of the Label
* @param string $sInputID Dependant Input Element ID
* @return string HTML code
*/
function genLabel(&$aInput)
{
if (!isset($aInput['label']) or empty($aInput['label']))
return '';
$sLabel = $aInput['label'];
$sInputID = $this->getInputId($aInput);
$sRet = '';
return $sRet;
}
function genInfoIcon($sInfo)
{
return '' . bx_process_output($sInfo) . '
';
}
function genErrorIcon( $sError = '' )
{
if ($this->bEnableErrorIcon) {
$sStyle = '';
if (!$sError)
$sStyle = 'style="display:none;"';
return '' . $sError . '
';
}
}
function getOpenSection($aAttrs = array(), $sLegend = '')
{
if (!$this->_isSectionOpened) {
if (!$aAttrs || !is_array($aAttrs))
$aAttrs = array();
if ($sLegend)
$sClassesAdd = "bx-form-section-header";
else
$sClassesAdd = "bx-form-section-divider";
$sAttrs = bx_convert_array2attrs($aAttrs, "bx-form-section bx-def-padding-sec-top bx-def-border-top " . $sClassesAdd);
$this->_isSectionOpened = true;
return "\n \n\n";
} else {
return '';
}
}
function getOpenSectionViewMode($aAttrs = array(), $sLegend = '')
{
if (!$this->_isSectionOpened) {
if (!$aAttrs || !is_array($aAttrs))
$aAttrs = array();
if ($sLegend)
$sClassesAdd = "bx-form-section-header";
else
$sClassesAdd = "bx-form-section-divider";
$sAttrs = bx_convert_array2attrs($aAttrs, "bx-form-section bx-form-view-section bx-def-padding-sec-top bx-def-border-top " . $sClassesAdd);
$this->_isSectionOpened = true;
return "\n \n\n";
} else {
return '';
}
}
function addCssJs ()
{
if (isset($this->aParams['view_mode']) && $this->aParams['view_mode']) {
if (self::$_isCssJsAddedViewMode)
return;
$this->oTemplate->addCss('forms.css');
self::$_isCssJsAddedViewMode = true;
} else {
if (self::$_isCssJsAdded)
return;
$aCss = array(
'forms.css',
'jquery-ui/jquery-ui.css',
'timepicker-addon/jquery-ui-timepicker-addon.css',
BX_DIRECTORY_PATH_PLUGINS_PUBLIC . 'jquery-minicolors/|jquery.minicolors.css',
);
$aUiLangs = array ('af' => 1, 'ar-DZ' => 1, 'ar' => 1, 'az' => 1, 'be' => 1, 'bg' => 1, 'bs' => 1, 'ca' => 1, 'cs' => 1, 'cy-GB' => 1, 'da' => 1, 'de' => 1, 'el' => 1, 'en-AU' => 1, 'en-GB' => 1, 'en-NZ' => 1, 'en' => 1, 'eo' => 1, 'es' => 1, 'et' => 1, 'eu' => 1, 'fa' => 1, 'fi' => 1, 'fo' => 1, 'fr-CA' => 1, 'fr-CH' => 1, 'fr' => 1, 'gl' => 1, 'he' => 1, 'hi' => 1, 'hr' => 1, 'hu' => 1, 'hy' => 1, 'id' => 1, 'is' => 1, 'it' => 1, 'ja' => 1, 'ka' => 1, 'kk' => 1, 'km' => 1, 'ko' => 1, 'ky' => 1, 'lb' => 1, 'lt' => 1, 'lv' => 1, 'mk' => 1, 'ml' => 1, 'ms' => 1, 'nb' => 1, 'nl-BE' => 1, 'nl' => 1, 'nn' => 1, 'no' => 1, 'pl' => 1, 'pt-BR' => 1, 'pt' => 1, 'rm' => 1, 'ro' => 1, 'ru' => 1, 'sk' => 1, 'sl' => 1, 'sq' => 1, 'sr-SR' => 1, 'sr' => 1, 'sv' => 1, 'ta' => 1, 'th' => 1, 'tj' => 1, 'tr' => 1, 'uk' => 1, 'vi' => 1, 'zh-CN' => 1, 'zh-HK' => 1, 'zh-TW' => 1);
$aCalendarLangs = array ('af' => 1, 'am' => 1, 'bg' => 1, 'ca' => 1, 'cs' => 1, 'da' => 1, 'de' => 1, 'el' => 1, 'es' => 1, 'et' => 1, 'eu' => 1, 'fa' => 1, 'fi' => 1, 'fr' => 1, 'gl' => 1, 'he' => 1, 'hr' => 1, 'hu' => 1, 'id' => 1, 'it' => 1, 'ja' => 1, 'ko' => 1, 'lt' => 1, 'lv' => 1, 'mk' => 1, 'nl' => 1, 'no' => 1, 'pl' => 1, 'pt-BR' => 1, 'pt' => 1, 'ro' => 1, 'ru' => 1, 'sk' => 1, 'sl' => 1, 'sr-RS' => 1, 'sr-YU' => 1, 'sv' => 1, 'th' => 1, 'tr' => 1, 'uk' => 1, 'vi' => 1, 'zh-CN' => 1, 'zh-TW' => 1);
$sCalendarLang = BxDolLanguages::getInstance()->detectLanguageFromArray ($aCalendarLangs);
$sUiLang = BxDolLanguages::getInstance()->detectLanguageFromArray ($aUiLangs);
$aJs = array(
'jquery.webForms.js',
'jquery-ui/jquery.ui.core.min.js',
'jquery-ui/jquery.ui.widget.min.js',
'jquery-ui/jquery.ui.mouse.min.js',
'jquery-ui/jquery.ui.position.min.js',
'jquery-ui/jquery.ui.slider.min.js',
'jquery-ui/jquery.ui.datepicker.min.js',
'jquery-ui/i18n/jquery.ui.datepicker-' . $sUiLang . '.js',
'jquery-minicolors/jquery.minicolors.min.js',
'timepicker-addon/jquery-ui-timepicker-addon.min.js',
'timepicker-addon/jquery-ui-sliderAccess.js',
'timepicker-addon/i18n/jquery-ui-timepicker-' . $sCalendarLang . '.js',
);
foreach ($this->aInputs as $aInput) {
if (!isset($aInput['type']) || 'files' != $aInput['type'] || !isset($aInput['uploaders']))
continue;
foreach ($aInput['uploaders'] as $sUploaderObject) {
$oUploader = BxDolUploader::getObjectInstance($sUploaderObject, $aInput['storage_object'], '', $this->oTemplate);
if ($oUploader)
$oUploader->addCssJs();
}
}
$this->oTemplate->addJs($aJs);
$this->oTemplate->addCss($aCss);
self::$_isCssJsAdded = true;
}
}
}
/** @} */