Skip to content

Commit

Permalink
Merge pull request #16 from owncloud/new-settings
Browse files Browse the repository at this point in the history
Use new settings registration style
  • Loading branch information
Vincent Petry authored Jul 4, 2017
2 parents 0e8b071 + ead8fb0 commit 10c8ee3
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 28 deletions.
4 changes: 0 additions & 4 deletions appinfo/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
*
*/


// --- register settings -----------------------------------------------
\OCP\App::registerAdmin('search_elastic', 'settings/admin');

$mode = \OC::$server->getConfig()->getAppValue('search_elastic', 'mode', 'active');
if ($mode === 'active') {
// --- add js & css -----------------------------------------------
Expand Down
5 changes: 4 additions & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<licence>Commercial</licence>
<author>ownCloud Inc.</author>
<dependencies>
<owncloud min-version="9.0" max-version="9.1" />
<owncloud min-version="10.0" max-version="10.0" />
</dependencies>
<types>
<filesystem/>
Expand All @@ -15,5 +15,8 @@
<description>This app uses a separate elasticsearch cluster to enable
searching in content and meta data of files.
</description>
<settings>
<admin>OCA\search_elastic\AdminPanel</admin>
</settings>
</info>

35 changes: 35 additions & 0 deletions lib/adminpanel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php
/**
* ownCloud
*
* @author Jörn Friedrich Dreyer <[email protected]>
* @copyright (C) 2017 ownCloud GmbH
*
* This code is covered by the ownCloud Commercial License.
*
* You should have received a copy of the ownCloud Commercial License
* along with this program. If not, see <https://owncloud.com/licenses/owncloud-commercial/>.
*
*/

namespace OCA\search_elastic;

use OCP\Settings\ISettings;

class AdminPanel implements ISettings {

public function getPanel() {
return new \OCP\Template('search_elastic', 'settings/admin');
}

public function getSectionID() {
return 'search';
}

public function getPriority() {
return 50;
}

}


22 changes: 0 additions & 22 deletions settings/admin.php

This file was deleted.

6 changes: 5 additions & 1 deletion templates/settings/admin.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<?php
script('search_elastic', 'settings/admin');
style('search_elastic', 'settings/admin');
?>
<div class="section" id="searchElasticSettings" >

<h2><?php p($l->t('Elasticsearch'));?></h2>
<h2 class="appname"><?php p($l->t('Elasticsearch'));?></h2>
<div>
<span class="icon"></span>

Expand Down

0 comments on commit 10c8ee3

Please sign in to comment.