/** * @param string $formName */ function addValidateJsCode($formName = null) { if (!__Config::get('GLIZY_ADD_VALIDATE_JS')) { return; } if (!org_glizy_ObjectValues::get('org.glizy.JS.Validate', 'add', false) && __Config::get('GLIZY_ADD_JS_LIB')) { // Validate org_glizy_ObjectValues::set('org.glizy.JS.Validate', 'add', true); $this->addJSLibCore(); if (file_exists(org_glizy_Paths::get('STATIC_DIR') . 'jquery/jquery.validationEngine/jquery.validationEngine-' . $this->getLanguage() . '.js')) { $this->_rootComponent->addOutputCode(org_glizy_helpers_JS::linkStaticJSfile('jquery/jquery.validationEngine/jquery.validationEngine-' . $this->getLanguage() . '.js'), 'head'); } else { $this->_rootComponent->addOutputCode(org_glizy_helpers_JS::linkStaticJSfile('jquery/jquery.validationEngine/jquery.validationEngine-en.js'), 'head'); } $this->_rootComponent->addOutputCode(org_glizy_helpers_JS::linkStaticJSfile('jquery/jquery.validationEngine/jquery.validationEngine.js'), 'head'); $this->_rootComponent->addOutputCode(org_glizy_helpers_CSS::linkStaticCSSfile('jquery/jquery.validationEngine/validationEngine.jquery.css'), 'head'); } if (!is_null($formName) && __Config::get('GLIZY_ADD_JS_LIB')) { $this->_rootComponent->addOutputCode(org_glizy_helpers_JS::JScode('jQuery(document).ready(function() { $("#' . $formName . '").validationEngine( "attach", { validationEventTrigger: "none", scroll: false, showAllErrors: false } ); });'), 'head'); // $this->_rootComponent->addOutputCode(org_glizy_helpers_JS::JScode( '$(document).ready(function() { $("#'.$formName.'").validationEngine(); });' ), 'head'); } }
function addOutputCode($output, $editableRegion = '', $atEnd = false) { if ($editableRegion == 'relationsGraph' || $editableRegion == 'relations' || $editableRegion == 'referenceRelations' || $editableRegion == 'europeanaRelatedContents' || $editableRegion == 'photogallery') { if (!property_exists($this->_content['relations'], $editableRegion)) { $this->_content['relations']->{$editableRegion} = ''; } $this->_content['relations']->{$editableRegion} .= $output; return; } parent::addOutputCode($output, $editableRegion, $atEnd); }