protected function loadSiteProperties() { $menu = $this->_application->getCurrentMenu(); $siteProp = $this->_application->getSiteProperty(); $title = org_glizy_ObjectValues::get('org.glizy.og', 'title', $menu->title); $description = org_glizy_ObjectValues::get('org.glizy.og', 'description', $menu->description); $keywords = org_glizy_ObjectValues::get('org.glizy.og', 'keywords', $menu->keywords); $this->addOutputCode($title . ' - ' . $siteProp['title'], 'docTitle'); $this->addOutputCode($title . ' - ' . $siteProp['title'], 'doctitle'); // NOTE: per compatibilità $this->addOutputCode($title, 'metadata_title'); $this->addOutputCode($description, 'metadata_description'); $this->addOutputCode($keywords, 'metadata_keywords'); $this->addOutputCode($siteProp['copyright'], 'copyright'); $this->addOutputCode($siteProp['address'], 'address'); $slideShowSpeed = ((int) $siteProp['slideShow'] ?: 5) * 1000; $this->addOutputCode(org_glizy_helpers_JS::JScode('if (typeof(Glizy)!=\'object\') Glizy = {}; Glizy.slideShowSpeed = ' . $slideShowSpeed . ';'), 'head'); $reg = __T(strlen($menu->creationDate) <= 10 || preg_match('/00:00:00|12:00:00 AM/', $menu->creationDate) ? 'GLZ_DATE_FORMAT' : 'GLZ_DATETIME_FORMAT'); $updateText = org_glizy_locale_Locale::get('MW_FOOTER', glz_defaultDate2locale($reg, $menu->creationDate), glz_defaultDate2locale($reg, $menu->modificationDate)); $this->addOutputCode($updateText, 'docUpdate'); }
public function convertToPHPValue($value, AbstractPlatform $platform = null) { return is_string($value) ? glz_defaultDate2locale(__T('GLZ_DATE_FORMAT'), $value) : $value; }
function _validateDate($value, $type) { if ($value != '0000-00-00' && $value != '0000-00-00 00:00:00' && !is_null($value) && !empty($value)) { if (strlen($value) >= 10) { $reg = __T($type == 'date' ? 'GLZ_TIME_TO_DATE_REGEXP' : 'GLZ_TIME_TO_DATETIME_REGEXP'); if (is_array($reg) && preg_match($reg[0], $value)) { $value = glz_defaultDate2locale(__T($type == AR_TYPE_DATE ? 'GLZ_DATE_FORMAT' : 'GLZ_DATETIME_FORMAT'), $value); } } } else { $value = ''; } return $value; }