Skip to content

Commit

Permalink
Merge pull request #129 from arnowelzel/master
Browse files Browse the repository at this point in the history
Fix compliance errors reported by occ app:check-code drawio and make the app usable with NC20
  • Loading branch information
pawelrojek authored Nov 30, 2020
2 parents 86ff740 + 3a6d98a commit b15480d
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 26 deletions.
2 changes: 0 additions & 2 deletions drawio/appinfo/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@

namespace OCA\Drawio\AppInfo;

use OCP\App;

$app = new Application();
16 changes: 8 additions & 8 deletions drawio/appinfo/info.xml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<?xml version="1.0"?>
<info>
<info xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://apps.nextcloud.com/schema/apps/info.xsd">
<id>drawio</id>
<name>Draw.io</name>
<summary>Draw.io integration app</summary>
<description><![CDATA[Integrates Draw.io with Nextcloud]]></description>
<licence>AGPL</licence>
<description>Integrates Draw.io with Nextcloud</description>
<version>0.9.8</version>
<licence>agpl</licence>
<author>Paweł Rojek</author>
<version>0.9.7</version>
<namespace>Drawio</namespace>
<types>
<filesystem/>
<filesystem />
</types>
<category>files</category>
<category>integration</category>
<category>tools</category>
<website>https://github.com/pawelrojek/nextcloud-drawio/</website>
<screenshot small-thumbnail="https://raw.githubusercontent.com/pawelrojek/nextcloud-drawio/master/screenshots/drawio_integration_sm.png">https://raw.githubusercontent.com/pawelrojek/nextcloud-drawio/master/screenshots/drawio_integration.png</screenshot>
<bugs>https://github.com/pawelrojek/nextcloud-drawio/issues</bugs>
<repository type="git">https://github.com/pawelrojek/nextcloud-drawio.git</repository>
<screenshot small-thumbnail="https://raw.githubusercontent.com/pawelrojek/nextcloud-drawio/master/screenshots/drawio_integration_sm.png">https://raw.githubusercontent.com/pawelrojek/nextcloud-drawio/master/screenshots/drawio_integration.png</screenshot>
<dependencies>
<nextcloud min-version="11" max-version="19"/>
<owncloud min-version="10.0" max-version="10.1" />
<nextcloud min-version="11" max-version="20"/>
</dependencies>
<settings>
<admin>OCA\Drawio\AdminSettings</admin>
Expand Down
3 changes: 1 addition & 2 deletions drawio/controller/editorcontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace OCA\Drawio\Controller;

