|
|
@ -42,6 +42,7 @@ function live_meta_box_add()
|
|
|
|
function orari_dirette_input($post)
|
|
|
|
function orari_dirette_input($post)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$values = get_post_custom($post->ID);
|
|
|
|
$values = get_post_custom($post->ID);
|
|
|
|
|
|
|
|
$onair_cadence = array();
|
|
|
|
$text_start = array();
|
|
|
|
$text_start = array();
|
|
|
|
$text_end = array();
|
|
|
|
$text_end = array();
|
|
|
|
wp_nonce_field('on_air_nonce', 'onair_nonce');
|
|
|
|
wp_nonce_field('on_air_nonce', 'onair_nonce');
|
|
|
@ -52,12 +53,13 @@ function orari_dirette_input($post)
|
|
|
|
<?php
|
|
|
|
<?php
|
|
|
|
for ($x=0;$x<7;$x++) :
|
|
|
|
for ($x=0;$x<7;$x++) :
|
|
|
|
$onair_day[$x] = isset($values['on_air_day_'.$x]) ? esc_attr($values['on_air_day_'.$x][0]) : '';
|
|
|
|
$onair_day[$x] = isset($values['on_air_day_'.$x]) ? esc_attr($values['on_air_day_'.$x][0]) : '';
|
|
|
|
|
|
|
|
$onair_cadence[$x] = isset($values['on_air_cadence'.$x]) ? esc_attr($values['on_air_cadence'.$x][0]) : '';
|
|
|
|
$text_start[$x] = isset($values['on_air_start_'.$x]) ? esc_attr($values['on_air_start_'.$x][0]) : '';
|
|
|
|
$text_start[$x] = isset($values['on_air_start_'.$x]) ? esc_attr($values['on_air_start_'.$x][0]) : '';
|
|
|
|
$text_end[$x] = isset($values['on_air_end_'.$x]) ? esc_attr($values['on_air_end_'.$x][0]) : '';
|
|
|
|
$text_end[$x] = isset($values['on_air_end_'.$x]) ? esc_attr($values['on_air_end_'.$x][0]) : '';
|
|
|
|
$broadcast[$x] = term_exists('Podcast', 'category', 0);
|
|
|
|
$broadcast[$x] = term_exists('Podcast', 'category', 0);
|
|
|
|
$old_term[$x] = term_exists($post->post_title, 'category', $broadcast); ?>
|
|
|
|
$old_term[$x] = term_exists($post->post_title, 'category', $broadcast); ?>
|
|
|
|
|
|
|
|
|
|
|
|
<div style='width:33%;float:left;'>
|
|
|
|
<div style='width:25%;float:left;'>
|
|
|
|
<select name="on_air_day_<?php echo $x; ?>" id="on_air_day_<?php echo $x; ?>">
|
|
|
|
<select name="on_air_day_<?php echo $x; ?>" id="on_air_day_<?php echo $x; ?>">
|
|
|
|
<option <?php echo ($onair_day[$x]=='') ? 'selected="selected"' : ''; ?> value="">Seleziona un giorno</option>
|
|
|
|
<option <?php echo ($onair_day[$x]=='') ? 'selected="selected"' : ''; ?> value="">Seleziona un giorno</option>
|
|
|
|
<option <?php echo ($onair_day[$x]==1) ? 'selected="selected"' : ''; ?> value="1">Lunedì</option>
|
|
|
|
<option <?php echo ($onair_day[$x]==1) ? 'selected="selected"' : ''; ?> value="1">Lunedì</option>
|
|
|
@ -69,11 +71,20 @@ function orari_dirette_input($post)
|
|
|
|
<option <?php echo ($onair_day[$x]==7) ? 'selected="selected"' : ''; ?> value="7">Domenica</option>
|
|
|
|
<option <?php echo ($onair_day[$x]==7) ? 'selected="selected"' : ''; ?> value="7">Domenica</option>
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div style='width:33%;float:left;'>
|
|
|
|
<div style='width:25%;float:left;'>
|
|
|
|
|
|
|
|
<select name="on_air_cadence_<?php echo $x; ?>" id="on_air_cadence_<?php echo $x; ?>">
|
|
|
|
|
|
|
|
<label for="on_air_cadence_<?php echo $x; ?>">Cadenza</label>
|
|
|
|
|
|
|
|
<option <?php echo ($onair_cadence[$x]=='') ? 'selected="selected"' : ''; ?> value="">Seleziona una cadenza</option>
|
|
|
|
|
|
|
|
<option <?php echo ($onair_cadence[$x]==1) ? 'selected="selected"' : ''; ?> value="1">Una volta a settimana</option>
|
|
|
|
|
|
|
|
<option <?php echo ($onair_cadence[$x]==2) ? 'selected="selected"' : ''; ?> value="2">Due volte al mese</option>
|
|
|
|
|
|
|
|
<option <?php echo ($onair_cadence[$x]==3) ? 'selected="selected"' : ''; ?> value="3">Una volta al mese</option>
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div style='width:25%;float:left;'>
|
|
|
|
<label for="on_air_start_<?php echo $x; ?>">Ora inizio</label>
|
|
|
|
<label for="on_air_start_<?php echo $x; ?>">Ora inizio</label>
|
|
|
|
<input type="time" name="on_air_start_<?php echo $x; ?>" id="on_air_start_<?php echo $x; ?>" value="<?php echo $text_start[$x]; ?>" style="width: 30%;" />
|
|
|
|
<input type="time" name="on_air_start_<?php echo $x; ?>" id="on_air_start_<?php echo $x; ?>" value="<?php echo $text_start[$x]; ?>" style="width: 30%;" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div style='width:33%;float:left;'>
|
|
|
|
<div style='width:25%;float:left;'>
|
|
|
|
<label for="on_air_end_<?php echo $x; ?>">Ora fine</label>
|
|
|
|
<label for="on_air_end_<?php echo $x; ?>">Ora fine</label>
|
|
|
|
<input type="time" name="on_air_end_<?php echo $x; ?>" id="on_air_end_<?php echo $x; ?>" value="<?php echo $text_end[$x]; ?>" style="width: 30%;" />
|
|
|
|
<input type="time" name="on_air_end_<?php echo $x; ?>" id="on_air_end_<?php echo $x; ?>" value="<?php echo $text_end[$x]; ?>" style="width: 30%;" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -85,37 +96,48 @@ function orari_dirette_input($post)
|
|
|
|
function orari_repliche_input($post)
|
|
|
|
function orari_repliche_input($post)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$values = get_post_custom($post->ID);
|
|
|
|
$values = get_post_custom($post->ID);
|
|
|
|
|
|
|
|
$rerun_cadence = array();
|
|
|
|
$text_start = array();
|
|
|
|
$text_start = array();
|
|
|
|
$text_end = array();
|
|
|
|
$text_end = array();
|
|
|
|
wp_nonce_field('rerun_nonce', 're_run_nonce');
|
|
|
|
wp_nonce_field('rerun_nonce', 're_run_nonce');
|
|
|
|
for ($x=0;$x<7;$x++) :
|
|
|
|
for ($x=0;$x<7;$x++) :
|
|
|
|
$rerun_day[$x] = isset($values['rerun_day_'.$x]) ? esc_attr($values['rerun_day_'.$x][0]) : '';
|
|
|
|
$rerun_day[$x] = isset($values['rerun_day_'.$x]) ? esc_attr($values['rerun_day_'.$x][0]) : '';
|
|
|
|
$text_start[$x] = isset($values['rerun_start_'.$x]) ? esc_attr($values['rerun_start_'.$x][0]) : '';
|
|
|
|
$rerun_cadence[$x] = isset($values['on_air_cadence'.$x]) ? esc_attr($values['on_air_cadence'.$x][0]) : '';
|
|
|
|
$text_end[$x] = isset($values['rerun_end_'.$x]) ? esc_attr($values['rerun_end_'.$x][0]) : ''; ?>
|
|
|
|
$text_start[$x] = isset($values['rerun_start_'.$x]) ? esc_attr($values['rerun_start_'.$x][0]) : '';
|
|
|
|
<div style='width:100%;float:left;'>
|
|
|
|
$text_end[$x] = isset($values['rerun_end_'.$x]) ? esc_attr($values['rerun_end_'.$x][0]) : ''; ?>
|
|
|
|
<h3>Replica n. <?php echo $x+1; ?></h3>
|
|
|
|
<div style='width:100%;float:left;'>
|
|
|
|
</div>
|
|
|
|
<h3>Replica n. <?php echo $x+1; ?></h3>
|
|
|
|
<div style='width:33%;float:left;'>
|
|
|
|
</div>
|
|
|
|
<select name="rerun_day_<?php echo $x; ?>" id="rerun_day_<?php echo $x; ?>">
|
|
|
|
<div style='width:25%;float:left;'>
|
|
|
|
<option <?php echo ($rerun_day[$x]=='') ? 'selected="selected"' : ''; ?> value="">Seleziona un giorno</option>
|
|
|
|
<select name="rerun_day_<?php echo $x; ?>" id="rerun_day_<?php echo $x; ?>">
|
|
|
|
<option <?php echo ($rerun_day[$x]==1) ? 'selected="selected"' : ''; ?> value="1">Lunedì</option>
|
|
|
|
<option <?php echo ($rerun_day[$x]=='') ? 'selected="selected"' : ''; ?> value="">Seleziona un giorno</option>
|
|
|
|
<option <?php echo ($rerun_day[$x]==2) ? 'selected="selected"' : ''; ?> value="2">Martedì</option>
|
|
|
|
<option <?php echo ($rerun_day[$x]==1) ? 'selected="selected"' : ''; ?> value="1">Lunedì</option>
|
|
|
|
<option <?php echo ($rerun_day[$x]==3) ? 'selected="selected"' : ''; ?> value="3">Mercoledì</option>
|
|
|
|
<option <?php echo ($rerun_day[$x]==2) ? 'selected="selected"' : ''; ?> value="2">Martedì</option>
|
|
|
|
<option <?php echo ($rerun_day[$x]==4) ? 'selected="selected"' : ''; ?> value="4">Giovedì</option>
|
|
|
|
<option <?php echo ($rerun_day[$x]==3) ? 'selected="selected"' : ''; ?> value="3">Mercoledì</option>
|
|
|
|
<option <?php echo ($rerun_day[$x]==5) ? 'selected="selected"' : ''; ?> value="5">Venerdì</option>
|
|
|
|
<option <?php echo ($rerun_day[$x]==4) ? 'selected="selected"' : ''; ?> value="4">Giovedì</option>
|
|
|
|
<option <?php echo ($rerun_day[$x]==6) ? 'selected="selected"' : ''; ?> value="6">Sabato</option>
|
|
|
|
<option <?php echo ($rerun_day[$x]==5) ? 'selected="selected"' : ''; ?> value="5">Venerdì</option>
|
|
|
|
<option <?php echo ($rerun_day[$x]==7) ? 'selected="selected"' : ''; ?> value="7">Domenica</option>
|
|
|
|
<option <?php echo ($rerun_day[$x]==6) ? 'selected="selected"' : ''; ?> value="6">Sabato</option>
|
|
|
|
</select>
|
|
|
|
<option <?php echo ($rerun_day[$x]==7) ? 'selected="selected"' : ''; ?> value="7">Domenica</option>
|
|
|
|
</div>
|
|
|
|
</select>
|
|
|
|
<div style='width:33%;float:left;'>
|
|
|
|
</div>
|
|
|
|
<label for="rerun_start_<?php echo $x; ?>">Ora inizio</label>
|
|
|
|
<div style='width:25%;float:left;'>
|
|
|
|
<input type="time" name="rerun_start_<?php echo $x; ?>" id="rerun_start_<?php echo $x; ?>" value="<?php echo $text_start[$x]; ?>" style="width: 30%;" />
|
|
|
|
<select name="rerun_cadence_<?php echo $x; ?>" id="on_air_cadence_<?php echo $x; ?>">
|
|
|
|
</div>
|
|
|
|
<label for="rerun_cadence_<?php echo $x; ?>">Cadenza</label>
|
|
|
|
<div style='width:33%;float:left;'>
|
|
|
|
<option <?php echo ($rerun_cadence[$x]=='') ? 'selected="selected"' : ''; ?> value="">Seleziona una cadenza</option>
|
|
|
|
<label for="rerun_end_<?php echo $x; ?>">Ora fine</label>
|
|
|
|
<option <?php echo ($rerun_cadence[$x]==1) ? 'selected="selected"' : ''; ?> value="1">Una volta a settimana</option>
|
|
|
|
<input type="time" name="rerun_end_<?php echo $x; ?>" id="rerun_end_<?php echo $x; ?>" value="<?php echo $text_end[$x]; ?>" style="width: 30%;" />
|
|
|
|
<option <?php echo ($rerun_cadence[$x]==2) ? 'selected="selected"' : ''; ?> value="2">Due volte al mese</option>
|
|
|
|
</div>
|
|
|
|
<option <?php echo ($rerun_cadence[$x]==3) ? 'selected="selected"' : ''; ?> value="3">Una volta al mese</option>
|
|
|
|
<div style="clear:both;"></div>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div style='width:25%;float:left;'>
|
|
|
|
|
|
|
|
<label for="rerun_start_<?php echo $x; ?>">Ora inizio</label>
|
|
|
|
|
|
|
|
<input type="time" name="rerun_start_<?php echo $x; ?>" id="rerun_start_<?php echo $x; ?>" value="<?php echo $text_start[$x]; ?>" style="width: 30%;" />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div style='width:25%;float:left;'>
|
|
|
|
|
|
|
|
<label for="rerun_end_<?php echo $x; ?>">Ora fine</label>
|
|
|
|
|
|
|
|
<input type="time" name="rerun_end_<?php echo $x; ?>" id="rerun_end_<?php echo $x; ?>" value="<?php echo $text_end[$x]; ?>" style="width: 30%;" />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div style="clear:both;"></div>
|
|
|
|
<?php
|
|
|
|
<?php
|
|
|
|
endfor;
|
|
|
|
endfor;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -176,9 +198,11 @@ function orari_dirette_save($post_id)
|
|
|
|
update_post_meta($post_id, 'on_air_day_'.$x, wp_kses($_POST['on_air_day_'.$x], $allowed));
|
|
|
|
update_post_meta($post_id, 'on_air_day_'.$x, wp_kses($_POST['on_air_day_'.$x], $allowed));
|
|
|
|
update_post_meta($post_id, 'on_air_start_'.$x, wp_kses($_POST['on_air_start_'.$x], $allowed));
|
|
|
|
update_post_meta($post_id, 'on_air_start_'.$x, wp_kses($_POST['on_air_start_'.$x], $allowed));
|
|
|
|
update_post_meta($post_id, 'on_air_end_'.$x, wp_kses($_POST['on_air_end_'.$x], $allowed));
|
|
|
|
update_post_meta($post_id, 'on_air_end_'.$x, wp_kses($_POST['on_air_end_'.$x], $allowed));
|
|
|
|
|
|
|
|
update_post_meta($post_id, 'on_air_cadence_'.$x, wp_kses($_POST['on_air_cadence_'.$x], $allowed));
|
|
|
|
update_post_meta($post_id, 'rerun_day_'.$x, wp_kses($_POST['rerun_day_'.$x], $allowed));
|
|
|
|
update_post_meta($post_id, 'rerun_day_'.$x, wp_kses($_POST['rerun_day_'.$x], $allowed));
|
|
|
|
update_post_meta($post_id, 'rerun_start_'.$x, wp_kses($_POST['rerun_start_'.$x], $allowed));
|
|
|
|
update_post_meta($post_id, 'rerun_start_'.$x, wp_kses($_POST['rerun_start_'.$x], $allowed));
|
|
|
|
update_post_meta($post_id, 'rerun_end_'.$x, wp_kses($_POST['rerun_end_'.$x], $allowed));
|
|
|
|
update_post_meta($post_id, 'rerun_end_'.$x, wp_kses($_POST['rerun_end_'.$x], $allowed));
|
|
|
|
|
|
|
|
update_post_meta($post_id, 'rerun_cadence_'.$x, wp_kses($_POST['rerun_end_'.$x], $allowed));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|