Skip to content
Snippets Groups Projects
Commit 0f7b2f5c authored by Marcus Eibrink-Lunzenauer's avatar Marcus Eibrink-Lunzenauer
Browse files

Add unstaged files

parent 6cf28b73
No related branches found
No related tags found
No related merge requests found
...@@ -14,8 +14,30 @@ class ExamplePlugin extends StudIPPlugin implements ...@@ -14,8 +14,30 @@ class ExamplePlugin extends StudIPPlugin implements
require_once 'vendor/autoload.php'; require_once 'vendor/autoload.php';
} }
public function perform($unconsumedPath) /**
{ * This method dispatches all actions.
*
* @param string part of the dispatch path that was not consumed
*
* @return void
*/
public function perform($unconsumedPath) {
$args = explode('/', $unconsumedPath);
$trailsRoot = $this->getPluginPath();
$trailsUri = rtrim(PluginEngine::getLink($this, [], null, true), '/');
$dispatcher = new Trails_Dispatcher($trailsRoot, $trailsUri, 'index');
$dispatcher->current_plugin = $this;
try {
$dispatcher->dispatch($unconsumedPath);
} catch (Trails_UnknownAction $exception) {
if (count($args) > 0) {
throw $exception;
} else {
throw new Exception(_('unbekannte Plugin-Aktion: ') . $unconsumedPath);
}
}
} }
/* Interface Methods */ /* Interface Methods */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment