1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-13 10:15:28 +02:00

Minor AdminThemeUikit updates plus move access certain shared admin theme labels into AdminTheme::getLabels() method

This commit is contained in:
Ryan Cramer
2020-07-10 12:34:15 -04:00
parent 9c2c5e986e
commit 4f98dc974a
6 changed files with 32 additions and 6 deletions

View File

@@ -165,6 +165,25 @@ abstract class AdminTheme extends WireData implements Module {
return parent::get($key);
}
/**
* Get predefined translated label by key for labels shared among admin themes
*
* @param string $key
* @param string $val Value to return if label not available
* @return string
* @since 3.0.162
*
*/
public function getLabel($key, $val = '') {
switch($key) {
case 'search-help': return $this->_('help'); // Localized term to type for search-engine help (3+ chars)
case 'search-tip': return $this->_('Try “help”'); // // Search tip (indicating your translated “help” term)
case 'advanced-mode': return $this->_('Advanced Mode');
case 'debug': return $this->_('Debug');
}
return $val;
}
/**
* Returns true if this admin theme is the one that will be used for this request
*