Commit 2a558d8f authored by Matthieu Le Corre's avatar Matthieu Le Corre
Browse files

Major update, add setting section


Signed-off-by: Matthieu Le Corre's avatarMatthieu Le Corre <matthieu.lecorre@univ-nantes.fr>
parent e9de5f91
<?php
$eventDispatcher = \OC::$server->getEventDispatcher();
/**
* @author 2019 Matthieu Le Corre <matthieu.lecorre@univ-nantes.fr>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
$eventDispatcher->addListener('OCA\Files::loadAdditionalScripts',
function() {
OCP\Util::addscript('files_readmemd', 'script');
OCP\Util::addStyle('files_readmemd','style') ;
OCP\Util::addStyle('files_readmemd','content') ;
});
$eventDispatcher->addListener('OCA\Files_Sharing::loadAdditionalScripts',
function() {
OCP\Util::addscript('files_readmemd', 'script');
OCP\Util::addStyle('files_readmemd','style') ;
OCP\Util::addStyle('files_readmemd','content') ;
});
$app = new \OCA\ReadmeMD\AppInfo\Application() ;
\ No newline at end of file
......@@ -7,10 +7,10 @@
With this app you can add a header and a footer to your nextcloud directories.
This can be use to explain the goal of a directory, describe the content of a folder ...
It show README.md in the way gitlab does.]]></description>
<version>1.0.4</version>
<version>1.0.4.3</version>
<licence>agpl</licence>
<author mail="matthieu.lecorre@univ-nantes.fr" homepage="http://www.univ-nantes.fr">Matthieu Le Corre</author>
<namespace>ReadMeMd</namespace>
<namespace>ReadmeMD</namespace>
<types>
<filesystem/>
</types>
......@@ -21,4 +21,9 @@ It show README.md in the way gitlab does.]]></description>
<dependencies>
<nextcloud min-version="14" max-version="16"/>
</dependencies>
<settings>
<admin-section>OCA\ReadmeMD\Settings\Admin\Section</admin-section>
<admin>OCA\ReadmeMD\Settings\Admin\Appareance</admin>
<admin>OCA\ReadmeMD\Settings\Admin\Engine</admin>
</settings>
</info>
<?php
/**
* @author 2019 Matthieu Le Corre <matthieu.lecorre@univ-nantes.fr>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
return [
'routes' => [
[ 'name' => 'config#getConfig', url => '/config', verb => 'GET' ],
[ 'name' => 'config#setConfig', url => '/config', verb => 'POST' ]
]
];
\ No newline at end of file
......@@ -2,15 +2,23 @@
padding: 2em ;
border-top: 1px solid silver ;
margin-top: 1em ;
background-color: #c6d6390f ;
text-align: initial ;
}
.yellowish {
background-color: #c6d6390f ;
}
.readmemd::before {
content:"README.md" !important ;
content:"README.md" !important;
color: silver ;
}
.no-before::before {
content : none !important;
}
.headermd {
padding: 1em ;
border-bottom: 1px solid silver ;
......
<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" version="1.1" viewBox="0 0 16 16"><path d="m7.9992 0.999a6.9993 6.9994 0 0 0 -6.9992 6.9996 6.9993 6.9994 0 0 0 6.9992 6.9994 6.9993 6.9994 0 0 0 3.6308 -1.024c0.86024 0.34184 2.7871 1.356 3.2457 0.91794 0.47922-0.45765-0.56261-2.6116-0.81238-3.412a6.9993 6.9994 0 0 0 0.935 -3.4814 6.9993 6.9994 0 0 0 -6.9991 -6.9993zm0.0008 2.6611a4.34 4.3401 0 0 1 4.34 4.3401 4.34 4.3401 0 0 1 -4.34 4.3398 4.34 4.3401 0 0 1 -4.34 -4.3398 4.34 4.3401 0 0 1 4.34 -4.3401z" stroke-width="0.14"/></svg>
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=282)}({282:function(e,t){
/**
* @author Matthieu Le Corre <matthieu.lecorre@univ-nantes.fr>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
$(document).ready(function(){$("#readmeMD-appearance-txt").click(function(e){$.post(OC.generateUrl("apps/files_readmemd/config"),{key:"show_title",value:e.target.checked}).success(function(e){console.log(e)})}),$("#readmeMD-appearance-color").click(function(e){$.post(OC.generateUrl("apps/files_readmemd/config"),{key:"yellow_back",value:e.target.checked}).success(function(e){console.log(e)})})})}});
//# sourceMappingURL=config.js.map
\ No newline at end of file
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/config.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","$","document","ready","click","Event","post","OC","generateUrl","target","checked","success","json","console","log"],"mappings":"aACA,IAAAA,EAAA,GAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,GAAA,CACAG,EAAAH,EACAI,GAAA,EACAH,QAAA,IAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QAKAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,SAAAR,EAAAS,EAAAC,GACAZ,EAAAa,EAAAX,EAAAS,IACAG,OAAAC,eAAAb,EAAAS,EAAA,CAA0CK,YAAA,EAAAC,IAAAL,KAK1CZ,EAAAkB,EAAA,SAAAhB,GACA,oBAAAiB,eAAAC,aACAN,OAAAC,eAAAb,EAAAiB,OAAAC,YAAA,CAAwDC,MAAA,WAExDP,OAAAC,eAAAb,EAAA,cAAiDmB,OAAA,KAQjDrB,EAAAsB,EAAA,SAAAD,EAAAE,GAEA,GADA,EAAAA,IAAAF,EAAArB,EAAAqB,IACA,EAAAE,EAAA,OAAAF,EACA,KAAAE,GAAA,iBAAAF,QAAAG,WAAA,OAAAH,EACA,IAAAI,EAAAX,OAAAY,OAAA,MAGA,GAFA1B,EAAAkB,EAAAO,GACAX,OAAAC,eAAAU,EAAA,WAAyCT,YAAA,EAAAK,UACzC,EAAAE,GAAA,iBAAAF,EAAA,QAAAM,KAAAN,EAAArB,EAAAU,EAAAe,EAAAE,EAAA,SAAAA,GAAgH,OAAAN,EAAAM,IAAqBC,KAAA,KAAAD,IACrI,OAAAF,GAIAzB,EAAA6B,EAAA,SAAA1B,GACA,IAAAS,EAAAT,KAAAqB,WACA,WAA2B,OAAArB,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAH,EAAAU,EAAAE,EAAA,IAAAA,GACAA,GAIAZ,EAAAa,EAAA,SAAAiB,EAAAC,GAAsD,OAAAjB,OAAAkB,UAAAC,eAAA1B,KAAAuB,EAAAC,IAGtD/B,EAAAkC,EAAA,GAIAlC,IAAAmC,EAAA;;;;;;;;;;;;;;;;;;;;AC9DAC,EAAAC,UAAAC,MAAA,WAEAF,EAAA,4BAAAG,MAAA,SAAAC,GACAJ,EAAAK,KAAAC,GAAAC,YAAA,+BAA6DhB,IAAA,aAAAN,MAAAmB,EAAAI,OAAAC,UAC7DC,QAAA,SAAAC,GACAC,QAAAC,IAAAF,OAIAX,EAAA,8BAAAG,MAAA,SAAAC,GACAJ,EAAAK,KAAAC,GAAAC,YAAA,+BAA6DhB,IAAA,cAAAN,MAAAmB,EAAAI,OAAAC,UAC7DC,QAAA,SAAAC,GACAC,QAAAC,IAAAF","file":"config.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 282);\n","/**\n * @author Matthieu Le Corre <matthieu.lecorre@univ-nantes.fr>\n *\n * @license GNU AGPL version 3 or any later version\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\n $(document).ready(function () {\n\n $(\"#readmeMD-appearance-txt\").click(function(Event){\n $.post(OC.generateUrl(\"apps/files_readmemd/config\"),{key: \"show_title\", value: Event.target.checked})\n .success(function (json) {\n console.log(json) ;\n })\n }) ;\n\n $(\"#readmeMD-appearance-color\").click(function(Event){\n $.post(OC.generateUrl(\"apps/files_readmemd/config\"),{key: \"yellow_back\", value: Event.target.checked})\n .success(function (json) {\n console.log(json) ;\n })\n }) ;\n\n }) ;"],"sourceRoot":""}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?php
/**
* @author 2019 Matthieu Le Corre <matthieu.lecorre@univ-nantes.fr>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\ReadmeMD\Appinfo ;
use OCA\ReadmeMD\Services\Config ;
use OCP\AppFramework\App;
class Application extends App {
public function __construct(array $urlParams = []) {
parent::__construct('files_readmemd', $urlParams);
$container = $this->getContainer();
$server = $container->getServer();
$eventDispatcher = $server->getEventDispatcher();
$this->addPublicViewListeners($eventDispatcher) ;
$this->addPrivateListeners($eventDispatcher) ;
$container->registerService('Config', function($c) {
return new Config(
$c->query('Config'),
$c->query('AppName')
);
});
}
protected function addPublicViewListeners ($eventDispatcher) {
$eventDispatcher->addListener('OCA\Files_Sharing::loadAdditionalScripts',
function() {
\OCP\Util::addscript('files_readmemd', 'main');
\OCP\Util::addStyle('files_readmemd','style') ;
\OCP\Util::addStyle('files_readmemd','content') ;
});
}
protected function addPrivateListeners ($eventDispatcher) {
$eventDispatcher->addListener('OCA\Files::loadAdditionalScripts',
function() {
\OCP\Util::addscript('files_readmemd', 'main');
\OCP\Util::addStyle('files_readmemd','style') ;
\OCP\Util::addStyle('files_readmemd','content') ;
});
}
}
\ No newline at end of file
<?php
/**
* @author 2019 Matthieu Le Corre <matthieu.lecorre@univ-nantes.fr>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\ReadmeMD\Controller ;
use OCP\AppFramework\Controller ;
use OCA\ReadmeMD\Services\Config ;
use OCP\IRequest;
class ConfigController extends Controller {
public function __construct($AppName, IRequest $request, Config $config ) {
parent::__construct($AppName, $request);
$this->config = $config;
}
public function getConfig() {
$params = [
"show_asciidoc" => $this->config->getAppValue("show_asciidoc"),
"show_html" => $this->config->getAppValue("show_html") ,
"yellow_back" => $this->config->getAppValue("yellow_back") ,
"show_title" => $this->config->getAppValue("show_title")
];
return $params ;
}
public function setConfig($key,$value) {
$this->config->setAppValue($key,$value) ;
return $this->config->getAppValue($key) ;
}
}
\ No newline at end of file
<?php
/**
* @author 2019 Matthieu Le Corre <matthieu.lecorre@univ-nantes.fr>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\ReadmeMD\Services ;
use \OCP\IConfig;
class Config {
private $config;
private $appName;
public function __construct(IConfig $config, $appName){
$this->config = $config;
$this->appName = $appName;
$this->setDefaults() ;
}
private function setDefaults() {
if (null == $this->getAppValue('show_asciidoc') ) {
$this->setAppValue('show_asciidoc','false') ;
}
if (null == $this->getAppValue('show_html') ) {
$this->setAppValue('show_html','false') ;
}
if (null == $this->getAppValue('show_title') ) {
$this->setAppValue('show_title','true') ;
}
if (null == $this->getAppValue('yellow_back') ) {
$this->setAppValue('yellow_back','true') ;
}
}
public function getAppValue($key) {
return $this->config->getAppValue($this->appName, $key);
}
public function setAppValue($key, $value) {
$this->config->setAppValue($this->appName, $key, $value);
}
}
\ No newline at end of file
<?php
/**
* @author Matthieu Le Corre <matthieu.lecorre@univ-nantes.fr>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\ReadmeMD\Settings\Admin ;
use OCP\IL10N;
use OCP\Settings\ISettings;
use OCA\ReadmeMD\Services\Config ;
use OCP\AppFramework\Http\TemplateResponse;
class Appareance implements ISettings {
/** @var Config */
private $config;
/** @var IL10N */
private $l;
/** @var IDateTimeFormatter */
private $dateTimeFormatter;
public function __construct(Config $config,IL10N $l) {
$this->config = $config;
$this->l = $l;
}
/**
* @return string the section ID, e.g. 'sharing'
*/
public function getSection() {
return 'files_readmemd';
}
/**
* @return int whether the form should be rather on the top or bottom of
* the admin section. The forms are arranged in ascending order of the
* priority values. It is required to return a value between 0 and 100.
*/
public function getPriority() {
return 50;
}
/**
* @return TemplateResponse
*/
public function getForm() {
$show_title = $this->config->getAppValue('show_title') ;
$yellow_back = $this->config->getAppValue('yellow_back') ;
$parameters = [
'show_title' => $show_title,
'yellow_back' => $yellow_back
];
return new TemplateResponse('files_readmemd', 'Appareance', $parameters);
}
}
\ No newline at end of file
<?php
/**
* @author Matthieu Le Corre <matthieu.lecorre@univ-nantes.fr>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\ReadmeMD\Settings\Admin ;
use OCP\IL10N;
use OCP\Settings\ISettings;
use OCA\ReadmeMD\Services\Config ;
use OCP\AppFramework\Http\TemplateResponse;
class Engine implements ISettings {
/** @var Config */
private $config;
/** @var IL10N */
private $l;
/** @var IDateTimeFormatter */
private $dateTimeFormatter;
public function __construct(Config $config,IL10N $l) {
$this->config = $config;
$this->l = $l;
}
/**
* @return string the section ID, e.g. 'sharing'
*/
public function getSection() {
return 'files_readmemd';
}
/**
* @return int whether the form should be rather on the top or bottom of
* the admin section. The forms are arranged in ascending order of the
* priority values. It is required to return a value between 0 and 100.
*/
public function getPriority() {
return 50;
}
/**
* @return TemplateResponse
*/
public function getForm() {
$show_asciidoc = $this->config->getAppValue('show_asciidoc') ;
$show_html = $this->config->getAppValue('show_html') ;
$parameters = [
'show_asciidoc' => $show_asciidoc,
'show_html' => $show_html
];
return new TemplateResponse('files_readmemd', 'Engine', $parameters);
}
}
\ No newline at end of file
<?php
/**
* @author 2019 Matthieu Le Corre <matthieu.lecorre@univ-nantes.fr>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\ReadmeMD\Settings\Admin ;
use OCP\IL10N;
use OCP\IURLGenerator;
use OCP\Settings\IIconSection;
class Section implements IIconSection {
/** @var IL10N */
private $l;
public function __construct(IURLGenerator $url,IL10N $l) {
$this->l = $l;
$this->url = $url;
}
/**
* returns the ID of the section. It is supposed to be a lower case string
*
* @returns string
*/
public function getID() {
return 'files_readmemd'; //or a generic id if feasible
}
/**
* returns the translated name as it should be displayed, e.g. 'LDAP / AD
* integration'. Use the L10N service to translate it.
*
* @return string
*/
public function getName() {
return $this->l->t('README.md');
}
/**
* @return int whether the form should be rather on the top or bottom of
* the settings navigation. The sections are arranged in ascending order of
* the priority values. It is required to return a value between 0 and 99.
*/
public function getPriority() {
return 80;
}
/**
* returns the relative path to an 16*16 icon describing the section.
* e.g. '/core/img/places/files.svg'
*
* @returns string
* @since 12
*/
public function getIcon() {
return $this->url->imagePath('files_readmemd', 'app-dark.png');
}
}
\ No newline at end of file
{
"name": "files_readmemd",
"version": "1.0.3",
"version": "1.0.4",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......@@ -314,11 +314,12 @@
}
},
"assert": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz",
"integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=",
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz",
"integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==",
"dev": true,
"requires": {
"object-assign": "^4.1.1",
"util": "0.10.3"
},
"dependencies": {
......@@ -437,9 +438,9 @@
"dev": true
},
"bluebird": {
"version": "3.5.4",
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.4.tgz",
"integrity": "sha512-FG+nFEZChJrbQ9tIccIfZJBz3J7mLrAhxakAbnrJWn8d7aKOC+LWifa0G+p4ZqKp4y13T7juYvdhq9NzKdsrjw==",