From ebf60018e67bc72c7e89220cad049ae8708f453c Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Tue, 29 Dec 2020 07:56:35 -0500 Subject: [PATCH] Change default for the grid setting in AdminThemeUikit (percents vs classes), seems enough time has passed that this is a good/safe new default. --- wire/core/Fieldtype.php | 8 ++++---- .../AdminTheme/AdminThemeUikit/AdminThemeUikit.module | 11 +++++------ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/wire/core/Fieldtype.php b/wire/core/Fieldtype.php index d55b0495..45e21619 100644 --- a/wire/core/Fieldtype.php +++ b/wire/core/Fieldtype.php @@ -1412,12 +1412,12 @@ abstract class Fieldtype extends WireData implements Module { * */ public function ___replacePageField(Page $src, Page $dst, Field $field) { - $database = $this->wire('database'); + $database = $this->wire()->database; $table = $database->escapeTable($field->table); $this->emptyPageField($dst, $field); // move the data $sql = "UPDATE `$table` SET pages_id=:dstID WHERE pages_id=:srcID"; - $query = $this->wire('database')->prepare($sql); + $query = $database->prepare($sql); $query->bindValue(':dstID', (int) $dst->id); $query->bindValue(':srcID', (int) $src->id); $result = $query->execute(); @@ -1442,7 +1442,7 @@ abstract class Fieldtype extends WireData implements Module { * */ public function ___deleteTemplateField(Template $template, Field $field) { - return $this->wire('fields')->deleteFieldDataByTemplate($field, $template); + return $this->wire()->fields->deleteFieldDataByTemplate($field, $template); } /** @@ -1521,7 +1521,7 @@ abstract class Fieldtype extends WireData implements Module { * * #pw-group-other * - * @throws WireException Should throw an Exception if uninstsall can't be completed. + * @throws WireException Should throw an Exception if uninstall can't be completed. * */ public function ___uninstall() { diff --git a/wire/modules/AdminTheme/AdminThemeUikit/AdminThemeUikit.module b/wire/modules/AdminTheme/AdminThemeUikit/AdminThemeUikit.module index bddde1d6..bbaa4dcf 100644 --- a/wire/modules/AdminTheme/AdminThemeUikit/AdminThemeUikit.module +++ b/wire/modules/AdminTheme/AdminThemeUikit/AdminThemeUikit.module @@ -18,7 +18,7 @@ * @property int $maxWidth Maximum layout width in pixels, or 0 for no max (default=1600). * @property bool|int $groupNotices Whether or not notices should be grouped by type * @property string $inputSize Size for input/select elements. One of "s" for small, "m" for medium (default), or "l" for large. - * @property bool|int $noGrid When true, do not use uk-width classes for Inputfields (use CSS percentages instead). + * @property bool|int $ukGrid When true, use uk-width classes for Inputfields (rather than CSS percentages). * * */ @@ -81,8 +81,7 @@ class AdminThemeUikit extends AdminThemeFramework implements Module, Configurabl $this->set('maxWidth', 1600); $this->set('groupNotices', true); $this->set('inputSize', 'm'); // m=medium (default), s=small, l=large - $this->set('noGrid', false); - + $this->set('ukGrid', false); $this->setClasses(array( 'input' => 'uk-input', 'input-small' => 'uk-input uk-form-small', @@ -150,7 +149,7 @@ class AdminThemeUikit extends AdminThemeFramework implements Module, Configurabl } } - if($this->noGrid) { + if(!$this->ukGrid) { $this->addClass('body', 'AdminThemeUikitNoGrid'); } @@ -285,7 +284,7 @@ class AdminThemeUikit extends AdminThemeFramework implements Module, Configurabl $isWrapper = $inputfield instanceof InputfieldWrapper && !$isFieldset && !$isMarkup; $ukWidthClass = 'uk-width-1-1'; $globalInputSize = $this->get('inputSize'); - $noGrid = $this->get('noGrid'); + $ukGrid = $this->get('ukGrid'); $themeColor = ''; $themeBorder = ''; $themeOffset = ''; @@ -309,7 +308,7 @@ class AdminThemeUikit extends AdminThemeFramework implements Module, Configurabl return; // no further settings needed for button } - if(!$noGrid) { + if($ukGrid) { $ukWidthClass = $this->getUkWidthClass($columnWidth, $widths); if($ukWidthClass) $wrapClasses[] = $ukWidthClass; }