Skip to content

Commit

Permalink
Merge pull request #47 from himangi/calendar
Browse files Browse the repository at this point in the history
[imp] move calendar markup to layouts
  • Loading branch information
phproberto committed Jun 1, 2014
2 parents f9d11d4 + 6e5bafb commit 0f7d2e7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
18 changes: 18 additions & 0 deletions layouts/libraries/joomla/form/fields/calendar.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

defined('JPATH_BASE') or die;

extract($displayData);

// Including fallback code for HTML5 non supported browsers.
JHtml::_('jquery.framework');
JHtml::_('script', 'system/html5fallback.js', false, true);

echo JHtml::_('calendar', $value, $name, $id, $format, $attributes);
14 changes: 9 additions & 5 deletions libraries/joomla/form/fields/calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,14 @@ protected function getInput()
break;
}

// Including fallback code for HTML5 non supported browsers.
JHtml::_('jquery.framework');
JHtml::_('script', 'system/html5fallback.js', false, true);

return JHtml::_('calendar', $this->value, $this->name, $this->id, $format, $attributes);
$displayData = array(
'value' => $this->value,
'name' => $this->name,
'id' => $this->id,
'format' => $format,
'attributes' => $attributes
);

return JLayoutHelper::render('libraries.joomla.form.fields.calendar', $displayData);
}
}

0 comments on commit 0f7d2e7

Please sign in to comment.