Skip to content

Commit

Permalink
Breadcrumbs url route
Browse files Browse the repository at this point in the history
  • Loading branch information
JustCarmen committed Dec 10, 2017
1 parent c8582b2 commit 469c759
Showing 1 changed file with 61 additions and 61 deletions.
122 changes: 61 additions & 61 deletions app/Template/AdminTemplate.php
Expand Up @@ -49,69 +49,69 @@ private function pageHeader(PageController $controller) {

private function pageBody(PageController $controller) {
echo Bootstrap4::breadcrumbs([
'admin.php' => I18N::translate('Control panel'),
'admin_modules.php' => I18N::translate('Module administration'),
route('admin-control-panel') => I18N::translate('Control panel'),
route('admin-modules') => I18N::translate('Module administration'),
'module.php?mod=' . $this->getName() . '&mod_action=admin_config' => $this->getTitle(),
], $controller->getPageTitle()); ?>
<h1><?= $controller->getPageTitle() ?></h1>
<div class="alert alert-info alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="' . I18N::translate('close') . '">
<span aria-hidden="true">&times;</span>
</button>
<p class="small"><?= I18N::translate('Check the plugins you want to use in the sidebar.') ?></p>
<p class="small"><?= I18N::translate('Hit the radio button in front of an research area title to set that research area as default. The chosen research area will open unfolded in the sidebar.') ?></p>
</div>
<form class="form-horizontal" method="post" name="configform" action="<?= $this->getConfigLink() ?>">
<input type="hidden" name="action" value="save"><?= Filter::getCsrf() ?>
<!-- SELECT ALL -->
<?= Bootstrap4::checkbox(I18N::translate('select all'), true, ['name' => 'select-all']) ?>
<!-- RESEARCH LINKS -->
<?php foreach ($this->getPluginList() as $area => $plugins): ?>
<div class="form-group form-check">
<label class="form-check-label">
<?php
// reset returns the first value in an array
// we take the area code from the first plugin in this area
$area_code = reset($plugins)->getSearchArea(); ?>
<input
class="form-check-input"
type="radio"
name="FRL_DEFAULT_AREA"
value="<?= $area_code ?>"
<?php if ($this->getPreference('FRL_DEFAULT_AREA') === $area_code): ?>
checked="checked"
<?php endif; ?>
>
<span class="h4"><?= $area ?></span>
</label>
</div>

<h1><?= $controller->getPageTitle() ?></h1>
<div class="alert alert-info alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="' . I18N::translate('close') . '">
<span aria-hidden="true">&times;</span>
</button>
<p class="small"><?= I18N::translate('Check the plugins you want to use in the sidebar.') ?></p>
<p class="small"><?= I18N::translate('Hit the radio button in front of an research area title to set that research area as default. The chosen research area will open unfolded in the sidebar.') ?></p>
</div>
<form class="form-horizontal" method="post" name="configform" action="<?= $this->getConfigLink() ?>">
<input type="hidden" name="action" value="save"><?= Filter::getCsrf() ?>
<!-- SELECT ALL -->
<?= Bootstrap4::checkbox(I18N::translate('select all'), true, ['name' => 'select-all']) ?>
<!-- RESEARCH LINKS -->
<?php foreach ($this->getPluginList() as $area => $plugins): ?>
<div class="form-group form-check">
<label class="form-check-label">
<?php
// reset returns the first value in an array
// we take the area code from the first plugin in this area
$area_code = reset($plugins)->getSearchArea(); ?>
<input
class="form-check-input"
type="radio"
name="FRL_DEFAULT_AREA"
value="<?= $area_code ?>"
<?php if ($this->getPreference('FRL_DEFAULT_AREA') === $area_code): ?>
checked="checked"
<?php endif; ?>
>
<span class="h4"><?= $area ?></span>
</label>
</div>

<div class="row form-group col-sm-12">
<?php
$FRL_PLUGINS = $this->getEnabledPlugins($plugins);
<div class="row form-group col-sm-12">
<?php
$FRL_PLUGINS = $this->getEnabledPlugins($plugins);
foreach ($plugins as $label => $plugin):
?>
<div class="col-sm-4 checkbox" dir="ltr">
<label>
<input type="checkbox" name="NEW_FRL_PLUGINS[]" value="<?= $label ?>"<?= in_array($label, $FRL_PLUGINS) ? ' checked' : '' ?>>
<?= $plugin->getPluginName() ?>
</label>
</div>
<?php endforeach; ?>
</div>
<?php endforeach; ?>
<div class="form-group col-sm-12">
<button type="submit" class="btn btn-primary">
<i class="fa fa-check"></i>
<?= I18N::translate('save') ?>
</button>
<button type="reset" class="btn btn-primary" onclick="if (confirm('<?= I18N::translate('The settings will be reset to default. Are you sure you want to do this?') ?>'))
window.location.href = 'module.php?mod=<?= $this->getName() ?>&amp;mod_action=admin_reset';">
<i class="fa fa-recycle"></i>
<?= I18N::translate('reset') ?>
</button>
</div>
</form>
<?php
?>
<div class="col-sm-4 checkbox" dir="ltr">
<label>
<input type="checkbox" name="NEW_FRL_PLUGINS[]" value="<?= $label ?>"<?= in_array($label, $FRL_PLUGINS) ? ' checked' : '' ?>>
<?= $plugin->getPluginName() ?>
</label>
</div>
<?php endforeach; ?>
</div>
<?php endforeach; ?>
<div class="form-group col-sm-12">
<button type="submit" class="btn btn-primary">
<i class="fa fa-check"></i>
<?= I18N::translate('save') ?>
</button>
<button type="reset" class="btn btn-primary" onclick="if (confirm('<?= I18N::translate('The settings will be reset to default. Are you sure you want to do this?') ?>'))
window.location.href = 'module.php?mod=<?= $this->getName() ?>&amp;mod_action=admin_reset';">
<i class="fa fa-recycle"></i>
<?= I18N::translate('reset') ?>
</button>
</div>
</form>
<?php
}
}

0 comments on commit 469c759

Please sign in to comment.