Project

General

Profile

« Previous | Next » 

Revision 571

Added by thorn almost 17 years ago

adapted news-module to use the new jscalendar, removed old one

View differences:

modify_post.php
49 49
			require(WB_PATH.'/modules/'.WYSIWYG_EDITOR.'/include.php');
50 50
}
51 51

  
52
// include jscalendar-setup
53
$jscal_use_time = false; // whether to use a clock, too
54
require_once(WB_PATH."/include/jscalendar/wb-setup.php");
55
// override some vars: (normally, there is no need to change this)
56
//$jscal_lang = "en"; //- calendar-language (default: wb-backend-language)
57
//$jscal_today = ""; // - date the calendar offers if the text-field is empty (default: today)
58
//$jscal_firstday = "0"; // - first-day-of-week (0-sunday, 1-monday, ...) (default: 0(EN) or 1(everything else))
59
//$jscal_format = "Y-m-d"; // - initial-format used for the text-field (default: from wb-backend-date-format)
60
//$jscal_ifformat = "%Y-%m-%d"; // - format for jscalendar (default: from wb-backend-date-format)
61

  
52 62
?>
53
<script type="text/javascript" src="calendar/calendarDateInput.js"></script>
54 63

  
55 64
<h2><?php echo $TEXT['ADD'].'/'.$TEXT['MODIFY'].' '.$TEXT['POST']; ?></h2>
56 65

  
......
113 122
</tr>
114 123
<tr>
115 124
	<td><?php echo $TEXT['DATE']; ?>:</td>
116
	<td><script>DateInput('publishdate', true, 'YYYY-MM-DD'<?php if($fetch_content['published_when'] != 0) { echo ",'" . date("Y-m-d",$fetch_content['published_when']) . "'"; } ?>)</script></td>
125
	<td>
126
	<input type="text" id="publishdate" name="publishdate" value="<?php if($fetch_content['published_when']==0) print ""; else print date($jscal_format, $fetch_content['published_when'])?>" style="width: 120px;" />
127
	<img src="<?php echo WB_URL ?>/include/jscalendar/img.gif" id="publishdate_trigger" style="cursor: pointer; border: 1px solid red;" title="Calendar" onmouseover="this.style.background='red';" onmouseout="this.style.background=''" />
128
	</td>
117 129
</tr>
118 130
</table>
119 131

  
......
151 163
</tr>
152 164
</table>
153 165

  
166
<script type="text/javascript">
167
	Calendar.setup(
168
		{
169
			inputField  : "publishdate",
170
			ifFormat    : "<?php echo $jscal_ifformat ?>",
171
			button      : "publishdate_trigger",
172
			firstDay    : <?php echo $jscal_firstday ?>,
173
			<?php if(isset($jscal_use_time) && $jscal_use_time==TRUE) { ?>
174
				showsTime   : "true",
175
				timeFormat  : "24",
176
			<?php } ?>
177
			date        : "<?php echo $jscal_today ?>",
178
			range       : [1970, 2037],
179
			step        : 1
180
		}
181
	);
182
</script>
183

  
154 184
<br />
155 185

  
156 186
<h2><?php echo $TEXT['MODIFY'].'/'.$TEXT['DELETE'].' '.$TEXT['COMMENT']; ?></h2>

Also available in: Unified diff