*/ // must be run within Dokuwiki if (!defined('DOKU_INC')) { die(); } class admin_plugin_watchcycle extends DokuWiki_Admin_Plugin { /** * @return int sort number in admin menu */ public function getMenuSort() { return 1; } /** * @return bool true if only access for superuser, false is for superusers and moderators */ public function forAdminOnly() { return false; } /** * Should carry out any processing required by the plugin. */ public function handle() { } /** * Render HTML output, e.g. helpful text and a form */ public function html() { global $ID; /* @var Input */ global $INPUT; /** @var \helper_plugin_sqlite $sqlite */ $sqlite = plugin_load('helper', 'watchcycle_db')->getDB(); /* @var \helper_plugin_watchcycle */ $helper = plugin_load('helper', 'watchcycle'); ptln('
' . $icon . ' ' . $lang . ' | '); } $q = 'SELECT page, maintainer, cycle, DAYS_AGO(last_maintainer_rev) AS current, uptodate FROM watchcycle'; $where = []; $q_args = []; if ($INPUT->str('filter') != '') { $where[] = 'page LIKE ?'; $q_args[] = '%' . $INPUT->str('filter') . '%'; } if ($INPUT->has('outdated')) { $where[] = 'uptodate=0'; } if (count($where) > 0) { $q .= ' WHERE '; $q .= implode(' AND ', $where); } if ($INPUT->has('sortby') && in_array($INPUT->str('sortby'), $headers)) { $q .= ' ORDER BY ' . $INPUT->str('sortby'); if ($INPUT->int('desc') == 1) { $q .= ' DESC'; } } $res = $sqlite->query($q, $q_args); while ($row = $sqlite->res2row($res)) { ptln('||||
---|---|---|---|---|
' . $row['page'] . ' | '); ptln('' . $row['maintainer'] . ' | '); ptln('' . $row['cycle'] . ' | '); ptln('' . $row['current'] . ' | '); $icon = $row['uptodate'] == 1 ? '✓' : '✕'; ptln('' . $icon . ' | '); ptln('