Changeset 366 for dev/mods/ajcron

Show
Ignore:
Timestamp:
12/18/08 00:28:21 (12 years ago)
Author:
exi
Message:

Fixed apiuser to not enable xajax on all pages
Added a html tweak for opera on killsummarytables
Reworked ajcron::getNextRun(), it didnt work on values greater than 60 minutes
Now no xajax code is inserted when board is in IGB mode

Location:
dev/mods/ajcron
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • dev/mods/ajcron/auto_settings.php

    r364 r366  
    1010options::fadd('Blocking Cronjobs', 'ajcron_blocking', 'checkbox'); 
    1111options::fadd('Next scheduled run', 'none', 'custom', array('ajcron', 'getNextRunDisplay'), array('ajcron', 'resetNextRunCheckbox')); 
    12 options::fadd('Jobs', 'ajcron_jobs', 'textarea:cols:60:rows:10'); 
     12options::fadd('Jobs', 'ajcron_jobs', 'textarea:cols:70:rows:10'); 
    1313options::fadd('Runtable', 'anone', 'custom', array('ajcron', 'getRuntable')); 
  • dev/mods/ajcron/init.php

    r365 r366  
    7878        { 
    7979            $int = substr($intervall, 1); 
    80             if ($int == 60) 
    81             { 
    82                 $mintoh = 59-date('i', $time); 
    83                 $stoh = 60-date('s', $time); 
    84                 $nextrun = $time+$mintoh*60+$stoh; 
    85             } 
    86             else 
    87             { 
    88                 $mintot = 59 % $int - date('i', $time); 
    89                 $stot = 60 - date('s', $time); 
    90                 while ($mintot < 0) 
    91                 { 
    92                     $mintot += $int; 
    93                 } 
    94                 $nextrun = $time + $mintot * 60 + $stot; 
    95             } 
     80 
     81            // seconds till interval has passed (counts from 0 to int) 
     82            $seconds_passed = $time % ($int*60); 
     83 
     84            // reverse, how many seconds are left til 0 
     85            $seconds_to_go = ($int*60) - $seconds_passed; 
     86 
     87            // just add to current time and we have the next intervall 
     88            $nextrun = $time + $seconds_to_go; 
    9689        } 
    9790        return $nextrun;