Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #26: Fix 'Use local library' option. #29

Merged
merged 1 commit into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions islandora_mirador.module
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ function islandora_mirador_library_info_alter(&$libraries, $extension) {
if ($config->get('mirador_library_installation_type') == 'local') {
unset($libraries['mirador']['remote']);
unset($libraries['mirador']['license']);
unset($libraries['mirador']['js']);
$libraries['mirador']['js']['/libraries/mirador/dist/main.js'] = [];
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/Form/MiradorConfigForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@

namespace Drupal\islandora_mirador\Form;

use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\islandora_mirador\Annotation\IslandoraMiradorPlugin;
use Drupal\islandora_mirador\IslandoraMiradorPluginManager;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
* Mirador Settings Form.
*/
class MiradorConfigForm extends ConfigFormBase {

/**
* @var \Drupal\islandora_mirador\IslandoraMiradorPluginManager
*/
Expand Down Expand Up @@ -40,6 +42,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
'local'=> $this->t('Local library placed in /libraries inside your webroot.'),
'remote' => $this->t('Default remote location'),
],
'#description' => $this->t("For local, put the output of 'npm run webpack' of <a href=\"https://github.com/roblib/mirador-integration-islandora\">Mirador Integration Islandora</a> into web/library/mirador/dist/ and ensure it's named main.js."),
'#default_value' => $config->get('mirador_library_installation_type'),
];

Expand Down