Plugin Directory

Changeset 797544


Ignore:
Timestamp:
11/02/2013 02:25:08 AM (12 years ago)
Author:
cesperanc
Message:

1.0.6

  • Bug fix on the graph view when showing the results on the dashboard for just one campaign (thanks JML0691)
  • Strict warning fixes on class methods invoked by WordPress hooks
  • Updates to use the integrated jquery ui from wordpress library
Location:
click-to-donate/trunk
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • click-to-donate/trunk/css/admin.css

    r570393 r797544  
    1 .start-hidden{display:hidden}#ctd-startminutes,#ctd-endminutes{margin-right:0;text-align:right}.ctd-enable-container{margin:0 2px;border:1px none transparent;padding:5px;border-radius:5px}.ctd-enable-container.ctd-visible{margin:0 2px 10px;border:1px solid #ececec}.ctd-enable-container legend{margin:0;padding:0}.ctd-enable-container input+label.selectit{margin:0 5px}#ctd-campaign-admin{padding:6px 10px 8px;margin-top:6px}
     1.start-hidden{display:hidden}.ctd-enable-container{margin:0 2px;border:1px none transparent;padding:5px;border-radius:5px}.ctd-enable-container.ctd-visible{margin:0 2px 10px;border:1px solid #ececec}.ctd-enable-container legend{margin:0;padding:0}.ctd-enable-container input+label.selectit{margin:0 5px}#ctd-campaign-admin{padding:6px 10px 8px;margin-top:6px}.ctd-jquery-ui .ui-widget .ui-spinner-input{box-shadow:none;border-color:transparent;background-color:transparent;text-align:right;margin-left:0}.ctd-time-separator{font-weight:bold}.ctd-timer-container{text-align:right;margin-top:5px}#ctd-startdate,#ctd-enddate,#ctd-cool-off-time-unit{padding:.5em .5em;text-align:center;height:auto}
  • click-to-donate/trunk/css/admin.dev.css

    r570393 r797544  
    11.start-hidden{
    22    display: hidden;
    3 }
    4 
    5 #ctd-startminutes,
    6 #ctd-endminutes{
    7     margin-right: 0;
    8     text-align: right;
    93}
    104
     
    3428    margin-top : 6px;
    3529}
     30
     31.ctd-jquery-ui .ui-widget .ui-spinner-input{
     32    box-shadow: none;
     33    border-color: transparent;
     34    background-color: transparent;
     35    text-align: right;
     36    margin-left: 0;
     37}
     38
     39.ctd-time-separator{
     40    font-weight: bold;
     41}
     42
     43.ctd-timer-container{
     44    text-align: right;
     45    margin-top: 5px;
     46}
     47
     48#ctd-startdate,
     49#ctd-enddate,
     50#ctd-cool-off-time-unit{
     51    padding: 0.5em 0.5em;
     52    text-align: center;
     53    height: auto;
     54}
  • click-to-donate/trunk/js/admin.dev.js

    r556070 r797544  
    108108    $j('#ctd-starthours, #ctd-endhours').spinner($j.extend(true, {}, timeDefaults, {
    109109        'max': 23
    110     })).css({
     110    }))/*.css({
    111111        'margin-right': 0,
    112112        'text-align': 'right'
    113     });
     113    })*/;
    114114   
    115115    $j('#ctd-startminutes, #ctd-endminutes').spinner($j.extend(true, {}, timeDefaults, {
    116116        'max': 59
    117     })).css({'margin-right': '0'});
     117    }))/*.css({'margin-right': '0'})*/;
    118118   
    119119    // Hide the hidden elements
  • click-to-donate/trunk/js/admin.js

    r556070 r797544  
    1 var $j=jQuery.noConflict();$j(function(){var b={closeText:ctdAdminL10n.closeText,currentText:ctdAdminL10n.currentText,dateFormat:ctdAdminL10n.dateFormat,dayNames:[ctdAdminL10n.dayNamesSunday,ctdAdminL10n.dayNamesMonday,ctdAdminL10n.dayNamesTuesday,ctdAdminL10n.dayNamesWednesday,ctdAdminL10n.dayNamesThursday,ctdAdminL10n.dayNamesFriday,ctdAdminL10n.dayNamesSaturday],dayNamesMin:[ctdAdminL10n.dayNamesMinSu,ctdAdminL10n.dayNamesMinMo,ctdAdminL10n.dayNamesMinTu,ctdAdminL10n.dayNamesMinWe,ctdAdminL10n.dayNamesMinTh,ctdAdminL10n.dayNamesMinFr,ctdAdminL10n.dayNamesMinSa],dayNamesShort:[ctdAdminL10n.dayNamesShortSun,ctdAdminL10n.dayNamesShortMon,ctdAdminL10n.dayNamesShortTue,ctdAdminL10n.dayNamesShortWed,ctdAdminL10n.dayNamesShortThu,ctdAdminL10n.dayNamesShortFri,ctdAdminL10n.dayNamesShortSat],monthNames:[ctdAdminL10n.monthNamesJanuary,ctdAdminL10n.monthNamesFebruary,ctdAdminL10n.monthNamesMarch,ctdAdminL10n.monthNamesApril,ctdAdminL10n.monthNamesMay,ctdAdminL10n.monthNamesJune,ctdAdminL10n.monthNamesJuly,ctdAdminL10n.monthNamesAugust,ctdAdminL10n.monthNamesSeptember,ctdAdminL10n.monthNamesOctober,ctdAdminL10n.monthNamesNovember,ctdAdminL10n.monthNamesDecember],monthNamesShort:[ctdAdminL10n.monthNamesShortJan,ctdAdminL10n.monthNamesShortFeb,ctdAdminL10n.monthNamesShortMar,ctdAdminL10n.monthNamesShortApr,ctdAdminL10n.monthNamesShortMay,ctdAdminL10n.monthNamesShortJun,ctdAdminL10n.monthNamesShortJul,ctdAdminL10n.monthNamesShortAug,ctdAdminL10n.monthNamesShortSep,ctdAdminL10n.monthNamesShortOct,ctdAdminL10n.monthNamesShortNov,ctdAdminL10n.monthNamesShortDec],nextText:ctdAdminL10n.nextText,prevText:ctdAdminL10n.prevText,weekHeader:ctdAdminL10n.weekHeader,altFormat:"yy-m-d",autoSize:true,changeMonth:true,changeYear:true},e={min:0,showOn:"none",width:24,mouseWheel:true,step:1,largeStep:1},a=null,c=null;$j("#ctd-maximum-clicks-limit").spinner({min:0,increment:"fast",showOn:"both",mouseWheel:true,step:100,largeStep:1000});$j("#ctd-cool-off-period").spinner({min:0,increment:"fast",showOn:"both",mouseWheel:true,step:1,largeStep:3600}).trigger("change");$j("#ctd-starthours, #ctd-endhours").spinner($j.extend(true,{},e,{max:23})).css({"margin-right":0,"text-align":"right"});$j("#ctd-startminutes, #ctd-endminutes").spinner($j.extend(true,{},e,{max:59})).css({"margin-right":"0"});$j(".start-hidden").hide();function d(g,h,f){if(f){$j(h).addClass("ctd-visible");$j(g).show()}else{$j(g).hide();$j(h).removeClass("ctd-visible")}}$j("#ctd-enable-cool-off").click(function(){var f=$j(this).is(":checked");d("#ctd-cool-off-container","#ctd-enable-cool-off-container",f);$j("#ctd-restrict-by-cookie").attr("checked",f);$j("#ctd-restrict-by-login").attr("checked",f)});$j("#ctd-enable-maxclicks").click(function(){d("#ctd-maxclicks-container","#ctd-enable-maxclicks-container",$j(this).is(":checked"))});$j("#ctd-enable-startdate").click(function(){d("#ctd-startdate-container","#ctd-enable-startdate-container",$j(this).is(":checked"));if(!$j(this).is(":checked")){$j("#ctd-enddate").datepicker("option","minDate",null)}});$j("#ctd-enable-enddate").click(function(){d("#ctd-enddate-container","#ctd-enable-enddate-container",$j(this).is(":checked"));if(!$j(this).is(":checked")){$j("#ctd-startdate").datepicker("option","maxDate",null)}});if($j("#ctd-hidden-startdate").val()){a=$j.datepicker.parseDate(b.altFormat,$j("#ctd-hidden-startdate").val())||null}if($j("#ctd-hidden-enddate").val()){c=$j.datepicker.parseDate(b.altFormat,$j("#ctd-hidden-enddate").val())||null}$j("#ctd-startdate").datepicker($j.extend(true,{},b,{defaultDate:"+1w",altField:"#ctd-hidden-startdate",maxDate:$j("#ctd-enable-enddate").is(":checked")?c:null,onSelect:function(h){if($j("#ctd-enable-enddate").is(":checked")){var f=$j(this).data("datepicker"),g=$j.datepicker.parseDate(f.settings.dateFormat||$j.datepicker._defaults.dateFormat,h,f.settings);$j("#ctd-enddate").datepicker("option","minDate",g)}else{$j("#ctd-enddate").datepicker("option","minDate",null)}}})).datepicker("setDate",a);$j("#ctd-enddate").datepicker($j.extend(true,{},b,{defaultDate:"+2w",altField:"#ctd-hidden-enddate",minDate:$j("#ctd-enable-startdate").is(":checked")?a:null,onSelect:function(h){if($j("#ctd-enable-startdate").is(":checked")){var f=$j(this).data("datepicker"),g=$j.datepicker.parseDate(f.settings.dateFormat||$j.datepicker._defaults.dateFormat,h,f.settings);$j("#ctd-startdate").datepicker("option","maxDate",g)}else{$j("#ctd-startdate").datepicker("option","minDate",null)}}})).datepicker("setDate",c);d("#ctd-cool-off-container","#ctd-enable-cool-off-container",$j("#ctd-enable-cool-off").is(":checked"));d("#ctd-maxclicks-container","#ctd-enable-maxclicks-container",$j("#ctd-enable-maxclicks").is(":checked"));d("#ctd-startdate-container","#ctd-enable-startdate-container",$j("#ctd-enable-startdate").is(":checked"));d("#ctd-enddate-container","#ctd-enable-enddate-container",$j("#ctd-enable-enddate").is(":checked"))});
     1var $j=jQuery.noConflict();$j(function(){var b={closeText:ctdAdminL10n.closeText,currentText:ctdAdminL10n.currentText,dateFormat:ctdAdminL10n.dateFormat,dayNames:[ctdAdminL10n.dayNamesSunday,ctdAdminL10n.dayNamesMonday,ctdAdminL10n.dayNamesTuesday,ctdAdminL10n.dayNamesWednesday,ctdAdminL10n.dayNamesThursday,ctdAdminL10n.dayNamesFriday,ctdAdminL10n.dayNamesSaturday],dayNamesMin:[ctdAdminL10n.dayNamesMinSu,ctdAdminL10n.dayNamesMinMo,ctdAdminL10n.dayNamesMinTu,ctdAdminL10n.dayNamesMinWe,ctdAdminL10n.dayNamesMinTh,ctdAdminL10n.dayNamesMinFr,ctdAdminL10n.dayNamesMinSa],dayNamesShort:[ctdAdminL10n.dayNamesShortSun,ctdAdminL10n.dayNamesShortMon,ctdAdminL10n.dayNamesShortTue,ctdAdminL10n.dayNamesShortWed,ctdAdminL10n.dayNamesShortThu,ctdAdminL10n.dayNamesShortFri,ctdAdminL10n.dayNamesShortSat],monthNames:[ctdAdminL10n.monthNamesJanuary,ctdAdminL10n.monthNamesFebruary,ctdAdminL10n.monthNamesMarch,ctdAdminL10n.monthNamesApril,ctdAdminL10n.monthNamesMay,ctdAdminL10n.monthNamesJune,ctdAdminL10n.monthNamesJuly,ctdAdminL10n.monthNamesAugust,ctdAdminL10n.monthNamesSeptember,ctdAdminL10n.monthNamesOctober,ctdAdminL10n.monthNamesNovember,ctdAdminL10n.monthNamesDecember],monthNamesShort:[ctdAdminL10n.monthNamesShortJan,ctdAdminL10n.monthNamesShortFeb,ctdAdminL10n.monthNamesShortMar,ctdAdminL10n.monthNamesShortApr,ctdAdminL10n.monthNamesShortMay,ctdAdminL10n.monthNamesShortJun,ctdAdminL10n.monthNamesShortJul,ctdAdminL10n.monthNamesShortAug,ctdAdminL10n.monthNamesShortSep,ctdAdminL10n.monthNamesShortOct,ctdAdminL10n.monthNamesShortNov,ctdAdminL10n.monthNamesShortDec],nextText:ctdAdminL10n.nextText,prevText:ctdAdminL10n.prevText,weekHeader:ctdAdminL10n.weekHeader,altFormat:"yy-m-d",autoSize:true,changeMonth:true,changeYear:true},e={min:0,showOn:"none",width:24,mouseWheel:true,step:1,largeStep:1},a=null,c=null;$j("#ctd-maximum-clicks-limit").spinner({min:0,increment:"fast",showOn:"both",mouseWheel:true,step:100,largeStep:1000});$j("#ctd-cool-off-period").spinner({min:0,increment:"fast",showOn:"both",mouseWheel:true,step:1,largeStep:3600}).trigger("change");$j("#ctd-starthours, #ctd-endhours").spinner($j.extend(true,{},e,{max:23}));$j("#ctd-startminutes, #ctd-endminutes").spinner($j.extend(true,{},e,{max:59}));$j(".start-hidden").hide();function d(g,h,f){if(f){$j(h).addClass("ctd-visible");$j(g).show()}else{$j(g).hide();$j(h).removeClass("ctd-visible")}}$j("#ctd-enable-cool-off").click(function(){var f=$j(this).is(":checked");d("#ctd-cool-off-container","#ctd-enable-cool-off-container",f);$j("#ctd-restrict-by-cookie").attr("checked",f);$j("#ctd-restrict-by-login").attr("checked",f)});$j("#ctd-enable-maxclicks").click(function(){d("#ctd-maxclicks-container","#ctd-enable-maxclicks-container",$j(this).is(":checked"))});$j("#ctd-enable-startdate").click(function(){d("#ctd-startdate-container","#ctd-enable-startdate-container",$j(this).is(":checked"));if(!$j(this).is(":checked")){$j("#ctd-enddate").datepicker("option","minDate",null)}});$j("#ctd-enable-enddate").click(function(){d("#ctd-enddate-container","#ctd-enable-enddate-container",$j(this).is(":checked"));if(!$j(this).is(":checked")){$j("#ctd-startdate").datepicker("option","maxDate",null)}});if($j("#ctd-hidden-startdate").val()){a=$j.datepicker.parseDate(b.altFormat,$j("#ctd-hidden-startdate").val())||null}if($j("#ctd-hidden-enddate").val()){c=$j.datepicker.parseDate(b.altFormat,$j("#ctd-hidden-enddate").val())||null}$j("#ctd-startdate").datepicker($j.extend(true,{},b,{defaultDate:"+1w",altField:"#ctd-hidden-startdate",maxDate:$j("#ctd-enable-enddate").is(":checked")?c:null,onSelect:function(h){if($j("#ctd-enable-enddate").is(":checked")){var f=$j(this).data("datepicker"),g=$j.datepicker.parseDate(f.settings.dateFormat||$j.datepicker._defaults.dateFormat,h,f.settings);$j("#ctd-enddate").datepicker("option","minDate",g)}else{$j("#ctd-enddate").datepicker("option","minDate",null)}}})).datepicker("setDate",a);$j("#ctd-enddate").datepicker($j.extend(true,{},b,{defaultDate:"+2w",altField:"#ctd-hidden-enddate",minDate:$j("#ctd-enable-startdate").is(":checked")?a:null,onSelect:function(h){if($j("#ctd-enable-startdate").is(":checked")){var f=$j(this).data("datepicker"),g=$j.datepicker.parseDate(f.settings.dateFormat||$j.datepicker._defaults.dateFormat,h,f.settings);$j("#ctd-startdate").datepicker("option","maxDate",g)}else{$j("#ctd-startdate").datepicker("option","minDate",null)}}})).datepicker("setDate",c);d("#ctd-cool-off-container","#ctd-enable-cool-off-container",$j("#ctd-enable-cool-off").is(":checked"));d("#ctd-maxclicks-container","#ctd-enable-maxclicks-container",$j("#ctd-enable-maxclicks").is(":checked"));d("#ctd-startdate-container","#ctd-enable-startdate-container",$j("#ctd-enable-startdate").is(":checked"));d("#ctd-enddate-container","#ctd-enable-enddate-container",$j("#ctd-enable-enddate").is(":checked"))});
  • click-to-donate/trunk/php/ClickToDonateController.php

    r565133 r797544  
    7777         * Register the post type for the campaigns
    7878         */
    79         public function WpInit() {
     79        public static function WpInit() {
    8080            load_plugin_textdomain('ClickToDonate', false, dirname(plugin_basename(ClickToDonate::FILE)) . '/langs');
    8181           
     
    322322         * @param object $post with the post object
    323323         */
    324         public function transitionPostStatus($newStatus, $oldStatus, $post) {
     324        public static function transitionPostStatus($newStatus, $oldStatus, $post) {
    325325            self::updatePostStatus(self::getPostID($post));
    326326        }
     
    333333         */
    334334        public static function updatePostStatus($post = 0) {
    335             $post = &get_post($post);
     335            $post = get_post($post);
    336336            if(get_post_type($post)==self::POST_TYPE):
    337337                // Compute the new status
     
    428428         * @return string with the filtered URL
    429429         */
    430         public function postTypeLink($post_link, $post, $leavename = false, $sample = false){
     430        public static function postTypeLink($post_link, $post, $leavename = false, $sample = false){
    431431            return /*(ClickToDonateController::bannerCanBeShown($post, false, false)==ClickToDonateController::MSG_OK)?*/self::createPostLink($post_link)/*:$post_link*/;
    432432        }
  • click-to-donate/trunk/php/ClickToDonateGraphBannersView.php

    r570393 r797544  
    2929         * Register the scripts to be loaded on the backoffice, on our custom post type
    3030         */
    31         public function adminEnqueueScripts() {
     31        public static function adminEnqueueScripts() {
    3232            if (is_admin()):
    3333                $suffix = ClickToDonateView::debugSufix();
     
    110110         * Register the styles to be loaded on the backoffice on our custom post type
    111111         */
    112         public function adminPrintStyles() {
     112        public static function adminPrintStyles() {
    113113            if (is_admin()):
    114114                $suffix = ClickToDonateView::debugSufix();
     
    116116                $current_screen = get_current_screen();
    117117                if(current_user_can('publish_pages') && ($current_screen->id=='dashboard' || $current_screen->post_type == ClickToDonateController::POST_TYPE)):
    118                     wp_enqueue_style(ClickToDonate::CLASS_NAME . '_jquery-ui-theme', plugins_url("css/jquery-ui/jquery-ui-1.8.20.custom$suffix.css", ClickToDonate::FILE), array(), '1.8.20');
     118                    wp_enqueue_style(ClickToDonate::CLASS_NAME . '_jquery-ui-theme', plugins_url("css/jquery-ui/jquery-ui-1.10.3.custom{$suffix}.css", ClickToDonate::FILE), array(), '1.10.3');
    119119                    wp_enqueue_style(ClickToDonate::CLASS_NAME . '_common', plugins_url("css/common$suffix.css", ClickToDonate::FILE), array(ClickToDonate::CLASS_NAME . '_jquery-ui-theme'), '1.0');
    120120                endif;
     
    125125         * Add a metabox to dashboard
    126126         */
    127         public function wpDashboardSetup() {
     127        public static function wpDashboardSetup() {
    128128            // Add our metabox with the graphics to the dashboard
    129129            if(current_user_can('publish_pages')):
     
    135135         * Add a metabox to the campaign post type
    136136         */
    137         public function addMetaBox() {
     137        public static function addMetaBox() {
    138138            // Add our metabox with the graphics to our custom post type
    139139            if(current_user_can('publish_pages')):
     
    150150                ?>
    151151                    <div style="margin: 10px 0 20px;">
    152                         <label class="selectit"><?php _e('Period start date:', 'ClickToDonate'); ?> <input style="width: 6em;" size="8" maxlength="10" title="<?php esc_attr_e('Specify the period start date', 'ClickToDonate') ?>" id="ctd-graphbanners-startdate" type="text" /></label>
     152                        <label class="selectit"><?php _e('Period start date:', 'ClickToDonate'); ?> <input style="text-align: center;" size="8" maxlength="10" title="<?php esc_attr_e('Specify the period start date', 'ClickToDonate') ?>" id="ctd-graphbanners-startdate" type="text" /></label>
    153153                        <input id="ctd-hidden-graphbanners-startdate" type="hidden" value="<?php printf("%.0f", ((current_time('timestamp')-3600*24*7)*1000)); ?>" />
    154                         <label class="selectit"><?php _e('Period end date:', 'ClickToDonate'); ?> <input style="width: 6em;" size="8" maxlength="10" title="<?php esc_attr_e('Specify the period end date', 'ClickToDonate') ?>" id="ctd-graphbanners-enddate" type="text" /></label>
     154                        <label class="selectit"><?php _e('Period end date:', 'ClickToDonate'); ?> <input style="text-align: center;" size="8" maxlength="10" title="<?php esc_attr_e('Specify the period end date', 'ClickToDonate') ?>" id="ctd-graphbanners-enddate" type="text" /></label>
    155155                        <input id="ctd-hidden-graphbanners-enddate" type="hidden" value="<?php printf("%.0f", (current_time('timestamp')*1000)); ?>" />
    156156                        <label for="ctd-graphbanners-date-granularity" class="selectit"><?php _e('Period granularity:', 'ClickToDonate'); ?></label>
     
    195195         * Send the campaigns list as a response of an ajax request
    196196         */
    197         public function getBannerVisits() {
     197        public static function getBannerVisits() {
    198198            if(current_user_can('publish_pages')):
    199199                check_ajax_referer('ctd-get-visits', '_ajax_ctd_get_visits_nonce');
     
    226226                        break;
    227227                endswitch;
    228                 if(count($results->postIds)==1):
     228                if(count($results->postIds)==1 && $postId==0):
    229229                    $resultsArray[] = array($title, __('Total', 'ClickToDonate'));
     230                   
    230231                    foreach ($results->data as $result):
    231232                        $values = array();
  • click-to-donate/trunk/php/ClickToDonateGraphParticipantsView.php

    r570393 r797544  
    2929         * Register the scripts to be loaded on the backoffice, on our custom post type
    3030         */
    31         public function adminEnqueueScripts() {
     31        public static function adminEnqueueScripts() {
    3232            if (is_admin()):
    3333                $suffix = ClickToDonateView::debugSufix();
     
    110110         * Register the styles to be loaded on the backoffice on our custom post type
    111111         */
    112         public function adminPrintStyles() {
     112        public static function adminPrintStyles() {
    113113            if (is_admin()):
    114114                $suffix = ClickToDonateView::debugSufix();
     
    116116                $current_screen = get_current_screen();
    117117                if(current_user_can('read') && ($current_screen->id=='dashboard' || $current_screen->post_type == ClickToDonateController::POST_TYPE)):
    118                     wp_enqueue_style(ClickToDonate::CLASS_NAME . '_jquery-ui-theme', plugins_url("css/jquery-ui/jquery-ui-1.8.20.custom$suffix.css", ClickToDonate::FILE), array(), '1.8.20');
     118                    wp_enqueue_style(ClickToDonate::CLASS_NAME . '_jquery-ui-theme', plugins_url("css/jquery-ui/jquery-ui-1.10.3.custom{$suffix}.css", ClickToDonate::FILE), array(), '1.10.3');
    119119                    wp_enqueue_style(ClickToDonate::CLASS_NAME . '_common', plugins_url("css/common$suffix.css", ClickToDonate::FILE), array(ClickToDonate::CLASS_NAME . '_jquery-ui-theme'), '1.0');
    120120                endif;
     
    125125         * Add a metabox to dashboard
    126126         */
    127         public function wpDashboardSetup() {
     127        public static function wpDashboardSetup() {
    128128            // Add our metabox with the graphics to the dashboard
    129129            if(current_user_can('read')):
     
    135135         * Add a metabox to the campaign post type
    136136         */
    137         public function addMetaBox() {
     137        public static function addMetaBox() {
    138138            // Add our metabox with the graphics to our custom post type
    139139            if(current_user_can('list_users')):
     
    151151                ?>
    152152                    <div style="margin: 10px 0 20px;">
    153                         <label class="selectit"><?php _e('Period start date:', 'ClickToDonate'); ?> <input style="width: 6em;" size="8" maxlength="10" title="<?php esc_attr_e('Specify the period start date', 'ClickToDonate') ?>" id="ctd-graphparticipants-startdate" type="text" /></label>
     153                        <label class="selectit"><?php _e('Period start date:', 'ClickToDonate'); ?> <input style="text-align: center;" size="8" maxlength="10" title="<?php esc_attr_e('Specify the period start date', 'ClickToDonate') ?>" id="ctd-graphparticipants-startdate" type="text" /></label>
    154154                        <input id="ctd-hidden-graphparticipants-startdate" type="hidden" value="<?php printf("%.0f", ((current_time('timestamp')-3600*24*7)*1000)); ?>" />
    155                         <label class="selectit"><?php _e('Period end date:', 'ClickToDonate'); ?> <input style="width: 6em;" size="8" maxlength="10" title="<?php esc_attr_e('Specify the period end date', 'ClickToDonate') ?>" id="ctd-graphparticipants-enddate" type="text" /></label>
     155                        <label class="selectit"><?php _e('Period end date:', 'ClickToDonate'); ?> <input style="text-align: center;" size="8" maxlength="10" title="<?php esc_attr_e('Specify the period end date', 'ClickToDonate') ?>" id="ctd-graphparticipants-enddate" type="text" /></label>
    156156                        <input id="ctd-hidden-graphparticipants-enddate" type="hidden" value="<?php printf("%.0f", (current_time('timestamp')*1000)); ?>" />
    157157
     
    186186         * Send the campaigns list as a response of an ajax request
    187187         */
    188         public function getRankings() {
     188        public static function getRankings() {
    189189           
    190190            if(current_user_can('read')):
  • click-to-donate/trunk/php/ClickToDonateModel.php

    r556104 r797544  
    354354               
    355355                // If we have more than one banner, rearrange the data to a more suitable form
    356                 if(count($visitsData->postIds)>1):
     356                if(count($visitsData->postIds)>=1 && $post<=0):
    357357                    $tRows = array();
    358358                    $bannerColumns = array();
  • click-to-donate/trunk/php/ClickToDonateView.php

    r565133 r797544  
    6868         * Register the scripts to be loaded on the backoffice, on our custom post type
    6969         */
    70         public function adminEnqueueScripts() {
     70        public static function adminEnqueueScripts() {
    7171            if (is_admin()):
    7272                $suffix = self::debugSufix();
     
    7676                    if($current_screen->base=="post"):
    7777                        // Register the scripts
    78                         wp_enqueue_script(ClickToDonate::CLASS_NAME . '_ui-spinner', plugins_url("js/ui-spinner/ui-spinner$suffix.js", ClickToDonate::FILE), array('jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-mouse'), '1.20');
    79 
    80 
    8178                        wp_enqueue_script(ClickToDonate::CLASS_NAME.'_common', plugins_url("js/common$suffix.js", ClickToDonate::FILE), array('jquery', 'jquery-ui-datepicker'), '1.0');
    8279                        // Admin script
    83                         wp_enqueue_script(ClickToDonate::CLASS_NAME.'_admin', plugins_url("js/admin$suffix.js", ClickToDonate::FILE), array('jquery-ui-datepicker', ClickToDonate::CLASS_NAME . '_ui-spinner', ClickToDonate::CLASS_NAME.'_common'), '1.0');
     80                        wp_enqueue_script(ClickToDonate::CLASS_NAME.'_admin', plugins_url("js/admin$suffix.js", ClickToDonate::FILE), array('jquery-ui-datepicker', 'jquery-ui-spinner', ClickToDonate::CLASS_NAME.'_common'), '1.0');
    8481                        // Localize the script
    8582                        wp_localize_script(ClickToDonate::CLASS_NAME.'_admin', 'ctdAdminL10n', array(
     
    184181         * Register the styles to be loaded on the backoffice on our custom post type
    185182         */
    186         public function adminPrintStyles() {
     183        public static function adminPrintStyles() {
    187184            if (is_admin()):
    188185                $suffix = self::debugSufix();
    189186                if(($current_screen = get_current_screen()) && $current_screen->post_type == ClickToDonateController::POST_TYPE):
    190                     wp_enqueue_style(ClickToDonate::CLASS_NAME . '_jquery-ui-theme', plugins_url("css/jquery-ui/jquery-ui-1.8.20.custom$suffix.css", ClickToDonate::FILE), array(), '1.8.20');
    191                     wp_enqueue_style(ClickToDonate::CLASS_NAME . '_ui-spinner', plugins_url("css/ui-spinner/ui-spinner$suffix.css", ClickToDonate::FILE), array(), '1.20');
     187                    wp_enqueue_style(ClickToDonate::CLASS_NAME . '_jquery-ui-theme', plugins_url("css/jquery-ui/jquery-ui-1.10.3.custom{$suffix}.css", ClickToDonate::FILE), array(), '1.10.3');
    192188                    wp_enqueue_style(ClickToDonate::CLASS_NAME . '_common', plugins_url("css/common$suffix.css", ClickToDonate::FILE), array(ClickToDonate::CLASS_NAME . '_jquery-ui-theme'), '1.0');
    193                     wp_enqueue_style(ClickToDonate::CLASS_NAME . '_admin', plugins_url("css/admin$suffix.css", ClickToDonate::FILE), array(ClickToDonate::CLASS_NAME . '_ui-spinner', ClickToDonate::CLASS_NAME . '_jquery-ui-theme', ClickToDonate::CLASS_NAME . '_common'), '1.0');
     189                    wp_enqueue_style(ClickToDonate::CLASS_NAME . '_admin', plugins_url("css/admin$suffix.css", ClickToDonate::FILE), array(ClickToDonate::CLASS_NAME . '_jquery-ui-theme', ClickToDonate::CLASS_NAME . '_common'), '1.0');
    194190                endif;
    195191               
     
    198194        }
    199195       
    200         public function contextualHelpForCampaigns($screen, $tab) {
     196        public static function contextualHelpForCampaigns($screen, $tab) {
    201197            _e("
    202198                <p>Campaigns <strong>Click-to-donate</strong> are a special type of content that allow the accounting of visits by site visitors.</p>
     
    216212        }
    217213       
    218         public function contextualHelpForCampaignsAssociations($screen, $tab) {
     214        public static function contextualHelpForCampaignsAssociations($screen, $tab) {
    219215            printf(__('
    220216                <p>The button %1$s on the WYSIWYG editor can be used to create special links for access to the campaigns.</p>
     
    227223        }
    228224       
    229         public function contextualHelpForConfigurationOptions($screen, $tab) {
     225        public static function contextualHelpForConfigurationOptions($screen, $tab) {
    230226            _e("
    231227                <p>The <strong>Campaign Setup</strong> panel can used to set the properties and constraints associated with a campaign:
     
    260256         * @return array with our plugin added
    261257         */
    262         public function filterMceExternalPlugins($plugins) {
     258        public static function filterMceExternalPlugins($plugins) {
    263259            if (self::hasPermission()):
    264260                $suffix = self::debugSufix();
     
    274270         * @return array with our button added
    275271         */
    276         public function filterMceButtons($buttons) {
     272        public static function filterMceButtons($buttons) {
    277273            if (self::hasPermission())
    278274                array_push($buttons, 'separator', ClickToDonate::CLASS_NAME);
     
    286282         * @return array
    287283         */
    288         public function filterMceExternalLanguages($files) {
     284        public static function filterMceExternalLanguages($files) {
    289285            if (self::hasPermission())
    290286                $files[] = plugin_dir_path(ClickToDonate::FILE) . 'php/langs/wp-langs.php';
     
    299295         * @return array with out parameter
    300296         */
    301         public function filterMceBeforeInit($params) {
     297        public static function filterMceBeforeInit($params) {
    302298            if (self::hasPermission()):
    303299
     
    320316         * @param type $settings
    321317         */
    322         public function afterWpTinyMce($settings) {
     318        public static function afterWpTinyMce($settings) {
    323319            ?>
    324320            <div style="display:none;">
     
    381377         * Send the campaigns list as a response of an ajax request
    382378         */
    383         public function getBannersList() {
     379        public static function getBannersList() {
    384380            check_ajax_referer('ctd-links-list', '_ajax_ctd_links_nonce');
    385381
     
    419415         * Add a metabox to the campaign post type
    420416         */
    421         public function addMetaBox() {
     417        public static function addMetaBox() {
    422418            // Replace the submit core metabox by ours
    423419            add_meta_box('submitdiv', __('Campaign configuration', 'ClickToDonate'), array(__CLASS__, 'writeSubmitMetaBox'), ClickToDonateController::POST_TYPE, 'side', 'core');
     
    495491                            <input id="ctd-require-login" name="<?php echo(__CLASS__ . self::$requireLogin); ?>" value="require_login"<?php checked(ClickToDonateController::isLoginRequired($post)); ?> type="checkbox"/><label class="selectit" for="ctd-require-login"><?php _e('Require visitor authentication', 'ClickToDonate'); ?></label>
    496492                        </div>
    497                         <fieldset id="ctd-enable-cool-off-container" class="ctd-enable-container">
     493                        <fieldset id="ctd-enable-cool-off-container" class="ctd-enable-container ctd-jquery-ui">
    498494                            <legend><input id="ctd-enable-cool-off" name="<?php echo(__CLASS__ . self::$enableCoolOff); ?>" value="enable_cool_off"<?php checked(ClickToDonateController::hasCoolOffLimit($post)); ?> type="checkbox"/><label class="selectit" for="ctd-enable-cool-off"><?php _e('Cooling-off period', 'ClickToDonate'); ?></label></legend>
    499495                            <div id="ctd-cool-off-container" class="start-hidden">
     
    534530                                    <div>
    535531                                        <input title="<?php esc_attr_e('Specify the number of seconds between visits on the same campaign', 'ClickToDonate') ?>" id="ctd-cool-off-period" type="text" size="8" style="width: 70px;" name="<?php echo(__CLASS__ . self::$coolOff); ?>" value="<?php echo($time); ?>" />
    536                                         <select name="<?php echo(__CLASS__ . self::$coolOffUnit); ?>">
     532                                        <select name="<?php echo(__CLASS__ . self::$coolOffUnit); ?>" id="ctd-cool-off-time-unit">
    537533                                            <option<?php selected($timeUnit, self::$coolOffUnitSeconds); ?> value='1'><?php _e('Second(s)', 'ClickToDonate') ?></option>
    538534                                            <option<?php selected($timeUnit, self::$coolOffUnitMinutes); ?> value='60'><?php _e('Minute(s)', 'ClickToDonate') ?></option>
     
    548544                        </fieldset>
    549545
    550                         <fieldset id="ctd-enable-maxclicks-container" class="ctd-enable-container">
     546                        <fieldset id="ctd-enable-maxclicks-container" class="ctd-enable-container ctd-jquery-ui">
    551547                            <legend><input id="ctd-enable-maxclicks" name="<?php echo(__CLASS__ . self::$enableClickLimits); ?>" value="enable_click_limits"<?php checked(ClickToDonateController::hasClicksLimit($post)); ?> type="checkbox"/><label class="selectit" for="ctd-enable-maxclicks"><?php _e('Limit the number of clicks', 'ClickToDonate'); ?></label></legend>
    552548                            <div id="ctd-maxclicks-container" class="start-hidden">
     
    556552                        </fieldset>
    557553
    558                         <fieldset id="ctd-enable-startdate-container" class="ctd-enable-container">
     554                        <fieldset id="ctd-enable-startdate-container" class="ctd-enable-container ctd-jquery-ui">
    559555                            <legend>
    560556                                <input id="ctd-enable-startdate" name="<?php echo(__CLASS__ . self::$enableStartDate); ?>" value="enable_startDate"<?php checked(ClickToDonateController::hasStartDate($post)); ?> type="checkbox"/><label class="selectit" for="ctd-enable-startdate"><?php _e('Set the campaign start date', 'ClickToDonate'); ?></label>
    561557                            </legend>
    562558                            <div id="ctd-startdate-container" class="start-hidden">
    563                                 <label class="selectit"><?php _e('Start date:', 'ClickToDonate'); ?> <input style="width: 6em;" size="8" maxlength="10" title="<?php esc_attr_e('Specify the start date when the campaign is supposed to start', 'ClickToDonate') ?>" id="ctd-startdate" type="text" /></label>
     559                                <label class="selectit"><?php _e('Start date:', 'ClickToDonate'); ?> <input size="8" maxlength="10" title="<?php esc_attr_e('Specify the start date when the campaign is supposed to start', 'ClickToDonate') ?>" id="ctd-startdate" type="text" /></label>
    564560                                <input id="ctd-hidden-startdate" type="hidden" name="<?php echo(__CLASS__ . self::$startDate); ?>" value="<?php echo(date('Y-n-j', $startDate)); ?>" />
    565                                 @<input title="<?php esc_attr_e('Specify the campaign starting hours', 'ClickToDonate') ?>" style="width: 2em;" size="2" maxlength="2" id="ctd-starthours" name="<?php echo(__CLASS__ . '_startHours'); ?>" type="text" value="<?php echo($startHours[0]); ?>" />:<input title="<?php esc_attr_e('Specify the campaign starting minutes', 'ClickToDonate') ?>" style="width: 2em;" size="2" maxlength="2" id="ctd-startminutes" name="<?php echo(__CLASS__ . '_startMinutes'); ?>" type="text" value="<?php echo($startMinutes[0]); ?>" />
     561                                <div class="ctd-timer-container">@<input title="<?php esc_attr_e('Specify the campaign starting hours', 'ClickToDonate') ?>" size="2" maxlength="2" id="ctd-starthours" name="<?php echo(__CLASS__ . '_startHours'); ?>" type="text" value="<?php echo($startHours[0]); ?>" /><span class="ctd-time-separator"> : </span><input title="<?php esc_attr_e('Specify the campaign starting minutes', 'ClickToDonate') ?>" size="2" maxlength="2" id="ctd-startminutes" name="<?php echo(__CLASS__ . '_startMinutes'); ?>" type="text" value="<?php echo($startMinutes[0]); ?>" /></div>
    566562                            </div>
    567563                        </fieldset>
    568564
    569                         <fieldset id="ctd-enable-enddate-container" class="ctd-enable-container">
     565                        <fieldset id="ctd-enable-enddate-container" class="ctd-enable-container ctd-jquery-ui">
    570566                            <legend>
    571567                                <input id="ctd-enable-enddate" name="<?php echo(__CLASS__ . self::$enableEndDate); ?>" value="enable_endDate"<?php checked(ClickToDonateController::hasEndDate($post)); ?> type="checkbox"/><label class="selectit" for="ctd-enable-enddate"><?php _e('Set the campaign end date', 'ClickToDonate'); ?></label>
    572568                            </legend>
    573569                            <div id="ctd-enddate-container" class="start-hidden">
    574                                 <label class="selectit"><?php _e('End date:', 'ClickToDonate'); ?> <input style="width: 6em;" size="8" maxlength="10" title="<?php esc_attr_e('Specify the end date when the campaign is supposed to end', 'ClickToDonate') ?>" id="ctd-enddate" type="text" name="<?php echo(__CLASS__ . self::$endDate); ?>" /></label>
     570                                <label class="selectit"><?php _e('End date:', 'ClickToDonate'); ?> <input size="8" maxlength="10" title="<?php esc_attr_e('Specify the end date when the campaign is supposed to end', 'ClickToDonate') ?>" id="ctd-enddate" type="text" name="<?php echo(__CLASS__ . self::$endDate); ?>" /></label>
    575571                                <input id="ctd-hidden-enddate" type="hidden" name="<?php echo(__CLASS__ . self::$endDate); ?>" value="<?php echo(date('Y-n-j', $endDate)); ?>" />
    576                                 @<input title="<?php esc_attr_e('Specify the campaign ending hours', 'ClickToDonate') ?>" style="width: 2em;" size="2" maxlength="2" id="ctd-endhours" name="<?php echo(__CLASS__ . '_endHours'); ?>" type="text" value="<?php echo($endHours[0]); ?>" />:<input title="<?php esc_attr_e('Specify the campaign ending minutes', 'ClickToDonate') ?>" style="width: 2em;" size="2" maxlength="2" id="ctd-endminutes" name="<?php echo(__CLASS__ . '_endMinutes'); ?>" type="text" value="<?php echo($endMinutes[0]); ?>" />
     572                                <div class="ctd-timer-container">@<input title="<?php esc_attr_e('Specify the campaign ending hours', 'ClickToDonate') ?>" size="2" maxlength="2" id="ctd-endhours" name="<?php echo(__CLASS__ . '_endHours'); ?>" type="text" value="<?php echo($endHours[0]); ?>" /><span class="ctd-time-separator"> : </span><input title="<?php esc_attr_e('Specify the campaign ending minutes', 'ClickToDonate') ?>" size="2" maxlength="2" id="ctd-endminutes" name="<?php echo(__CLASS__ . '_endMinutes'); ?>" type="text" value="<?php echo($endMinutes[0]); ?>" /></div>
    577573                            </div>
    578574                        </fieldset>
     
    653649         * @return int with the post id
    654650         */
    655         public function savePost($postId) {
     651        public static function savePost($postId) {
    656652            if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE):
    657653                return $postId;
     
    757753         * @return array with the (possible) filtered posts
    758754         */
    759         public function thePosts($posts, $query) {
     755        public static function thePosts($posts, $query) {
    760756            if (empty($posts))
    761757                return $posts;
     
    816812         * @param string $content
    817813         */
    818         public function theContent($content){
     814        public static function theContent($content){
    819815            $matches = array();
    820816            $patterns = array();
  • click-to-donate/trunk/readme.txt

    r571997 r797544  
    33Tags: clicks, visits, tracking, donate, donation, NGO, ONG, plugin, extension
    44Requires at least: 3.2.0
    5 Tested up to: 3.4.1
     5Tested up to: 3.7.1
    66Stable tag: 1.0
    77License: GPLv3 or later
     
    4646== Changelog ==
    4747
     48= 1.0.6 =
     49* Bug fix on the graph view when showing the results on the dashboard for just one campaign (thanks JML0691)
     50* Strict warning fixes on class methods invoked by WordPress hooks
     51* Updates to use the integrated jquery ui from wordpress library
     52
    4853= 1.0.5 =
    4954* Bug fix on the graph views date interval when using PHP on Windows
Note: See TracChangeset for help on using the changeset viewer.