PageRenderTime 916ms CodeModel.GetById 580ms app.highlight 10ms RepoModel.GetById 250ms app.codeStats 0ms

/halogy/application/modules/events/views/admin/add_event.php

https://bitbucket.org/haloweb/halogy-1.0/
PHP | 109 lines | 89 code | 20 blank | 0 comment | 3 complexity | 0f3f748220a9acdaa60a19e2df245526 MD5 | raw file
  1<script type="text/javascript">
  2function preview(el){
  3	$.post('/admin/events/preview', { body: $(el).val() }, function(data){
  4		$('div.preview').html(data);
  5	});
  6}
  7$(function(){
  8	$("input.datebox").datebox();
  9	$('textarea#body').focus(function(){
 10		$('.previewbutton').show();
 11	});
 12	$('textarea#body').blur(function(){
 13		preview(this);
 14	});
 15	preview($('textarea#body'));	
 16});
 17</script>
 18
 19<form name="form" method="post" action="<?php echo $this->uri->uri_string(); ?>" class="default">
 20	
 21	<h1 class="headingleft">Add Event <small>(<a href="/admin/events">Back to Events</a>)</small></h1>
 22	
 23	<div class="headingright">
 24		<input type="submit" value="Save Changes" class="button" />
 25	</div>
 26	
 27	<div class="clear"></div>
 28	
 29	<?php if ($errors = validation_errors()): ?>
 30		<div class="error">
 31			<?php echo $errors; ?>
 32		</div>
 33	<?php endif; ?>
 34
 35	<h2 class="underline">Place and Time</h2>
 36
 37	<label for="eventName">Event title:</label>
 38	<?php echo @form_input('eventTitle', set_value('eventTitle', $data['eventTitle']), 'id="eventTitle" class="formelement"'); ?>
 39	<br class="clear" />
 40
 41	<label for="eventDate">Start Date:</label>
 42	<?php echo @form_input('eventDate', date('d M Y', strtotime($data['eventDate'])), 'id="eventDate" class="formelement datebox" readonly="readonly"'); ?>
 43	<br class="clear" />
 44
 45	<label for="eventEnd">End Date:</label>
 46	<?php echo @form_input('eventEnd', (($data['eventEnd'] > 0) ? date('d M Y', strtotime($data['eventEnd'])) : ''), 'id="eventEnd" class="formelement datebox" readonly="readonly"'); ?>
 47	<span class="tip">This is optional and useful if the event goes on for more than one day.</span>
 48	<br class="clear" />
 49
 50	<label for="time">Time:</label>
 51	<?php echo @form_input('time', set_value('time', $data['time']), 'id="time" class="formelement"'); ?>
 52	<br class="clear" />
 53
 54	<label for="location">Location:</label>
 55	<?php echo @form_input('location', set_value('location', $data['location']), 'id="location" class="formelement"'); ?>
 56	<br class="clear" /><br />
 57
 58	<h2 class="underline">Event Description</h2>	
 59
 60	<div class="buttons">
 61		<a href="#" class="boldbutton"><img src="<?php echo $this->config->item('staticPath'); ?>/images/btn_bold.png" alt="Bold" title="Bold" /></a>
 62		<a href="#" class="italicbutton"><img src="<?php echo $this->config->item('staticPath'); ?>/images/btn_italic.png" alt="Italic" title="Italic" /></a>
 63		<a href="#" class="h1button"><img src="<?php echo $this->config->item('staticPath'); ?>/images/btn_h1.png" alt="Heading 1" title="Heading 1"/></a>
 64		<a href="#" class="h2button"><img src="<?php echo $this->config->item('staticPath'); ?>/images/btn_h2.png" alt="Heading 2" title="Heading 2" /></a>
 65		<a href="#" class="h3button"><img src="<?php echo $this->config->item('staticPath'); ?>/images/btn_h3.png" alt="Heading 3" title="Heading 3" /></a>	
 66		<a href="#" class="urlbutton"><img src="<?php echo $this->config->item('staticPath'); ?>/images/btn_url.png" alt="Insert Link" title="Insert Link" /></a>
 67		<a href="#" class="halogycms_imagebutton"><img src="<?php echo $this->config->item('staticPath'); ?>/images/btn_image.png" alt="Insert Image" title="Insert Image" /></a>
 68		<a href="#" class="halogycms_filebutton"><img src="<?php echo $this->config->item('staticPath'); ?>/images/btn_file.png" alt="Insert File" title="Insert File" /></a>
 69		<a href="#" class="previewbutton"><img src="<?php echo $this->config->item('staticPath'); ?>/images/btn_save.png" alt="Preview" title="Preview" /></a>	
 70	</div>
 71	<label for="body">Body:</label>
 72	<?php echo @form_textarea('description', set_value('description', $data['description']), 'id="body" class="formelement code half"'); ?>
 73	<div class="preview"></div>
 74	<br class="clear" /><br />
 75
 76	<label for="excerpt">Excerpt:</label>
 77	<?php echo @form_textarea('excerpt', set_value('excerpt', $data['excerpt']), 'id="excerpt" class="formelement code short"'); ?>
 78	<br class="clear" /><br />
 79
 80	<h2 class="underline">Publishing</h2>
 81	
 82	<label for="featured">Featured:</label>
 83	<?php 
 84		$values = array(
 85			0 => 'No',
 86			1 => 'Yes',
 87		);
 88		echo @form_dropdown('featured',$values,set_value('featured', $data['featured']), 'id="featured"'); 
 89	?>
 90	<br class="clear" />
 91
 92	<label for="tags">Tags: <br /></label>
 93	<?php echo @form_input('tags', set_value('tags', $data['tags']), 'id="tags" class="formelement"'); ?>
 94	<span class="tip">Separate tags with spaces (e.g. &ldquo;event popular london&rdquo;)</span>
 95	<br class="clear" />
 96
 97	<label for="published">Publish:</label>
 98	<?php 
 99		$values = array(
100			1 => 'Yes',
101			0 => 'No (save as draft)',
102		);
103		echo @form_dropdown('published',$values,set_value('published', $data['published']), 'id="published"'); 
104	?>
105	<br class="clear" /><br />
106
107	<p class="clear" style="text-align: right;"><a href="#" class="button grey" id="totop">Back to top</a></p>		
108	
109</form>