function options_subpanel() { global $ec3; if (isset($_POST['info_update'])) { echo '<div id="message" class="updated fade"><p><strong>'; if (isset($_POST['ec3_event_category'])) { $ec3->set_event_category(intval($_POST['ec3_event_category'])); } if (isset($_POST['ec3_num_months'])) { $ec3->set_num_months(intval($_POST['ec3_num_months'])); } if (isset($_POST['ec3_show_only_events'])) { $ec3->set_show_only_events(intval($_POST['ec3_show_only_events'])); } if (isset($_POST['ec3_day_length'])) { $ec3->set_day_length(intval($_POST['ec3_day_length'])); } if (isset($_POST['ec3_hide_logo'])) { $ec3->set_hide_logo(intval($_POST['ec3_hide_logo'])); } if (isset($_POST['ec3_hide_event_box'])) { $ec3->set_hide_event_box(intval($_POST['ec3_hide_event_box'])); } if (isset($_POST['ec3_advanced'])) { $ec3->set_advanced(intval($_POST['ec3_advanced'])); } if (isset($_POST['ec3_navigation'])) { $ec3->set_navigation(intval($_POST['ec3_navigation'])); } if (isset($_POST['ec3_disable_popups'])) { $ec3->set_disable_popups(intval($_POST['ec3_disable_popups'])); } if (isset($_POST['ec3_tz'])) { $ec3->set_tz($_POST['ec3_tz']); } _e('Options saved.'); echo '</strong></p></div>'; } ?> <div class="wrap"> <form method="post"> <h2><?php _e('Event Calendar Options', 'ec3'); ?> </h2> <?php if (isset($_GET['ec3_easteregg'])) { ?> <h3><?php _e('Easter Egg', 'ec3'); ?> : <input type="submit" name="ec3_upgrade_posts" value="<?php _e('Upgrade Event Posts', 'ec3'); ?> " /></h3> <?php } ?> <table class="form-table"> <tr valign="top"> <th width="33%" scope="row"><?php _e('Event category', 'ec3'); ?> :</th> <td> <select name="ec3_event_category"> <?php if (0 == $ec3->event_category) { echo '<option value="0">' . __('- Select -') . '</option>'; } wp_dropdown_cats(0, $ec3->event_category); ?> </select> <br /><em> <?php _e("Event posts are put into this category for you. Don't make this your default post category.", 'ec3'); ?> </em> </td> </tr> <tr valign="top"> <th width="33%" scope="row"><?php _e('Show schedule within posts', 'ec3'); ?> :</th> <td> <select name="ec3_hide_event_box"> <option value='0'<?php if (!$ec3->hide_event_box) { echo " selected='selected'"; } ?> > <?php _e('Show Schedule', 'ec3'); ?> </option> <option value='1'<?php if ($ec3->hide_event_box) { echo " selected='selected'"; } ?> > <?php _e('Hide Schedule', 'ec3'); ?> </option> </select> </td> </tr> <tr valign="top"> <th width="33%" scope="row"><?php _e('Show events as blog entries', 'ec3'); ?> :</th> <td> <select name="ec3_advanced"> <option value='0'<?php if (!$ec3->advanced_setting) { echo " selected='selected'"; } ?> > <?php _e('Events are Normal Posts', 'ec3'); ?> </option> <option value='1'<?php if ($ec3->advanced_setting) { echo " selected='selected'"; } ?> > <?php _e('Keep Events Separate', 'ec3'); ?> </option> </select> <br /><em> <?php _e('Keep Events Separate: the Event Category page shows future events, in date order. Events do not appear on front page.', 'ec3'); ?> </em> </td> <tr valign="top"> <?php if ($ec3->tz_disabled) { ?> <th style="color:gray" width="33%" scope="row"><?php _e('Timezone', 'ec3'); ?> :</th> <td> <input disabled="disabled" type="text" value="<?php if (empty($ec3->tz)) { _e('unknown', 'ec3'); } else { echo $ec3->tz; } ?> " /> <br /><em> <?php _e("You cannot change your timezone. Turn off PHP's 'safe mode' or upgrade to PHP5.", 'ec3'); ?> </em> </td> <?php } else { ?> <th width="33%" scope="row"><?php _e('Timezone', 'ec3'); ?> :</th> <td> <select name="ec3_tz"> <option value="wordpress">WordPress</option> <?php ec3_get_tz_options($ec3->tz); ?> </select> </td> <?php } ?> </tr> </table> <h3><?php _e('Calendar Display', 'ec3'); ?> </h3> <table class="form-table"> <tr valign="top"> <th width="33%" scope="row"><?php _e('Number of months', 'ec3'); ?> :</th> <td> <input type="text" name="ec3_num_months" value="<?php echo $ec3->num_months; ?> " /> </td> </tr> <tr valign="top"> <th width="33%" scope="row"><?php _e('Show all categories in calendar', 'ec3'); ?> :</th> <td> <select name="ec3_show_only_events"> <option value='1'<?php if ($ec3->show_only_events) { echo " selected='selected'"; } ?> > <?php _e('Only Show Events', 'ec3'); ?> </option> <option value='0'<?php if (!$ec3->show_only_events) { echo " selected='selected'"; } ?> > <?php _e('Show All Posts', 'ec3'); ?> </option> </select> </td> </tr> <tr valign="top"> <th width="33%" scope="row"><?php _e('Show day names as', 'ec3'); ?> :</th> <td> <select name="ec3_day_length"> <option value='1'<?php if ($ec3->day_length < 3) { echo " selected='selected'"; } ?> > <?php _e('Single Letter', 'ec3'); ?> </option> <option value='3'<?php if (3 == $ec3->day_length) { echo " selected='selected'"; } ?> > <?php _e('3-Letter Abbreviation', 'ec3'); ?> </option> <option value='9'<?php if ($ec3->day_length > 3) { echo " selected='selected'"; } ?> > <?php _e('Full Day Name', 'ec3'); ?> </option> </select> </td> </tr> <tr valign="top"> <th width="33%" scope="row"><?php _e('Show Event Calendar logo', 'ec3'); ?> :</th> <td> <select name="ec3_hide_logo"> <option value='0'<?php if (!$ec3->hide_logo) { echo " selected='selected'"; } ?> > <?php _e('Show Logo', 'ec3'); ?> </option> <option value='1'<?php if ($ec3->hide_logo) { echo " selected='selected'"; } ?> > <?php _e('Hide Logo', 'ec3'); ?> </option> </select> </td> </tr> <tr valign="top"> <th width="33%" scope="row"><?php _e('Position of navigation links', 'ec3'); ?> :</th> <td> <select name="ec3_navigation"> <option value='0'<?php if (0 == !$ec3->navigation) { echo " selected='selected'"; } ?> > <?php _e('Above Calendar', 'ec3'); ?> </option> <option value='1'<?php if (1 == $ec3->navigation) { echo " selected='selected'"; } ?> > <?php _e('Below Calendar', 'ec3'); ?> </option> <option value='2'<?php if (2 == $ec3->navigation) { echo " selected='selected'"; } ?> > <?php _e('Hidden', 'ec3'); ?> </option> </select> <br /><em> <?php _e('The navigation links are more usable when they are above the calendar, but you might prefer them below or hidden for aesthetic reasons.', 'ec3'); ?> </em> </td> </tr> <tr valign="top"> <th width="33%" scope="row"><?php _e('Popup event lists', 'ec3'); ?> :</th> <td> <select name="ec3_disable_popups"> <option value='0'<?php if (!$ec3->disable_popups) { echo " selected='selected'"; } ?> > <?php _e('Show Popups', 'ec3'); ?> </option> <option value='1'<?php if ($ec3->disable_popups) { echo " selected='selected'"; } ?> > <?php _e('Hide Popups', 'ec3'); ?> </option> </select> <br /><em> <?php _e('You might want to disable popups if you use Nicetitles.', 'ec3'); ?> </em> </td> </tr> </table> <p class="submit"><input type="submit" name="info_update" value="<?php _e('Save Changes'); ?> " /></p> </form> </div> <?php }
function options_subpanel() { global $ec3; if (isset($_POST['info_update'])) { echo '<div id="message" class="updated fade"><p><strong>'; if (isset($_POST['ec3_event_category'])) { $ec3->set_event_category(intval($_POST['ec3_event_category'])); } if (isset($_POST['ec3_show_event_box'])) { $ec3->set_show_event_box(intval($_POST['ec3_show_event_box'])); } if (isset($_POST['ec3_advanced'])) { $ec3->set_advanced(intval($_POST['ec3_advanced'])); } if (isset($_POST['ec3_tz'])) { $ec3->set_tz($_POST['ec3_tz']); } _e('Options saved.'); echo '</strong></p></div>'; } ?> <div class="wrap"> <form method="post"> <h2><?php _e('Event Calendar Options', 'ec3'); ?> </h2> <?php if (isset($_GET['ec3_easteregg'])) { ?> <h3><?php _e('Easter Egg', 'ec3'); ?> : <input type="submit" name="ec3_upgrade_posts" value="<?php _e('Upgrade Event Posts', 'ec3'); ?> " /></h3> <?php } ?> <table class="form-table"> <tr valign="top"> <th width="33%" scope="row"><?php _e('Event category', 'ec3'); ?> :</th> <td> <select name="ec3_event_category"> <?php if (0 == $ec3->event_category) { echo '<option value="0">' . __('- Select -') . '</option>'; } wp_dropdown_cats(0, $ec3->event_category); ?> </select> <br /><em> <?php _e("Event posts are put into this category for you. Don't make this your default post category.", 'ec3'); ?> </em> </td> </tr> <tr valign="top"> <th width="33%" scope="row"><?php _e('Show times within post content', 'ec3'); ?> :</th> <td> <select name="ec3_show_event_box"> <option value='0'<?php if ($ec3->show_event_box == 0) { echo " selected='selected'"; } ?> > <?php _e('Hide Times', 'ec3'); ?> </option> <option value='1'<?php if ($ec3->show_event_box == 1) { echo " selected='selected'"; } ?> > <?php _e('List Times', 'ec3'); ?> </option> <option value='2'<?php if ($ec3->show_event_box == 2) { echo " selected='selected'"; } ?> > <?php _e('Show Times as Icons', 'ec3'); ?> </option> </select> </td> </tr> <tr valign="top"> <th width="33%" scope="row"><?php _e('Show events as blog entries', 'ec3'); ?> :</th> <td> <select name="ec3_advanced"> <option value='0'<?php if (!$ec3->advanced_setting) { echo " selected='selected'"; } ?> > <?php _e('Events are Normal Posts', 'ec3'); ?> </option> <option value='1'<?php if ($ec3->advanced_setting) { echo " selected='selected'"; } ?> > <?php _e('Keep Events Separate', 'ec3'); ?> </option> </select> <br /><em> <?php _e('Keep Events Separate: the Event Category page shows future events, in date order. Events do not appear on front page.', 'ec3'); ?> </em> </td> <tr valign="top"> <?php if ($ec3->tz_disabled) { ?> <th style="color:gray" width="33%" scope="row"><?php _e('Timezone', 'ec3'); ?> :</th> <td> <input disabled="disabled" type="text" value="<?php if (empty($ec3->tz)) { _e('unknown', 'ec3'); } else { echo $ec3->tz; } ?> " /> <br /><em> <?php _e("You cannot change your timezone. Turn off PHP's 'safe mode' or upgrade to PHP5.", 'ec3'); ?> </em> </td> <?php } else { ?> <th width="33%" scope="row"><?php _e('Timezone', 'ec3'); ?> :</th> <td> <select name="ec3_tz"> <option value="wordpress">WordPress</option> <?php ec3_get_tz_options($ec3->tz); ?> </select> </td> <?php } ?> </tr> </table> <p class="submit"><input type="submit" name="info_update" value="<?php _e('Save Changes'); ?> " /></p> </form> </div> <?php }
function options_subpanel() { global $ec3, $wpdb; $table_opt = $wpdb->prefix . 'ec3_add_opt'; //$post_types = get_post_types( '', 'names' ); //$listeActivePosteType = $ec3->listPostType; $OpenAgandaKey = $ec3->OpenAgandaKey; $OpenAgandaSecretKey = $ec3->OpenAgandaSecretKey; $OpenAgandaSlugName = $ec3->OpenAgandaSlugName; if (isset($_POST['info_update'])) { echo '<div id="message" class="updated fade"><p><strong>'; if (isset($_POST['ec3_event_category'])) { $ec3->set_event_category(intval($_POST['ec3_event_category'])); } if (isset($_POST['ec3_show_event_box'])) { $ec3->set_show_event_box(intval($_POST['ec3_show_event_box'])); } if (isset($_POST['ec3_advanced'])) { $ec3->set_advanced(intval($_POST['ec3_advanced'])); } if (isset($_POST['ec3_tz'])) { $ec3->set_tz($_POST['ec3_tz']); } // listPostType //$newlistPostType = 'post'; /* if( isset($_POST['ec3PosteType']) ){ $newlistPostType = $_POST['ec3PosteType']; } $ec3->set_listPostType( $newlistPostType ); $listeActivePosteType = $ec3->listPostType; */ if (isset($_POST['OpenAgandaSlugName'])) { $newOpenAgandaSlugName = $_POST['OpenAgandaSlugName']; $ec3->set_OpenAgandaSlugName($newOpenAgandaSlugName); $OpenAgandaSlugName = $ec3->OpenAgandaSlugName; } if (isset($_POST['OpenAgandaKey'])) { $newOpenAgandaKey = $_POST['OpenAgandaKey']; $ec3->set_OpenAgandaKey($newOpenAgandaKey); $OpenAgandaKey = $ec3->OpenAgandaKey; } if (isset($_POST['OpenAgandaSecretKey'])) { $newOpenAgandaSecretKey = $_POST['OpenAgandaSecretKey']; $ec3->set_OpenAgandaSecretKey($newOpenAgandaSecretKey); $OpenAgandaSecretKey = $ec3->OpenAgandaSecretKey; } foreach ($_POST as $k => $v) { if (preg_match('/^nom_option_new_([0-9]+)$/', $k, $match)) { $sid = intval($match[1]); $nom_option = $_POST['nom_option_new_' . $sid]; $message_option = $_POST['message_option_new_' . $sid]; $expo_option = $_POST['expo_option_new_' . $sid]; if (!empty($nom_option)) { $wpdb->insert($table_opt, array('nom' => $nom_option, 'message' => $message_option, 'post_type_expo' => $expo_option), array('%s', '%s', '%s')); } else { } } if (preg_match('/^nom_option_modif_([0-9]+)$/', $k, $match)) { $sid = intval($match[1]); $nom_option = $_POST['nom_option_modif_' . $sid]; $message_option = $_POST['message_option_modif_' . $sid]; $expo_option = $_POST['expo_option_modif_' . $sid]; if (!empty($nom_option)) { $wpdb->update($table_opt, array('nom' => $nom_option, 'message' => $message_option, 'post_type_expo' => $expo_option), array('option_id' => $sid), array('%s', '%s', '%s')); } } if (preg_match('/^nom_option_delete_([0-9]+)$/', $k, $match)) { $sid = intval($match[1]); $wpdb->delete($table_opt, array('option_id' => $sid)); } } _e('Options saved.'); echo '</strong></p></div>'; } ?> <div class="wrap"> <form method="post"> <h2><?php _e('Event Calendar Options', 'ec3'); ?> </h2> <?php if (isset($_GET['ec3_easteregg'])) { ?> <h3><?php _e('Easter Egg', 'ec3'); ?> : <input type="submit" name="ec3_upgrade_posts" value="<?php _e('Upgrade Event Posts', 'ec3'); ?> " /></h3> <?php } ?> <table class="form-table"> <tr valign="top"> <th width="33%" scope="row"><?php _e('Event category', 'ec3'); ?> :</th> <td> <select name="ec3_event_category"> <?php if (0 == $ec3->event_category) { echo '<option value="0">' . __('- Select -') . '</option>'; } wp_dropdown_cats(0, $ec3->event_category); ?> </select> <br /><em> <?php _e("Event posts are put into this category for you. Don't make this your default post category.", 'ec3'); ?> </em> </td> </tr> <tr valign="top"> <th width="33%" scope="row"><?php _e('Show times within post content', 'ec3'); ?> :</th> <td> <select name="ec3_show_event_box"> <option value='0'<?php if ($ec3->show_event_box == 0) { echo " selected='selected'"; } ?> > <?php _e('Hide Times', 'ec3'); ?> </option> <option value='1'<?php if ($ec3->show_event_box == 1) { echo " selected='selected'"; } ?> > <?php _e('List Times', 'ec3'); ?> </option> <option value='2'<?php if ($ec3->show_event_box == 2) { echo " selected='selected'"; } ?> > <?php _e('Show Times as Icons', 'ec3'); ?> </option> </select> </td> </tr> <tr valign="top"> <th width="33%" scope="row"><?php _e('Show events as blog entries', 'ec3'); ?> :</th> <td> <select name="ec3_advanced"> <option value='0'<?php if (!$ec3->advanced_setting) { echo " selected='selected'"; } ?> > <?php _e('Events are Normal Posts', 'ec3'); ?> </option> <option value='1'<?php if ($ec3->advanced_setting) { echo " selected='selected'"; } ?> > <?php _e('Keep Events Separate', 'ec3'); ?> </option> </select> <br /><em> <?php _e('Keep Events Separate: the Event Category page shows future events, in date order. Events do not appear on front page.', 'ec3'); ?> </em> </td> </tr> <tr valign="top"> <?php //if($ec3->tz_disabled): ?> <!-- <th style="color:gray" width="33%" scope="row"><?php // _e('Timezone','ec3'); ?> :</th> <td> <input disabled="disabled" type="text" value="<?php // if(empty($ec3->tz)) // _e('unknown','ec3'); // else // echo $ec3->tz; ?> " /> <br /><em> <?php php; ?> </em> </td> --> <?php //else: ?> <th width="33%" scope="row"><?php _e('Timezone', 'ec3'); ?> :</th> <td> <select name="ec3_tz"> <option value="wordpress">WordPress</option> <?php ec3_get_tz_options($ec3->tz); ?> </select> </td> <?php //endif; ?> </tr> <?php $liste_option = $wpdb->get_results("SELECT * FROM {$table_opt}"); ?> <tr valign="top" id="block_liste_option"> <th width="33%" scope="row"><?php _e('Créer des options sur l\'etat des evenement', 'ec3'); ?> :</th> <?php if (count($liste_option) > 0) { ?> <?php foreach ($liste_option as $value) { ?> <td class="row_option"> <label for="nom_option_modif_<?php echo $value->option_id; ?> ">Nom :</label> <input type="text" name="nom_option_modif_<?php echo $value->option_id; ?> " id="nom_option_modif_<?php echo $value->option_id; ?> " value="<?php echo $value->nom; ?> " > <label for="message_option_modif_<?php echo $value->option_id; ?> " >Message :</label> <textarea name="message_option_modif_<?php echo $value->option_id; ?> " id="message_option_modif_<?php echo $value->option_id; ?> " cols="40" rows="1" ><?php echo $value->message; ?> </textarea> <label for="expo_option_modif_<?php echo $value->option_id; ?> ">Pour les expo uniquement:</label> <input type="checkbox" name="expo_option_modif_<?php echo $value->option_id; ?> " id="expo_option_modif_<?php echo $value->option_id; ?> " value="true" <?php if ($value->post_type_expo == 'true') { echo 'checked="checked"'; } ?> > <button class="del" >-</button> </td> <?php } ?> <?php } ?> <td class="row_option" id="new_block"> <button >+</button> </td> </tr> <tr valign="top"> <th width="33%" scope="row"><?php _e('The slug name of your Agenda', 'ec3'); ?> :</th> <td class="row_option"> <input type="text" name="OpenAgandaSlugName" value="<?php echo $OpenAgandaSlugName; ?> " size="40"> <p>[agenda-slug]: slug of the agenda, found in the url of agenda pages</p> </td> </tr> <tr valign="top"> <th width="33%" scope="row"><?php _e('Your Key of Open Agenda', 'ec3'); ?> :</th> <td class="row_option"> <input type="text" name="OpenAgandaKey" value="<?php echo $OpenAgandaKey; ?> " size="40"> </td> </tr> <tr valign="top"> <th width="33%" scope="row"><?php _e('Your Secret Key of Open Agenda', 'ec3'); ?> :</th> <td class="row_option"> <input type="text" name="OpenAgandaSecretKey" value="<?php echo $OpenAgandaSecretKey; ?> " size="40"> </td> </tr> <tr valign="top"> <th width="33%" scope="row"><?php _e('Synchroniser avec Open Agenda', 'ec3'); ?> :</th> <td class="row_option"> <button id="syncNow">Synchroniser Maintenant</button> <div id="reponseA"></div> <p><?php print_r($ec3->tz); ?> </p> </td> </tr> </table> <script> jQuery(document).ready(function($){ var nbr = 0; //var new_block = $('.new_block_option').html(); $('#new_block').click(function(e){ e.preventDefault(); nbr++; $('<td class="row_option">'+ '<label for="nom_option_new_'+nbr+'">Nom : </label>'+ '<input type="text" name="nom_option_new_'+nbr+'" id="nom_option_new_'+nbr+'" >'+ '<label for="message_option_new_'+nbr+'" > Message : </label>'+ '<textarea name="message_option_new_'+nbr+'" id="message_option_new_'+nbr+'" cols="40" rows="1"></textarea>'+ '<label for="expo_option_new_'+nbr+'">Pour les expo :</label>'+ '<input type="checkbox" name="expo_option_new_'+nbr+'" id="expo_option_new_'+nbr+'" value="true">'+ '<button class="del" > -</button>'+ '</td>').insertBefore('#new_block'); $('button.del').click(function(event){ event.preventDefault(); $(this).parent().css({"display":"none"}); var text_temp = $(this).parent().children('input').attr('name') ; text_temp = text_temp.replace( /modif|new/gi ,"delete"); $(this).parent().children('input').attr('name', text_temp) ; }); }); $('button.del').click(function(event){ event.preventDefault(); $(this).parent().css({"display":"none"}); var text_temp = $(this).parent().children('input').attr('name') ; text_temp = text_temp.replace( /modif|new/gi ,"delete"); $(this).parent().children('input').attr('name', text_temp) ; }); }); </script> <p class="submit"><input type="submit" name="info_update" value="<?php _e('Save Changes'); ?> " /></p> </form> </div> <?php }