1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-09 16:26:59 +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
*

View File

@@ -261,6 +261,13 @@ class AdminThemeUikit extends AdminThemeFramework implements Module, Configurabl
*
* This updates the Inputfield classes and settings for Uikit.
*
* - themeBorder: none, hide, card, line
* - themeOffset: s, m, l
* - themeInputSize: s, m, l
* - themeInputWidth: xs, s, m, l, f
* - themeColor: primary, secondary, warning, danger, success, highlight, none
* - themeBlank: no input borders, true or false
*
* @param HookEvent $event
*
*/

View File

@@ -12,7 +12,7 @@ if(!defined("PROCESSWIRE")) die();
<!-- FOOTER -->
<footer id='pw-footer' class='uk-margin'>
<div class='pw-container uk-container uk-container-expand'>
<div uk-grid>
<div class='uk-grid' uk-grid>
<div class='uk-width-1-3@m uk-flex-last@m uk-text-right@m uk-text-center'>
<div id='pw-uk-debug-toggle' class='uk-text-small'></div>
</div>
@@ -24,7 +24,7 @@ if(!defined("PROCESSWIRE")) die();
<?php
echo $config->versionName . ' <!--v' . $config->systemVersion . '--> &copy; ' . date("Y");
if($adminTheme->isEditor && $config->advanced) {
echo "<br />" . $adminTheme->renderNavIcon('flask') . $this->_('Advanced Mode');
echo "<br />" . $adminTheme->renderNavIcon('flask') . $adminTheme->getLabel('advanced-mode');
}
?>
</small>

View File

@@ -14,7 +14,7 @@ if(!defined("PROCESSWIRE")) die();
</a>
<!-- OFFCANVAS NAVIGATION -->
<div id="offcanvas-nav" uk-offcanvas>
<div id="offcanvas-nav" class="uk-offcanvas" uk-offcanvas>
<div class="uk-offcanvas-bar">
<p id="offcanvas-nav-header">
<a id="offcanvas-nav-close" href='#offcanvas-nav' class='uk-text-muted' onclick='return false;' data-uk-toggle>

View File

@@ -6,8 +6,8 @@ if(!defined("PROCESSWIRE")) die();
/** @var AdminThemeUikit $adminTheme */
$searchURL = $urls->admin . 'page/search/live/';
$helpTerm = $this->_('help'); // Localized term to type for help (3+ chars)
$helpNote = $this->_('Try “help”'); // Short instruction (with your translated help term)
$helpTerm = $adminTheme->getLabel('search-help'); // Localized term to type for help (3+ chars)
$helpNote = $adminTheme->getLabel('search-tip');
if($adminTheme->isEditor): ?>
<form class='pw-search-form' data-action='<?php echo $searchURL; ?>' action='<?php echo $searchURL; ?>' method='get'>

View File

@@ -140,7 +140,7 @@ $config->set('SystemNotifications', array(
$classes = InputfieldWrapper::getClasses();
$classes['form'] = 'InputfieldFormNoWidths InputfieldFormVertical uk-form-vertical';
$classes['list'] = 'Inputfields uk-grid-collapse uk-grid-match';
$classes['list'] = 'Inputfields uk-grid uk-grid-collapse uk-grid-match';
$classes['list_clearfix'] = 'uk-clearfix';
$classes['item_column_width_first'] = 'InputfieldColumnWidthFirst uk-first-column';
$classes['item'] = 'Inputfield {class} Inputfield_{name}'; // . ($adminTheme->get('useOffset') ? ' InputfieldIsOffset' : '');