diff options
author | daita <maxence@pontapreta.net> | 2016-11-21 04:13:13 +0300 |
---|---|---|
committer | daita <maxence@pontapreta.net> | 2016-11-21 04:13:13 +0300 |
commit | 002e4cee6b0ad78b3137081f2669a09a4121a0b1 (patch) | |
tree | e21a3a91e9023318138756079674a0293893fbae | |
parent | a937021247fb592672d8b086c98d98980ef0bb43 (diff) |
add option 'index federated shares'
-rw-r--r-- | js/settings.admin.js | 18 | ||||
-rw-r--r-- | lib/Controller/SettingsController.php | 4 | ||||
-rw-r--r-- | lib/Items/ItemDocument.php | 24 | ||||
-rw-r--r-- | lib/Service/ConfigService.php | 1 | ||||
-rw-r--r-- | lib/Service/FileService.php | 6 | ||||
-rw-r--r-- | templates/settings.admin.php | 11 |
6 files changed, 62 insertions, 2 deletions
diff --git a/js/settings.admin.js b/js/settings.admin.js index 63d5cb9..52a9f24 100644 --- a/js/settings.admin.js +++ b/js/settings.admin.js @@ -68,6 +68,8 @@ $(document) .is(':checked')) ? 1 : 0, index_files_sharelink : ($('#solr_index_files_sharelink') .is(':checked')) ? 1 : 0, + index_files_federated : ($('#solr_index_files_federated') + .is(':checked')) ? 1 : 0, index_files_external : ($('#solr_index_files_external') .is(':checked')) ? 1 : 0, index_files_encrypted : ($('#solr_index_files_encrypted') @@ -90,6 +92,10 @@ $(document) data.index_files_sharelink = (data.index_files_sharelink == 1) ? 0 : 1; + if (switched == 'index_files_federated') + data.index_files_federated = (data.index_files_federated == 1) ? 0 + : 1; + if (switched == 'index_files_external') data.index_files_external = (data.index_files_external == 1) ? 0 : 1; @@ -174,7 +180,7 @@ $(document) index_delay : $('#solr_index_delay').val(), force_index : force_index } - + if (switched == 'index_live') data.index_live = (data.index_live == 1) ? 0 : 1; @@ -233,6 +239,8 @@ $(document) (response.index_files_nextant_only == 1)); $('#solr_index_files_sharelink').prop('checked', (response.index_files_sharelink == 1)); + $('#solr_index_files_federated').prop('checked', + (response.index_files_federated == 1)); $('#solr_index_files_external').prop('checked', (response.index_files_external == 1)); $('#solr_index_files_encrypted').prop('checked', @@ -599,12 +607,20 @@ $(document) .savesuboptions_files('index_files_sharelink'); }); + $('#solr_index_files_federated') + .mousedown( + function() { + nextantSettings + .savesuboptions_files('index_files_federated'); + }); + $('#solr_index_files_external') .mousedown( function() { nextantSettings .savesuboptions_files('index_files_external'); }); + $('#solr_index_files_encrypted') .mousedown( function() { diff --git a/lib/Controller/SettingsController.php b/lib/Controller/SettingsController.php index a9809b2..51214c6 100644 --- a/lib/Controller/SettingsController.php +++ b/lib/Controller/SettingsController.php @@ -100,6 +100,7 @@ class SettingsController extends Controller 'index_files_tree' => $this->configService->getAppValue('index_files_tree'), 'index_files_nextant_only' => $this->configService->getAppValue('index_files_nextant_only'), 'index_files_sharelink' => $this->configService->getAppValue('index_files_sharelink'), + 'index_files_federated' => $this->configService->getAppValue('index_files_federated'), 'index_files_external' => $this->configService->getAppValue('index_files_external'), 'index_files_encrypted' => $this->configService->getAppValue('index_files_encrypted'), 'index_files_filters_text' => $this->configService->getAppValue('index_files_filters_text'), @@ -127,12 +128,13 @@ class SettingsController extends Controller return $response; } - public function setOptionsFiles($index_files, $index_files_max_size, $index_files_tree, $index_files_nextant_only, $index_files_sharelink, $index_files_external, $index_files_encrypted, $index_files_filters) + public function setOptionsFiles($index_files, $index_files_max_size, $index_files_tree, $index_files_nextant_only, $index_files_sharelink, $index_files_federated, $index_files_external, $index_files_encrypted, $index_files_filters) { $this->configService->setAppValue('index_files', $index_files); $this->configService->setAppValue('index_files_tree', $index_files_tree); $this->configService->setAppValue('index_files_nextant_only', $index_files_nextant_only); $this->configService->setAppValue('index_files_sharelink', $index_files_sharelink); + $this->configService->setAppValue('index_files_federated', $index_files_federated); $this->configService->setAppValue('index_files_external', $index_files_external); $this->configService->setAppValue('index_files_encrypted', $index_files_encrypted); $this->configService->setAppValue('index_files_max_size', $index_files_max_size); diff --git a/lib/Items/ItemDocument.php b/lib/Items/ItemDocument.php index 632d0c0..b19ad69 100644 --- a/lib/Items/ItemDocument.php +++ b/lib/Items/ItemDocument.php @@ -35,6 +35,8 @@ class ItemDocument const TYPE_BOOKMARK = 'bookmarks'; + private $test = false; + private $type; private $source; @@ -77,6 +79,8 @@ class ItemDocument private $external = false; + private $federated = false; + private $shared = false; private $encrypted = false; @@ -135,6 +139,16 @@ class ItemDocument return (int) $this->id; } + public function test($test) + { + $this->test = $test; + } + + public function isTest() + { + return $this->test; + } + public function setSource($source) { $this->source = $source; @@ -310,6 +324,16 @@ class ItemDocument return $this->storage; } + public function federated($fed) + { + $this->federated = $fed; + } + + public function isFederated() + { + return $this->federated; + } + public function needExtract($need) { $this->needExtract = $need; diff --git a/lib/Service/ConfigService.php b/lib/Service/ConfigService.php index 644857f..0c44355 100644 --- a/lib/Service/ConfigService.php +++ b/lib/Service/ConfigService.php @@ -55,6 +55,7 @@ class ConfigService 'index_files_tree' => 0, 'index_files_nextant_only' => 0, 'undex_files_sharelink' => 0, + 'index_files_federated' => 0, 'index_files_external' => 0, 'index_files_encrypted' => 0, 'index_files_max_size' => 40, diff --git a/lib/Service/FileService.php b/lib/Service/FileService.php index 6a5af9a..756bc78 100644 --- a/lib/Service/FileService.php +++ b/lib/Service/FileService.php @@ -174,6 +174,12 @@ class FileService { $item->synced(true); + // $this->miscService->log('-- local: ' . (($item->getStorage() + // ->isLocal()) ? 'y' : 'n') . ' -- external: ' . (($item->isExternal()) ? 'y' : 'n') . ' -- encrypted:' . (($item->isEncrypted()) ? 'y' : 'n') . ' -- test: ' . (($item->isTest()) ? 'y' : 'n') . ' -- ' . $item->getPath()); + + if ($item->isFederated() && $this->configService->getAppValue('index_files_federated') !== '1') + return false; + if ($item->isExternal() && $this->configService->getAppValue('index_files_external') !== '1') return false; diff --git a/templates/settings.admin.php b/templates/settings.admin.php index b8fd751..6962383 100644 --- a/templates/settings.admin.php +++ b/templates/settings.admin.php @@ -127,12 +127,23 @@ style('nextant', 'admin'); <tr style="height: 30px;"> <td class="nextant_admin_left"> + <?php p($l->t('Index Federated Shares :')) ?></td> + <td colspan="2"><input type="checkbox" + name="solr_index_files_federated" + id="solr_index_files_federated" value="1" style="margin: 10px;"></td> + </tr> + + + <tr style="height: 30px;"> + <td class="nextant_admin_left"> <?php p($l->t('Index External Storage :')) ?></td> <td colspan="2"><input type="checkbox" name="solr_index_files_external" id="solr_index_files_external" value="1" style="margin: 10px;"></td> </tr> + + <tr style="height: 30px;"> <td class="nextant_admin_left"> <?php p($l->t('Index Encrypted Files :')) ?></td> |