WordPress.org

Plugin Directory

Changeset 865684


Ignore:
Timestamp:
02/26/14 20:54:01 (12 months ago)
Author:
joedolson
Message:

Update dev version.

Location:
my-calendar/trunk
Files:
4 added
18 edited

Legend:

Unmodified
Added
Removed
  • my-calendar/trunk/js/tabs.js

    r857615 r865684  
    11jQuery(document).ready(function($){ 
    2     var tabs = $('.mc-settings-page .wptab').length; 
    3     $('.mc-settings .tabs a[href="#'+firstItem+'"]').addClass('active'); 
     2    var tabs = $('.mc-tabs .wptab').length; 
     3    $('.mc-tabs .tabs a[href="#'+firstItem+'"]').addClass('active'); 
    44    if ( tabs > 1 ) { 
    5     $('.mc-settings-page .wptab').not('#'+firstItem).hide(); 
    6     $('.mc-settings-page .tabs a').on('click',function(e) { 
     5    $('.mc-tabs .wptab').not('#'+firstItem).hide(); 
     6    $('.mc-tabs .tabs a').on('click',function(e) { 
    77        e.preventDefault(); 
    8         $('.mc-settings-page .tabs a').removeClass('active'); 
     8        $('.mc-tabs .tabs a').removeClass('active'); 
    99        $(this).addClass('active'); 
    1010        var target = $(this).attr('href'); 
    11         $('.mc-settings-page .wptab').not(target).hide(); 
     11        $('.mc-tabs .wptab').not(target).hide(); 
    1212        $(target).show(); 
    1313    }); 
  • my-calendar/trunk/my-calendar-api.php

    r859129 r865684  
    1515             
    1616            $data = my_calendar_events( $from, $to, $category, $ltype, $lvalue, 'api', $author, $host ); 
    17  
    1817            $output = mc_format_api( $data, $format ); 
    1918            // if json, encode as json 
  • my-calendar/trunk/my-calendar-categories.php

    r857615 r865684  
    183183    <?php } ?> 
    184184 
    185 <div class="postbox-container" style="width: 70%"> 
     185<div class="postbox-container jcd-wide"> 
    186186<div class="metabox-holder"> 
    187187 
  • my-calendar/trunk/my-calendar-core.php

    r860300 r865684  
    128128    $stylesheet = mc_get_style_path( get_option( 'mc_css_file' ),'url' ); 
    129129    wp_register_style( 'my-calendar-style', $stylesheet ); 
    130     $admin_stylesheet = plugins_url( 'mc-admin.css', __FILE__ ); 
     130    $admin_stylesheet = plugins_url( 'css/mc-admin.css', __FILE__ ); 
    131131    wp_register_style( 'my-calendar-admin-style', $admin_stylesheet ); 
    132132    if ( current_user_can( 'mc_manage_events' ) ) { 
     
    265265        wp_localize_script( 'mc-upload', 'thumbHeight', get_option( 'thumbnail_size_h' ) );      
    266266    } 
    267     if ( isset($_GET['page']) && $_GET['page'] == 'my-calendar-config' ) { 
     267    if ( isset($_GET['page']) && ( $_GET['page'] == 'my-calendar-config' || $_GET['page'] == 'my-calendar-help' ) ) { 
    268268        wp_register_script( 'mc.tabs', plugins_url( 'js/tabs.js', __FILE__ ), array( 'jquery' ) ); 
    269269        wp_register_script( 'mc.sortable', plugins_url( 'js/sortable.js', __FILE__ ), array( 'jquery','jquery-ui-sortable' ) ); 
     
    271271        wp_enqueue_script( 'mc.tabs' ); 
    272272        wp_enqueue_script( 'mc.sortable' ); 
    273          
    274         wp_localize_script( 'mc.tabs', 'firstItem', 'mc_editor' );       
     273        if ( $_GET['page'] == 'my-calendar-config' ) { 
     274            $firstItem = 'mc_editor'; 
     275        } else if ( $_GET['page'] == 'my-calendar-help' ) { 
     276            $firstItem = 'mc_main'; 
     277        } 
     278        wp_localize_script( 'mc.tabs', 'firstItem', $firstItem );        
    275279    } 
    276280    if ( isset($_GET['page']) && ( $_GET['page'] == 'my-calendar-groups' || $_GET['page'] == 'my-calendar-manage' ) ) { 
     
    381385    if ( !empty($_GET['page']) ) { 
    382386        if (  isset($_GET['page']) && ($_GET['page'] == 'my-calendar' || $_GET['page'] == 'my-calendar-manage' || $_GET['page'] == 'my-calendar-groups' || $_GET['page'] == 'my-calendar-categories' || $_GET['page'] == 'my-calendar-locations' || $_GET['page'] == 'my-calendar-config' || $_GET['page'] == 'my-calendar-styles' || $_GET['page'] == 'my-calendar-help' || $_GET['page'] == 'my-calendar-behaviors' ) || $_GET['page'] == 'my-calendar-templates' ) { 
    383             echo '<link type="text/css" rel="stylesheet" href="'.plugins_url( 'mc-styles.css', __FILE__ ).'" />'; 
     387            echo '<link type="text/css" rel="stylesheet" href="'.plugins_url( 'css/mc-styles.css', __FILE__ ).'" />'; 
    384388        } 
    385389        if ( isset($_GET['page']) && $_GET['page'] == 'my-calendar') { 
     
    13571361} 
    13581362 
    1359 // Adding button to the MCE toolbar (Visual Mode)  
    1360 add_action('init', 'mc_addbuttons'); 
    1361  
    1362 // Add button hooks to the Tiny MCE  
    1363 function mc_addbuttons() { 
    1364     global $mc_version; 
    1365     if ( !current_user_can('edit_posts') && !current_user_can('edit_pages') ) { return; } 
    1366     if ( get_user_option('rich_editing') == 'true') { 
    1367         add_filter( 'tiny_mce_version', 'mc_tiny_mce_version', 0 ); 
    1368         add_filter( 'mce_external_plugins', 'mc_plugin', 0 ); 
    1369         add_filter( 'mce_buttons', 'mc_button', 0 ); 
    1370     } 
    1371     // Register Hooks 
    1372     if (is_admin()) { 
    1373         // Add Quicktag 
    1374         add_action( 'edit_form_advanced', 'mc_add_quicktags' ); 
    1375         add_action( 'edit_page_form', 'mc_add_quicktags' ); 
    1376  
    1377         // Queue Embed JS 
    1378         add_action( 'admin_head', 'mc_admin_js_vars'); 
    1379         wp_enqueue_script( 'mcqt', plugins_url('button/mcb.js',__FILE__), array(), $mc_version ); 
    1380     }  
    1381 } 
    1382  
    1383 // Break the browser cache of TinyMCE 
    1384 function mc_tiny_mce_version( ) { 
    1385     global $mc_version; 
    1386     return 'mcb-' . $mc_version; 
    1387 } 
    1388  
    1389 // Load the custom TinyMCE plugin 
    1390 function mc_plugin( $plugins ) { 
    1391     $plugins['mcqt'] = plugins_url('button/tinymce3/editor_plugin.js', __FILE__ ); 
    1392     return $plugins; 
    1393 } 
    1394  
    1395 // Add the buttons: separator, custom 
    1396 function mc_button( $buttons ) { 
    1397     array_push( $buttons, 'separator', 'myCalendar' ); 
    1398     return $buttons; 
    1399 } 
    1400  
    1401  
    14021363add_action('admin_enqueue_scripts', 'mc_scripts'); 
    14031364function mc_scripts( $hook ) { 
    1404     if ( $hook == 'edit.php' || $hook == 'post.php' ) { 
    1405         wp_enqueue_script( 
    1406             'mc_quicktags', 
    1407             plugin_dir_url(__FILE__) . 'js/mc-quicktags.js', 
    1408             array('quicktags') 
    1409         ); 
    1410     } 
    14111365    global $current_screen; 
    1412     if ( $current_screen->id == 'toplevel_page_my-calendar' ) { 
     1366    if ( $current_screen->id == 'toplevel_page_my-calendar' && function_exists( 'jd_doTwitterAPIPost' ) ) { 
    14131367        // later. 
    14141368        wp_enqueue_script(  'charCount', plugins_url( 'wp-to-twitter/js/jquery.charcount.js'), array('jquery') ); 
     
    14201374} 
    14211375 
    1422 // Add a button to the quicktag view (HTML Mode) >>> 
    1423 function mc_add_quicktags(){ 
    1424 ?> 
    1425 <script type="text/javascript"> 
    1426 // <![CDATA[ 
    1427 (function(){ 
    1428     if (typeof jQuery === 'undefined') { 
    1429         return; 
    1430     } 
    1431     jQuery(document).ready(function($){ 
    1432         // Add the buttons to the HTML view 
    1433         $("#ed_toolbar").append('<input type="button" class="ed_button" onclick="myCalQT.Tag.embed.apply(myCalQT.Tag); return false;" title="Insert My Calendar" value="My Calendar" />'); 
    1434     }); 
    1435 }()); 
    1436 // ]]> 
    1437 </script> 
    1438 <?php    
    1439 } 
    1440  
    14411376function mc_newline_replace($string) { 
    14421377  return (string)str_replace(array("\r", "\r\n", "\n"), '', $string); 
    14431378} 
    14441379 
    1445 // Set URL for the generator page 
    1446 function mc_admin_js_vars(){ 
    1447 ?> 
    1448 <script type="text/javascript"> 
    1449 // <![CDATA[ 
    1450     if (typeof myCalQT !== 'undefined' && typeof myCalQT.Tag !== 'undefined') { 
    1451         myCalQT.Tag.configUrl = "<?php echo plugins_url( 'button/generator.php',__FILE__ ); ?>"; 
    1452     } 
    1453 // ]]>   
    1454 </script> 
    1455 <?php 
    1456 } 
    1457  
    1458 function reverse_array($array, $boolean, $order) { 
     1380function reverse_array( $array, $boolean, $order ) { 
    14591381    if ( $order == 'desc' ) { 
    1460         return array_reverse($array, $boolean); 
     1382        return array_reverse( $array, $boolean ); 
    14611383    } else { 
    14621384        return $array; 
     
    14731395        function wp_is_mobile() { return false; } 
    14741396    } 
    1475 }    
    1476  
     1397} 
    14771398 
    14781399function mc_is_mobile() { 
     
    17331654} 
    17341655 
    1735 /* indiscriminately deletes all instances of an event without deleting the event details. Sets stage for rebuilding event instances. */ 
     1656/* deletes all instances of an event without deleting the event details. Sets stage for rebuilding event instances. */ 
    17361657function mc_delete_instances( $id ) {  
    17371658    global $wpdb; 
  • my-calendar/trunk/my-calendar-event-manager.php

    r860306 r865684  
    2323    } 
    2424    if ( $action == 'edit' ) { 
    25         if ( $_POST['event_post'] == 0 ) { 
     25        if ( $_POST['event_post'] == 0 || $_POST['event_post'] == '' ) { 
    2626            $post_id = mc_create_event_post( $data, $event_id );  
    2727        } else { 
     
    156156            } else { 
    157157                $instance_date = ''; 
    158             } 
    159         ?> 
     158            } ?> 
    160159            <div class="error"> 
    161160            <form action="<?php echo admin_url('admin.php?page=my-calendar'); ?>" method="post"> 
     
    305304<div id="icon-edit" class="icon32"></div> 
    306305    <h2 class='mc-clear'id='mc-manage'><?php _e('Manage Events','my-calendar'); ?></h2> 
    307     <div class="postbox-container" style="width: 75%"> 
     306    <div class="postbox-container jcd-wide"> 
    308307        <div class="metabox-holder"> 
    309308            <div class="ui-sortable meta-box-sortables">    
     
    350349$edit = $create = $save = $delete = false; 
    351350 
    352 $action = !empty($_POST['event_action']) ? $_POST['event_action'] : ''; 
    353 $event_id = !empty($_POST['event_id']) ? $_POST['event_id'] : ''; 
     351$action = !empty( $_POST['event_action'] ) ? $_POST['event_action'] : ''; 
     352$event_id = !empty( $_POST['event_id'] ) ? $_POST['event_id'] : ''; 
    354353 
    355354if ( isset( $_GET['mode'] ) ) { 
     
    361360 
    362361if ( isset( $_POST['event_action'] ) ) { 
    363     $nonce=$_REQUEST['_wpnonce']; 
    364     if (! wp_verify_nonce($nonce,'my-calendar-nonce') ) die("Security check failed"); 
     362    $nonce = $_REQUEST['_wpnonce']; 
     363    if (! wp_verify_nonce( $nonce,'my-calendar-nonce' ) ) die( "Security check failed" ); 
    365364    $proceed = false; 
    366365    global $mc_output; 
    367366    $count = 0; 
    368     if ( isset($_POST['event_begin']) && is_array( $_POST['event_begin'] ) ) { 
    369         $count = count($_POST['event_begin']); 
     367    if ( isset( $_POST['event_begin'] ) && is_array( $_POST['event_begin'] ) ) { 
     368        $count = count( $_POST['event_begin'] ); 
    370369    } else { 
    371         $response = my_calendar_save($action,$mc_output,(int) $_POST['event_id']); 
     370        $response = my_calendar_save( $action, $mc_output, (int) $_POST['event_id'] ); 
    372371        echo $response; 
    373372    } 
    374373    for ($i=0;$i<$count;$i++) { 
    375     $mc_output = mc_check_data($action,$_POST, $i); 
     374    $mc_output = mc_check_data( $action,$_POST, $i ); 
    376375        if ($action == 'add'|| $action == 'copy') { 
    377             $response = my_calendar_save($action,$mc_output); 
    378         } else { 
    379             $response = my_calendar_save($action,$mc_output,(int) $_POST['event_id']);       
     376            $response = my_calendar_save( $action,$mc_output ); 
     377        } else { 
     378            $response = my_calendar_save( $action,$mc_output,(int) $_POST['event_id'] );         
    380379        } 
    381380        echo $response; 
     
    390389 
    391390<div class="wrap jd-my-calendar"> 
    392  
    393 <?php my_calendar_check_db();?> 
    394 <?php  
    395 if ( get_site_option('mc_multisite') == 2 ) {  
    396     if ( get_option('mc_current_table') == 0 ) { 
    397         $message = __('Currently editing your local calendar','my-calendar'); 
    398     } else { 
    399         $message = __('Currently editing your central calendar','my-calendar'); 
    400     } 
    401     echo "<div class='message updated'><p>$message</p></div>"; 
    402 } ?> 
    403     <?php if ( $action == 'edit'|| ($action == 'edit'&& $error_with_saving == 1) ) { ?> 
    404 <div id="icon-edit" class="icon32"></div>        
     391<?php my_calendar_check_db(); 
     392    if ( get_site_option('mc_multisite') == 2 ) {  
     393        if ( get_option('mc_current_table') == 0 ) { 
     394            $message = __('Currently editing your local calendar','my-calendar'); 
     395        } else { 
     396            $message = __('Currently editing your central calendar','my-calendar'); 
     397        } 
     398        echo "<div class='message updated'><p>$message</p></div>"; 
     399    }  
     400    if ( $action == 'edit'|| ($action == 'edit'&& $error_with_saving == 1) ) { ?> 
     401        <div id="icon-edit" class="icon32"></div>        
    405402        <h2><?php _e('Edit Event','my-calendar'); ?></h2> 
    406403        <?php 
     
    411408        }        
    412409    } else if ( $action == 'copy'|| ($action == 'copy'&& $error_with_saving == 1)) { ?> 
    413 <div id="icon-edit" class="icon32"></div>    
     410        <div id="icon-edit" class="icon32"></div>    
    414411        <h2><?php _e('Copy Event','my-calendar'); ?></h2> 
    415412        <?php 
     
    419416            jd_events_edit_form('copy', $event_id); 
    420417        } 
    421     } else { 
    422     ?>   
    423 <div id="icon-edit" class="icon32"></div>    
    424         <h2><?php _e('Add Event','my-calendar'); ?></h2> 
    425         <?php jd_events_edit_form(); ?> 
    426     <?php } ?> 
    427         <?php jd_show_support_box(); ?> 
    428 </div> 
    429         <?php 
     418    } else { ?>  
     419        <div id="icon-edit" class="icon32"></div>    
     420        <h2><?php _e('Add Event','my-calendar'); ?></h2><?php  
     421        jd_events_edit_form(); 
     422    }  
     423    jd_show_support_box(); ?> 
     424    </div><?php 
    430425}  
    431426 
    432427function mc_tweet_approval( $prev, $new ) { 
    433     if ( function_exists( 'jd_doTwitterAPIPost') && isset( $_POST['mc_twitter'] ) && trim( $_POST['mc_twitter'] ) != '') { 
     428    if ( function_exists( 'jd_doTwitterAPIPost' ) && isset( $_POST['mc_twitter'] ) && trim( $_POST['mc_twitter'] ) != '' ) { 
    434429        if ( ( $prev == 0 || $prev == 2 ) && $new == 1 ) { 
    435430            jd_doTwitterAPIPost( stripslashes( $_POST['mc_twitter'] ) ); 
     
    679674    ?> 
    680675 
    681 <div class="postbox-container" style="width: 70%"> 
     676<div class="postbox-container jcd-wide"> 
    682677<div class="metabox-holder"> 
    683678<?php if ( $mode == 'add'|| $mode == 'copy') { $edit_args = ''; } else { 
     
    686681}  
    687682?> 
    688 <form id="my-calendar" method="post" action="<?php echo admin_url('admin.php?page=my-calendar').$edit_args; ?>"> 
     683<form id="my-calendar" method="post" action="<?php echo admin_url( 'admin.php?page=my-calendar' ).$edit_args; ?>"> 
    689684<div> 
    690     <input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /> 
    691     <?php if ( isset($_GET['ref']) ) { ?> 
    692         <input type="hidden" name="ref" value="<?php echo esc_url($_GET['ref']); ?>" /> 
     685    <input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce( 'my-calendar-nonce' ); ?>" /> 
     686    <?php if ( isset( $_GET['ref'] ) ) { ?> 
     687        <input type="hidden" name="ref" value="<?php echo esc_url( $_GET['ref'] ); ?>" /> 
    693688    <?php } ?> 
    694     <input type="hidden" name="event_group_id" value="<?php if ( !empty( $data->event_group_id ) && $mode != 'copy') { echo $data->event_group_id; } else { echo mc_group_id(); } ?>" /> 
     689    <input type="hidden" name="event_group_id" value="<?php if ( !empty( $data->event_group_id ) && $mode != 'copy' ) { echo $data->event_group_id; } else { echo mc_group_id(); } ?>" /> 
    695690    <input type="hidden" name="event_action" value="<?php echo $mode; ?>" /> 
    696691    <?php if ( !empty( $_GET['date'] ) ) { ?>  
     
    709704    <?php  
    710705        if ( isset($_GET['mode']) && $_GET['mode'] == 'edit' ) { 
    711             $text = __('Edit Event', 'my-calendar' ); 
    712             $delete =  " &bull; <a href='".admin_url("admin.php?page=my-calendar-manage&amp;mode=delete&amp;event_id=$data->event_id")."' class='delete'>".__('Delete','my-calendar')."</a>"; 
     706            $text = __( 'Edit Event', 'my-calendar' ); 
     707            $delete =  " &middot; <a href='".admin_url("admin.php?page=my-calendar-manage&amp;mode=delete&amp;event_id=$data->event_id")."' class='delete'>".__('Delete','my-calendar')."</a>"; 
    713708        } else { 
    714709            $text = __('Add Event', 'my-calendar' ); 
    715710            $delete = ''; 
    716711        } 
     712        $post_id = $data->event_post; 
     713        if ( $has_data && !$data->event_post ) { 
     714            $array_data = (array) $data; 
     715            $post_id = mc_event_post( 'add', $array_data, $data->event_id ); 
     716        } 
     717        $post_link = ( $post_id ) ? get_edit_post_link( $post_id ) : false; 
     718        $text_link = ( $post_link ) ? sprintf( " &middot; <a href='%s'>".__('Edit Event Post','my-calendar')."</a>", $post_link ) : ''; 
    717719    ?> 
    718     <h3><?php echo $text; ?> <small>[<a href="<?php echo admin_url('admin.php?page=my-calendar-manage'); ?>"><?php _e('Manage events','my-calendar'); ?></a><?php echo $delete; ?>]</small></h3> 
     720    <h3><?php echo $text; ?> <span class="alignright"><a href="<?php echo admin_url('admin.php?page=my-calendar-manage'); ?>"><?php _e('Manage events','my-calendar'); ?></a><?php echo $delete; echo $text_link; ?></span> 
     721</h3> 
    719722    <div class="inside"> 
    720 <?php 
     723    <?php 
    721724    if ( !empty( $_GET['date'] ) && $data->event_recur != 'S') { 
    722725        $event = mc_get_event( $instance ); 
     
    794797        </p> 
    795798        <?php } ?> 
     799        <div class='mc-image-upload field-holder'> 
    796800        <?php 
    797801        if ( mc_show_edit_block( 'event_image' ) ) { ?> 
    798         <div class='mc-image-upload field-holder'> 
     802            <input type="hidden" name="event_image_id" value="" class="textfield" id="event_image_id" /> 
     803            <label for="event_image"><?php _e("Add an image:",'my-calendar'); ?></label><br /><input type="text" name="event_image" id="event_image" size="60" value="<?php if ( $has_data ) echo esc_attr( $data->event_image ); ?>" placeholder="http://yourdomain.com/image.jpg" /> <a href="#" class="button textfield-field"><?php _e( "Upload",'my-calendar' ); ?></a> 
     804        <?php } else { ?> 
     805            <input type="hidden" name="event_image" value="<?php if ( $has_data ) echo esc_attr( $data->event_image ); ?>" /> 
     806        <?php } ?> 
    799807            <?php if ( !empty( $data->event_image ) ) { ?> 
    800             <div class="event_image"><img src="<?php if ( $has_data ) echo esc_attr($data->event_image); ?>" alt="" /></div> 
     808            <div class="event_image"><img src="<?php echo esc_attr( $data->event_image ); ?>" alt="" /></div> 
    801809            <?php } else { ?> 
    802810            <div class="event_image"></div> 
    803             <?php } ?> 
    804             <input type="hidden" name="event_image_id" value="" class="textfield" id="event_image_id" /> 
    805             <label for="event_image"><?php _e("Add an image:",'my-calendar'); ?></label> <input type="text" name="event_image" id="event_image" size="40" value="<?php if ( $has_data ) echo esc_attr( $data->event_image ); ?>" placeholder="http://yourdomain.com/image.jpg" /> <a href="#" class="button textfield-field"><?php _e( "Upload",'my-calendar' ); ?></a> 
     811            <?php } ?>   
    806812        </div> 
    807         <?php } else { ?> 
    808         <div> 
    809             <input type="hidden" name="event_image" value="<?php if ( $has_data ) echo esc_attr( $data->event_image ); ?>" /> 
    810             <?php if ( !empty( $data->event_image ) ) { ?> 
    811             <div class="event_image"><img src="<?php echo esc_attr( $data->event_image ); ?>" alt="" /></div> 
    812             <?php } ?> 
    813         </div> 
    814         <?php } ?>       
    815813    <p> 
    816814    <label for="event_host"><?php _e('Host','my-calendar'); ?></label> 
     
    913911                <?php _e('Editing a single date of an event changes only that date. Editing the root event changes all events in the series.','my-calendar'); ?>             
    914912                <ul class="columns"> 
    915                     <?php if ( isset($_GET['date']) ) { $date = (int) $_GET['date']; } else { $date = false; } ?> 
     913                    <?php if ( isset( $_GET['date'] ) ) { $date = (int) $_GET['date']; } else { $date = false; } ?> 
    916914                    <?php echo mc_instance_list( $data->event_id, $date ); ?> 
    917915                </ul> 
     
    984982        <h3><?php $label = __('Event Access','my-calendar'); echo $label; ?></h3> 
    985983        <div class="inside">         
    986             <?php echo mc_event_accessibility( $data, $label ); ?> 
     984            <?php echo mc_event_accessibility( '', $data, $label ); ?> 
    987985            <?php echo apply_filters( 'mc_event_accessibility', '', $has_data, $data ); ?>                           
    988986        </div> 
     
    12091207<?php } 
    12101208 
    1211 function mc_event_accessibility( $data, $label ) { 
     1209function mc_event_accessibility( $form, $data, $label ) { 
    12121210    $note_value = ''; 
    1213     $access_list = " 
     1211    $events_access = array(); 
     1212    $form .= " 
    12141213        <fieldset> 
    12151214            <legend>$label</legend> 
     
    12181217    if ( !empty( $data ) ) { 
    12191218        $events_access = get_post_meta( $data->event_post, '_mc_event_access', true ); 
    1220     } else { 
    1221         $events_access = array(); 
    12221219    } 
    12231220    foreach ( $access as $k=>$a ) { 
     
    12291226        } 
    12301227        $item = sprintf( '<li><input type="checkbox" id="%1$s" name="events_access[]" value="%4$s" class="checkbox" %2$s /> <label for="%1$s">%3$s</label></li>', $id, $checked, $label, $a ); 
    1231         $access_list .= $item;   
     1228        $form .= $item;  
    12321229    } 
    12331230    if ( isset( $events_access['notes'] ) ) { $note_value = esc_attr( $events_access['notes'] ); } 
    1234     $access_list .= '<li><label for="events_access_notes">'.__('Notes','my-calendar').'</label> <input type="text" name="events_access[notes]" value="'.$note_value.'" /></li>'; 
    1235     $access_list .= "</ul> 
     1231    $form .= '<li><label for="events_access_notes">'.__('Notes','my-calendar').'</label> <input type="text" name="events_access[notes]" value="'.$note_value.'" /></li>'; 
     1232    $form .= "</ul> 
    12361233    </fieldset>"; 
    1237     return $access_list; 
     1234    return $form; 
    12381235} 
    12391236 
     
    13161313    $found_rows = $wpdb->get_col("SELECT FOUND_ROWS();"); 
    13171314    $items = $found_rows[0]; 
    1318     ?> 
    1319         <?php if ( ( function_exists( 'akismet_http_post') || function_exists( 'bs_checker') ) && $allow_filters ) { ?> 
     1315    if ( ( function_exists( 'akismet_http_post') || function_exists( 'bs_checker') ) && $allow_filters ) { ?> 
    13201316        <ul class="links"> 
    13211317            <li><a <?php echo ( isset($_GET['restrict']) && $_GET['restrict']=='flagged')?'class="active-link"':''; ?>  href="<?php echo admin_url('admin.php?page=my-calendar-manage&amp;restrict=flagged&amp;filter=1'); ?>"><?php _e('Spam','my-calendar'); ?></a></li> 
    1322         </ul> 
    1323         <?php } ?>   
    1324         <?php if ( get_option('mc_event_approve') == 'true' ) { ?> 
     1318        </ul><?php  
     1319    }  
     1320    if ( get_option('mc_event_approve') == 'true' ) { ?> 
    13251321        <ul class="links"> 
    1326         <li><a <?php echo ( isset($_GET['limit']) && $_GET['limit']=='published')?'class="active-link"':''; ?> href="<?php echo admin_url('admin.php?page=my-calendar-manage&amp;limit=published'); ?>"><?php _e('Published','my-calendar'); ?></a></li> 
    1327         <li><a <?php echo ( isset($_GET['limit']) && $_GET['limit']=='reserved')?'class="active-link"':''; ?>  href="<?php echo admin_url('admin.php?page=my-calendar-manage&amp;limit=reserved'); ?>"><?php _e('Reserved','my-calendar'); ?></a></li>  
    1328         <li><a <?php echo ( isset($_GET['limit']) && $_GET['limit']=='all'|| !isset($_GET['limit']))?'class="active-link"':''; ?>  href="<?php echo admin_url('admin.php?page=my-calendar-manage&amp;limit=archived'); ?>"><?php _e('Archived','my-calendar'); ?></a></li> 
    1329         <li><a <?php echo ( isset($_GET['limit']) && $_GET['limit']=='all'|| !isset($_GET['limit']))?'class="active-link"':''; ?>  href="<?php echo admin_url('admin.php?page=my-calendar-manage&amp;limit=all'); ?>"><?php _e('All','my-calendar'); ?></a></li> 
    1330         </ul> 
    1331         <?php } ?> 
    1332  
    1333         <?php echo $filtered; ?> 
    1334         <?php 
    1335         $num_pages = ceil($items / $items_per_page); 
    1336         if ( $num_pages > 1 ) { 
    1337             $page_links = paginate_links( array( 
    1338                 'base'=> add_query_arg( 'paged', '%#%'), 
    1339                 'format'=> '', 
    1340                 'prev_text'=> __('&laquo; Previous Page','my-calendar'), 
    1341                 'next_text'=> __('Next Page &raquo;','my-calendar'), 
    1342                 'total'=> $num_pages, 
    1343                 'current'=> $current 
    1344             )); 
    1345             echo "<div class='tablenav'>"; 
    1346             echo "<div class='tablenav-pages'>"; 
    1347             echo $page_links;  
    1348             echo "</div>"; 
    1349             echo "</div>"; 
    1350         } 
    1351         ?>           
    1352     <?php 
     1322            <li><a <?php echo ( isset($_GET['limit']) && $_GET['limit']=='published')?'class="active-link"':''; ?> href="<?php echo admin_url('admin.php?page=my-calendar-manage&amp;limit=published'); ?>"><?php _e('Published','my-calendar'); ?></a></li> 
     1323            <li><a <?php echo ( isset($_GET['limit']) && $_GET['limit']=='reserved')?'class="active-link"':''; ?>  href="<?php echo admin_url('admin.php?page=my-calendar-manage&amp;limit=reserved'); ?>"><?php _e('Reserved','my-calendar'); ?></a></li>  
     1324            <li><a <?php echo ( isset($_GET['limit']) && $_GET['limit']=='all'|| !isset($_GET['limit']))?'class="active-link"':''; ?>  href="<?php echo admin_url('admin.php?page=my-calendar-manage&amp;limit=archived'); ?>"><?php _e('Archived','my-calendar'); ?></a></li> 
     1325            <li><a <?php echo ( isset($_GET['limit']) && $_GET['limit']=='all'|| !isset($_GET['limit']))?'class="active-link"':''; ?>  href="<?php echo admin_url('admin.php?page=my-calendar-manage&amp;limit=all'); ?>"><?php _e('All','my-calendar'); ?></a></li> 
     1326        </ul><?php  
     1327    } 
     1328    echo $filtered; 
     1329    $num_pages = ceil($items / $items_per_page); 
     1330    if ( $num_pages > 1 ) { 
     1331        $page_links = paginate_links( array( 
     1332            'base'=> add_query_arg( 'paged', '%#%'), 
     1333            'format'=> '', 
     1334            'prev_text'=> __( '&laquo; Previous<span class="screen-reader-text"> Events</span>','my-calendar' ), 
     1335            'next_text'=> __( 'Next<span class="screen-reader-text"> Events</span> &raquo;','my-calendar' ), 
     1336            'total'=> $num_pages, 
     1337            'current'=> $current, 
     1338            'mid_size'=> 1 
     1339        )); 
     1340        echo "<div class='tablenav'>"; 
     1341        echo "<div class='tablenav-pages'>"; 
     1342        echo $page_links;  
     1343        echo "</div>"; 
     1344        echo "</div>"; 
     1345    } 
    13531346    if ( !empty($events) ) { 
    13541347        ?> 
     
    15561549        $host = !empty($post['event_host']) ? $post['event_host'] : $current_user->ID;   
    15571550        $category = !empty($post['event_category']) ? $post['event_category'] : ''; 
    1558         $linky = !empty($post['event_link']) ? trim($post['event_link']) : ''; 
     1551        $event_link = !empty($post['event_link']) ? trim($post['event_link']) : ''; 
    15591552        $expires = !empty($post['event_link_expires']) ? $post['event_link_expires'] : '0'; 
    15601553        $approved = !empty($post['event_approved']) ? $post['event_approved'] : '0'; 
     
    16331626                } 
    16341627            } 
    1635             // Perform some validation on the submitted dates - this checks for valid years and months 
    1636             // We know we have a valid year and month and valid integers for days so now we do a final check on the date 
    1637             $begin_split = explode('-',$begin); 
    1638             $begin_y = $begin_split[0];  
    1639             $begin_m = $begin_split[1]; 
    1640             $begin_d = $begin_split[2]; 
    1641             $end_split = explode('-',$end); 
    1642             $end_y = $end_split[0]; 
    1643             $end_m = $end_split[1]; 
    1644             $end_d = $end_split[2]; 
    1645             if ( checkdate( $begin_m,$begin_d,$begin_y ) && checkdate( $end_m,$end_d,$end_y ) ) { 
    1646                 // Ok, now we know we have valid dates, we want to make sure that they are either equal or that the end date is later than the start date 
    1647                 if ( strtotime( $end ) >= strtotime( $begin ) ) { 
    1648                 } else { 
     1628            // Perform validation on the submitted dates - checks for valid years and months 
     1629            if ( mc_checkdate( $begin ) && mc_checkdate( $end ) ) { 
     1630                // Make sure dates are equal or end date is later than start date 
     1631                if ( strtotime( $end ) < strtotime( $begin ) ) { 
    16491632                    $errors .= "<div class='error'><p><strong>".__('Error','my-calendar').":</strong> ".__('Your event end date must be either after or the same as your event begin date','my-calendar')."</p></div>"; 
    16501633                } 
     
    16541637 
    16551638            // We check for a valid time, or an empty one 
    1656             /* 
    1657             Safari on Mac returns timezone in the value of $time.  
    1658             Between having i18n for time formats and a bug in Safari, I choose the bug in Safari.  
    1659             But, I can eliminate *some* problems with it via a simple str_replace. No, this is in no way complete. 
    1660             */ 
    1661             $zones = array( 'EDT', 'EST', 'CDT', 'CST', 'PDT', 'PST', 'MDT', 'MST', 'CET', 'FWT', 'MET', 'MEWT', 'SWT', 'EET', 'BT', 'CXT', 'CCT', 'AWST', 'WST', 'JST', 'EAST', 'GST', 'IDLE', 'NZST', 'NZT', 'AKST', 'HST', 'CAT', 'AST', 'ADT', 'BST', 'AKDT', 'YDT', 'HADT', 'HDT' ); 
    1662             $time = ($time == '')?'00:00:00':date( 'H:i:00',strtotime( str_replace( $zones, '', $time ) ) ); 
     1639            $time = ($time == '')?'00:00:00':date( 'H:i:00',strtotime( $time ) ); 
    16631640            $time_format_one = '/^([0-1][0-9]):([0-5][0-9]):([0-5][0-9])$/'; 
    16641641            $time_format_two = '/^([2][0-3]):([0-5][0-9]):([0-5][0-9])$/'; 
    1665             if (preg_match($time_format_one,$time) || preg_match($time_format_two,$time) || $time == '') { 
     1642            if ( preg_match( $time_format_one,$time ) || preg_match( $time_format_two,$time ) || $time == '' ) { 
    16661643            } else { 
    1667                 $errors .= "<div class='error'><p><strong>".__('Error','my-calendar').":</strong> ".__('The time field must either be blank or be entered in the format hh:mm am/pm','my-calendar')."</p></div>"; 
     1644                $errors .= "<div class='error'><p><strong>".__( 'Error','my-calendar' ).":</strong> ".__('The time field must either be blank or be entered in the format hh:mm am/pm','my-calendar')."</p></div>"; 
    16681645            } 
    16691646            // We check for a valid end time, or an empty one 
    1670             if (preg_match($time_format_one,$endtime) || preg_match($time_format_two,$endtime) || $endtime == '') { 
     1647            if ( preg_match( $time_format_one,$endtime ) || preg_match( $time_format_two,$endtime ) || $endtime == '' ) { 
    16711648            } else { 
    16721649                $errors .= "<div class='error'><p><strong>".__('Error','my-calendar').":</strong> ".__('The end time field must either be blank or be entered in the format hh:mm am/pm','my-calendar')."</p></div>"; 
    16731650            }    
    1674             // We check to make sure the URL is acceptable (blank or starting with http://)                                                         
    1675             if ( $linky == '' ) { 
    1676             } else if ( preg_match('/^(http)(s?)(:)\/\//',$linky) ) { 
     1651            // We check to make sure the URL is acceptable (blank or starting with http://) 
     1652            if ( $event_link == '' || preg_match('/^(http)(s?)(:)\/\//',$event_link) ) { 
     1653                $event_link = $event_link; 
    16771654            } else { 
    1678                 $linky = "http://" . $linky; 
    1679             } 
    1680         } 
    1681         // The title must be at least one character in length and no more than 255 - only basic punctuation is allowed 
     1655                $event_link = "http://" . $event_link; 
     1656            } 
     1657        } 
     1658        // A title is required, and can't be more than 255 characters. 
    16821659        $title_length = strlen($title); 
    16831660        if ( $title_length >= 1 && $title_length <= 255 ) { 
     
    16851662            $errors .= "<div class='error'><p><strong>".__('Error','my-calendar').":</strong> ".__('An event title is required.','my-calendar')."</p></div>"; 
    16861663        } 
    1687         // We run some checks on recurrance                                                                         
     1664        // Run checks on recurrence profile                                                                       
    16881665        if (( $repeats == 0 && $recur == 'S') || (($repeats >= 0) && ($recur == 'W'|| $recur == 'B'|| $recur == 'M'|| $recur == 'U'|| $recur == 'Y'|| $recur == 'D'|| $recur == 'E'))) { 
    16891666            $recur = $recur . $every; 
     
    17081685                'event_time'=>$time, 
    17091686                'event_endtime'=>$endtime,               
    1710                 'event_link'=>$linky, 
     1687                'event_link'=>$event_link, 
    17111688                'event_label'=>$event_label,  
    17121689                'event_street'=>$event_street,  
     
    17351712                'event_approved'=>$approved, 
    17361713                'event_host'=>$host, 
    1737                 'event_flagged'=> mc_spam( $linky, $desc, $post ), 
     1714                'event_flagged'=> mc_spam( $event_link, $desc, $post ), 
    17381715                'event_fifth_week'=>$event_fifth_week, 
    17391716                'event_holiday'=>$event_holiday, 
     
    17591736            $users_entries->event_host = $host; 
    17601737            $users_entries->event_category = $category; 
    1761             $users_entries->event_link = $linky; 
     1738            $users_entries->event_link = $event_link; 
    17621739            $users_entries->event_link_expires = $expires; 
    17631740            $users_entries->event_label = $event_label; 
     
    18881865    if ( is_array($results) && is_admin() ) { 
    18891866        foreach ( $results as $result ) { 
    1890             if ( $result->occur_id == $occur ) {  
     1867            if ( $result->occur_id == $occur ) { 
     1868                $form_control = ''; 
    18911869                $current = "<em>".__('Editing: ','my-calendar')."</em>"; $end = ''; 
    1892             } else {  
     1870            } else { 
     1871                $form_control = "<input type='checkbox' name='delete_occurrences[]' id='delete_$result->occur_id' value='$result->occur_id' aria-labelledby='occur_label occur_date' /> <label id='occur_label' for='delete_$result->occur_id'>Delete</label> "; 
    18931872                $current = "<a href='".admin_url('admin.php?page=my-calendar')."&amp;mode=edit&amp;event_id=$id&amp;date=$result->occur_id'>"; $end = "</a>"; 
    18941873            } 
    1895             $begin = date_i18n( get_option('mc_date_format'),strtotime($result->occur_begin) ) . ''. date( get_option('mc_time_format'),strtotime($result->occur_begin) ); 
    1896             $output.= "<li>$current$begin$end</li>"; 
     1874            $begin = "<span id='occur_date'>".date_i18n( get_option('mc_date_format'),strtotime($result->occur_begin) ) . ', ' . date( get_option('mc_time_format'),strtotime($result->occur_begin) )."</span>"; 
     1875            $output.= "<li>$form_control$current$begin$end</li>"; 
    18971876        } 
    18981877    } else { 
  • my-calendar/trunk/my-calendar-events.php

    r859129 r865684  
    33 
    44// used to generate upcoming events lists 
    5 function mc_get_all_events( $category, $before, $after, $today, $author, $host ) { 
    6 global $wpdb; 
    7     $mcdb = $wpdb; 
    8 if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); } 
     5function mc_get_all_events( $category, $before, $after, $today, $author, $host, $ltype='', $lvalue='' ) { 
     6    global $wpdb; 
     7    $mcdb = $wpdb; 
     8    if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); } 
    99    $select_category = ( $category!='default' )?mc_select_category($category):''; 
    1010    $limit_string = mc_limit_string(); 
    1111    $select_author = ( $author != 'default' )?mc_select_author($author):''; 
    1212    $select_host = ( $host != 'default' )?mc_select_host($host):''; 
     13    $select_location = mc_limit_string( 'grab', $ltype, $lvalue ); 
    1314     
    1415    $date = date('Y', current_time('timestamp')).'-'.date('m', current_time('timestamp')).'-'.date('d', current_time('timestamp')); 
    1516    // if a value is non-zero, I'll grab a handful of extra events so I can throw out holidays and others like that. 
    1617    if ( $before > 0 ) { 
    17         $before = $before + 5; 
     18        $before = $before + 10; 
    1819        $events1 = $mcdb->get_results("SELECT *, UNIX_TIMESTAMP(occur_begin) AS ts_occur_begin, UNIX_TIMESTAMP(occur_end) AS ts_occur_end  
    1920        FROM " . MY_CALENDAR_EVENTS_TABLE . "  
     
    3637    } 
    3738    if ( $after > 0 ) { 
    38         $after = $after + 5; 
     39        $after = $after + 10; 
    3940        $events2 = $mcdb->get_results("SELECT *, UNIX_TIMESTAMP(occur_begin) AS ts_occur_begin, UNIX_TIMESTAMP(occur_end) AS ts_occur_end  
    4041        FROM " . MY_CALENDAR_EVENTS_TABLE . "  
     
    127128 
    128129// get event instance (object or html) 
    129 function mc_get_event( $id,$type='object' ) { 
     130function mc_get_event( $id, $type='object' ) { 
    130131// indicates whether you want a specific instance, or a general event 
    131132    global $wpdb; 
  • my-calendar/trunk/my-calendar-group-manager.php

    r857615 r865684  
    55    global $current_user, $wpdb, $users_entries; 
    66    $mcdb = $wpdb; 
    7      
    8 // First some quick cleaning up  
    9 $edit = $save = false; 
    10  
    11 $action = !empty($_POST['event_action']) ? $_POST['event_action'] : ''; 
    12 $event_id = !empty($_POST['event_id']) ? $_POST['event_id'] : ''; 
    13 $group_id = !empty($_POST['group_id']) ? $_POST['group_id'] : ''; 
    14  
    15  
    16 if ( isset( $_GET['mode'] ) ) { 
    17     if ( $_GET['mode'] == 'edit' ) { 
    18         $action = "edit"; 
    19         $event_id = (int) $_GET['event_id']; 
    20         $group_id = (int) $_GET['group_id']; 
    21     } 
    22 } 
    23  
    24 if ( isset( $_POST['event_action'] ) ) { 
    25     global $mc_output; 
    26     $nonce=$_REQUEST['_wpnonce']; 
    27     if (! wp_verify_nonce($nonce,'my-calendar-nonce') ) die("Security check failed"); 
    28     $proceed = false; 
    29     switch ( $_POST['event_action'] ) { 
    30     case 'edit': 
    31         if ( isset( $_POST['apply'] ) && is_array($_POST['apply']) ) { 
    32             $mc_output = mc_check_group_data( $action,$_POST ); 
    33             foreach ( $_POST['apply'] as $event_id ) { 
    34                 $response = my_calendar_save_group($action,$mc_output,$event_id);    
    35                 echo $response; 
     7    // First some quick cleaning up  
     8    $edit = $save = false; 
     9    $action = !empty( $_POST['event_action'] ) ? $_POST['event_action'] : ''; 
     10    $event_id = !empty( $_POST['event_id'] ) ? $_POST['event_id'] : ''; 
     11    $group_id = !empty( $_POST['group_id'] ) ? $_POST['group_id'] : ''; 
     12 
     13    if ( isset( $_GET['mode'] ) ) { 
     14        if ( $_GET['mode'] == 'edit' ) { 
     15            $action = "edit"; 
     16            $event_id = (int) $_GET['event_id']; 
     17            $group_id = (int) $_GET['group_id']; 
     18        } 
     19    } 
     20 
     21    if ( isset( $_POST['event_action'] ) ) { 
     22        global $mc_output; 
     23        $nonce = $_REQUEST['_wpnonce']; 
     24        if ( !wp_verify_nonce( $nonce,'my-calendar-nonce' ) ) wp_die( "Security check failed" ); 
     25        $proceed = false; 
     26        switch ( $_POST['event_action'] ) { 
     27        case 'edit': 
     28            if ( isset( $_POST['apply'] ) && is_array( $_POST['apply'] ) ) { 
     29                $mc_output = mc_check_group_data( $action, $_POST ); 
     30                foreach ( $_POST['apply'] as $event_id ) { 
     31                    $response = my_calendar_save_group( $action,$mc_output,$event_id );  
     32                    echo $response; 
     33                } 
    3634            } 
     35        break; 
     36        case 'break': 
     37            foreach ( $_POST['break'] as $event_id ) { 
     38                $update = array( 'event_group_id'=>0 ); 
     39                $formats = array( '%d' ); 
     40                //$mcdb->show_errors(); 
     41                $result = $mcdb->update(  
     42                        my_calendar_table(),  
     43                        $update,  
     44                        array( 'event_id'=>$event_id ), 
     45                        $formats,  
     46                        '%d' ); 
     47                //$mcdb->print_error(); 
     48                $url = ( get_option('mc_uri') != '' && !is_numeric( get_option('mc_uri') ) )?' '.sprintf( __( 'View <a href="%s">your calendar</a>.','my-calendar' ),get_option( 'mc_uri' ) ):''; 
     49                    if ( $result === false ) { 
     50                        $message = "<div class='error'><p><strong>".__( 'Error','my-calendar' ).":</strong>".__('Event not updated.','my-calendar')."$url</p></div>"; 
     51                    } else if ( $result === 0 ) { 
     52                        $message = "<div class='updated'><p>#$event_id: ".__( 'Nothing was changed in that update.','my-calendar' )."$url</p></div>"; 
     53                    } else { 
     54                        $message = "<div class='updated'><p>#$event_id: ".__( 'Event updated successfully','my-calendar' ).".$url</p></div>"; 
     55                    } 
     56            } 
     57        break; 
     58        case 'group': 
     59            if ( isset($_POST['group']) && is_array( $_POST['group']) ) { 
     60                $events = $_POST['group']; 
     61                sort($events); 
     62            } 
     63            foreach ( $events as $event_id ) { 
     64                $group_id = $events[0]; 
     65                $update = array( 'event_group_id'=>$group_id ); 
     66                $formats = array( '%d' ); 
     67                //$mcdb->show_errors(); 
     68                $result = $mcdb->update(  
     69                        my_calendar_table(),  
     70                        $update,  
     71                        array( 'event_id'=>$event_id ), 
     72                        $formats,  
     73                        '%d' ); 
     74                //$mcdb->print_error(); 
     75                    if ( $result === false ) { 
     76                        $message = "<div class='error'><p><strong>".__('Error','my-calendar').":</strong>".__('Event not grouped.','my-calendar')."</p></div>"; 
     77                    } else if ( $result === 0 ) { 
     78                        $message = "<div class='updated'><p>#$event_id: ".__('Nothing was changed in that update.','my-calendar')."</p></div>"; 
     79                    } else { 
     80                        $message = "<div class='updated'><p>#$event_id: ".__('Event grouped successfully','my-calendar')."</p></div>"; 
     81                    } 
     82            }    
     83        break; 
    3784        } 
    38     break; 
    39     case 'break': 
    40         foreach ( $_POST['break'] as $event_id ) { 
    41             $update = array( 'event_group_id'=>0 ); 
    42             $formats = array( '%d' ); 
    43             //$mcdb->show_errors(); 
    44             $result = $mcdb->update(  
    45                     my_calendar_table(),  
    46                     $update,  
    47                     array( 'event_id'=>$event_id ), 
    48                     $formats,  
    49                     '%d' ); 
    50             //$mcdb->print_error(); 
    51             $url = ( get_option('mc_uri') != '' && !is_numeric( get_option('mc_uri') ) )?' '.sprintf(__('View <a href="%s">your calendar</a>.','my-calendar'),get_option('mc_uri') ):''; 
    52                 if ( $result === false ) { 
    53                     $message = "<div class='error'><p><strong>".__('Error','my-calendar').":</strong>".__('Event not updated.','my-calendar')."$url</p></div>"; 
    54                 } else if ( $result === 0 ) { 
    55                     $message = "<div class='updated'><p>#$event_id: ".__('Nothing was changed in that update.','my-calendar')."$url</p></div>"; 
    56                 } else { 
    57                     $message = "<div class='updated'><p>#$event_id: ".__('Event updated successfully','my-calendar').".$url</p></div>"; 
    58                 } 
    59         } 
    60     break; 
    61     case 'group': 
    62         if ( isset($_POST['group']) && is_array( $_POST['group']) ) { 
    63             $events = $_POST['group']; 
    64             sort($events); 
    65         } 
    66         foreach ( $events as $event_id ) { 
    67             $group_id = $events[0]; 
    68             $update = array( 'event_group_id'=>$group_id ); 
    69             $formats = array( '%d' ); 
    70             //$mcdb->show_errors(); 
    71             $result = $mcdb->update(  
    72                     my_calendar_table(),  
    73                     $update,  
    74                     array( 'event_id'=>$event_id ), 
    75                     $formats,  
    76                     '%d' ); 
    77             //$mcdb->print_error(); 
    78                 if ( $result === false ) { 
    79                     $message = "<div class='error'><p><strong>".__('Error','my-calendar').":</strong>".__('Event not grouped.','my-calendar')."</p></div>"; 
    80                 } else if ( $result === 0 ) { 
    81                     $message = "<div class='updated'><p>#$event_id: ".__('Nothing was changed in that update.','my-calendar')."</p></div>"; 
    82                 } else { 
    83                     $message = "<div class='updated'><p>#$event_id: ".__('Event grouped successfully','my-calendar')."</p></div>"; 
    84                 } 
    85         }    
    86     break; 
    87     } 
    88 } 
    89  
    90 ?> 
    91  
    92 <div class="wrap jd-my-calendar" id="my-calendar"> 
    93 <?php my_calendar_check_db();?> 
    94     <?php 
    95     if ( $action == 'edit' || ($action == 'edit' && $error_with_saving == 1) ) { 
    96         ?> 
    97 <div id="icon-edit" class="icon32"></div>        
    98         <h2><?php _e('Edit Event Group','my-calendar'); ?></h2> 
    99         <?php 
    100         if ( empty($event_id) || empty($group_id) ) { 
    101             echo "<div class=\"error\"><p>".__("You must provide an event group id in order to edit it",'my-calendar')."</p></div>"; 
    102         } else { 
    103             jd_groups_edit_form('edit', $event_id, $group_id ); 
    104         }    
    105     } else { 
    106     ?>   
    107 <div id="icon-edit" class="icon32"></div>    
     85    } ?> 
     86 
     87    <div class="wrap jd-my-calendar" id="my-calendar"><?php  
     88    my_calendar_check_db();  
     89    if ( $action == 'edit' || ($action == 'edit' && $error_with_saving == 1) ) { ?> 
     90            <div id="icon-edit" class="icon32"></div>        
     91            <h2><?php _e('Edit Event Group','my-calendar'); ?></h2> 
     92            <?php 
     93            if ( empty($event_id) || empty($group_id) ) { 
     94                echo "<div class=\"error\"><p>".__("You must provide an event group id in order to edit it",'my-calendar')."</p></div>"; 
     95            } else { 
     96                jd_groups_edit_form('edit', $event_id, $group_id ); 
     97            }    
     98    } else { ?>  
     99        <div id="icon-edit" class="icon32"></div> 
    108100        <h2><?php _e('Manage Event Groups','my-calendar'); ?></h2> 
    109         <p><?php _e('Grouped events can be edited simultaneously. When you choose a group of events to edit, the form will be pre-filled with the content applicable to the member of the event group you started from. (e.g., if you click on the "Edit Group" link for the 3rd of a set of events, the boxes will use the content applicable to that event.). You will also receive a set of checkboxes which will indicate which events in the group should have these changes applied. (All grouped events can also be edited individually.)','my-calendar'); ?></p> 
    110         <p><?php _e('The following fields will never be changed when editing groups: registration availability, event publication status, spam flagging, event recurrence, event repetitions, and the start and end dates and times for that event.','my-calendar'); ?></p> 
    111  
    112 <div class="postbox-container" style="width: 70%"> 
    113 <div class="metabox-holder"> 
    114     <div class="ui-sortable meta-box-sortables"> 
    115         <div class="postbox">    
    116             <h3><?php _e('Manage Event Groups','my-calendar'); ?></h3> 
    117             <div class="inside"> 
    118                 <p><?php _e('Select an event group to edit.','my-calendar'); ?></p> 
     101        <p> 
     102            <?php _e('Grouped events can be edited simultaneously. When you choose a group of events to edit, the form will be pre-filled with the content applicable to the member of the event group you started from. (e.g., if you click on the "Edit Group" link for the 3rd of a set of events, the boxes will use the content applicable to that event.). You will also receive a set of checkboxes which will indicate which events in the group should have these changes applied. (All grouped events can also be edited individually.)','my-calendar'); ?> 
     103        </p> 
     104 
     105        <div class="postbox-container jcd-wide"> 
     106        <div class="metabox-holder"> 
     107            <div class="ui-sortable meta-box-sortables"> 
     108                <div class="postbox">    
     109                    <h3><?php _e('Manage Event Groups','my-calendar'); ?></h3> 
     110                    <div class="inside"> 
     111                        <p><?php _e('Select an event group to edit.','my-calendar'); ?></p> 
     112                    </div> 
     113                </div> 
     114            </div> 
     115            <div class="ui-sortable meta-box-sortables"> 
     116                <div class="postbox">    
     117                    <h3><?php _e('Create/Modify Groups','my-calendar'); ?></h3> 
     118                    <?php jd_groups_display_list(); ?> 
     119                </div> 
    119120            </div> 
    120121        </div> 
    121     </div> 
    122 </div> 
    123 </div> 
    124          
    125     <?php } ?> 
    126      
    127     <?php jd_show_support_box(); ?> 
    128     <?php jd_groups_display_list(); ?> 
    129 </div> 
    130 <?php 
     122        </div><?php  
     123    } 
     124    jd_show_support_box(); ?> 
     125    </div><?php 
    131126}  
    132127 
    133128function my_calendar_save_group( $action,$output,$event_id=false ) { 
    134 global $wpdb,$event_author; 
     129    global $wpdb,$event_author; 
    135130    $mcdb = $wpdb; 
    136131    $proceed = $output[0]; 
     
    174169 
    175170function jd_acquire_group_data($event_id=false) { 
    176 global $wpdb,$users_entries; 
     171    global $wpdb,$users_entries; 
    177172    $mcdb = $wpdb; 
    178173    if ( $event_id !== false ) { 
     
    237232    $group = "<div class='group $class'>"; 
    238233    $group .= $warning; 
    239     $group .= ($type == 'apply')?"<fieldset><legend>".__('Apply these changes to:','my-calendar')."</legend>":''; 
    240     $group .= ($type == 'break')?"<form method='post' action='".admin_url("admin.php?page=my-calendar-groups&amp;mode=edit&amp;event_id=$event_id&amp;group_id=$group_id")."'> 
     234    $group .= ( $type == 'apply' )?"<fieldset><legend>".__('Apply these changes to:','my-calendar')."</legend>":''; 
     235    $group .= ( $type == 'break' )?"<form method='post' action='".admin_url("admin.php?page=my-calendar-groups&amp;mode=edit&amp;event_id=$event_id&amp;group_id=$group_id")."'> 
    241236    <div><input type='hidden' value='$group_id' name='group_id' /><input type='hidden' value='$type' name='event_action' /><input type='hidden' name='_wpnonce' value='$nonce' /> 
    242 </div>":''; 
    243     $group .= "<ul class='columns'>"; 
     237    </div>":''; 
     238    $group .= "<ul class='checkboxes'>"; 
    244239    $checked = ( $type=='apply' )?' checked="checked"':''; 
    245240    foreach ( $results as $result ) { 
     
    249244    } 
    250245    $group .= "<li><input type='checkbox' class='selectall' id='$type'$checked /> <label for='$type'><b>".__('Check/Uncheck all','my-calendar')."</b></label></li>\n</ul>"; 
    251     $group .= ($type == 'apply')?"</fieldset>":''; 
    252     $group .= ($type == 'break')?"<p><input type='submit' class='button' value='".__('Remove checked events from this group','my-calendar')."' /></p></form>":''; 
     246    $group .= ( $type == 'apply' )?"</fieldset>":''; 
     247    $group .= ( $type == 'break' )?"<p><input type='submit' class='button' value='".__('Remove checked events from this group','my-calendar')."' /></p></form>":''; 
    253248    $group .= "</div>"; 
    254249    return $group; 
     
    270265        $message .= __('You must provide a group ID to edit groups','my-calendar');  
    271266    } 
    272      
    273 ?> 
    274  
    275     <?php echo ($message != '')?"<div class='error'><p>$message</p></div>":''; ?> 
    276     <?php echo $group; ?> 
    277     <?php my_calendar_print_group_fields($data,$mode,$event_id, $group_id); ?> 
    278  
    279 <?php 
     267    echo ($message != '')?"<div class='error'><p>$message</p></div>":'';  
     268    echo $group;  
     269    my_calendar_print_group_fields($data,$mode,$event_id, $group_id);  
    280270} 
    281271 
     
    287277    $user = get_userdata($user_ID);      
    288278    $mc_input_administrator = (get_option('mc_input_options_administrators')=='true' && current_user_can('manage_options'))?true:false; 
    289     $mc_input = get_option('mc_input_options'); 
    290 ?> 
    291  
    292 <div class="postbox-container" style="width: 70%"> 
    293 <div class="metabox-holder"> 
    294 <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-groups&amp;mode=edit&amp;event_id=$event_id&amp;group_id=$group_id"); ?>"> 
    295 <div> 
    296 <input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /> 
    297 <input type="hidden" name="group_id" value="<?php if ( !empty( $data->event_group_id ) ) { echo $data->event_group_id; } else { echo mc_group_id(); } ?>" /> 
    298 <input type="hidden" name="event_action" value="<?php echo $mode; ?>" /> 
    299 <input type="hidden" name="event_id" value="<?php echo $event_id; ?>" /> 
    300 <input type="hidden" name="event_author" value="<?php echo $user_ID; ?>" /> 
    301 <input type="hidden" name="event_post" value="<?php echo $data->event_post; ?>" /> 
    302 <input type="hidden" name="event_nonce_name" value="<?php echo wp_create_nonce('event_nonce'); ?>" /> 
    303 </div> 
    304 <div class="ui-sortable meta-box-sortables"> 
     279    $mc_input = get_option('mc_input_options'); ?> 
     280 
     281    <div class="postbox-container jcd-wide"> 
     282    <div class="metabox-holder"> 
     283    <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-groups&amp;mode=edit&amp;event_id=$event_id&amp;group_id=$group_id"); ?>"> 
     284    <div> 
     285        <input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /> 
     286        <input type="hidden" name="group_id" value="<?php if ( !empty( $data->event_group_id ) ) { echo $data->event_group_id; } else { echo mc_group_id(); } ?>" /> 
     287        <input type="hidden" name="event_action" value="<?php echo $mode; ?>" /> 
     288        <input type="hidden" name="event_id" value="<?php echo $event_id; ?>" /> 
     289        <input type="hidden" name="event_author" value="<?php echo $user_ID; ?>" /> 
     290        <input type="hidden" name="event_post" value="<?php echo $data->event_post; ?>" /> 
     291        <input type="hidden" name="event_nonce_name" value="<?php echo wp_create_nonce('event_nonce'); ?>" /> 
     292    </div> 
     293    <div class="ui-sortable meta-box-sortables"> 
    305294    <div class="postbox">    
    306295    <h3><?php _e('Manage Event Groups','my-calendar'); ?></h3> 
     
    559548    $host = !empty($post['event_host']) ? $post['event_host'] : $current_user->ID; 
    560549    $category = !empty($post['event_category']) ? $post['event_category'] : ''; 
    561     $linky = !empty($post['event_link']) ? trim($post['event_link']) : ''; 
     550    $event_link = !empty($post['event_link']) ? trim($post['event_link']) : ''; 
    562551    $expires = !empty($post['event_link_expires']) ? $post['event_link_expires'] : '0'; 
    563552    $location_preset = !empty($post['location_preset']) ? $post['location_preset'] : ''; 
     
    605594     
    606595        // We check to make sure the URL is acceptable (blank or starting with http://)                                                         
    607         if ($linky == '') { 
     596        if ( $event_link == '' ) { 
    608597            $url_ok = 1; 
    609         } else if ( preg_match('/^(http)(s?)(:)\/\//',$linky) ) { 
     598        } else if ( preg_match('/^(http)(s?)(:)\/\//',$event_link) ) { 
    610599            $url_ok = 1; 
    611600        } else { 
    612             $linky = "http://" . $linky; 
     601            $event_link = "http://" . $event_link; 
    613602        } 
    614603    } 
     
    628617            'event_desc'=>$desc,  
    629618            'event_short'=>$short, 
    630             'event_link'=>$linky, 
     619            'event_link'=>$event_link, 
    631620            'event_label'=>$event_label,  
    632621            'event_street'=>$event_street,  
     
    661650        $users_entries->event_host = $host; 
    662651        $users_entries->event_category = $category; 
    663         $users_entries->event_link = $linky; 
     652        $users_entries->event_link = $event_link; 
    664653        $users_entries->event_link_expires = $expires; 
    665654        $users_entries->event_label = $event_label; 
     
    695684    global $wpdb; 
    696685    $mcdb = $wpdb; 
    697      
    698         $sortby = ( isset( $_GET['sort'] ) )?(int) $_GET['sort']:get_option('mc_default_sort'); 
    699  
    700         if ( isset( $_GET['order'] ) ) { 
    701             $sortdir = ( isset($_GET['order']) && $_GET['order'] == 'ASC' )?'ASC':'default'; 
    702         } else { 
    703             $sortdir = 'default'; 
    704         } 
    705      
     686    $sortby = ( isset( $_GET['sort'] ) )?(int) $_GET['sort']:get_option('mc_default_sort'); 
     687    if ( isset( $_GET['order'] ) ) { 
     688        $sortdir = ( isset($_GET['order']) && $_GET['order'] == 'ASC' )?'ASC':'default'; 
     689    } else { 
     690        $sortdir = 'default'; 
     691    } 
     692 
    706693    if ( empty($sortby) ) { 
    707694        $sortbyvalue = 'event_begin'; 
    708695    } else { 
    709696        switch ($sortby) { 
    710             case 1:$sortbyvalue = 'event_ID'; 
    711             break; 
    712             case 2:$sortbyvalue = 'event_title'; 
    713             break; 
    714             case 3:$sortbyvalue = 'event_desc'; 
    715             break; 
    716             case 4:$sortbyvalue = 'event_begin'; 
    717             break; 
    718             case 5:$sortbyvalue = 'event_author'; 
    719             break; 
    720             case 6:$sortbyvalue = 'event_category'; 
    721             break; 
    722             case 7:$sortbyvalue = 'event_label'; 
    723             break; 
    724             case 8:$sortbyvalue = 'group_id'; 
    725             break; 
     697            case 1:$sortbyvalue = 'event_ID'; break; 
     698            case 2:$sortbyvalue = 'event_title'; break; 
     699            case 3:$sortbyvalue = 'event_desc'; break; 
     700            case 4:$sortbyvalue = 'event_begin'; break; 
     701            case 5:$sortbyvalue = 'event_author'; break; 
     702            case 6:$sortbyvalue = 'event_category'; break; 
     703            case 7:$sortbyvalue = 'event_label'; break; 
     704            case 8:$sortbyvalue = 'group_id'; break; 
    726705            default:$sortbyvalue = 'event_begin'; 
    727706        } 
     
    737716    } else { 
    738717        $sorting = ''; 
     718    } 
     719     
     720    $current = empty($_GET['paged']) ? 1 : intval($_GET['paged']); 
     721    $user = get_current_user_id(); 
     722    $screen = get_current_screen(); 
     723    $option = $screen->get_option( 'per_page', 'option' ); 
     724    $items_per_page = get_user_meta( $user, $option, true ); 
     725    if ( empty( $items_per_page ) || $items_per_page < 1 ) { 
     726        $items_per_page = $screen->get_option( 'per_page', 'default' ); 
    739727    } 
    740728    $limit = ( isset($_GET['limit']) )?$_GET['limit']:'all'; 
     
    745733        default:$limit = ''; 
    746734    } 
    747     $events = $mcdb->get_results("SELECT * FROM " . my_calendar_table() . " $limit ORDER BY $sortbyvalue $sortbydirection"); 
    748     ?> 
    749     <h2 class="mc-clear"><?php _e('Create/Modify Groups','my-calendar'); ?></h2> 
    750     <?php if ( get_option('mc_event_approve') == 'true' ) { ?> 
     735    $events = $mcdb->get_results( "SELECT SQL_CALC_FOUND_ROWS * FROM " . my_calendar_table() . " $limit ORDER BY $sortbyvalue $sortbydirection LIMIT ".(($current-1)*$items_per_page).", ".$items_per_page ); 
     736    $found_rows = $wpdb->get_col("SELECT FOUND_ROWS();"); 
     737    $items = $found_rows[0];     
     738    ?><div class='inside'><?php 
     739    if ( get_option('mc_event_approve') == 'true' ) { ?> 
    751740        <ul class="links"> 
    752741        <li><a <?php echo ( isset($_GET['limit']) && $_GET['limit']=='groupeed' )?' class="active-link"':''; ?> href="<?php echo admin_url('admin.php?page=my-calendar-groups&amp;limit=grouped#my-calendar-admin-table'); ?>"><?php _e('Grouped Events','my-calendar'); ?></a></li> 
     
    757746     
    758747    <p><?php _e('Check a set of events to group them for mass editing.','my-calendar'); ?></p> 
     748     
     749        <?php 
     750        $num_pages = ceil($items / $items_per_page); 
     751        if ( $num_pages > 1 ) { 
     752            $page_links = paginate_links( array( 
     753                'base'=> add_query_arg( 'paged', '%#%'), 
     754                'format'=> '', 
     755                'prev_text'=> __( '&laquo; Previous<span class="screen-reader-text"> Events</span>','my-calendar' ), 
     756                'next_text'=> __( 'Next<span class="screen-reader-text"> Events</span> &raquo;','my-calendar' ), 
     757                'total'=> $num_pages, 
     758                'current'=> $current, 
     759                'mid_size'=> 1               
     760            )); 
     761            echo "<div class='tablenav'>"; 
     762            echo "<div class='tablenav-pages'>"; 
     763            echo $page_links;  
     764            echo "</div>"; 
     765            echo "</div>"; 
     766        } 
     767        ?>       
    759768    <?php 
    760769    if ( !empty($events) ) { 
     
    767776        <p style="position:relative;"> 
    768777        <input type="submit" class="button-primary group" value="<?php _e('Group checked events for mass editing','my-calendar'); ?>" /> 
    769         </p>         
     778        </p> 
     779    </div> 
    770780<table class="widefat wp-list-table" id="my-calendar-admin-table"> 
    771781    <thead> 
     
    792802            $author = ( $event->event_author != 0 )?get_userdata($event->event_author):'Public Submitter'; 
    793803            if ($event->event_link != '') {  
    794             $title = "<a href='".esc_attr($event->event_link)."'>$event->event_title</a>"; 
     804                $title = "<a href='".esc_attr($event->event_link)."'>$event->event_title</a>"; 
    795805            } else { 
    796             $title = $event->event_title; 
     806                $title = $event->event_title; 
    797807            } 
    798808            ?> 
     
    817827                </div> 
    818828                </td> 
    819                 <td><?php echo stripslashes($event->event_label); ?></td> 
    820                 <?php if ($event->event_time != "00:00:00") { $eventTime = date_i18n(get_option('mc_time_format'), strtotime($event->event_time)); } else { $eventTime = get_option('mc_notime_text'); } ?> 
    821                 <td><?php echo "$event->event_begin, $eventTime"; ?></td> 
    822                 <?php /* <td><?php echo $event->event_end; ?></td> */ ?> 
     829                <td><?php echo stripslashes( $event->event_label ); ?></td> 
     830                <?php if ( $event->event_time != "00:00:00" ) { $eventTime = date_i18n(get_option('mc_time_format'), strtotime($event->event_time)); } else { $eventTime = get_option('mc_notime_text'); } ?> 
     831                <td><?php echo "$event->event_begin<br />$eventTime"; ?></td> 
    823832                <td> 
    824833                <?php  
     
    852861                <td><div class="category-color" style="background-color:<?php echo (strpos($this_cat->category_color,'#') !== 0)?'#':''; echo $this_cat->category_color;?>;"> </div> <?php echo stripslashes($this_cat->category_name); ?></td> 
    853862                <?php unset($this_cat); ?> 
    854             </tr> 
    855 <?php 
    856         } 
    857 ?> 
     863            </tr><?php 
     864        } ?> 
    858865        </table> 
    859         <p> 
    860         <input type="submit" class="button-secondary group" value="<?php _e('Group checked events for mass editing','my-calendar'); ?>" /> 
    861         </p> 
    862         </form> 
    863 <?php 
    864     } else { 
    865 ?> 
    866         <p><?php _e("There are no events in the database!",'my-calendar') ?></p> 
    867 <?php    
     866        <div class="inside"> 
     867            <p> 
     868            <input type="submit" class="button-secondary group" value="<?php _e( 'Group checked events for mass editing',   'my-calendar' ); ?>" /> 
     869            </p> 
     870        </div> 
     871        </form><?php 
     872    } else { ?> 
     873        <div class="inside"><p><?php _e("There are no events in the database!",'my-calendar') ?></p></div><?php  
    868874    } 
    869875} 
  • my-calendar/trunk/my-calendar-help.php

    r860306 r865684  
    66<div class="wrap jd-my-calendar"> 
    77<h2><?php _e('How to use My Calendar','my-calendar'); ?></h2> 
    8 <div class="postbox-container" style="width: 70%"> 
     8<div class="postbox-container jcd-wide"> 
    99<div class="metabox-holder"> 
    1010 
     
    1515    <?php do_action( 'mc_before_help' ); ?> 
    1616    <ul class="mc-settings checkboxes"> 
     17        <li><a href="#mc-generator"><?php _e('Shortcode Generator','my-calendar'); ?></a></li>   
    1718        <li><a href="#mc-shortcodes"><?php _e('Shortcodes','my-calendar'); ?></a></li> 
    1819        <li><a href="#icons"><?php _e('Icons','my-calendar'); ?></a></li> 
     
    4243</div> 
    4344 
     45<div class="ui-sortable meta-box-sortables" id="mc-generator"> 
     46<div class="postbox"> 
     47<h3 id="help"><?php _e("My Calendar Shortcode Generator",'my-calendar'); ?></h3> 
     48    <div class="inside mc-tabs"> 
     49        <?php mc_generate(); ?> 
     50        <ul class='tabs'> 
     51            <li><a href='#mc_main'><?php _e( 'Main','my-calendar' ); ?></a></li> 
     52            <li><a href='#mc_upcoming'><?php _e( 'Upcoming','my-calendar' ); ?></a></li> 
     53            <li><a href='#mc_today'><?php _e( 'Today','my-calendar' ); ?></a></li> 
     54        </ul> 
     55        <div class='wptab mc_main' id='mc_main' aria-live='polite'>  
     56            <?php mc_generator( 'main' ); ?> 
     57        </div> 
     58        <div class='wptab mc_upcoming' id='mc_upcoming' aria-live='polite'> 
     59            <?php mc_generator( 'upcoming' ); ?> 
     60        </div> 
     61        <div class='wptab mc_today' id='mc_today' aria-live='polite'> 
     62            <?php mc_generator( 'today' ); ?> 
     63        </div> 
     64    </div> 
     65</div> 
     66</div> 
     67 
     68 
    4469<div class="ui-sortable meta-box-sortables"> 
    4570<div class="postbox" id="mc-shortcodes"> 
     
    7297</p> 
    7398<h4><?php _e('Additional Views (Upcoming events, today\'s events)','my-calendar'); ?></h4> 
    74 <p class="example"><code>[my_calendar_upcoming before="3" after="3" type="event" fallback="No events coming up!" category="General" author="1" host="1" template="{title} {date}" order="asc" show_today="yes" skip="0"]</code></p> 
     99<p class="example"><code>[my_calendar_upcoming before="3" after="3" type="event" fallback="No events coming up!" category="General" author="1" host="1" template="{title} {date}" order="asc" show_today="yes" skip="0" ltype="" lvalue=""]</code></p> 
    75100<p> 
    76101    <?php _e('Displays the output of the Upcoming Events widget. <code>before</code> and <code>after</code> are numbers; <code>type</code> is either "event" or "days", and <code>category</code> and <code>author</code> work the same as in the main calendar shortcode. Templates use the template codes listed below. <code>fallback</code> provides text if no events meet your criteria. Order sets sort order for the list &ndash; ascending (<code>asc</code>) or descending (<code>desc</code>). <code>show_today</code> indicates whether to include today\'s events in the list. <code>Skip</code> is how many events to skip in the list.','my-calendar'); ?> 
     
    91116<h4><?php _e( 'Calendar Filter Shortcodes', 'my-calendar' ); ?></h4> 
    92117 
     118<p class="example"><code>[mc_filters show="categories,locations"]</code></p> 
     119<p> 
     120    <?php _e('Displays all available filters as a single form. The <code>show</code> attribute takes three keywords: categories, locations, and access, to indicate which filters to show and in what order.','my-calendar'); ?> 
     121</p> 
    93122<p class="example"><code>[my_calendar_locations show="list" type="saved" datatype="name"]</code></p> 
    94123<p> 
     
    168197        <dt><code>{time}</code></dt> 
    169198        <dd><?php _e('Displays the start time for the event.','my-calendar'); ?></dd> 
     199 
     200        <dt><code>{runtime}</code></dt> 
     201        <dd><?php _e('Human language estimate of how long an event will run.','my-calendar'); ?></dd> 
    170202 
    171203        <dt><code>{usertime}</code></dt> 
  • my-calendar/trunk/my-calendar-install.php

    r857615 r865684  
    468468    // this function migrates the DB from version 1.10.x to version 2.0. 
    469469    $tables = $wpdb->get_results("show tables;"); 
    470         foreach ( $tables as $table ) { 
    471             foreach ( $table as $value )  { 
    472                 if ( $value == my_calendar_event_table() ) { 
    473                     $count = $wpdb->get_var( 'SELECT count(1) from '.my_calendar_event_table() ); 
    474                     $count2 = $wpdb->get_var( 'SELECT count(1) from '.my_calendar_table() ); 
    475                     if ( $count2 > 0 && $count > 0 ) { 
    476                         $migrated = true; // both tables have event data 
    477                         return; 
    478                     } 
    479                     if ( $count2 == 0 && $count == 0 ) { 
    480                         return; // no events, migration unnecessary 
    481                     } 
    482                     break 2; 
     470    foreach ( $tables as $table ) { 
     471        foreach ( $table as $value )  { 
     472            if ( $value == my_calendar_event_table() ) { 
     473                $count = $wpdb->get_var( 'SELECT count(1) from '.my_calendar_event_table() ); 
     474                $count2 = $wpdb->get_var( 'SELECT count(1) from '.my_calendar_table() ); 
     475                if ( $count2 > 0 && $count > 0 ) { 
     476                    $migrated = true; // both tables have event data 
     477                    return; 
    483478                } 
     479                if ( $count2 == 0 && $count == 0 ) { 
     480                    return; // no events, migration unnecessary 
     481                } 
     482                break 2; 
    484483            } 
    485484        } 
    486         // 2) create new occurrences database, if necessary 
    487         //dbDelta($initial_occur_db); 
    488         // 3) migrate events 
    489         $sql = "SELECT event_id, event_begin, event_time, event_end, event_endtime FROM ".my_calendar_table(); 
    490         $events = $wpdb->get_results($sql); 
    491         foreach ( $events as $event ) { 
    492             // assign endtimes to all events 
    493             if ( $event->event_endtime == '00:00:00' && $event->event_time != '00:00:00' ) { 
    494                 $event->event_endtime = date('H:i:s',strtotime( "$event->event_time +1 hour" ) ); 
    495                 mc_flag_event( $event->event_id, $event->event_endtime ); 
    496             } 
    497             $dates = array( 'event_begin'=>$event->event_begin,'event_end'=>$event->event_end,'event_time'=>$event->event_time,'event_endtime'=>$event->event_endtime ); 
    498             $event = mc_increment_event( $event->event_id, $dates ); 
    499         } 
     485    } 
     486    // 2) create new occurrences database, if necessary 
     487    //dbDelta($initial_occur_db); 
     488    // 3) migrate events 
     489    $sql = "SELECT event_id, event_begin, event_time, event_end, event_endtime FROM ".my_calendar_table(); 
     490    $events = $wpdb->get_results($sql); 
     491    foreach ( $events as $event ) { 
     492        // assign endtimes to all events 
     493        if ( $event->event_endtime == '00:00:00' && $event->event_time != '00:00:00' ) { 
     494            $event->event_endtime = date('H:i:s',strtotime( "$event->event_time +1 hour" ) ); 
     495            mc_flag_event( $event->event_id, $event->event_endtime ); 
     496        } 
     497        $dates = array( 'event_begin'=>$event->event_begin,'event_end'=>$event->event_end,'event_time'=>$event->event_time,'event_endtime'=>$event->event_endtime ); 
     498        $event = mc_increment_event( $event->event_id, $dates ); 
     499    } 
    500500} 
    501501 
  • my-calendar/trunk/my-calendar-locations.php

    r859129 r865684  
    1515        } 
    1616        update_option( 'mc_location_controls', $mc_location_controls ); 
    17         echo "<div class='notice update'><p>".__( 'Location Controls Updated','my-calendar' )."</p></div>";      
     17        echo "<div class='notice updated'><p>".__( 'Location Controls Updated','my-calendar' )."</p></div>";         
    1818    } 
    1919} 
     
    136136<h2><?php _e( 'Edit Location','my-calendar' ); ?></h2> 
    137137<?php } ?> 
    138 <div class="postbox-container" style="width: 70%"> 
     138<div class="postbox-container jcd-wide"> 
    139139<div class="metabox-holder"> 
    140140 
  • my-calendar/trunk/my-calendar-output.php

    r857615 r865684  
    460460<meta name="generator" content="My Calendar for WordPress" /> 
    461461<meta name="robots" content="noindex,nofollow" />'; 
    462 if ( mc_file_exists( 'mc-print.css' ) ) { 
    463     $stylesheet = mc_get_file( 'mc-print.css', 'url' ); 
     462if ( mc_file_exists( 'css/mc-print.css' ) ) { 
     463    $stylesheet = mc_get_file( 'css/mc-print.css', 'url' ); 
    464464} else { 
    465465    $stylesheet = $url."mc-print.css"; 
     
    12881288    <div id='mc-filters'> 
    12891289        <form action='".$current_url."' method='get'>\n"; 
    1290          
    1291     $qsa = array(); 
    1292     parse_str($_SERVER['QUERY_STRING'],$qsa); 
    1293     if ( !isset( $_GET['cid'] ) ) { $form .= '<input type="hidden" name="cid" value="all" />'; }     
    1294     foreach ($qsa as $name => $argument) { 
    1295         $name = esc_attr(strip_tags($name)); 
    1296         $argument = esc_attr(strip_tags($argument)); 
    1297         if ( $name == 'access' || $name == 'mcat' || $name == 'ltype' || $name == 'lvalue' && in_array( $name, $args ) ) { 
    1298         } else { 
    1299             $form .= '      <input type="hidden" name="'.$name.'" value="'.$argument.'" />'."\n"; 
    1300         } 
    1301     } 
    1302              
    1303     foreach ( $fields as $show ) { 
    1304         $show = trim($show); 
    1305         switch ( $show ) { 
    1306             case 'categories': $form .= my_calendar_categories_list( 'form','public','group' ); $return = true; break; 
    1307             case 'locations': $form .= my_calendar_locations_list( 'form','saved','name','group' ); $return = true; break; 
    1308             case 'access': $form .= mc_access_list( 'form','group' ); $return = true; break; 
    1309         } 
    1310     } 
     1290        $qsa = array(); 
     1291        parse_str($_SERVER['QUERY_STRING'],$qsa); 
     1292        if ( !isset( $_GET['cid'] ) ) { $form .= '<input type="hidden" name="cid" value="all" />'; }     
     1293        foreach ($qsa as $name => $argument) { 
     1294            $name = esc_attr(strip_tags($name)); 
     1295            $argument = esc_attr(strip_tags($argument)); 
     1296            if ( $name == 'access' || $name == 'mcat' || $name == 'ltype' || $name == 'lvalue' && in_array( $name, $args ) ) { 
     1297            } else { 
     1298                $form .= '      <input type="hidden" name="'.$name.'" value="'.$argument.'" />'."\n"; 
     1299            } 
     1300        } 
     1301                 
     1302        foreach ( $fields as $show ) { 
     1303            $show = trim($show); 
     1304            switch ( $show ) { 
     1305                case 'categories': $form .= my_calendar_categories_list( 'form','public','group' ); $return = true; break; 
     1306                case 'locations': $form .= my_calendar_locations_list( 'form','saved','name','group' ); $return = true; break; 
     1307                case 'access': $form .= mc_access_list( 'form','group' ); $return = true; break; 
     1308            } 
     1309        } 
    13111310    $form .= "<p><input type='submit' value='".esc_attr( __( 'Filter Events','my-calendar' ) )."' /></p> 
    13121311    </form></div>"; 
     
    13241323    $current_url = mc_get_current_url(); 
    13251324     
    1326     $admin_fields = ($context == 'public')?' ':' multiple="multiple" size="5" '; 
     1325    $name = ($context == 'public')?'mcat':'category'; 
     1326    $admin_fields = ($context == 'public')?' name="'.$name.'"':' multiple="multiple" size="5" name="'.$name.'[]"  '; 
    13271327    $admin_label = ($context == 'public')?'':__('(select to include)','my-calendar'); 
    13281328    $form = ( $group == 'single' ) ? "<form action='".$current_url."' method='get'> 
     
    13431343        </div><p>'; 
    13441344    $public_form = ($context == 'public')?$form:''; 
    1345     $name = ($context == 'public')?'mcat':'category'; 
    13461345         
    13471346    $categories = $mcdb->get_results( "SELECT * FROM " . MY_CALENDAR_CATEGORIES_TABLE . " ORDER BY category_id ASC" ); 
     
    13531352            <li><a href='$url'>".__('All Categories','my-calendar')."</a></li>":$public_form.' 
    13541353            <label for="category">'.__('Categories','my-calendar').' '.$admin_label.'</label> 
    1355             <select'.$admin_fields.' name="'.$name.'" id="category"> 
     1354            <select'.$admin_fields.' id="category"> 
    13561355            <option value="all" selected="selected">'.__('All Categories','my-calendar').'</option>'."\n"; 
    13571356         
     
    13761375        $output .= "\n</div>"; 
    13771376    } 
    1378     $output = apply_filters('mc_category_selector',$output,$categories); 
     1377    $output = apply_filters( 'mc_category_selector',$output,$categories ); 
    13791378    return $output; 
    13801379} 
     
    14781477    if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); } 
    14791478    switch ( $datatype ) { 
    1480         case "name":$data = "location_label";break; 
     1479        case "name": case "location": $data = "location_label";break; 
    14811480        case "city":$data = "location_city";break; 
    14821481        case "state":$data = "location_state";break; 
  • my-calendar/trunk/my-calendar-settings.php

    r860300 r865684  
    258258        update_option('mc_show_map',( !empty($_POST['mc_show_map']) && $_POST['mc_show_map']=='on')?'true':'false'); 
    259259        update_option('mc_show_address',( !empty($_POST['mc_show_address']) && $_POST['mc_show_address']=='on')?'true':'false');  
    260         update_option('mc_hide_icons',( !empty($_POST['mc_hide_icons']) && $_POST['mc_hide_icons']=='on')?'false':'true'); 
     260        update_option('mc_hide_icons',( !empty($_POST['mc_hide_icons']) && $_POST['mc_hide_icons']=='on')?'true':'false'); 
    261261        update_option('mc_event_link_expires',( !empty($_POST['mc_event_link_expires']) && $_POST['mc_event_link_expires']=='on')?'true':'false'); 
    262262        update_option('mc_apply_color',$_POST['mc_apply_color']); 
     
    390390    <div id="icon-options-general" class="icon32"><br /></div> 
    391391    <h2><?php _e('My Calendar Options','my-calendar'); ?></h2> 
    392 <div class="postbox-container" style="width: 70%"> 
     392<div class="postbox-container jcd-wide"> 
    393393<div class="metabox-holder"> 
    394394  <?php 
     
    505505    <li><?php mc_settings_field ( 'mc_week_caption', __('Week view caption:','my-calendar'), '', __( 'Available tag: <code>{date format=""}</code>','my-calendar' ) ); ?></li> 
    506506    <li><?php mc_settings_field ( 'my_calendar_caption', __('Extended caption:','my-calendar'), '', __( 'Follows month/year in list views.','my-calendar' ) ); ?></li> 
    507     <li><?php mc_settings_field ( 'mc_title_template', __('Event title template','my-calendar'), '', "<a href='".admin_url("admin.php?page=my-calendar-help#templates")."'>".__( "Templating Help",'my-calendar' ).'</a>' ); ?></li> 
     507    <?php $templates = get_option('mc_templates'); $title_template = $templates['title']; ?> 
     508    <li><?php mc_settings_field ( 'mc_title_template', __('Event title template','my-calendar'), $title_template, "<a href='".admin_url("admin.php?page=my-calendar-help#templates")."'>".__( "Templating Help",'my-calendar' ).'</a>' ); ?></li> 
    508509    <li><?php mc_settings_field ( 'mc_details_label', __('Event details link text','my-calendar'), '', __('Tags: <code>{title}</code>, <code>{location}</code>, <code>{color}</code>, <code>{icon}</code>, <code>{date}</code>, <code>{time}</code>.','my-calendar') ); ?></li> 
    509510    <li><?php mc_settings_field ( 'mc_link_label', __('Event URL link text','my-calendar'), '', "<a href='".admin_url("admin.php?page=my-calendar-help#templates")."'>".__( "Templating Help",'my-calendar' ).'</a>' ); ?></li> 
     
    597598    <fieldset> 
    598599    <legend><?php _e('Event Details Pop-up','my-calendar'); ?></legend> 
    599     <p><?php _e('The checked items will be shown in your event details view. Does not apply if you are using a custom template','my-calendar'); ?> 
    600     <ul class="columns"> 
    601     <li><?php mc_settings_field ( 'mc_display_author', __('Author\'s name','my-calendar'), '', '', array(), 'checkbox-single' ); ?></li> 
    602     <li><?php mc_settings_field ( 'mc_show_event_vcal', __('Link to single event iCal download','my-calendar'), '', '', array(), 'checkbox-single' ); ?></li> 
    603     <li><?php mc_settings_field ( 'mc_show_gcal', __('Link to submit event to Google Calendar','my-calendar'), '', '', array(), 'checkbox-single' ); ?></li>         
    604     <li><?php mc_settings_field ( 'mc_hide_icons', __('Category icons','my-calendar'), '', '', array(), 'checkbox-single' ); ?></li> 
    605     <li><?php mc_settings_field ( 'mc_show_map', __('Link to Google Map','my-calendar'), '', '', array(), 'checkbox-single' ); ?></li> 
    606     <li><?php mc_settings_field ( 'mc_show_address', __('Event Address','my-calendar'), '', '', array(), 'checkbox-single' ); ?></li> 
    607     <li><?php mc_settings_field ( 'mc_short', __('Short description','my-calendar'), '', '', array(), 'checkbox-single' ); ?></li> 
    608     <li><?php mc_settings_field ( 'mc_desc', __('Full description','my-calendar'), '', '', array(), 'checkbox-single' ); ?></li> 
    609     <li><?php mc_settings_field ( 'mc_process_shortcodes', __('Process WordPress shortcodes in descriptions','my-calendar'), '', '', array(), 'checkbox-single' ); ?></li>   
    610     <li><?php mc_settings_field ( 'mc_details', __('Link to event details (requires <a href=\'#mc_uri\'>URL</a>)','my-calendar'), '', '', array(), 'checkbox-single' ); ?></li> 
    611     <li><?php mc_settings_field ( 'mc_event_link', __('External link','my-calendar'), '', '', array(), 'checkbox-single' ); ?></li> 
    612     <li><?php mc_settings_field ( 'mc_event_registration', __('Registration info','my-calendar'), '', '', array(), 'checkbox-single' ); ?></li> 
    613     </ul> 
     600        <p><?php _e('The checked items will be shown in your event details view. Does not apply if you are using a custom template','my-calendar'); ?> 
     601        <ul class="checkboxes"> 
     602            <li><?php mc_settings_field ( 'mc_display_author', __('Author\'s name','my-calendar'), '', '', array(), 'checkbox-single' ); ?></li> 
     603            <li><?php mc_settings_field ( 'mc_show_event_vcal', __('Link to single event iCal download','my-calendar'), '', '', array(), 'checkbox-single' ); ?></li> 
     604            <li><?php mc_settings_field ( 'mc_show_gcal', __('Link to submit event to Google Calendar','my-calendar'), '', '', array(), 'checkbox-single' ); ?></li>         
     605            <li><?php mc_settings_field ( 'mc_hide_icons', __('Hide Category icons','my-calendar'), '', '', array(), 'checkbox-single' ); ?></li> 
     606            <li><?php mc_settings_field ( 'mc_show_map', __('Link to Google Map','my-calendar'), '', '', array(), 'checkbox-single' ); ?></li> 
     607            <li><?php mc_settings_field ( 'mc_show_address', __('Event Address','my-calendar'), '', '', array(), 'checkbox-single' ); ?></li> 
     608            <li><?php mc_settings_field ( 'mc_short', __('Short description','my-calendar'), '', '', array(), 'checkbox-single' ); ?></li> 
     609            <li><?php mc_settings_field ( 'mc_desc', __('Full description','my-calendar'), '', '', array(), 'checkbox-single' ); ?></li> 
     610            <li><?php mc_settings_field ( 'mc_process_shortcodes', __('Process WordPress shortcodes in descriptions','my-calendar'), '', '', array(), 'checkbox-single' ); ?></li>   
     611            <li><?php mc_settings_field ( 'mc_details', __('Link to event details (requires <a href=\'#mc_uri\'>URL</a>)','my-calendar'), '', '', array(), 'checkbox-single' ); ?></li> 
     612            <li><?php mc_settings_field ( 'mc_event_link', __('External link','my-calendar'), '', '', array(), 'checkbox-single' ); ?></li> 
     613            <li><?php mc_settings_field ( 'mc_event_registration', __('Registration info','my-calendar'), '', '', array(), 'checkbox-single' ); ?></li> 
     614        </ul> 
    614615    </fieldset> 
    615616    <fieldset> 
    616617    <legend><?php _e('Event Category Display','my-calendar'); ?></legend> 
    617     <ul class='checkboxes'> 
    618     <?php mc_settings_field ( 'mc_apply_color', array( 'default'=> __('No category colors with titles.','my-calendar'), 'font'=>__('Titles are in category colors.','my-calendar'), 'background'=>__('Titles have category color as background.','my-calendar') ), 'default', '', array(), 'radio' ); ?> 
    619     <li><?php mc_settings_field ( 'mc_inverse_color', __('Optimize contrast for category colors.','my-calendar'), '', '', array(), 'checkbox-single' ); ?></li> 
    620     </ul>    
     618        <ul class='checkboxes'> 
     619            <?php mc_settings_field ( 'mc_apply_color', array( 'default'=> __('No category colors with titles.','my-calendar'), 'font'=>__('Titles are in category colors.','my-calendar'), 'background'=>__('Titles have category color as background.','my-calendar') ), 'default', '', array(), 'radio' ); ?> 
     620            <li><?php mc_settings_field ( 'mc_inverse_color', __('Optimize contrast for category colors.','my-calendar'), '', '', array(), 'checkbox-single' ); ?></li> 
     621        </ul>    
    621622    <?php // End Event Options // ?> 
    622623    </fieldset> 
    623624    <fieldset> 
    624625    <legend><?php _e('Event Scheduling Defaults','my-calendar'); ?></legend> 
    625     <ul> 
    626     <li><?php mc_settings_field ( 'mc_event_link_expires', __('Event links expire after event passes.','my-calendar'), '', '', array(), 'checkbox-single' ); ?></li>     
    627     <li><?php mc_settings_field ( 'mc_no_fifth_week', __('If a recurring event falls on a date that doesn\'t exist (like the 5th Wednesday in February), move it back one week.','my-calendar'), '', '', array(), 'checkbox-single' ); ?></li> 
    628     <li> 
    629     <label for="mc_shc"><?php _e('Holiday Category','my-calendar'); ?></label> 
    630     <select id="mc_shc" name="mc_skip_holidays_category"> 
     626        <ul> 
     627            <li><?php mc_settings_field ( 'mc_event_link_expires', __('Event links expire after event passes.','my-calendar'), '', '', array(), 'checkbox-single' ); ?></li>     
     628            <li><?php mc_settings_field ( 'mc_no_fifth_week', __('If a recurring event falls on a date that doesn\'t exist (like the 5th Wednesday in February), move it back one week.','my-calendar'), '', '', array(), 'checkbox-single' ); ?></li> 
     629            <li> 
     630            <label for="mc_shc"><?php _e('Holiday Category','my-calendar'); ?></label> 
     631            <select id="mc_shc" name="mc_skip_holidays_category"> 
    631632            <option value=''> -- <?php _e('None','my-calendar'); ?> -- </option> 
    632633            <?php 
     
    643644            ?> 
    644645            </select> 
    645     </li> 
    646     <li><?php mc_settings_field ( 'mc_skip_holidays', __('If an event coincides with an event in the designated "Holiday" category, do not show the event.','my-calendar'), '', '', array(), 'checkbox-single' ); ?></li> 
    647     </ul>    
     646            </li> 
     647            <li><?php mc_settings_field ( 'mc_skip_holidays', __('If an event coincides with an event in the designated "Holiday" category, do not show the event.','my-calendar'), '', '', array(), 'checkbox-single' ); ?></li> 
     648        </ul>    
    648649    <?php // End Scheduling Options // ?> 
    649650    </fieldset> 
     
    698699    <legend><?php _e('Select which input fields will be available when adding or editing events.','my-calendar'); ?></legend> 
    699700    <div><input type='hidden' name='mc_input' value='true' /></div> 
    700     <ul class="columns"> 
     701    <ul class="checkboxes"> 
    701702    <?php  
    702703        $input_options = get_option('mc_input_options'); 
     
    758759<div class="postbox" id="my-calendar-permissions"> 
    759760    <h3><?php _e('My Calendar Permissions','my-calendar'); ?></h3> 
    760     <div class="inside">     
     761    <div class="inside mc-tabs">     
    761762    <?php if ( current_user_can('administrator') ) { ?> 
    762763 
  • my-calendar/trunk/my-calendar-shortcodes.php

    r857615 r865684  
    4444                'show_today' => 'yes', 
    4545                'author' => 'default', 
    46                 'host' => 'default' 
     46                'host' => 'default', 
     47                'ltype' => '', 
     48                'lvalue' => '' 
    4749            ), $atts, 'my_calendar_upcoming' ) ); 
    4850    global $user_ID;             
  • my-calendar/trunk/my-calendar-styles.php

    r857615 r865684  
    132132        $my_calendar_style = __('Sorry. The file you are looking for doesn\'t appear to exist. Please check your file name and location!', 'my-calendar'); 
    133133    } 
    134      
    135134?> 
    136135<div class="wrap jd-my-calendar"> 
    137 <?php  
    138 my_calendar_check_db(); 
    139 ?> 
     136<?php my_calendar_check_db(); ?> 
    140137<h2><?php _e('My Calendar Styles','my-calendar'); ?></h2> 
    141 <div class="postbox-container" style="width: 70%"> 
    142 <div class="metabox-holder"> 
    143  
    144 <div class="ui-sortable meta-box-sortables">    
    145 <div class="postbox"> 
    146     <h3><?php _e('Calendar Style Settings','my-calendar'); ?></h3> 
    147     <div class="inside">     
    148      
    149     <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-styles"); ?>"> 
    150     <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div> 
    151     <div><input type="hidden" value="true" name="mc_choose_style" /></div> 
    152     <fieldset>   
    153     <p> 
    154     <label for="mc_css_file"><?php _e('Select My Calendar Theme','my-calendar'); ?></label> 
    155     <select name="mc_css_file" id="mc_css_file"> 
    156 <?php 
    157     $custom_directory = str_replace('/my-calendar/','',$dir) . '/my-calendar-custom/styles/'; 
    158     $directory = dirname(__FILE__).'/styles/'; 
    159      
    160     $files = @my_csslist($custom_directory); 
    161     if (!empty($files)) { 
    162     echo "<optgroup label='".__('Your Custom Stylesheets','my-calendar')."'>\n"; 
    163     foreach ($files as $value) { 
    164         $test = "mc_custom_".$value; 
    165         $selected = (get_option('mc_css_file') == $test )?" selected='selected'":""; 
    166         echo "<option value='mc_custom_$value'$selected>$value</option>\n"; 
    167     }    
    168     echo "</optgroup>"; 
    169     }  
    170     $files = my_csslist($directory); 
    171     echo "<optgroup label='".__('Installed Stylesheets','my-calendar')."'>\n"; 
    172     foreach ($files as $value) { 
    173         $selected = (get_option('mc_css_file') == $value )?" selected='selected'":""; 
    174         echo "<option value='$value'$selected>$value</option>\n"; 
    175     } 
    176     echo "</optgroup>"; 
    177 ?> 
    178     </select> 
    179     <input type="submit" name="save" class="button-secondary" value="<?php _e('Choose Style','my-calendar'); ?>" /> 
    180     </p>     
    181     </fieldset> 
    182     </form> 
    183     <hr /> 
    184     <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-styles"); ?>"> 
    185     <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div> 
    186     <div><input type="hidden" value="true" name="mc_edit_style" /> 
    187     <input type="hidden" name="mc_css_file" value="<?php echo get_option('mc_css_file'); ?>" /> 
     138<div class="postbox-container jcd-wide"> 
     139    <div class="metabox-holder"> 
     140        <div class="ui-sortable meta-box-sortables">    
     141            <div class="postbox"> 
     142                <h3><?php _e('Calendar Style Settings','my-calendar'); ?></h3> 
     143                <div class="inside">     
     144                 
     145                <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-styles"); ?>"> 
     146                <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div> 
     147                <div><input type="hidden" value="true" name="mc_choose_style" /></div> 
     148                <fieldset>   
     149                <p> 
     150                <label for="mc_css_file"><?php _e('Select My Calendar Theme','my-calendar'); ?></label> 
     151                <select name="mc_css_file" id="mc_css_file"><?php 
     152                $custom_directory = str_replace('/my-calendar/','',$dir) . '/my-calendar-custom/styles/'; 
     153                $directory = dirname(__FILE__).'/styles/'; 
     154                 
     155                $files = @my_csslist($custom_directory); 
     156                if (!empty($files)) { 
     157                echo "<optgroup label='".__('Your Custom Stylesheets','my-calendar')."'>\n"; 
     158                foreach ($files as $value) { 
     159                    $test = "mc_custom_".$value; 
     160                    $selected = (get_option('mc_css_file') == $test )?" selected='selected'":""; 
     161                    echo "<option value='mc_custom_$value'$selected>$value</option>\n"; 
     162                }    
     163                echo "</optgroup>"; 
     164                }  
     165                $files = my_csslist($directory); 
     166                echo "<optgroup label='".__( 'Installed Stylesheets','my-calendar' )."'>\n"; 
     167                foreach ( $files as $value ) { 
     168                    $selected = (get_option('mc_css_file') == $value )?" selected='selected'":""; 
     169                    echo "<option value='$value'$selected>$value</option>\n"; 
     170                } 
     171                echo "</optgroup>"; ?> 
     172                </select> 
     173                <input type="submit" name="save" class="button-secondary" value="<?php _e('Choose Style','my-calendar'); ?>" /> 
     174                </p>     
     175                </fieldset> 
     176                </form> 
     177                <hr /> 
     178                <form method="post" action="<?php echo admin_url("admin.php?page=my-calendar-styles"); ?>"> 
     179                <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div> 
     180                <div><input type="hidden" value="true" name="mc_edit_style" /> 
     181                <input type="hidden" name="mc_css_file" value="<?php echo get_option('mc_css_file'); ?>" /> 
     182                </div> 
     183                <?php  
     184                if ( get_option('mc_file_permissions') == 'false' ) { 
     185                    echo "<div id='my_calendar_old_styles'> 
     186                    <p>".__('My Calendar was unable to update your CSS files during the upgrade. Please check your file permissions if you wish to edit your My Calendar styles. Your previously stored styles are below. This message and these styles will be deleted from the database when you successfully update your stylesheet.','my-calendar')."</p><pre>"; 
     187                    echo stripcslashes(get_option('mc_style'));  
     188                    echo get_option('mc_file_permission'); 
     189                    echo "</pre> 
     190                    </div>"; 
     191                } 
     192                ?> 
     193                <fieldset style="position:relative;"> 
     194                <legend><?php _e('CSS Style Options','my-calendar'); ?></legend> 
     195                <p> 
     196                <label for="mc_show_css"><?php _e('Apply CSS on these pages (comma separated IDs)','my-calendar'); ?></label> <input type="text" id="mc_show_css" name="mc_show_css" value="<?php echo $mc_show_css; ?>" /> 
     197                </p>     
     198                <p> 
     199                <input type="checkbox" id="reset_styles" name="reset_styles" <?php if ( mc_is_custom_style( get_option('mc_css_file') ) ) { echo "disabled='disabled'"; } ?> /> <label for="reset_styles"><?php _e('Restore My Calendar stylesheet','my-calendar'); ?></label> <input type="checkbox" id="use_styles" name="use_styles" <?php mc_is_checked('mc_use_styles','true'); ?> /> <label for="use_styles"><?php _e('Disable My Calendar Stylesheet','my-calendar'); ?></label> 
     200                </p>     
     201                <p> 
     202                <label for="style"><?php _e('Edit the stylesheet for My Calendar','my-calendar'); ?></label><br /><textarea class="style-editor" id="style" name="style" rows="30" cols="80"<?php if ( get_option('mc_use_styles') == 'true' ) { echo "disabled='disabled'"; } ?>><?php echo $my_calendar_style; ?></textarea> 
     203                </p>     
     204                <p> 
     205                    <input type="submit" name="save" class="button-primary button-adjust" value="<?php _e('Save Changes','my-calendar'); ?>" /> 
     206                </p>     
     207                </fieldset> 
     208                </form> 
     209                <?php 
     210                $left_string  = normalize_whitespace($my_calendar_style); 
     211                $right_string = normalize_whitespace($mc_current_style); 
     212                if ( $right_string ) { // if right string is blank, there is no default 
     213                    if ( isset( $_GET['diff'] ) ) { 
     214                        echo '<div class="wrap jd-my-calendar" id="diff">'; 
     215                        echo wp_text_diff( $left_string,$right_string, array( 'title' => __('Comparing Your Style with latest installed version of My Calendar','my-calendar'), 'title_right' => __('Latest (from plugin)','my-calendar'), 'title_left' => __('Current (in use)','my-calendar') ) ); 
     216                        echo '</div>'; 
     217                    } else if ( trim( $left_string )!=trim( $right_string ) ) { 
     218                        echo '<div class="wrap jd-my-calendar">'; 
     219                        echo '<div class="updated"><p>'.__('There have been updates to the stylesheet.','my-calendar').' <a href="'.admin_url("admin.php?page=my-calendar-styles&amp;diff#diff").'">'.__('Compare Your Stylesheet with latest installed version of My Calendar.','my-calendar').'</a></p></div>'; 
     220                        echo '</div>'; 
     221                    } else { 
     222                        echo ' 
     223                        <div class="wrap jd-my-calendar"> 
     224                            <p>'.__('Your stylesheet matches that included with My Calendar.','my-calendar').'</p> 
     225                        </div>'; 
     226                    } 
     227                } ?> 
     228            </div> 
     229            </div> 
     230            <p><?php _e('Resetting your stylesheet will set your stylesheet to the version of that style currently distributed with the plug-in.','my-calendar'); ?></p> 
     231        </div> 
    188232    </div> 
    189     <?php  
    190     if ( get_option('mc_file_permissions') == 'false' ) { 
    191         echo "<div id='my_calendar_old_styles'> 
    192         <p>".__('My Calendar was unable to update your CSS files during the upgrade. Please check your file permissions if you wish to edit your My Calendar styles. Your previously stored styles are below. This message and these styles will be deleted from the database when you successfully update your stylesheet.','my-calendar')."</p><pre>"; 
    193         echo stripcslashes(get_option('mc_style'));  
    194         echo get_option('mc_file_permission'); 
    195         echo "</pre> 
    196         </div>"; 
    197     } 
    198     ?> 
    199     <fieldset style="position:relative;"> 
    200     <legend><?php _e('CSS Style Options','my-calendar'); ?></legend> 
    201     <p> 
    202     <label for="mc_show_css"><?php _e('Apply CSS on these pages (comma separated IDs)','my-calendar'); ?></label> <input type="text" id="mc_show_css" name="mc_show_css" value="<?php echo $mc_show_css; ?>" /> 
    203     </p>     
    204     <p> 
    205     <input type="checkbox" id="reset_styles" name="reset_styles" <?php if ( mc_is_custom_style( get_option('mc_css_file') ) ) { echo "disabled='disabled'"; } ?> /> <label for="reset_styles"><?php _e('Restore My Calendar stylesheet','my-calendar'); ?></label> <input type="checkbox" id="use_styles" name="use_styles" <?php mc_is_checked('mc_use_styles','true'); ?> /> <label for="use_styles"><?php _e('Disable My Calendar Stylesheet','my-calendar'); ?></label> 
    206     </p>     
    207     <p> 
    208     <label for="style"><?php _e('Edit the stylesheet for My Calendar','my-calendar'); ?></label><br /><textarea class="style-editor" id="style" name="style" rows="30" cols="80"<?php if ( get_option('mc_use_styles') == 'true' ) { echo "disabled='disabled'"; } ?>><?php echo $my_calendar_style; ?></textarea> 
    209     </p>     
    210     <p> 
    211         <input type="submit" name="save" class="button-primary button-adjust" value="<?php _e('Save Changes','my-calendar'); ?>" /> 
    212     </p>     
    213     </fieldset> 
    214   </form> 
    215    
    216     <?php 
    217     $left_string  = normalize_whitespace($my_calendar_style); 
    218     $right_string = normalize_whitespace($mc_current_style); 
    219     if ( $right_string ) { // if right string is blank, there is no default 
    220         if ( isset( $_GET['diff'] ) ) { 
    221             echo '<div class="wrap jd-my-calendar" id="diff">'; 
    222             echo wp_text_diff( $left_string,$right_string, array( 'title' => __('Comparing Your Style with latest installed version of My Calendar','my-calendar'), 'title_right' => __('Latest (from plugin)','my-calendar'), 'title_left' => __('Current (in use)','my-calendar') ) ); 
    223             echo '</div>'; 
    224         } else if ( trim( $left_string )!=trim( $right_string ) ) { 
    225             echo '<div class="wrap jd-my-calendar">'; 
    226             echo '<div class="updated"><p>'.__('There have been updates to the stylesheet.','my-calendar').' <a href="'.admin_url("admin.php?page=my-calendar-styles&amp;diff#diff").'">'.__('Compare Your Stylesheet with latest installed version of My Calendar.','my-calendar').'</a></p></div>'; 
    227             echo '</div>'; 
    228         } else { 
    229             echo ' 
    230             <div class="wrap jd-my-calendar"> 
    231                 <p>'.__('Your stylesheet matches that included with My Calendar.','my-calendar').'</p> 
    232             </div>'; 
    233         } 
    234     } 
    235  
    236     ?>   
    237    
    238   </div> 
    239  </div> 
    240 <p><?php _e('Resetting your stylesheet will set your stylesheet to the version of that style currently distributed with the plug-in.','my-calendar'); ?></p> 
    241  </div> 
    242  </div> 
    243  </div> 
    244   
     233    </div> 
    245234    <?php jd_show_support_box(); ?> 
    246  
    247  </div> 
    248   <?php 
    249  
    250  
    251 } 
    252  
    253 ?> 
     235    </div><?php 
     236} 
  • my-calendar/trunk/my-calendar-templating.php

    r857615 r865684  
    8383    <h2><?php _e('My Calendar Information Templates','my-calendar'); ?></h2> 
    8484     
    85 <div class="postbox-container" style="width: 70%"> 
     85<div class="postbox-container jcd-wide"> 
    8686<div class="metabox-holder"> 
    8787     
    8888    <p><?php _e('Advanced users may customize the HTML template for each event. This page lets you create a customized view of your events in each context. All available template tags are documented on the Help page. These default templates are based on the default views with all output enabled. <strong>Custom templates will override any other output rules in your settings.</strong>','my-calendar'); ?> <a href="<?php echo admin_url("admin.php?page=my-calendar-help#templates"); ?>"><?php _e("Templates Help",'my-calendar'); ?></a> &raquo;</p> 
    89  
    9089 
    9190    <div class="ui-sortable meta-box-sortables">    
     
    9695        <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div> 
    9796        <p> 
    98         <input type="checkbox" id="mc_use_grid_template" name="mc_use_grid_template" value="1"  <?php mc_is_checked('mc_use_grid_template',1); ?>/> <label for="mc_use_grid_template"><?php _e('Use this grid event template','my-calendar'); ?></label> 
     97        <input type="checkbox" id="mc_use_grid_template" name="mc_use_grid_template" value="1" <?php mc_is_checked('mc_use_grid_template',1); ?>/> <label for="mc_use_grid_template"><?php _e('Use this grid event template','my-calendar'); ?></label> 
    9998        </p> 
    10099        <p> 
    101         <label for="mc_grid_template"><?php _e('Your custom template for events in the calendar grid output.','my-calendar'); ?></label><br /><textarea id="mc_grid_template" name="mc_grid_template" class="template-editor" rows="12" cols="76"><?php echo $mc_grid_template; ?></textarea> 
     100        <label for="mc_grid_template"><?php _e('Your custom template for events in the calendar grid output.','my-calendar'); ?></label><br /><textarea id="mc_grid_template" name="mc_grid_template" class="template-editor" rows="16" cols="76"><?php echo $mc_grid_template; ?></textarea> 
    102101        </p> 
    103102        <p> 
     
    116115        <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div> 
    117116        <p> 
    118         <input type="checkbox" id="mc_use_list_template" name="mc_use_list_template" value="1"  <?php mc_is_checked('mc_use_list_template',1); ?>/> <label for="mc_use_list_template"><?php _e('Use this list event template','my-calendar'); ?></label> 
     117        <input type="checkbox" id="mc_use_list_template" name="mc_use_list_template" value="1" <?php mc_is_checked('mc_use_list_template',1); ?>/> <label for="mc_use_list_template"><?php _e('Use this list event template','my-calendar'); ?></label> 
    119118        </p> 
    120119        <p> 
    121         <label for="mc_list_template"><?php _e('Your custom template for events in calendar list output.','my-calendar'); ?></label><br /><textarea id="mc_list_template" name="mc_list_template" class="template-editor" rows="12" cols="76"><?php echo $mc_list_template; ?></textarea> 
     120        <label for="mc_list_template"><?php _e('Your custom template for events in calendar list output.','my-calendar'); ?></label><br /><textarea id="mc_list_template" name="mc_list_template" class="template-editor" rows="16" cols="76"><?php echo $mc_list_template; ?></textarea> 
    122121        </p> 
    123122        <p> 
     
    136135        <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div> 
    137136        <p> 
    138         <input type="checkbox" id="mc_use_mini_template" name="mc_use_mini_template" value="1"  <?php mc_is_checked('mc_use_mini_template',1); ?>/> <label for="mc_use_mini_template"><?php _e('Use this mini event template','my-calendar'); ?></label> 
     137        <input type="checkbox" id="mc_use_mini_template" name="mc_use_mini_template" value="1" <?php mc_is_checked('mc_use_mini_template',1); ?>/> <label for="mc_use_mini_template"><?php _e('Use this mini event template','my-calendar'); ?></label> 
    139138        </p> 
    140139        <p> 
    141         <label for="mc_mini_template"><?php _e('Your custom template for events in sidebar/mini calendar output.','my-calendar'); ?></label><br /><textarea id="mc_mini_template" name="mc_mini_template" rows="12" cols="76" class="template-editor"><?php echo $mc_mini_template; ?></textarea> 
     140        <label for="mc_mini_template"><?php _e('Your custom template for events in sidebar/mini calendar output.','my-calendar'); ?></label><br /><textarea id="mc_mini_template" name="mc_mini_template" rows="16" cols="76" class="template-editor"><?php echo $mc_mini_template; ?></textarea> 
    142141        </p> 
    143142        <p> 
     
    156155        <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div> 
    157156        <p> 
    158         <input type="checkbox" id="mc_use_details_template" name="mc_use_details_template" value="1"  <?php mc_is_checked('mc_use_details_template',1); ?>/> <label for="mc_use_details_template"><?php _e('Use this details template','my-calendar'); ?></label> 
     157        <input type="checkbox" id="mc_use_details_template" name="mc_use_details_template" value="1" <?php mc_is_checked('mc_use_details_template',1); ?>/> <label for="mc_use_details_template"><?php _e('Use this details template','my-calendar'); ?></label> 
    159158        </p> 
    160159        <p> 
    161         <label for="mc_details_template"><?php _e('Your custom template for events on the event details page.','my-calendar'); ?></label><br /><textarea id="mc_details_template" name="mc_details_template" rows="12" cols="76" class="template-editor"><?php echo $mc_details_template; ?></textarea> 
     160        <label for="mc_details_template"><?php _e('Your custom template for events on the event details page.','my-calendar'); ?></label><br /><textarea id="mc_details_template" name="mc_details_template" rows="16" cols="76" class="template-editor"><?php echo $mc_details_template; ?></textarea> 
    162161        </p> 
    163162        <p> 
     
    177176        <div><input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('my-calendar-nonce'); ?>" /></div> 
    178177        <p> 
    179         <input type="checkbox" id="mc_use_rss_template" name="mc_use_rss_template" value="1"  <?php mc_is_checked('mc_use_rss_template',1); ?>/> <label for="mc_use_grid_template"><?php _e('Use this custom RSS event template','my-calendar'); ?></label> 
     178        <input type="checkbox" id="mc_use_rss_template" name="mc_use_rss_template" value="1" <?php mc_is_checked('mc_use_rss_template',1); ?>/> <label for="mc_use_grid_template"><?php _e('Use this custom RSS event template','my-calendar'); ?></label> 
    180179        </p> 
    181180        <p> 
    182         <label for="mc_rss_template"><?php _e('Your custom template for events in the RSS feed.','my-calendar'); ?></label><br /><textarea id="mc_rss_template" name="mc_rss_template" class="template-editor" rows="12" cols="76"><?php echo $mc_rss_template; ?></textarea> 
     181        <label for="mc_rss_template"><?php _e('Your custom template for events in the RSS feed.','my-calendar'); ?></label><br /><textarea id="mc_rss_template" name="mc_rss_template" class="template-editor" rows="16" cols="76"><?php echo $mc_rss_template; ?></textarea> 
    183182        </p> 
    184183        <p> 
     
    188187        </div> 
    189188    </div> 
    190     </div>   
    191      
     189    </div> 
    192190</div> 
    193191</div> 
    194  
    195     <?php jd_show_support_box('templates'); ?> 
    196  
    197 <?php 
     192    <?php jd_show_support_box('templates'); 
    198193} 
    199 ?> 
  • my-calendar/trunk/my-calendar-widgets.php

    r860300 r865684  
    239239 
    240240// Widget upcoming events 
    241 function my_calendar_upcoming_events( $before='default',$after='default',$type='default',$category='default',$template='default',$substitute='',$order='asc',$skip=0, $show_today='yes',$author='default',$host='default' ) { 
     241function my_calendar_upcoming_events( $before='default',$after='default',$type='default',$category='default',$template='default',$substitute='',$order='asc',$skip=0, $show_today='yes',$author='default',$host='default',$ltype='', $lvalue='' ) { 
    242242    global $wpdb,$default_template,$defaults; 
    243243    $mcdb = $wpdb; 
     
    283283        $to = apply_filters( 'mc_upcoming_date_to', $to ); 
    284284 
    285         $event_array = my_calendar_events( $from, $to, $category, '', '', 'upcoming', $author, $host ); 
     285        $event_array = my_calendar_events( $from, $to, $category, $ltype, $lvalue, 'upcoming', $author, $host ); 
    286286        $no_events = ( empty( $event_array ) ) ? true : false;       
    287287        if (count($event_array) != 0) { 
     
    331331                    $cache = false; // take cache out of memory 
    332332                } else { 
    333                     $events = mc_get_all_events( $category, $before, $after, $show_today, $author, $host ); 
     333                    $events = mc_get_all_events( $category, $before, $after, $show_today, $author, $host, $ltype, $lvalue ); 
    334334                    $cache[$category] = $events; 
    335335                    set_transient( 'mc_cache_upcoming', $cache, 60*30 ); 
    336336                } 
    337337            } else { 
    338                 $events = mc_get_all_events( $category, $before, $after, $show_today, $author, $host ); 
     338                $events = mc_get_all_events( $category, $before, $after, $show_today, $author, $host, $ltype, $lvalue ); 
    339339                $cache[$category] = $events; 
    340340                set_transient( 'mc_cache_upcoming', $cache, 60*30 );             
    341341            } 
    342342        } else { 
    343             $events = mc_get_all_events( $category, $before, $after, $show_today, $author, $host );  // grab all events within reasonable proximity      
    344         } 
     343            $events = mc_get_all_events( $category, $before, $after, $show_today, $author, $host, $ltype, $lvalue );     // grab all events within reasonable proximity      
     344        } 
     345         
    345346        if ( !get_option('mc_skip_holidays_category') || get_option('mc_skip_holidays_category') == '' ) {  
    346347            $holidays = array(); 
     
    453454                                        if ( $show_today == 'yes' ) { $extra++; } 
    454455                                    } else if ( !my_calendar_date_comp( $end,$current ) ) { 
    455                                         if ( !$same_event && !$same_group ) { $future++;  } // else { $extra++; } // why was this here? 
     456                                        if ( !$same_event && !$same_group ) { $future++;  } //else { $extra++; } // why was this here? 
    456457                                    } 
    457458                                    $last_events[] = $e->occur_id; 
  • my-calendar/trunk/my-calendar.php

    r860302 r865684  
    8787include(dirname(__FILE__).'/my-calendar-export.php' ); 
    8888include(dirname(__FILE__).'/my-calendar-api.php' ); 
    89  
     89include(dirname(__FILE__).'/my-calendar-generator.php' ); 
    9090 
    9191// Enable internationalisation 
     
    133133function jd_show_support_box( $show='', $add=false, $remove=false ) { 
    134134    if ( current_user_can('mc_view_help') ) { ?> 
    135     <div class="postbox-container" style="width:20%"> 
     135    <div class="postbox-container jcd-narrow"> 
    136136    <div class="metabox-holder"> 
    137137        <?php if ( !$remove ) { ?> 
     
    141141            <h3><strong><?php _e('My Calendar: Submissions','my-calendar'); ?></strong></h3> 
    142142            <div class="inside resources"> 
    143                 <p class="mcsbuy"><img src="<?php echo plugins_url('my-calendar/images/submissions.png'); ?>" alt="My Calendar: Submissions" class="alignleft" /><?php _e("Buy the <a href='http://www.joedolson.com/articles/my-calendar/submissions/' rel='external'>My Calendar: Submissions add-on</a> &mdash; let your site's visitors help build your calendar.",'my-calendar'); ?></p> 
     143                <p class="mcsbuy"><?php _e("Buy the <a href='http://www.joedolson.com/articles/my-calendar/submissions/' rel='external'>My Calendar Submissions add-on</a> &mdash; let your audience build your calendar.",'my-calendar'); ?></p> 
    144144                <p class="mc-button"><a href="http://www.joedolson.com/articles/my-calendar/submissions/" rel="external"><?php _e('Learn more!','my-calendar'); ?></a></p> 
    145145            </div> 
     
    152152            <div class="inside resources"> 
    153153                <p> 
    154                 <a href="https://twitter.com/intent/tweet?screen_name=joedolson&text=My%20Calendar%20is%20great%20-%20Thanks!" class="twitter-mention-button" data-size="large" data-related="joedolson">Tweet to @joedolson</a> 
     154                <a href="https://twitter.com/intent/follow?screen_name=joedolson" class="twitter-follow-button" data-size="small" data-related="joedolson">Follow @joedolson</a> 
    155155                <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script> 
    156156                </p> 
    157                 <p class="mcbuy"><img src="<?php echo plugins_url('my-calendar/images/guide.png'); ?>" alt="My Calendar User's Guide" class="alignleft" /><?php _e('Help me help you:','my-calendar'); ?> <a href="http://www.joedolson.com/articles/my-calendar/users-guide/" rel="external"><?php _e("Buy the My Calendar User's Guide",'my-calendar'); ?></a></p> 
     157                <p class="mcbuy"><?php _e('Help me help you:','my-calendar'); ?> <a href="http://www.joedolson.com/articles/my-calendar/users-guide/" rel="external"><?php _e("Buy the My Calendar User's Guide",'my-calendar'); ?></a></p> 
    158158                <p><?php _e('<strong>Or make a donation today!</strong> Every donation counts - donate $5, $20, or $100 and help me keep this plug-in running!','my-calendar'); ?></p> 
    159159                <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> 
     
    213213        <dd><?php _e('Start time for the event.','my-calendar'); ?></dd> 
    214214 
    215         <dt><code>{usertime}</code>/<code>{endusertime}</code></dt> 
    216         <dd><?php _e('Event times adjusted to the current user\'s time zone if set.','my-calendar'); ?></dd> 
    217  
    218215        <dt><code>{date}</code></dt> 
    219216        <dd><?php _e('Date on which the event begins.','my-calendar'); ?></dd> 
     
    252249        <dd><?php _e('Current status of event: either "Published" or "Reserved."','my-calendar'); ?></dd> 
    253250        </dl> 
     251         
    254252        <h4><?php _e('Location Template Tags','my-calendar'); ?></h4> 
    255  
    256253        <dl> 
    257254        <dt><code>{location}</code></dt> 
     
    347344            add_submenu_page('my-calendar', __('Event Categories','my-calendar'), __('Manage Categories','my-calendar'), 'mc_edit_cats', 'my-calendar-categories', 'my_calendar_manage_categories'); 
    348345            add_submenu_page('my-calendar', __('Event Locations','my-calendar'), __('Manage Locations','my-calendar'), 'mc_edit_locations', 'my-calendar-locations', 'my_calendar_manage_locations');        
    349             add_submenu_page('my-calendar', __('Event Groups','my-calendar'), __('Manage Event Groups','my-calendar'), 'mc_manage_events', 'my-calendar-groups', 'edit_my_calendar_groups');         
     346            $groups = add_submenu_page('my-calendar', __('Event Groups','my-calendar'), __('Manage Event Groups','my-calendar'), 'mc_manage_events', 'my-calendar-groups', 'edit_my_calendar_groups'); 
     347                add_action( "load-$groups", 'mc_add_screen_option' ); 
     348             
    350349        } 
    351350        add_submenu_page('my-calendar', __('Style Editor','my-calendar'), __('Style Editor','my-calendar'), 'mc_edit_styles', 'my-calendar-styles', 'edit_my_calendar_styles'); 
  • my-calendar/trunk/readme.txt

    r859129 r865684  
    33Donate link: http://www.joedolson.com/donate.php 
    44Tags: calendar, dates, times, events, scheduling, event manager, event calendar 
    5 Requires at least: 3.3.0 
     5Requires at least: 3.4.2 
    66Tested up to: 3.8.1 
    77License: GPLv2 or later 
     
    103103* Bug fix: If an event ends at midnight, automatically end tomorrow unless set for a later date. 
    104104* Bug fix: Don't show events on both days if they end at midnight. 
     105* Bug fix: Don't attempt to enqueue jquery.charcount.js if WP to Twitter not installed. 
    105106 
    106107* New template tag: {runtime} to show human language version of length of event. 
     
    116117* New feature: Archive events to hide from admin events list.  
    117118* New feature: Control input options for multiple types of location input data.  
     119* New feature: Shortcode generator for primary, upcoming, and today's events shortcodes. 
    118120 
    119121* New filter: mc_date_format for customizing date formats. 
Note: See TracChangeset for help on using the changeset viewer.