1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-12 17:54:44 +02:00

Change default for the grid setting in AdminThemeUikit (percents vs classes), seems enough time has passed that this is a good/safe new default.

This commit is contained in:
Ryan Cramer
2020-12-29 07:56:35 -05:00
parent d3b1ab2983
commit ebf60018e6
2 changed files with 9 additions and 10 deletions

View File

@@ -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() {

View File

@@ -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;
}