diff options
author | dave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-04-29 09:41:45 +0000 |
---|---|---|
committer | dave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-04-29 09:41:45 +0000 |
commit | fa763e03865b0426332c61f2f3cfa05c43347659 (patch) | |
tree | 3e11d36b64cda22f6ce909c27c570848efadfe81 /views/default/input | |
parent | a6c6c59961848c095c9bf80ce4dd211488a39a02 (diff) | |
download | elgg-fa763e03865b0426332c61f2f3cfa05c43347659.tar.gz elgg-fa763e03865b0426332c61f2f3cfa05c43347659.tar.bz2 |
small tweak to the calendar input
git-svn-id: https://code.elgg.org/elgg/trunk@549 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/input')
-rw-r--r-- | views/default/input/calendar.php | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/views/default/input/calendar.php b/views/default/input/calendar.php index 300850cb3..fd8336a51 100644 --- a/views/default/input/calendar.php +++ b/views/default/input/calendar.php @@ -1,4 +1,4 @@ -<?php +<?php
/**
* Elgg calendar input
@@ -16,27 +16,29 @@ * @uses $vars['internalname'] The name of the input field
*
*/
- - static $calendarjs; - if (empty($calendarjs)) { - - echo <<< END - -<script language="JavaScript" SRC="{$vars['url']}engine/vendors/calendarpopup/CalendarPopup.js"></script> - -END; - $calendarjs = 1; - } - $strippedname = sanitise_string($vars['internalname']); - $js = "cal" . $strippedname; - - if ($vars['value'] > 86400) { - $val = date("F j, Y",$vars['value']); - } - -?> -<script language="JavaScript"> - var cal<?php echo $strippedname; ?> = new CalendarPopup(); -</script> -<input type="text" <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" id="<?php echo $strippedname; ?>" value="<?php echo $val; ?>" /> +
+ static $calendarjs;
+ if (empty($calendarjs)) {
+
+ echo <<< END
+
+<script language="JavaScript" SRC="{$vars['url']}engine/vendors/calendarpopup/CalendarPopup.js"></script>
+
+END;
+ $calendarjs = 1;
+ }
+ $strippedname = sanitise_string($vars['internalname']);
+ $js = "cal" . $strippedname;
+
+ if ($vars['value'] > 86400) {
+ $val = date("F j, Y",$vars['value']);
+ } else {
+ $val = $vars['value'];
+ }
+
+?>
+<script language="JavaScript">
+ var cal<?php echo $strippedname; ?> = new CalendarPopup();
+</script>
+<input type="text" <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" id="<?php echo $strippedname; ?>" value="<?php echo $val; ?>" />
<a href="#" onclick="<?php echo $js; ?>.select(document.getElementById('<?php echo $strippedname; ?>'),'anchor<?php echo $strippedname; ?>','MMM dd, yyyy'); return false;" TITLE="<?php echo $js; ?>.select(document.forms[0].<?php echo $strippedname; ?>,'anchor<?php echo $strippedname; ?>','MMM dd, yyyy'); return false;" NAME="anchor<?php echo $strippedname; ?>" ID="anchor<?php echo $strippedname; ?>">select</a>
\ No newline at end of file |