/halogy/application/modules/events/views/admin/edit_event.php
PHP | 114 lines | 94 code | 20 blank | 0 comment | 4 complexity | db2c0192a0787119198ebe28944a0c63 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">Edit 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 <?php if (isset($message)): ?> 35 <div class="message"> 36 <?php echo $message; ?> 37 </div> 38 <?php endif; ?> 39 40 <h2 class="underline">Place and Time</h2> 41 42 <label for="eventName">Event Title:</label> 43 <?php echo @form_input('eventTitle', set_value('eventTitle', $data['eventTitle']), 'id="eventTitle" class="formelement"'); ?> 44 <br class="clear" /> 45 46 <label for="eventDate">Start Date:</label> 47 <?php echo @form_input('eventDate', date('d M Y', strtotime($data['eventDate'])), 'id="eventDate" class="formelement datebox" readonly="readonly"'); ?> 48 <br class="clear" /> 49 50 <label for="eventEnd">End Date:</label> 51 <?php echo @form_input('eventEnd', (($data['eventEnd'] > 0) ? date('d M Y', strtotime($data['eventEnd'])) : ''), 'id="eventEnd" class="formelement datebox" readonly="readonly"'); ?> 52 <span class="tip">This is optional and useful if the event goes on for more than one day.</span> 53 <br class="clear" /> 54 55 <label for="time">Time:</label> 56 <?php echo @form_input('time', set_value('time', $data['time']), 'id="time" class="formelement"'); ?> 57 <br class="clear" /> 58 59 <label for="location">Location:</label> 60 <?php echo @form_input('location', set_value('location', $data['location']), 'id="location" class="formelement"'); ?> 61 <br class="clear" /><br /> 62 63 <h2 class="underline">Event Description</h2> 64 65 <div class="buttons"> 66 <a href="#" class="boldbutton"><img src="<?php echo $this->config->item('staticPath'); ?>/images/btn_bold.png" alt="Bold" title="Bold" /></a> 67 <a href="#" class="italicbutton"><img src="<?php echo $this->config->item('staticPath'); ?>/images/btn_italic.png" alt="Italic" title="Italic" /></a> 68 <a href="#" class="h1button"><img src="<?php echo $this->config->item('staticPath'); ?>/images/btn_h1.png" alt="Heading 1" title="Heading 1"/></a> 69 <a href="#" class="h2button"><img src="<?php echo $this->config->item('staticPath'); ?>/images/btn_h2.png" alt="Heading 2" title="Heading 2" /></a> 70 <a href="#" class="h3button"><img src="<?php echo $this->config->item('staticPath'); ?>/images/btn_h3.png" alt="Heading 3" title="Heading 3" /></a> 71 <a href="#" class="urlbutton"><img src="<?php echo $this->config->item('staticPath'); ?>/images/btn_url.png" alt="Insert Link" title="Insert Link" /></a> 72 <a href="#" class="halogycms_imagebutton"><img src="<?php echo $this->config->item('staticPath'); ?>/images/btn_image.png" alt="Insert Image" title="Insert Image" /></a> 73 <a href="#" class="halogycms_filebutton"><img src="<?php echo $this->config->item('staticPath'); ?>/images/btn_file.png" alt="Insert File" title="Insert File" /></a> 74 <a href="#" class="previewbutton"><img src="<?php echo $this->config->item('staticPath'); ?>/images/btn_save.png" alt="Preview" title="Preview" /></a> 75 </div> 76 <label for="body">Body:</label> 77 <?php echo @form_textarea('description', set_value('description', $data['description']), 'id="body" class="formelement code half"'); ?> 78 <div class="preview"></div> 79 <br class="clear" /><br /> 80 81 <label for="excerpt">Excerpt:</label> 82 <?php echo @form_textarea('excerpt', set_value('excerpt', $data['excerpt']), 'id="excerpt" class="formelement code short"'); ?> 83 <br class="clear" /><br /> 84 85 <h2 class="underline">Publishing</h2> 86 87 <label for="featured">Featured:</label> 88 <?php 89 $values = array( 90 0 => 'No', 91 1 => 'Yes', 92 ); 93 echo @form_dropdown('featured',$values,set_value('featured', $data['featured']), 'id="featured"'); 94 ?> 95 <br class="clear" /> 96 97 <label for="tags">Tags: <br /></label> 98 <?php echo @form_input('tags', set_value('tags', $data['tags']), 'id="tags" class="formelement"'); ?> 99 <span class="tip">Separate tags with spaces (e.g. “event popular london”)</span> 100 <br class="clear" /> 101 102 <label for="published">Publish:</label> 103 <?php 104 $values = array( 105 1 => 'Yes', 106 0 => 'No (save as draft)', 107 ); 108 echo @form_dropdown('published',$values,set_value('published', $data['published']), 'id="published"'); 109 ?> 110 <br class="clear" /><br /> 111 112 <p class="clear" style="text-align: right;"><a href="#" class="button grey" id="totop">Back to top</a></p> 113 114</form>