Hello,
I'm using Contao 2.11.11 and Catalog 2.0 ß2 rev 74.
I got a Catalog with a date field. I've created a cataloglist module which is editable and a catalog edition module…
My problem is the page where is the Catalog edition module dysplays this part of the php code at the top of the page :
And so, the green datepicker button is not located at the right place and is no more active.Code:window.addEvent('domready', function() { new DatePicker('#ctrl_date_panier', { allowEmpty: true, toggleElements: '#toggle_date_panier', pickerClass: 'datepicker_dashboard', format: 'd-m-Y', inputOutputFormat: 'd-m-Y', positionOffset: { x:130, y:-185 }, startDay: 0, days: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'], dayShort: 3, months: ['Janvier','Février','Mars','Avril','Mai','Juin','Juillet','Août','Septembre','Octobre','Novembre','Décembre'], monthShort: 3 }); });
I suppose this a syntax problem in the code. Here is the concerned part of the code in ModuleCatalogEdit.php.
I think the problem is located somewhere around the lines (line 784 in the php file) :Code:// Add datepicker $datepicker = ''; if (in_array($arrData['eval']['rgxp'], array('date', 'time', 'datim'))) { $objDate = new Date($objWidget->value, $GLOBALS['TL_CONFIG'][$arrData['eval']['rgxp'] . 'Format']); $objWidget->value = $objDate->$arrData['eval']['rgxp']; // date picker was changed in 2.10 if(version_compare(VERSION, '2.10', '>=')) { $rgxp = $arrData['eval']['rgxp']; switch ($rgxp) { case 'datim': $time = ",\n timePicker: true"; break; case 'time': $time = ",\n timePickerOnly: true"; break; default: $time = ''; break; } $format = $GLOBALS['TL_CONFIG'][$rgxp.'Format']; $datepicker = '[img]plugins/datepicker/icon.gif[/img]id . '" style="vertical-align:-6px;">'; $GLOBALS['TL_HEAD'][]= 'window.addEvent(\'domready\', function() { new DatePicker(\'#ctrl_' . $objWidget->id . '\', { allowEmpty: true, toggleElements: \'#toggle_' . $objWidget->id . '\', pickerClass: \'datepicker_dashboard\', format: \'' . $format . '\', inputOutputFormat: \'' . $format . '\', positionOffset: { x:130, y:-185 }' . $time . ', startDay: ' . $GLOBALS['TL_LANG']['MSC']['weekOffset'] . ', days: [\''. implode("','", $GLOBALS['TL_LANG']['DAYS']) . '\'], dayShort: ' . $GLOBALS['TL_LANG']['MSC']['dayShortLength'] . ', months: [\''. implode("','", $GLOBALS['TL_LANG']['MONTHS']) . '\'], monthShort: ' . $GLOBALS['TL_LANG']['MSC']['monthShortLength'] . ' }); });'; } else { //$objWidget->datepicker = ' $GLOBALS['TL_HEAD'][]=' <script type="text/javascript"><![CDATA[//><!-- window.addEvent(\'domready\', function() { ' . sprintf($this->getDatePickerString(), 'ctrl_' . $objWidget->id) . ' }); //--><!]]></script>'; // files moved since 2.8 RC1 if(version_compare(VERSION.'.'.BUILD, '2.8.0', '<')) { $GLOBALS['TL_HEAD'][]='<script src="plugins/calendar/calendar.js" type="text/javascript"></script>'; $GLOBALS['TL_CSS'][] = 'plugins/calendar/calendar.css'; } else { $GLOBALS['TL_HEAD'][]='<script src="plugins/calendar/js/calendar.js" type="text/javascript"></script>'; $GLOBALS['TL_CSS'][] = 'plugins/calendar/css/calendar.css'; } } }
What is wrong with that syntax ? Thanks for your help.Code:$GLOBALS['TL_HEAD'][]= 'window.addEvent(\'domready\', function() {


Reply With Quote
Bookmarks