basedir(); $configuration->setting['basedir']->update($basedir); $conf['basedir'] = $basedir; } if (empty($conf['baseurl'])) { $baseurl = $this->baseurl(); $configuration->setting['baseurl']->update($baseurl); $conf['baseurl'] = $baseurl; } if ($update_config) { $configuration->save_settings('config'); } parent::loadConfig(); } public function getPluginName() { return 'bez'; } public function register(Doku_Event_Handler $controller) { } public function getGlobalConf($key='') { global $conf; if ($key == '') { return $conf; } return $conf[$key]; } public function get_model() { return $this->model; } public function get_client() { global $INFO; return $INFO['client']; } public function get_tpl() { return $this->tpl; } public function get_level() { return $this->model->get_level(); } public function bez_tpl_include($tpl_file='', $return=false) { $file = DOKU_PLUGIN . "bez/tpl/$tpl_file.php"; if (!file_exists($file)) { throw new Exception("$file doesn't exist"); } $tpl = $this->tpl; if ($return) ob_start(); include $file; if ($return) return ob_get_clean(); } public function createObjects($skip_acl=false) { global $auth; global $INFO; if ($skip_acl) { $client = false; } else { $client = $INFO['client']; } $this->model = new bez\mdl\Model($auth, $client, $this, $skip_acl); $this->tpl = new bez\meta\Tpl($this); } public function id() { $args = func_get_args(); if (count($args) === 0) { return $_GET['id']; } $elms = array(); foreach ($args as $arg) { if (is_array($arg)) { foreach ($arg as $k => $v) { $elms[] = $k; $elms[] = $v; } } else { $elms[] = $arg; } } array_unshift($elms, 'bez'); if ($this->getGlobalConf('lang') != '') { array_unshift($elms, $this->getGlobalConf('lang')); } $elms = array_map(function ($elm) { return str_replace(':', '', $elm); }, $elms); return implode(':', $elms); } public function url() { $args = func_get_args(); if (count($args) > 0) { $id = call_user_func_array(array($this, 'id'), $args); return DOKU_URL . 'doku.php?id=' . $id; } } }