Changeset 797544
- Timestamp:
- 11/02/2013 02:25:08 AM (12 years ago)
- Location:
- click-to-donate/trunk
- Files:
-
- 23 edited
-
css/admin.css (modified) (1 diff)
-
css/admin.dev.css (modified) (2 diffs)
-
css/jquery-ui/images/ui-bg_flat_0_aaaaaa_40x100.png (modified) (previous)
-
css/jquery-ui/images/ui-bg_flat_75_ffffff_40x100.png (modified) (previous)
-
css/jquery-ui/images/ui-bg_glass_55_fbf9ee_1x400.png (modified) (previous)
-
css/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png (modified) (previous)
-
css/jquery-ui/images/ui-bg_glass_75_dadada_1x400.png (modified) (previous)
-
css/jquery-ui/images/ui-bg_glass_75_e6e6e6_1x400.png (modified) (previous)
-
css/jquery-ui/images/ui-bg_glass_95_fef1ec_1x400.png (modified) (previous)
-
css/jquery-ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png (modified) (previous)
-
css/jquery-ui/images/ui-icons_222222_256x240.png (modified) (previous)
-
css/jquery-ui/images/ui-icons_2e83ff_256x240.png (modified) (previous)
-
css/jquery-ui/images/ui-icons_454545_256x240.png (modified) (previous)
-
css/jquery-ui/images/ui-icons_888888_256x240.png (modified) (previous)
-
css/jquery-ui/images/ui-icons_cd0a0a_256x240.png (modified) (previous)
-
js/admin.dev.js (modified) (1 diff)
-
js/admin.js (modified) (1 diff)
-
php/ClickToDonateController.php (modified) (4 diffs)
-
php/ClickToDonateGraphBannersView.php (modified) (8 diffs)
-
php/ClickToDonateGraphParticipantsView.php (modified) (7 diffs)
-
php/ClickToDonateModel.php (modified) (1 diff)
-
php/ClickToDonateView.php (modified) (20 diffs)
-
readme.txt (modified) (2 diffs)
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 1 1 .start-hidden{ 2 2 display: hidden; 3 }4 5 #ctd-startminutes,6 #ctd-endminutes{7 margin-right: 0;8 text-align: right;9 3 } 10 4 … … 34 28 margin-top : 6px; 35 29 } 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 108 108 $j('#ctd-starthours, #ctd-endhours').spinner($j.extend(true, {}, timeDefaults, { 109 109 'max': 23 110 })) .css({110 }))/*.css({ 111 111 'margin-right': 0, 112 112 'text-align': 'right' 113 }) ;113 })*/; 114 114 115 115 $j('#ctd-startminutes, #ctd-endminutes').spinner($j.extend(true, {}, timeDefaults, { 116 116 'max': 59 117 })) .css({'margin-right': '0'});117 }))/*.css({'margin-right': '0'})*/; 118 118 119 119 // 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"))});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}));$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 77 77 * Register the post type for the campaigns 78 78 */ 79 public function WpInit() {79 public static function WpInit() { 80 80 load_plugin_textdomain('ClickToDonate', false, dirname(plugin_basename(ClickToDonate::FILE)) . '/langs'); 81 81 … … 322 322 * @param object $post with the post object 323 323 */ 324 public function transitionPostStatus($newStatus, $oldStatus, $post) {324 public static function transitionPostStatus($newStatus, $oldStatus, $post) { 325 325 self::updatePostStatus(self::getPostID($post)); 326 326 } … … 333 333 */ 334 334 public static function updatePostStatus($post = 0) { 335 $post = &get_post($post);335 $post = get_post($post); 336 336 if(get_post_type($post)==self::POST_TYPE): 337 337 // Compute the new status … … 428 428 * @return string with the filtered URL 429 429 */ 430 public function postTypeLink($post_link, $post, $leavename = false, $sample = false){430 public static function postTypeLink($post_link, $post, $leavename = false, $sample = false){ 431 431 return /*(ClickToDonateController::bannerCanBeShown($post, false, false)==ClickToDonateController::MSG_OK)?*/self::createPostLink($post_link)/*:$post_link*/; 432 432 } -
click-to-donate/trunk/php/ClickToDonateGraphBannersView.php
r570393 r797544 29 29 * Register the scripts to be loaded on the backoffice, on our custom post type 30 30 */ 31 public function adminEnqueueScripts() {31 public static function adminEnqueueScripts() { 32 32 if (is_admin()): 33 33 $suffix = ClickToDonateView::debugSufix(); … … 110 110 * Register the styles to be loaded on the backoffice on our custom post type 111 111 */ 112 public function adminPrintStyles() {112 public static function adminPrintStyles() { 113 113 if (is_admin()): 114 114 $suffix = ClickToDonateView::debugSufix(); … … 116 116 $current_screen = get_current_screen(); 117 117 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'); 119 119 wp_enqueue_style(ClickToDonate::CLASS_NAME . '_common', plugins_url("css/common$suffix.css", ClickToDonate::FILE), array(ClickToDonate::CLASS_NAME . '_jquery-ui-theme'), '1.0'); 120 120 endif; … … 125 125 * Add a metabox to dashboard 126 126 */ 127 public function wpDashboardSetup() {127 public static function wpDashboardSetup() { 128 128 // Add our metabox with the graphics to the dashboard 129 129 if(current_user_can('publish_pages')): … … 135 135 * Add a metabox to the campaign post type 136 136 */ 137 public function addMetaBox() {137 public static function addMetaBox() { 138 138 // Add our metabox with the graphics to our custom post type 139 139 if(current_user_can('publish_pages')): … … 150 150 ?> 151 151 <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> 153 153 <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> 155 155 <input id="ctd-hidden-graphbanners-enddate" type="hidden" value="<?php printf("%.0f", (current_time('timestamp')*1000)); ?>" /> 156 156 <label for="ctd-graphbanners-date-granularity" class="selectit"><?php _e('Period granularity:', 'ClickToDonate'); ?></label> … … 195 195 * Send the campaigns list as a response of an ajax request 196 196 */ 197 public function getBannerVisits() {197 public static function getBannerVisits() { 198 198 if(current_user_can('publish_pages')): 199 199 check_ajax_referer('ctd-get-visits', '_ajax_ctd_get_visits_nonce'); … … 226 226 break; 227 227 endswitch; 228 if(count($results->postIds)==1 ):228 if(count($results->postIds)==1 && $postId==0): 229 229 $resultsArray[] = array($title, __('Total', 'ClickToDonate')); 230 230 231 foreach ($results->data as $result): 231 232 $values = array(); -
click-to-donate/trunk/php/ClickToDonateGraphParticipantsView.php
r570393 r797544 29 29 * Register the scripts to be loaded on the backoffice, on our custom post type 30 30 */ 31 public function adminEnqueueScripts() {31 public static function adminEnqueueScripts() { 32 32 if (is_admin()): 33 33 $suffix = ClickToDonateView::debugSufix(); … … 110 110 * Register the styles to be loaded on the backoffice on our custom post type 111 111 */ 112 public function adminPrintStyles() {112 public static function adminPrintStyles() { 113 113 if (is_admin()): 114 114 $suffix = ClickToDonateView::debugSufix(); … … 116 116 $current_screen = get_current_screen(); 117 117 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'); 119 119 wp_enqueue_style(ClickToDonate::CLASS_NAME . '_common', plugins_url("css/common$suffix.css", ClickToDonate::FILE), array(ClickToDonate::CLASS_NAME . '_jquery-ui-theme'), '1.0'); 120 120 endif; … … 125 125 * Add a metabox to dashboard 126 126 */ 127 public function wpDashboardSetup() {127 public static function wpDashboardSetup() { 128 128 // Add our metabox with the graphics to the dashboard 129 129 if(current_user_can('read')): … … 135 135 * Add a metabox to the campaign post type 136 136 */ 137 public function addMetaBox() {137 public static function addMetaBox() { 138 138 // Add our metabox with the graphics to our custom post type 139 139 if(current_user_can('list_users')): … … 151 151 ?> 152 152 <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> 154 154 <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> 156 156 <input id="ctd-hidden-graphparticipants-enddate" type="hidden" value="<?php printf("%.0f", (current_time('timestamp')*1000)); ?>" /> 157 157 … … 186 186 * Send the campaigns list as a response of an ajax request 187 187 */ 188 public function getRankings() {188 public static function getRankings() { 189 189 190 190 if(current_user_can('read')): -
click-to-donate/trunk/php/ClickToDonateModel.php
r556104 r797544 354 354 355 355 // 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): 357 357 $tRows = array(); 358 358 $bannerColumns = array(); -
click-to-donate/trunk/php/ClickToDonateView.php
r565133 r797544 68 68 * Register the scripts to be loaded on the backoffice, on our custom post type 69 69 */ 70 public function adminEnqueueScripts() {70 public static function adminEnqueueScripts() { 71 71 if (is_admin()): 72 72 $suffix = self::debugSufix(); … … 76 76 if($current_screen->base=="post"): 77 77 // 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 81 78 wp_enqueue_script(ClickToDonate::CLASS_NAME.'_common', plugins_url("js/common$suffix.js", ClickToDonate::FILE), array('jquery', 'jquery-ui-datepicker'), '1.0'); 82 79 // 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'); 84 81 // Localize the script 85 82 wp_localize_script(ClickToDonate::CLASS_NAME.'_admin', 'ctdAdminL10n', array( … … 184 181 * Register the styles to be loaded on the backoffice on our custom post type 185 182 */ 186 public function adminPrintStyles() {183 public static function adminPrintStyles() { 187 184 if (is_admin()): 188 185 $suffix = self::debugSufix(); 189 186 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'); 192 188 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'); 194 190 endif; 195 191 … … 198 194 } 199 195 200 public function contextualHelpForCampaigns($screen, $tab) {196 public static function contextualHelpForCampaigns($screen, $tab) { 201 197 _e(" 202 198 <p>Campaigns <strong>Click-to-donate</strong> are a special type of content that allow the accounting of visits by site visitors.</p> … … 216 212 } 217 213 218 public function contextualHelpForCampaignsAssociations($screen, $tab) {214 public static function contextualHelpForCampaignsAssociations($screen, $tab) { 219 215 printf(__(' 220 216 <p>The button %1$s on the WYSIWYG editor can be used to create special links for access to the campaigns.</p> … … 227 223 } 228 224 229 public function contextualHelpForConfigurationOptions($screen, $tab) {225 public static function contextualHelpForConfigurationOptions($screen, $tab) { 230 226 _e(" 231 227 <p>The <strong>Campaign Setup</strong> panel can used to set the properties and constraints associated with a campaign: … … 260 256 * @return array with our plugin added 261 257 */ 262 public function filterMceExternalPlugins($plugins) {258 public static function filterMceExternalPlugins($plugins) { 263 259 if (self::hasPermission()): 264 260 $suffix = self::debugSufix(); … … 274 270 * @return array with our button added 275 271 */ 276 public function filterMceButtons($buttons) {272 public static function filterMceButtons($buttons) { 277 273 if (self::hasPermission()) 278 274 array_push($buttons, 'separator', ClickToDonate::CLASS_NAME); … … 286 282 * @return array 287 283 */ 288 public function filterMceExternalLanguages($files) {284 public static function filterMceExternalLanguages($files) { 289 285 if (self::hasPermission()) 290 286 $files[] = plugin_dir_path(ClickToDonate::FILE) . 'php/langs/wp-langs.php'; … … 299 295 * @return array with out parameter 300 296 */ 301 public function filterMceBeforeInit($params) {297 public static function filterMceBeforeInit($params) { 302 298 if (self::hasPermission()): 303 299 … … 320 316 * @param type $settings 321 317 */ 322 public function afterWpTinyMce($settings) {318 public static function afterWpTinyMce($settings) { 323 319 ?> 324 320 <div style="display:none;"> … … 381 377 * Send the campaigns list as a response of an ajax request 382 378 */ 383 public function getBannersList() {379 public static function getBannersList() { 384 380 check_ajax_referer('ctd-links-list', '_ajax_ctd_links_nonce'); 385 381 … … 419 415 * Add a metabox to the campaign post type 420 416 */ 421 public function addMetaBox() {417 public static function addMetaBox() { 422 418 // Replace the submit core metabox by ours 423 419 add_meta_box('submitdiv', __('Campaign configuration', 'ClickToDonate'), array(__CLASS__, 'writeSubmitMetaBox'), ClickToDonateController::POST_TYPE, 'side', 'core'); … … 495 491 <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> 496 492 </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"> 498 494 <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> 499 495 <div id="ctd-cool-off-container" class="start-hidden"> … … 534 530 <div> 535 531 <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"> 537 533 <option<?php selected($timeUnit, self::$coolOffUnitSeconds); ?> value='1'><?php _e('Second(s)', 'ClickToDonate') ?></option> 538 534 <option<?php selected($timeUnit, self::$coolOffUnitMinutes); ?> value='60'><?php _e('Minute(s)', 'ClickToDonate') ?></option> … … 548 544 </fieldset> 549 545 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"> 551 547 <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> 552 548 <div id="ctd-maxclicks-container" class="start-hidden"> … … 556 552 </fieldset> 557 553 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"> 559 555 <legend> 560 556 <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> 561 557 </legend> 562 558 <div id="ctd-startdate-container" class="start-hidden"> 563 <label class="selectit"><?php _e('Start date:', 'ClickToDonate'); ?> <input s tyle="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> 564 560 <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> 566 562 </div> 567 563 </fieldset> 568 564 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"> 570 566 <legend> 571 567 <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> 572 568 </legend> 573 569 <div id="ctd-enddate-container" class="start-hidden"> 574 <label class="selectit"><?php _e('End date:', 'ClickToDonate'); ?> <input s tyle="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> 575 571 <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> 577 573 </div> 578 574 </fieldset> … … 653 649 * @return int with the post id 654 650 */ 655 public function savePost($postId) {651 public static function savePost($postId) { 656 652 if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE): 657 653 return $postId; … … 757 753 * @return array with the (possible) filtered posts 758 754 */ 759 public function thePosts($posts, $query) {755 public static function thePosts($posts, $query) { 760 756 if (empty($posts)) 761 757 return $posts; … … 816 812 * @param string $content 817 813 */ 818 public function theContent($content){814 public static function theContent($content){ 819 815 $matches = array(); 820 816 $patterns = array(); -
click-to-donate/trunk/readme.txt
r571997 r797544 3 3 Tags: clicks, visits, tracking, donate, donation, NGO, ONG, plugin, extension 4 4 Requires at least: 3.2.0 5 Tested up to: 3. 4.15 Tested up to: 3.7.1 6 6 Stable tag: 1.0 7 7 License: GPLv3 or later … … 46 46 == Changelog == 47 47 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 48 53 = 1.0.5 = 49 54 * Bug fix on the graph views date interval when using PHP on Windows
Note: See TracChangeset
for help on using the changeset viewer.