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

https://bitbucket.org/haloweb/halogy-1.0/ · PHP · 114 lines · 94 code · 20 blank · 0 comment · 4 complexity · db2c0192a0787119198ebe28944a0c63 MD5 · raw file

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