Commit 9590a268 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Add config option to turn off view theme selector


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent b473db7d
...@@ -771,6 +771,9 @@ function ViewManager() { ...@@ -771,6 +771,9 @@ function ViewManager() {
* Wire up the view theme selector * Wire up the view theme selector
*/ */
this.rewriteViewThemeSelector = function() { this.rewriteViewThemeSelector = function() {
if (!self.viewThemeSelect) {
return;
}
var currentTheme = self.viewThemeSelect.selectedIndex; var currentTheme = self.viewThemeSelect.selectedIndex;
connect(self.viewThemeSelect, 'onchange', function(e) { connect(self.viewThemeSelect, 'onchange', function(e) {
var choice = self.viewThemeSelect.options[self.viewThemeSelect.selectedIndex]; var choice = self.viewThemeSelect.options[self.viewThemeSelect.selectedIndex];
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
<td> <td>
<a id="layout-link" href="columns.php?id={$view}&amp;c={$category}&amp;new={$new}"{if !$can_change_layout} class="disabled"{/if}>{str tag='changeviewlayout' section='view'}</a> {contextualhelp plugintype="core" pluginname="view" section="changeviewlayout"} <a id="layout-link" href="columns.php?id={$view}&amp;c={$category}&amp;new={$new}"{if !$can_change_layout} class="disabled"{/if}>{str tag='changeviewlayout' section='view'}</a> {contextualhelp plugintype="core" pluginname="view" section="changeviewlayout"}
</td> </td>
{if $viewthemes}
<td class="center"> <td class="center">
<label for="viewtheme-select">{str tag=theme}: </label> <label for="viewtheme-select">{str tag=theme}: </label>
<select id="viewtheme-select" name="viewtheme"> <select id="viewtheme-select" name="viewtheme">
...@@ -35,6 +36,7 @@ ...@@ -35,6 +36,7 @@
{/foreach} {/foreach}
</select> </select>
</td> </td>
{/if}
<td class="right"> <td class="right">
<a id="btn-displaymyview" href="view.php?id={$view}&amp;new={$new}">{str tag=displaymyview section=view} &raquo;</a></td> <a id="btn-displaymyview" href="view.php?id={$view}&amp;new={$new}">{str tag=displaymyview section=view} &raquo;</a></td>
</td> </td>
......
...@@ -237,8 +237,10 @@ $smarty->assign('groupid', $group); ...@@ -237,8 +237,10 @@ $smarty->assign('groupid', $group);
$smarty->assign('institution', $institution); $smarty->assign('institution', $institution);
$smarty->assign('can_change_layout', (!$USER->get_account_preference('addremovecolumns') || ($view->get('numcolumns') > 1 && $view->get('numcolumns') < 5))); $smarty->assign('can_change_layout', (!$USER->get_account_preference('addremovecolumns') || ($view->get('numcolumns') > 1 && $view->get('numcolumns') < 5)));
$smarty->assign('viewtheme', $viewtheme); if (get_config('userscanchooseviewthemes')) {
$smarty->assign('viewthemes', $allowedthemes); $smarty->assign('viewtheme', $viewtheme);
$smarty->assign('viewthemes', $allowedthemes);
}
$smarty->assign('viewid', $view->get('id')); $smarty->assign('viewid', $view->get('id'));
$smarty->assign('viewtitle', $viewtitle); $smarty->assign('viewtitle', $viewtitle);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment