Skip to content

Commit

Permalink
Improve comments/argument names.
Browse files Browse the repository at this point in the history
  • Loading branch information
demiankatz committed Dec 9, 2024
1 parent 6d160ee commit 0441266
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions module/VuFindTheme/src/VuFindTheme/Initializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ public function init()
}
self::$themeInitialized = true;

// Determine the current theme:
// Determine the current theme (this sets the ui cookie as a side effect,
// which we will need to use in the line below):
$currentTheme = $this->pickTheme(
isset($this->event) ? $this->event->getRequest() : null
);
Expand Down Expand Up @@ -277,30 +278,30 @@ protected function pickTheme(?Request $request)
/**
* Make the theme options available to the view.
*
* @param string $currentTheme Active theme
* @param string $activeThemeOption Active theme option (ui cookie, not actual theme name)
*
* @return void
*/
protected function sendThemeOptionsToView($currentTheme)
protected function sendThemeOptionsToView($activeThemeOption)
{
// Get access to the view model:
if (PHP_SAPI !== 'cli') {
$viewModel = $this->serviceManager->get('ViewManager')->getViewModel();

// Send down the view options:
$viewModel->setVariable('themeOptions', $this->getThemeOptions($currentTheme));
$viewModel->setVariable('themeOptions', $this->getThemeOptions($activeThemeOption));
}
}

/**
* Return an array of information about user-selectable themes. Each entry in
* the array is an associative array with 'name', 'desc' and 'selected' keys.
*
* @param string $currentTheme Active theme
* @param string $activeThemeOption Active theme (ui cookie, not actual theme name)
*
* @return array
*/
protected function getThemeOptions($currentTheme)
protected function getThemeOptions($activeThemeOption)
{
$options = [];
if (isset($this->config->selectable_themes)) {
Expand All @@ -313,7 +314,7 @@ protected function getThemeOptions($currentTheme)
if (!empty($name)) {
$options[] = [
'name' => $name, 'desc' => $desc,
'selected' => ($currentTheme == $name),
'selected' => ($activeThemeOption == $name),
];
}
}
Expand Down

0 comments on commit 0441266

Please sign in to comment.