1<?php
2/**
3 * DokuWiki Plugin cronojob (Action Component)
4 *
5 * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
6 * @author  Luigi Micco <l.micco@tiscali.it>
7 */
8
9// must be run within Dokuwiki
10if (!defined('DOKU_INC')) die();
11
12if (!defined('DOKU_LF')) define('DOKU_LF', "\n");
13if (!defined('DOKU_TAB')) define('DOKU_TAB', "\t");
14if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
15require_once DOKU_PLUGIN.'action.php';
16
17class action_plugin_cronojob extends DokuWiki_Action_Plugin {
18
19    /**
20     * return some info
21     */
22    function getInfo() {
23      return array(
24              'author' => 'Luigi micco',
25              'email'  => 'l.micco@tiscali.it',
26              'date'   => '2010-04-22',
27              'name'   => 'cronojob Plugin',
28              'desc'   => 'A plugin for schedule jobs',
29              'url'    => 'http://www.bitlibero.com/dokuwiki/cronojob-22.04.2010.zip',
30              );
31    }
32
33    function register(&$controller) {
34      $controller->register_hook('DOKUWIKI_DONE', 'AFTER', $this, 'handle');
35    }
36
37    function handle(&$event, $param) {
38      global $ID;
39
40      $p = array();
41      $p['src']    = DOKU_URL.'lib/plugins/cronojob/pseudocron.php?id='.rawurlencode($ID).'&'.time();
42      $p['width']  = 1;
43      $p['height'] = 1;
44      $p['alt']    = '';
45      $att = buildAttributes($p);
46      echo "<img $att />";
47    }
48
49}
50
51// vim:ts=4:sw=4:et:enc=utf-8:
52