diff options
-rw-r--r-- | js/settings.admin.js | 20 | ||||
-rw-r--r-- | lib/Controller/SettingsController.php | 16 | ||||
-rw-r--r-- | lib/Service/ConfigService.php | 2 | ||||
-rw-r--r-- | templates/settings.admin.php | 40 |
4 files changed, 59 insertions, 19 deletions
diff --git a/js/settings.admin.js b/js/settings.admin.js index b4e3068..4ab11fa 100644 --- a/js/settings.admin.js +++ b/js/settings.admin.js @@ -50,6 +50,8 @@ $(document) '#solr_index_files_max_size').val(), index_files_external_index : ($('#solr_index_files_external_index') .is(':checked')) ? 1 : 0, + index_bookmarks : ($('#solr_index_bookmarks') + .is(':checked')) ? 1 : 0, display_result : $('#solr_display_result') .val(), index_files_needed : index_files_needed @@ -66,6 +68,10 @@ $(document) data.index_files_external_index = (data.index_files_external_index == 1) ? 0 : 1; + if (switched == 'index_bookmarks') + data.index_bookmarks = (data.index_bookmarks == 1) ? 0 + : 1; + $.post(OC.filePath('nextant', 'ajax/settings', 'option.php'), data, nextantSettings.updatesuboptions); @@ -125,6 +131,17 @@ $(document) + response.display_result + '"]') .prop('selected', true); + if (response.bookmarks_app_enabled) { + $('#nextant_bookmarks_appdisabled').hide(delay); + $('#nextant_bookmarks_appenabled').show(delay); + + $('#solr_index_bookmarks').prop('checked', + (response.index_bookmarks == 1)); + } else { + $('#nextant_bookmarks_appdisabled').show(delay); + $('#nextant_bookmarks_appenabled').hide(delay); + } + if (response.configured == 0) { $('#solr_current_docs').text( 'Nextant is not configured yet'); @@ -381,6 +398,9 @@ $(document) $('#solr_display_result').on('change', function() { nextantSettings.savesuboptions(); }); + $('#solr_index_bookmarks').mousedown(function() { + nextantSettings.savesuboptions('index_bookmarks'); + }); nextantSettings.init(); diff --git a/lib/Controller/SettingsController.php b/lib/Controller/SettingsController.php index 4e3267c..382de75 100644 --- a/lib/Controller/SettingsController.php +++ b/lib/Controller/SettingsController.php @@ -83,30 +83,36 @@ class SettingsController extends Controller 'instant' => $instant, 'configured' => $this->configService->getAppValue('configured'), 'ping' => $this->solrAdmin->ping($error), + 'solr_url' => $this->configService->getAppValue('solr_url'), + 'solr_core' => $this->configService->getAppValue('solr_core'), 'nextant_version' => $this->configService->getAppValue('installed_version') . ' (beta)', - 'current_docs' => $this->solrTools->count('files', $error), 'index_files_last' => $this->configService->getAppValue('index_files_last'), 'index_files_last_format' => date('r', $this->configService->getAppValue('index_files_last')), 'index_files_needed' => $this->configService->getAppValue('index_files_needed'), 'index_files_max_size' => $this->configService->getAppValue('index_files_max_size'), - 'display_result' => $this->configService->getAppValue('display_result'), 'index_files_live_extract' => $this->configService->getAppValue('index_files_live_extract'), 'index_files_live_update' => $this->configService->getAppValue('index_files_live_update'), 'index_files_external_index' => $this->configService->getAppValue('index_files_external_index'), - 'solr_url' => $this->configService->getAppValue('solr_url'), - 'solr_core' => $this->configService->getAppValue('solr_core'), + 'display_result' => $this->configService->getAppValue('display_result'), + 'current_docs' => $this->solrTools->count('files', $error), + 'bookmarks_app_enabled' => (\OCP\App::isEnabled('bookmarks')), + 'index_bookmarks' => $this->configService->getAppValue('index_bookmarks'), + 'index_bookmarks_needed' => $this->configService->getAppValue('index_bookmarks_needed'), + 'index_bookmarks_last' => $this->configService->getAppValue('index_bookmarks_last'), + 'index_bookmarks_last_format' => date('r', $this->configService->getAppValue('index_bookmarks_last')), 'index_locked' => $this->configService->getAppValue('index_locked') ); return $response; } - public function setOptions($index_files_live_extract, $index_files_live_update, $index_files_max_size, $index_files_external_index, $display_result, $index_files_needed) + public function setOptions($index_files_live_extract, $index_files_live_update, $index_files_max_size, $index_files_external_index, $index_bookmarks, $display_result, $index_files_needed) { $this->configService->setAppValue('index_files_live_extract', $index_files_live_extract); $this->configService->setAppValue('index_files_live_update', $index_files_live_update); $this->configService->setAppValue('index_files_external_index', $index_files_external_index); $this->configService->setAppValue('index_files_max_size', $index_files_max_size); + $this->configService->setAppValue('index_bookmarks', $index_bookmarks); $this->configService->setAppValue('display_result', $display_result); if ($index_files_needed == 1) $this->configService->needIndexFiles(true, true); diff --git a/lib/Service/ConfigService.php b/lib/Service/ConfigService.php index ae24d10..e3109c0 100644 --- a/lib/Service/ConfigService.php +++ b/lib/Service/ConfigService.php @@ -62,7 +62,7 @@ class ConfigService 'index_files_live_update' => 0, 'index_files_max_size' => 40, - 'index_bookmarks' => 0, + 'index_bookmarks' => 1, 'index_bookmarks_needed' => 1, 'index_bookmarks_last' => 0 ]; diff --git a/templates/settings.admin.php b/templates/settings.admin.php index 4993d3b..066bb99 100644 --- a/templates/settings.admin.php +++ b/templates/settings.admin.php @@ -104,7 +104,12 @@ style('nextant', 'admin'); <td><input type="checkbox" name="solr_index_files_live_update" id="solr_index_files_live_update" value="1" style="margin: 10px;"></td> </tr> + <tr style="height: 30px;"> + <td class="nextant_admin_left"> + <?php p($l->t('Last index :')) ?></td> + <td><div id="solr_index_files_last"></div></td> + </tr> <!-- @@ -116,14 +121,6 @@ style('nextant', 'admin'); </tr> --> - <tr style="height: 30px;"> - <td class="nextant_admin_left"> - <?php p($l->t('Display result :')) ?></td> - <td><select id="solr_display_result" style="width: 260px;"> - <option value="1">Nextant style</option> - <option value="2">Integrated to the Files</option> - </select></td> - </tr> <tr> <td> </td> @@ -133,6 +130,21 @@ style('nextant', 'admin'); <td class="nextant_admin_head">Indexing Bookmarks</td> </tr> + + + <tr style="height: 30px;"> + <td class="nextant_admin_left"> + <?php p($l->t('Index bookmarks :')) ?></td> + <td> + <div id="nextant_bookmarks_appdisabled">Bookmarks disabled</div> + <div id="nextant_bookmarks_appenabled"> + <input type="checkbox" name="solr_index_bookmarks" + id="solr_index_bookmarks" value="1" style="margin: 10px;"> + </div> + </td> + </tr> + + <tr> <td> </td> </tr> @@ -143,15 +155,17 @@ style('nextant', 'admin'); <tr style="height: 30px;"> <td class="nextant_admin_left"> - <?php p($l->t('Number of documents :')) ?></td> - <td><div id="solr_current_docs"></div></td> + <?php p($l->t('Display result :')) ?></td> + <td><select id="solr_display_result" style="width: 260px;"> + <option value="1">Nextant style</option> + <option value="2">Integrated to Files</option> + </select></td> </tr> <tr style="height: 30px;"> <td class="nextant_admin_left"> - <?php p($l->t('Last index :')) ?></td> - <td><div id="solr_index_files_last"></div></td> - + <?php p($l->t('Number of documents :')) ?></td> + <td><div id="solr_current_docs"></div></td> </tr> <tr> |