helper = plugin_load('helper', 'ckgdoku');
$this->dokuwiki_priority = $this->getConf('dw_priority');
$this->dw_priority_group = $this->getConf('dw_users');
$this->dw_priority_metafn=metaFN(':ckgdoku:dw_priority', '.ser');
if(!file_exists($this->dw_priority_metafn)) {
io_saveFile($this->dw_priority_metafn, serialize(array()));
}
if(!plugin_isdisabled('captcha')) {
$this->captcha = true;
}
}
/*
* Register its handlers with the dokuwiki's event controller
*/
function register(Doku_Event_Handler $controller) {
if($this->helper->is_outOfScope()) return;
$controller->register_hook( 'TPL_METAHEADER_OUTPUT', 'AFTER', $this, 'loadScript');
$controller->register_hook( 'HTML_EDITFORM_INJECTION', 'AFTER', $this, 'preprocess');
$controller->register_hook( 'HTML_EDITFORM_OUTPUT', 'BEFORE', $this, 'insertFormElement');
$controller->register_hook('DOKUWIKI_STARTED', 'BEFORE', $this, 'file_type');
$controller->register_hook('TPL_CONTENT_DISPLAY', 'AFTER', $this, 'setupDWEdit');
$controller->register_hook('DOKUWIKI_STARTED', 'AFTER', $this, 'reset_user_rewrite_check');
$controller->register_hook('DOKUWIKI_DONE', 'BEFORE', $this, 'restore_conf');
$controller->register_hook('AJAX_CALL_UNKNOWN', 'BEFORE', $this,'_ajax_call');
$controller->register_hook('HTML_UPDATEPROFILEFORM_OUTPUT', 'BEFORE', $this, 'handle_profile_form');
}
function handle_profile_form(Doku_Event $event, $param) {
if(!$this->getConf('dw_priority')) { return; }
global $INFO;
$client = $_SERVER['REMOTE_USER']; //$INFO['client'];
$ar = unserialize(file_get_contents($this->dw_priority_metafn));
$which = $ar[$client];
$dwed = ""; $cked = "";
if($which == 'N') {
$cked = "checked";
}
else if($which == 'Y') {
$dwed = "checked";
}
$pos = $event->data->findElementByAttribute('type', 'reset');
$_form = '