diff --git a/appinfo/routes.php b/appinfo/routes.php index cd5af35..e6066c2 100755 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -7,6 +7,8 @@ * The controller class has to be registered in the application.php file since * it's instantiated in there */ + +$this->create('carnet_writer','/writer')->actionInclude('carnet/templates/writer.php'); return [ 'routes' => [ diff --git a/templates/writer.php b/templates/writer.php index 3fb973d..7e449c8 100755 --- a/templates/writer.php +++ b/templates/writer.php @@ -1,19 +1,18 @@ ", "CarnetElectron/", $file); +$file = file_get_contents($currentpath."reader/reader.html"); +$file = str_replace("", $root."/CarnetElectron/", $file); $file = preg_replace_callback('/", "CarnetElectron/", $file); -$file = str_replace("", "../../../index.php/apps/carnet/", $file); - - +$urlGenerator = \OC::$server->getURLGenerator(); +$file = str_replace("", $root."/CarnetElectron/", $file); +$file = str_replace("", $urlGenerator->linkToRouteAbsolute("carnet.page.index"), $file); echo $file; ?> \ No newline at end of file