aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/inc/Action
diff options
context:
space:
mode:
Diffstat (limited to 'inc/Action')
-rw-r--r--inc/Action/Admin.php2
-rw-r--r--inc/Action/Export.php3
-rw-r--r--inc/Action/Logout.php2
-rw-r--r--inc/Action/Plugin.php2
-rw-r--r--inc/Action/Profile.php2
-rw-r--r--inc/Action/ProfileDelete.php2
-rw-r--r--inc/Action/Redirect.php3
-rw-r--r--inc/Action/Register.php2
-rw-r--r--inc/Action/Resendpwd.php4
-rw-r--r--inc/Action/Sitemap.php8
-rw-r--r--inc/Action/Subscribe.php28
11 files changed, 31 insertions, 27 deletions
diff --git a/inc/Action/Admin.php b/inc/Action/Admin.php
index cc6dfd74f..1c9afd6b9 100644
--- a/inc/Action/Admin.php
+++ b/inc/Action/Admin.php
@@ -28,7 +28,7 @@ class Admin extends AbstractUserAction {
// retrieve admin plugin name from $_REQUEST['page']
if(($page = $INPUT->str('page', '', true)) != '') {
- /** @var $plugin \DokuWiki_Admin_Plugin */
+ /** @var $plugin \dokuwiki\Extension\AdminPlugin */
if($plugin = plugin_getRequestAdminPlugin()) { // FIXME this method does also permission checking
if(!$plugin->isAccessibleByCurrentUser()) {
throw new ActionException('denied');
diff --git a/inc/Action/Export.php b/inc/Action/Export.php
index 1eec27ec3..6b46b276e 100644
--- a/inc/Action/Export.php
+++ b/inc/Action/Export.php
@@ -3,6 +3,7 @@
namespace dokuwiki\Action;
use dokuwiki\Action\Exception\ActionAbort;
+use dokuwiki\Extension\Event;
/**
* Class Export
@@ -96,7 +97,7 @@ class Export extends AbstractAction {
$data['headers'] = $headers;
$data['output'] =& $output;
- trigger_event('ACTION_EXPORT_POSTPROCESS', $data);
+ Event::createAndTrigger('ACTION_EXPORT_POSTPROCESS', $data);
if(!empty($data['output'])) {
if(is_array($data['headers'])) foreach($data['headers'] as $key => $val) {
diff --git a/inc/Action/Logout.php b/inc/Action/Logout.php
index 8b464e85d..28e8fee58 100644
--- a/inc/Action/Logout.php
+++ b/inc/Action/Logout.php
@@ -23,7 +23,7 @@ class Logout extends AbstractUserAction {
public function checkPreconditions() {
parent::checkPreconditions();
- /** @var \DokuWiki_Auth_Plugin $auth */
+ /** @var \dokuwiki\Extension\AuthPlugin $auth */
global $auth;
if(!$auth->canDo('logout')) throw new ActionDisabledException();
}
diff --git a/inc/Action/Plugin.php b/inc/Action/Plugin.php
index c3e16bf87..43964cf39 100644
--- a/inc/Action/Plugin.php
+++ b/inc/Action/Plugin.php
@@ -23,7 +23,7 @@ class Plugin extends AbstractAction {
* @triggers TPL_ACT_UNKNOWN
*/
public function tplContent() {
- $evt = new \Doku_Event('TPL_ACT_UNKNOWN', $this->actionname);
+ $evt = new \dokuwiki\Extension\Event('TPL_ACT_UNKNOWN', $this->actionname);
if($evt->advise_before()) {
msg('Failed to handle action: ' . hsc($this->actionname), -1);
}
diff --git a/inc/Action/Profile.php b/inc/Action/Profile.php
index 53d8d2ff3..654a23818 100644
--- a/inc/Action/Profile.php
+++ b/inc/Action/Profile.php
@@ -23,7 +23,7 @@ class Profile extends AbstractUserAction {
public function checkPreconditions() {
parent::checkPreconditions();
- /** @var \DokuWiki_Auth_Plugin $auth */
+ /** @var \dokuwiki\Extension\AuthPlugin $auth */
global $auth;
if(!$auth->canDo('Profile')) throw new ActionDisabledException();
}
diff --git a/inc/Action/ProfileDelete.php b/inc/Action/ProfileDelete.php
index 995f81394..89c58edb5 100644
--- a/inc/Action/ProfileDelete.php
+++ b/inc/Action/ProfileDelete.php
@@ -23,7 +23,7 @@ class ProfileDelete extends AbstractUserAction {
public function checkPreconditions() {
parent::checkPreconditions();
- /** @var \DokuWiki_Auth_Plugin $auth */
+ /** @var \dokuwiki\Extension\AuthPlugin $auth */
global $auth;
if(!$auth->canDo('delUser')) throw new ActionDisabledException();
}
diff --git a/inc/Action/Redirect.php b/inc/Action/Redirect.php
index ed67d66d7..dca911a22 100644
--- a/inc/Action/Redirect.php
+++ b/inc/Action/Redirect.php
@@ -3,6 +3,7 @@
namespace dokuwiki\Action;
use dokuwiki\Action\Exception\ActionAbort;
+use dokuwiki\Extension\Event;
/**
* Class Redirect
@@ -41,7 +42,7 @@ class Redirect extends AbstractAliasAction {
}
// execute the redirect
- trigger_event('ACTION_SHOW_REDIRECT', $opts, array($this, 'redirect'));
+ Event::createAndTrigger('ACTION_SHOW_REDIRECT', $opts, array($this, 'redirect'));
// should never be reached
throw new ActionAbort('show');
diff --git a/inc/Action/Register.php b/inc/Action/Register.php
index 0d5415868..7d21bff4a 100644
--- a/inc/Action/Register.php
+++ b/inc/Action/Register.php
@@ -23,7 +23,7 @@ class Register extends AbstractAclAction {
public function checkPreconditions() {
parent::checkPreconditions();
- /** @var \DokuWiki_Auth_Plugin $auth */
+ /** @var \dokuwiki\Extension\AuthPlugin $auth */
global $auth;
global $conf;
if(isset($conf['openregister']) && !$conf['openregister']) throw new ActionDisabledException();
diff --git a/inc/Action/Resendpwd.php b/inc/Action/Resendpwd.php
index 5b5e38194..f3f8d3bad 100644
--- a/inc/Action/Resendpwd.php
+++ b/inc/Action/Resendpwd.php
@@ -23,7 +23,7 @@ class Resendpwd extends AbstractAclAction {
public function checkPreconditions() {
parent::checkPreconditions();
- /** @var \DokuWiki_Auth_Plugin $auth */
+ /** @var \dokuwiki\Extension\AuthPlugin $auth */
global $auth;
global $conf;
if(isset($conf['resendpasswd']) && !$conf['resendpasswd']) throw new ActionDisabledException(); //legacy option
@@ -59,7 +59,7 @@ class Resendpwd extends AbstractAclAction {
protected function resendpwd() {
global $lang;
global $conf;
- /* @var \DokuWiki_Auth_Plugin $auth */
+ /* @var \dokuwiki\Extension\AuthPlugin $auth */
global $auth;
global $INPUT;
diff --git a/inc/Action/Sitemap.php b/inc/Action/Sitemap.php
index 10b1377a0..f0a925cc3 100644
--- a/inc/Action/Sitemap.php
+++ b/inc/Action/Sitemap.php
@@ -32,8 +32,8 @@ class Sitemap extends AbstractAction {
throw new FatalException('Sitemap generation is disabled', 404);
}
- $sitemap = \Sitemapper::getFilePath();
- if(\Sitemapper::sitemapIsCompressed()) {
+ $sitemap = Sitemap::getFilePath();
+ if(Sitemap::sitemapIsCompressed()) {
$mime = 'application/x-gzip';
} else {
$mime = 'application/xml; charset=utf-8';
@@ -41,13 +41,13 @@ class Sitemap extends AbstractAction {
// Check if sitemap file exists, otherwise create it
if(!is_readable($sitemap)) {
- \Sitemapper::generate();
+ Sitemap::generate();
}
if(is_readable($sitemap)) {
// Send headers
header('Content-Type: ' . $mime);
- header('Content-Disposition: attachment; filename=' . utf8_basename($sitemap));
+ header('Content-Disposition: attachment; filename=' . \dokuwiki\Utf8\PhpString::basename($sitemap));
http_conditionalRequest(filemtime($sitemap));
diff --git a/inc/Action/Subscribe.php b/inc/Action/Subscribe.php
index c16571022..a129a8698 100644
--- a/inc/Action/Subscribe.php
+++ b/inc/Action/Subscribe.php
@@ -4,6 +4,8 @@ namespace dokuwiki\Action;
use dokuwiki\Action\Exception\ActionAbort;
use dokuwiki\Action\Exception\ActionDisabledException;
+use dokuwiki\Subscriptions\SubscriberManager;
+use dokuwiki\Extension\Event;
/**
* Class Subscribe
@@ -67,18 +69,18 @@ class Subscribe extends AbstractUserAction {
if(empty($params['action']) || !checkSecurityToken()) return;
// Handle POST data, may throw exception.
- trigger_event('ACTION_HANDLE_SUBSCRIBE', $params, array($this, 'handlePostData'));
+ Event::createAndTrigger('ACTION_HANDLE_SUBSCRIBE', $params, array($this, 'handlePostData'));
$target = $params['target'];
$style = $params['style'];
$action = $params['action'];
// Perform action.
- $sub = new \Subscription();
- if($action == 'unsubscribe') {
- $ok = $sub->remove($target, $INPUT->server->str('REMOTE_USER'), $style);
+ $subManager = new SubscriberManager();
+ if($action === 'unsubscribe') {
+ $ok = $subManager->remove($target, $INPUT->server->str('REMOTE_USER'), $style);
} else {
- $ok = $sub->add($target, $INPUT->server->str('REMOTE_USER'), $style);
+ $ok = $subManager->add($target, $INPUT->server->str('REMOTE_USER'), $style);
}
if($ok) {
@@ -89,15 +91,15 @@ class Subscribe extends AbstractUserAction {
), 1
);
throw new ActionAbort('redirect');
- } else {
- throw new \Exception(
- sprintf(
- $lang["subscr_{$action}_error"],
- hsc($INFO['userinfo']['name']),
- prettyprint_id($target)
- )
- );
}
+
+ throw new \Exception(
+ sprintf(
+ $lang["subscr_{$action}_error"],
+ hsc($INFO['userinfo']['name']),
+ prettyprint_id($target)
+ )
+ );
}
/**