use OCP\App;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Http\ContentSecurityPolicy;
use OCP\AppFramework\Controller;
Expand Down Expand Up @@ -94,7 +93,7 @@ public function index($fileId) {
$lang = $this->config->GetLang();
$lang = trim(strtolower($lang));

if ($lang=="auto")
if ("auto" === $lang)
{
$lang = \OC::$server->getL10NFactory("")->get("")->getLanguageCode();
}
Expand Down
2 changes: 1 addition & 1 deletion drawio/l10n/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"Yes" : "Si",
"No" : "No",
"Associate XML files with Draw.io?" : "Associa i file XML a Draw.io?",
"Please note: when you disable the XML association, you need to manually register the MIME type application/x-drawio for the extension \".drawio\"." : "Nota: quando si disabilita l'associazione XML, è necessario registrare manualmente il tipo MIME application / x-drawio per l'estensione \".Drawio\".,
"Please note: when you disable the XML association, you need to manually register the MIME type application/x-drawio for the extension \".drawio\"." : "Nota: quando si disabilita l'associazione XML, è necessario registrare manualmente il tipo MIME application / x-drawio per l'estensione \".Drawio\".",
"Kennedy" : "Kennedy",
"Minimal" : "Minimale",
"Atlas" : "Atlas",
Expand Down
2 changes: 0 additions & 2 deletions drawio/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace OCA\Drawio;

use OCP\User;

use OCA\Drawio\AppInfo\Application;


Expand Down
2 changes: 1 addition & 1 deletion drawio/templates/editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
script("drawio", "editor");

$frame_params = "?embed=1";
if ($_["drawioOfflineMode"] == "yes")
if ($_["drawioOfflineMode"] === "yes")
{
$frame_params .= "&offline=1&stealth=1";
}
Expand Down
20 changes: 10 additions & 10 deletions drawio/templates/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
<p class="drawio-header">
<label for='theme'><?php p($l->t("Theme:")) ?></label>
<select id="theme">
<option value="kennedy"<?php if ($_["drawioTheme"]=="kennedy") echo ' selected'; ?>><?php p($l->t("Kennedy")) ?></option>
<option value="minimal"<?php if ($_["drawioTheme"]=="minimal") echo ' selected'; ?>><?php p($l->t("Minimal")) ?></option>
<option value="atlas"<?php if ($_["drawioTheme"]=="atlas") echo ' selected'; ?>><?php p($l->t("Atlas")) ?></option>
<option value="dark"<?php if ($_["drawioTheme"]=="dark") echo ' selected'; ?>><?php p($l->t("Dark")) ?></option>
<option value="kennedy"<?php if ($_["drawioTheme"] === "kennedy") echo ' selected'; ?>><?php p($l->t("Kennedy")) ?></option>
<option value="minimal"<?php if ($_["drawioTheme"] === "minimal") echo ' selected'; ?>><?php p($l->t("Minimal")) ?></option>
<option value="atlas"<?php if ($_["drawioTheme"] === "atlas") echo ' selected'; ?>><?php p($l->t("Atlas")) ?></option>
<option value="dark"<?php if ($_["drawioTheme"] === "dark") echo ' selected'; ?>><?php p($l->t("Dark")) ?></option>
</select>
</p>

Expand All @@ -26,8 +26,8 @@
<p class="drawio-header">
<label for='overrideXml'><?php p($l->t("Associate XML files with Draw.io?")) ?>
<select id="overrideXml">
<option value="yes"<?php if ($_["drawioOverrideXml"]=="yes") echo ' selected'; ?>><?php p($l->t("Yes")) ?></option>
<option value="no"<?php if ($_["drawioOverrideXml"]=="no") echo ' selected'; ?>><?php p($l->t("No")) ?></option>
<option value="yes"<?php if ($_["drawioOverrideXml"] === "yes") echo ' selected'; ?>><?php p($l->t("Yes")) ?></option>
<option value="no"<?php if ($_["drawioOverrideXml"] === "no") echo ' selected'; ?>><?php p($l->t("No")) ?></option>
</select>
</p>

Expand All @@ -36,8 +36,8 @@
<p class="drawio-header">
<label for='offlineMode'><?php p($l->t("Activate offline mode in Draw.io?")) ?>
<select id="offlineMode">
<option value="yes"<?php if ($_["drawioOfflineMode"]=="yes") echo ' selected'; ?>><?php p($l->t("Yes")) ?></option>
<option value="no"<?php if ($_["drawioOfflineMode"]=="no") echo ' selected'; ?>><?php p($l->t("No")) ?></option>
<option value="yes"<?php if ($_["drawioOfflineMode"] === "yes") echo ' selected'; ?>><?php p($l->t("Yes")) ?></option>
<option value="no"<?php if ($_["drawioOfflineMode"] === "no") echo ' selected'; ?>><?php p($l->t("No")) ?></option>
</select>
</p>

Expand All @@ -46,8 +46,8 @@
<p class="drawio-header">
<label for='drawioAutosave'><?php p($l->t("Activate autosave?")) ?>
<select id="drawioAutosave">
<option value="yes"<?php if ($_["drawioAutosave"]=="yes") echo ' selected'; ?>><?php p($l->t("Yes")) ?></option>
<option value="no"<?php if ($_["drawioAutosave"]=="no") echo ' selected'; ?>><?php p($l->t("No")) ?></option>
<option value="yes"<?php if ($_["drawioAutosave"] === "yes") echo ' selected'; ?>><?php p($l->t("Yes")) ?></option>
<option value="no"<?php if ($_["drawioAutosave"] === "no") echo ' selected'; ?>><?php p($l->t("No")) ?></option>
</select>
</p>

Expand Down

0 comments on commit b15480d

Please sign in to comment.