Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge remote-tracking branch 'stevangoode/JOINDIN-154' into edit-even…

…t-form

Conflicts:
	src/system/application/controllers/event.php
  • Loading branch information...
commit 1c6c0f26e12ce1704574b3377541688c5a482b50 2 parents 989edcc + b65e2ba
Lorna Jane Mitchell lornajane authored
77 src/system/application/controllers/event.php
View
@@ -315,47 +315,50 @@ function add($id = null)
$this->load->library('upload', $config);
$rules = array(
- 'event_name' => 'required',
- 'event_loc' => 'required',
- 'event_tz_cont' => 'required',
- 'event_tz_place' => 'required',
- 'start_mo' => 'callback_start_mo_check',
- 'end_mo' => 'callback_end_mo_check',
- 'event_stub' => 'callback_stub_check',
- 'cfp_end_mo' => 'callback_cfp_end_mo_check',
- 'cfp_start_mo' => 'callback_cfp_start_mo_check',
- 'cfp_url' => 'callback_cfp_url_check',
- 'tagged' => 'callback_tagged_check'
+ 'event_name' => 'required',
+ 'event_loc' => 'required',
+ 'event_contact_name' => 'required',
+ 'event_contact_email' => 'required|valid_email',
+ 'event_tz_cont' => 'required',
+ 'event_tz_place' => 'required',
+ 'start_mo' => 'callback_start_mo_check',
+ 'end_mo' => 'callback_end_mo_check',
+ 'cfp_start_mo' => 'callback_cfp_start_mo_check',
+ 'cfp_end_mo' => 'callback_cfp_end_mo_check',
+ 'event_stub' => 'callback_stub_check',
+ 'cfp_url' => 'callback_cfp_url_check',
+ 'event_desc' => 'required'
);
$this->validation->set_rules($rules);
$fields = array(
- 'event_name' => 'Event Name',
- 'start_mo' => 'Start Month',
- 'start_day' => 'Start Day',
- 'start_yr' => 'Start Year',
- 'end_mo' => 'End Month',
- 'end_day' => 'End Day',
- 'end_yr' => 'End Year',
- 'event_loc' => 'Event Venue Name',
- 'event_lat' => 'Latitude',
- 'event_long' => 'Longitude',
- 'event_desc' => 'Event Description',
- 'event_tz_cont' => 'Event Timezone (Continent)',
- 'event_tz_place' => 'Event Timezone (Place)',
- 'event_href' => 'Event Link(s)',
- 'event_hashtag' => 'Event Hashtag',
- 'event_private' => 'Private Event',
- 'event_stub' => 'Event Stub',
- 'addr' => 'Google address',
- 'cfp_start_mo' => 'Event Call for Papers Start Date',
- 'cfp_start_day' => 'Event Call for Papers Start Date',
- 'cfp_start_yr' => 'Event Call for Papers Start Date',
- 'cfp_end_mo' => 'Event Call for Papers End Date',
- 'cfp_end_day' => 'Event Call for Papers End Date',
- 'cfp_end_yr' => 'Event Call for Papers End Date',
- 'cfp_url' => 'Event Call for Papers URL',
- 'tagged' => 'Tagged With'
+ 'event_name' => 'Event Title',
+ 'event_contact_name' => 'Event Contact Name',
+ 'event_contact_email' => 'Event Contact Email',
+ 'event_desc' => 'Event Description',
+ 'start_mo' => 'Event Start Month',
+ 'start_day' => 'Event Start Day',
+ 'start_yr' => 'Event Start Year',
+ 'is_cfp' => 'Is CfP',
+ 'is_private' => 'Is this event private?',
+ 'is_admin' => 'I\'m an event admin?',
+ 'cfp_start_day' => 'CfP Start Day',
+ 'cfp_start_mo' => 'CfP Start Month',
+ 'cfp_start_yr' => 'CfP Start Year',
+ 'cfp_end_day' => 'CfP End Day',
+ 'cfp_end_mo' => 'CfP End Month',
+ 'cfp_end_yr' => 'CfP End Year',
+ 'cfp_url' => 'CfP URL',
+ 'end_mo' => 'Event End Month',
+ 'end_day' => 'Event End Day',
+ 'end_yr' => 'Event End Year',
+ 'event_loc' => 'Event Location',
+ 'event_tz_cont' => 'Event Timezone (Continent)',
+ 'event_tz_place' => 'Event Timezone (Place)',
+ 'event_lat' => 'Event Latitude',
+ 'event_long' => 'Event Longitude',
+ 'event_stub' => 'Event Stub',
+ 'addr' => 'Event Address'
);
$this->validation->set_fields($fields);
693 src/system/application/views/event/add.php
View
@@ -1,342 +1,409 @@
-<?php
-// predefine some vars
-
-$msg = '';
-$showFields = array();
-
-//$tz_list=array('Select Continent');
-//foreach ($tz as $k=>$v) { $tz_list[(string)$v->offset]=floor((string)$v->offset/3600); }
-
-if (isset($this->edit_id) && $this->edit_id) {
- echo form_open_multipart('event/edit/'.$this->edit_id);
- $sub ='Save Edits';
- $title ='Edit Event: <a style="text-decoration:none" href="/event/view/'.$detail[0]->ID.'">'.$detail[0]->event_name.'</a>';
- $curr_img = $detail[0]->event_icon;
- menu_pagetitle('Edit Event: '.$detail[0]->event_name);
-} else {
- echo form_open_multipart('event/add');
- $sub = 'Add Event';
- $title = 'Add Event';
- $curr_img='none.gif';
- menu_pagetitle('Add an Event');
-}
-
-echo '<h2>'.$title.'</h2>';
-?>
-<script type="text/javascript" src="/inc/js/event.js"></script>
-
-<?php if (!empty($msg) || !empty($this->validation->error_string)): ?>
-<?php
- if (!empty($this->validation->error_string)) { $msg.=$this->validation->error_string; }
- $this->load->view('msg_info', array('msg' => $msg));
-?>
-<?php endif; ?>
+<?php menu_pagetitle('Edit an event'); ?>
+<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false"></script>
+<script type="text/javascript">
+ var map;
+ var marker;
+ var geocoder;
+ var infowindow = new google.maps.InfoWindow();
+
+ function load_map() {
+ geocoder = new google.maps.Geocoder();
+ var myOptions = {
+ zoom: 5,
+ center: new google.maps.LatLng(53.8000, -1.5833), // UK
+ mapTypeId: google.maps.MapTypeId.ROADMAP
+ };
+ map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
+ google.maps.event.addListener(map, 'click', function(event) {
+ placeMarker(event.latLng);
+ });
+ }
+
+ function placeMarker(location) {
+ var clickedLocation = new google.maps.LatLng(location);
+ if (!marker) {
+ marker = new google.maps.Marker({
+ position: location,
+ map: map
+ });
+ } else {
+ marker.setPosition(location);
+ }
+
+ //map.setCenter(location);
+
+ $('#event_lat').val(location.lat());
+ $('#event_long').val(location.lng());
+ }
+
+ function chooseAddr(lat, lng) {
+ var location = new google.maps.LatLng(lat, lng);
+ map.setCenter(location);
+ placeMarker(location);
+ }
+
+ function addr_search() {
+ var inp = document.getElementById("addr");
+ if (geocoder) {
+ geocoder.geocode( { 'address': inp.value}, function(results, status) {
+ if (status == google.maps.GeocoderStatus.OK) {
+ $('#addr_selection').empty();
+ if (results.length > 1) {
+ $(results).each(function(result) {
+ var newLI = $('<li><a href="#" onclick="chooseAddr(' + this.geometry.location.lat() + ', ' + this.geometry.location.lng() + ');return false;">' + this.formatted_address + '</a></li>');
+ newLI.appendTo($('#addr_selection'));
+ //console.log(result.geometry.location);
+ });
+ }
+ //map.setCenter(results[0].geometry.location);
+ map.fitBounds(results[0].geometry.viewport);
+ placeMarker(results[0].geometry.location);
+ } else {
+ notifications.alert("Geocode was not successful for the following reason: " + status);
+ }
+ });
+ }
+ }
+
+ function toggleCfpDates(){
+
+ var sel_fields = new Array(
+ 'cfp_start_mo','cfp_start_day','cfp_start_yr',
+ 'cfp_end_mo','cfp_end_day','cfp_end_yr','cfp_url'
+ );
+
+ // Get the current status of the first one...
+ stat = $('input[name="is_cfp"]').is(':checked');
+ if(stat){
+ $('div.cfp').show();
+ $.each(sel_fields,function(){
+ $('#'+this).removeAttr("disabled");
+ });
+ }else{
+ $('div.cfp').hide();
+ $.each(sel_fields,function(){
+ $('#'+this).attr("disabled","disabled");
+ });
+ }
+ }
+
+ $('document').ready(function(){
+ load_map();
+ toggleCfpDates();
+ });
+</script>
+<style type="text/css">
+ h2.first
+ {
+ margin-top: 10px;
+ }
+
+ h2
+ {
+ margin-top: 40px;
+ }
+
+ #ctn .main form input, #ctn .main form textarea
+ {
+ border: 1px solid silver;
+ padding: 3px 5px;
+ border-radius: 3px;
+ }
+
+ #ctn .main div.row.last
+ {
+ border: none;
+ }
+
+ div.cfp
+ {
+ display: none;
+ padding-left: 30px;
+ }
+
+ #addr_selection
+ {
+ border: 1px solid silver;
+ height: 210px;
+ margin-right: 13px;
+ background: white;
+ overflow: auto;
+ list-style-image: none;
+ margin-bottom: 0px;
+ }
+
+ #addr_selection li
+ {
+ margin: 0;
+ padding: 0;
+ }
+
+ #addr_selection li a
+ {
+ display: block;
+ border-bottom: 1px solid #f0f0f0;
+ padding: 7px 10px;
+ font-size: 0.9em;
+ }
+
+ #addr_selection li a:hover
+ {
+ background: #f9f9f9;
+ }
+ #ctn .main form #event_long, #ctn .main form #event_lat
+ {
+ border: none;
+ background: transparent;
+ width: auto;
+ display: inline
+ }
+
+ .box .row td
+ {
+ vertical-align: top
+ }
+
+ .box .row table
+ {
+ margin-bottom: 0;
+ }
+
+ #ctn .main form #addr_search_button
+ {
+ width: auto;
+ display: inline
+ }
+
+ #ctn .main form #addr
+ {
+ width: 260px;
+ display: inline;
+ }
+
+ #map_canvas
+ {
+ width: 250px;
+ height: 300px;
+ }
+</style>
+
+<h1 class="icon-event">Edit an event</h1>
+
+<?php if (!empty($msg)) $this->load->view('msg_info', array('msg' => $msg)); ?>
+
+<?php if (empty($msg)): ?>
<div class="box">
- <div class="row">
- <label for="event_name">Event Name:</label>
- <?php echo form_input('event_name', $this->validation->event_name); ?>
- </div>
+ <?php echo form_open('event/edit/'.$this->validation->ID, array('class' => 'form-event-submit')); ?>
+ <?php if (!empty($this->validation->error_string)): ?>
+ <?php $this->load->view('msg_error', array('msg' => $this->validation->error_string)); ?>
+ <?php endif; ?>
+
+<h2 class="first">General</h2>
+
+ <?php if ($is_site_admin): ?>
+<div class="row">
+ <label for="bypass_spam_filter">Bypass Spam Filter</label>
+ <?php echo form_checkbox('bypass_spam_filter', 1); ?> Check to bypass spam filtering
+ <div class="clear"></div>
+</div>
+ <?php endif; ?>
+
+<div class="row">
+ <label for="event_title">Event Title *</label>
+ <?php echo form_input(array('name' => 'event_name', 'id' => 'event_title'), $this->validation->event_name); ?>
+ <div class="clear"></div>
+</div>
+
+<div class="row">
+ <label for="event_location">Venue name *</label>
+ <?php echo form_input(array('name' => 'event_loc', 'id' => 'event_location'), $this->validation->event_loc); ?>
<div class="clear"></div>
- <div class="row">
- <label for="event_icon">Event Icon:</label>
- <table cellpadding="0" cellspacing="0" border="0">
+</div>
+
+<div class="row last">
+ <label for="addr">Venue location</label>
+ <table>
<tr>
- <td style="padding-right:10px">
- <img src="/inc/img/event_icons/<?php echo $curr_img; ?>"/>
+ <td>
+ <table>
+ <tr>
+ <td colspan="2">
+ <input type="text" name="addr" id="addr" value="<?php echo $this->validation->addr; ?>" />
+ <input type="button" id="addr_search_button" onclick="addr_search()" value="Search" />
+ </td>
+ </tr>
+ <tr>
+ <td>Latitude</td>
+ <td>
+ <input type="text" name="event_lat" id="event_lat" readonly="readonly" value="<?php echo $this->validation->event_lat; ?>" />
+ </td>
+ </tr>
+ <tr>
+ <td>Longitude</td>
+ <td>
+ <input type="text" name="event_long" id="event_long" readonly="readonly" value="<?php echo $this->validation->event_long; ?>" />
+ </td>
+ </tr>
+ </table>
+ <ul id="addr_selection"></ul>
</td>
- <td style="vertical-align:top">
- <input type="file" name="event_icon" size="20" /><br/><br/>
- <span style="color:#3567AC;font-size:11px">
- <b>Please Note:</b> Only icons that are 90 pixels by 90 pixels will be accepted!<br/>
- Allowed types: gif, jpg, png
+ <td align="right">
+ <div id="map_canvas"></div>
</td>
</tr>
- </table>
- </span>
- </div>
- <div class="clear"></div>
- <div class="row">
- <table cellpadding="0" cellspacing="0" border="0">
- <tr><td>
- <label for="event_start">Event Start:</label>
- <?php
- foreach (range(1,12) as $v) {
- $m=date('M', mktime(0,0,0, $v,1, date('Y')));
- $start_mo[$v]=$m; }
- foreach (range(1,32) as $v) { $start_day[$v]=$v; }
- foreach (range($min_start_yr, date('Y')+5) as $v) { $start_yr[$v]=$v; }
- echo form_dropdown('start_day', $start_day, $this->validation->start_day, 'id="start_day"');
- echo form_dropdown('start_mo', $start_mo, $this->validation->start_mo, 'id="start_mo"');
- echo form_dropdown('start_yr', $start_yr, $this->validation->start_yr, 'id="start_yr"');
- echo form_datepicker('start_day', 'start_mo', 'start_yr');
- ?>
- &nbsp;&nbsp;
- </td>
- <td>
- <label for="event_end">Event End:</label>
- <?php
- foreach (range(1,12) as $v) {
- $m=date('M', mktime(0,0,0, $v,1, date('Y')));
- $end_mo[$v]=$m; }
- foreach (range(1,32) as $v) { $end_day[$v]=$v; }
- foreach (range($min_end_yr, date('Y')+5) as $v) { $end_yr[$v]=$v; }
- echo form_dropdown('end_day', $end_day, $this->validation->end_day);
- echo form_dropdown('end_mo', $end_mo, $this->validation->end_mo);
- echo form_dropdown('end_yr', $end_yr, $this->validation->end_yr);
- echo form_datepicker('end_day', 'end_mo', 'end_yr');
- ?>
- </td></tr>
</table>
- </div>
<div class="clear"></div>
- <div class="row">
- <label for="event_description">Event Description:</label>
- <?php
- $arr=array(
- 'name' => 'event_desc',
- 'cols' => 45,
- 'rows' => 12,
- 'value' => $this->validation->event_desc
- );
- echo form_textarea($arr);
- ?>
- </div>
+</div>
+
+<h2>Contact Information</h2>
+<div class="row">
+ <label for="event_contact_name">Event Contact Name *</label>
+ <?php echo form_input(array('name' => 'event_contact_name', 'id' => 'event_contact_name', 'value' => $this->validation->event_contact_name)); ?>
<div class="clear"></div>
- <div class="row">
- <label for="event_icon">Tagged with:</label>
- <?php
- echo form_input('tagged', $this->validation->tagged);
- ?>
- <span style="color:#3567AC;font-size:11px">
- Seperate tags with commas, limit <b>5 tags</b>, alpha-numeric only
- </span>
- </div>
+</div>
+
+<div class="row">
+ <label for="event_contact_email">Event Contact Email *</label>
+ <?php echo form_input(array('name' => 'event_contact_email', 'id' => 'event_contact_email'), $this->validation->event_contact_email); ?>
<div class="clear"></div>
- <div class="row">
- <label for="event_icon">Is the event private?</label>
- <?php
- $ev_y=($this->validation->event_private=='Y') ? true : false;
- $ev_n=($this->validation->event_private=='N') ? true : false;
- if (empty($this->validation->event_private)) { $ev_n=true; }
+</div>
- echo form_radio('event_private','Y', $ev_y).' Yes';
- echo form_radio('event_private','N', $ev_n).' No';
- ?>
- </div>
+ <?php if ($is_auth): ?>
+<div class="row last">
+ <?php
+ echo form_checkbox('is_admin','1', ($this->validation->is_admin == '1')); ?> I'm an event admin!<br/>
<div class="clear"></div>
- <div class="row">
- <label for="event_loc">Venue name:</label>
- <?php echo form_input(
- array('name'=>'event_loc',
- 'id'=>'event_loc'
- ), $this->validation->event_loc); ?>
- </div>
+</div>
+ <?php endif; ?>
+
+<h2>Event Details</h2>
+<div class="row">
+ <label for="event_stub">Event Stub</label>
+ <?php echo form_input(array('name' => 'event_stub', 'id' => 'event_stub'), $this->validation->event_stub, 'placeholder="my-event"'); ?>
<div class="clear"></div>
+</div>
- <div class="row">
- <label for="geo">Event Location</label>
- <link rel="stylesheet" href="/inc/leaflet/leaflet.css" />
- <!--[if lte IE 8]><link rel="stylesheet" href="/inc/leaflet/leaflet.ie.css" />< ![endif]-->
- <script src="/inc/leaflet/leaflet.js"></script>
+<div class="row">
+ <label for="event_tz_cont">Event Timezone *</label>
+ <?php echo custom_timezone_menu('event_tz', $this->validation->event_tz_cont, $this->validation->event_tz_place ); ?>
+ <div class="clear"></div>
+</div>
- <table cellpadding="0" cellspacing="0" border="0">
+<div class="row">
+ <table>
+ <tr>
+ <td><label for="start">Event Start Date *</label></td>
+ <td><label for="end">Event End Date *</label></td>
+ </tr>
<tr>
<td>
- <?php
- if (is_numeric($this->validation->event_lat) && $this->validation->event_lat != '') {
- $lat = $this->validation->event_lat;
- $long = $this->validation->event_long;
- $zoom = 13;
- } else {
- $lat = 0;
- $long = 0;
- $zoom = 0;
- }
- ?>
- <input type="hidden" name="map_latitude" id="map_latitude" value="<?php echo $lat; ?>"/>
- <input type="hidden" name="map_longitude" id="map_longitude" value="<?php echo $long; ?>"/>
- <input type="hidden" name="map_zoom" id="map_zoom" value="<?php echo $zoom; ?>"/>
-
- <input type="hidden" name="event_lat" id="event_lat" value="<?php echo $lat; ?>"/>
- <input type="hidden" name="event_long" id="event_long" value="<?php echo $long; ?>"/>
-
- <table cellpadding="0" cellspacing="0" border="0">
- <tr>
- <td style="padding-right:5px">
- <div id="map_canvas" style="width: 300px; height: 300px"></div>
- </td>
- <td style="vertical-align:top">
- Address Search:<br/>
- <?php
- $attr = array(
- 'id' => 'addr',
- 'name' => 'addr',
- 'size' => 10,
- 'value' => $this->validation->addr,
- 'style' => 'width: 250px'
- );
- echo form_input($attr);
- ?>
- <button type="button" onclick="addr_search();">Search</button>
- <br/><br/>
- <div id="results"></div>
- <table cellpadding="0" cellspacing="0" border="0">
- <tr>
- <td style="padding-right:8px"><b>Latitude</b></td>
- <td id="output_latitude"></td>
- </tr>
- <tr><td colspan="2">&nbsp;</td></tr>
- <tr>
- <td style="padding-right:8px"><b>Longitude</b></td>
- <td id="output_longitude"></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
-
- <script type="text/javascript" src="/inc/js/event_osm_map.js"></script>
+ <?php
+ foreach (range(1,12) as $v) { $start_mo[$v]=strftime('%B', strtotime('2000-' . $v . '-01')); }
+ foreach (range(1,31) as $v) { $start_day[$v]=sprintf('%02d', $v); }
+ foreach (range(date('Y'), date('Y')+5) as $v) { $start_yr[$v]=$v; }
+
+ echo form_dropdown('start_mo', $start_mo, $this->validation->start_mo);
+ echo form_dropdown('start_day', $start_day, $this->validation->start_day);
+ echo form_dropdown('start_yr', $start_yr, $this->validation->start_yr);
+ echo form_datepicker('start_day', 'start_mo', 'start_yr');
+ ?>
+ </td>
+ <td>
+ <?php
+ foreach (range(1,12) as $v) { $start_mo[$v]=strftime('%B', strtotime('2000-' . $v . '-01')); }
+ foreach (range(1,31) as $v) { $start_day[$v]=sprintf('%02d', $v); }
+ foreach (range(date('Y'), date('Y')+5) as $v) { $start_yr[$v]=$v; }
+
+ echo form_dropdown('end_mo', $start_mo, $this->validation->end_mo);
+ echo form_dropdown('end_day', $start_day, $this->validation->end_day);
+ echo form_dropdown('end_yr', $start_yr, $this->validation->end_yr);
+ echo form_datepicker('end_day', 'end_mo', 'end_yr');
+ ?>
</td>
</tr>
- </table>
- </div>
-
- <div class="row">
- <label for="event_tz_cont">Event Timezone:</label>
- <?php echo custom_timezone_menu('event_tz', $this->validation->event_tz_cont, $this->validation->event_tz_place ); ?>
- <span style="color:#3567AC;font-size:11px">For more information on locations and
- their time zone, see <a href="http://en.wikipedia.org/wiki/List_of_time_zones">this
- page on Wikipedia</a></span>
- </div>
+ </table>
<div class="clear"></div>
- <div class="row">
- <table cellpadding="5" cellspacing="5" border="0">
- <tr>
- <td style="padding-right:10px">
- <label for="event_stub">Event Stub</label>
- <?php echo form_input(array('name' => 'event_stub', 'id' => 'event_stub','maxlength' => 30 ), $this->validation->event_stub); ?>
- <span style="color:#3567AC;font-size:11px">Max length 30 characters</span>
- </td>
- <td style="vertical-align:middle">
- <span style="color:#3567AC;font-size:11px" id="stub_display">
- <?php if (!empty($this->validation->event_stub)) {
- echo '<a href="http://joind.in/event/'.$this->validation->event_stub.'">http://joind.in/event/'.$this->validation->event_stub.'</a>'; } ?>
- </span><br/>
- </tr></table>
- <div class="clear"></div>
- </div>
+</div>
+
+<div class="row">
+ <label for="event_desc">Event Description *</label>
+ <div>(In <em>English</em>, with optional alternative translation)</div>
+ <?php
+ echo form_textarea(array(
+ 'name' => 'event_desc',
+ 'id' => 'event_desc',
+ 'cols' => 50,
+ 'rows' => 10,
+ 'value' => $this->validation->event_desc
+ ));
+ ?>
<div class="clear"></div>
- <div class="row">
- <label for="event_link">Event Link(s):</label>
- <?php echo form_input('event_href', $this->validation->event_href); ?><br/>
- </div>
+</div>
+
+<div class="row">
+ <label for="start">Call for Papers</label>
+ <?php echo form_checkbox('is_cfp','1', $this->validation->cfp_checked, 'onclick="toggleCfpDates()"'); ?>
+ Yes, we're going to have a Call for Papers
<div class="clear"></div>
- <div class="row">
- <label for="event_hashtag">Event Hashtag(s):</label>
- <?php echo form_input('event_hashtag', $this->validation->event_hashtag); ?>
- <span style="color:#3567AC;font-size:11px">Seperate tags with commas</span>
- </div>
+</div>
+
+<div class="row cfp">
+ <table>
+ <tr>
+ <td><label for="cfp_start">Call for Papers Start Date</label></td>
+ <td><label for="cfp_end">Call for Papers End Date</label></td>
+ </tr>
+ <tr>
+ <td>
+ <?php
+ $js = ($this->validation->cfp_checked == 1) ? '' : 'disabled';
+
+ foreach (range(1,12) as $v) { $cfp_start_mo[$v]=strftime('%B', strtotime('2000-' . $v . '-01')); }
+ foreach (range(1,31) as $v) { $cfp_start_day[$v]=sprintf('%02d', $v); }
+ foreach (range(date('Y'), date('Y')+5) as $v) { $cfp_start_yr[$v]=$v; }
+
+ echo form_dropdown('cfp_start_mo', $cfp_start_mo, $this->validation->cfp_start_mo, 'id="cfp_start_mo" ' . $js);
+ echo form_dropdown('cfp_start_day', $cfp_start_day, $this->validation->cfp_start_day, 'id="cfp_start_day" ' . $js);
+ echo form_dropdown('cfp_start_yr', $cfp_start_yr, $this->validation->cfp_start_yr, 'id="cfp_start_yr" ' . $js);
+ echo form_datepicker('cfp_start_day', 'cfp_start_mo', 'cfp_start_yr');
+ ?>
+ </td>
+ <td>
+ <?php
+ foreach (range(1,12) as $v) { $cfp_end_mo[$v]=strftime('%B', strtotime('2000-' . $v . '-01')); }
+ foreach (range(1,31) as $v) { $cfp_end_day[$v]=sprintf('%02d', $v); }
+ foreach (range(date('Y'), date('Y')+5) as $v) { $cfp_end_yr[$v]=$v; }
+
+ echo form_dropdown('cfp_end_mo', $cfp_end_mo, $this->validation->cfp_end_mo, 'id="cfp_end_mo" ' . $js);
+ echo form_dropdown('cfp_end_day', $cfp_end_day, $this->validation->cfp_end_day, 'id="cfp_end_day" ' . $js);
+ echo form_dropdown('cfp_end_yr', $cfp_end_yr, $this->validation->cfp_end_yr, 'id="cfp_end_yr" ' . $js);
+ echo form_datepicker('cfp_end_day', 'cfp_end_mo', 'cfp_end_yr');
+ ?>
+ </td>
+ </tr>
+ </table>
<div class="clear"></div>
-
- <?php
- $cfp_validated = false;
- if (isset($this->validation->cfp_checked)) {
- $showFields[] = 'cfp-fields-toggle-link';
- $cfp_validated = true;
- }
- ?>
-
- <div class="row">
- <label for="start">Call for Papers</label>
- <?php echo form_checkbox('is_cfp','1', $this->validation->cfp_checked, 'onclick="toggleCfpDates()"'); ?>
- Yes, we're going to have a Call for Papers
- <div class="clear"></div>
- </div>
-
- <div class="row cfp">
- <table>
- <tr>
- <td><label for="cfp_start">Call for Papers Start Date</label></td>
- <td><label for="cfp_end">Call for Papers End Date</label></td>
- </tr>
- <tr>
- <td>
- <?php
- $js = ($this->validation->cfp_checked == 1) ? '' : 'disabled';
-
- foreach (range(1,12) as $v) { $cfp_start_mo[$v]=strftime('%B', strtotime('2000-' . $v . '-01')); }
- foreach (range(1,31) as $v) { $cfp_start_day[$v]=sprintf('%02d', $v); }
- foreach (range(date('Y'), date('Y')+5) as $v) { $cfp_start_yr[$v]=$v; }
-
- echo form_dropdown('cfp_start_mo', $cfp_start_mo, $this->validation->cfp_start_mo, 'id="cfp_start_mo" ' . $js);
- echo form_dropdown('cfp_start_day', $cfp_start_day, $this->validation->cfp_start_day, 'id="cfp_start_day" ' . $js);
- echo form_dropdown('cfp_start_yr', $cfp_start_yr, $this->validation->cfp_start_yr, 'id="cfp_start_yr" ' . $js);
- echo form_datepicker('cfp_start_day', 'cfp_start_mo', 'cfp_start_yr');
- ?>
- </td>
- <td>
- <?php
- foreach (range(1,12) as $v) { $cfp_end_mo[$v]=strftime('%B', strtotime('2000-' . $v . '-01')); }
- foreach (range(1,31) as $v) { $cfp_end_day[$v]=sprintf('%02d', $v); }
- foreach (range(date('Y'), date('Y')+5) as $v) { $cfp_end_yr[$v]=$v; }
-
- echo form_dropdown('cfp_end_mo', $cfp_end_mo, $this->validation->cfp_end_mo, 'id="cfp_end_mo" ' . $js);
- echo form_dropdown('cfp_end_day', $cfp_end_day, $this->validation->cfp_end_day, 'id="cfp_end_day" ' . $js);
- echo form_dropdown('cfp_end_yr', $cfp_end_yr, $this->validation->cfp_end_yr, 'id="cfp_end_yr" ' . $js);
- echo form_datepicker('cfp_end_day', 'cfp_end_mo', 'cfp_end_yr');
- ?>
- </td>
- </tr>
- </table>
- <div class="clear"></div>
- </div>
-
- <div class="row cfp">
- <label for="cfp-url">Call for Papers URL</label>
- <?php echo form_input('cfp_url', $this->validation->cfp_url, 'id="cfp_url" placeholder="http://www.example.com"' . $js); ?>
- <div class="clear"></div>
- </div>
-
- <div class="row">
- <?php echo form_submit('sub', $sub); ?>
- </div>
</div>
-<?php echo form_close(); ?>
-<script type="text/javascript">
- function toggleCfpDates(){
+<div class="row cfp">
+ <label for="cfp-url">Call for Papers URL</label>
+ <?php echo form_input('cfp_url', $this->validation->cfp_url, 'id="cfp_url" placeholder="http://www.example.com"' . $js); ?>
+ <div class="clear"></div>
+</div>
- var sel_fields = new Array(
- 'cfp_start_mo','cfp_start_day','cfp_start_yr',
- 'cfp_end_mo','cfp_end_day','cfp_end_yr','cfp_url'
- );
+<div class="row last">
+ <label for="is_private">Is this event private?</label>
+ <?php
+ echo form_radio('is_private','Y', $this->validation->is_private == 'Y') . ' Yes';
+ echo form_radio('is_private','N', $this->validation->is_private == 'N') . ' No';
+ ?><br/>
+</div>
- // Get the current status of the first one...
- stat = $('input[name="is_cfp"]').is(':checked');
- if(stat){
- $('div.cfp').show();
- $.each(sel_fields,function(){
- $('#'+this).removeAttr("disabled");
- });
- }else{
- $('div.cfp').hide();
- $.each(sel_fields,function(){
- $('#'+this).attr("disabled","disabled");
- });
- }
- }
+<div class="row row-buttons">
+ <?php echo form_submit(array('name' => 'sub', 'class' => 'btn-big'), 'Submit event'); ?>
+</div>
-$(document).ready(function() {
- JI_event.init();
- var fields = null;
- JI_event.hideFieldsets(fields);
-
- toggleCfpDates();
-
- var showFields = <?php echo json_encode($showFields); ?>;
-
- for(var x = 0; x < showFields.length; x++)
- $('#' + showFields[x]).click();
-})
-</script>
+ <?php echo form_close(); ?>
+</div>
+<?php endif;
Please sign in to comment.
Something went wrong with that request. Please try again.