mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Add 'partial' type to list columns.
This commit is contained in:
parent
e62f72e235
commit
8b7bbd1062
@ -53,12 +53,12 @@ class FormField
|
||||
public $options;
|
||||
|
||||
/**
|
||||
* @var string Specifies a side. Possible values: auto, left, right, full
|
||||
* @var string Specifies a side. Possible values: auto, left, right, full.
|
||||
*/
|
||||
public $span = 'full';
|
||||
|
||||
/**
|
||||
* @var string Specifies a size. Possible values: tiny, small, large, huge, giant
|
||||
* @var string Specifies a size. Possible values: tiny, small, large, huge, giant.
|
||||
*/
|
||||
public $size = 'large';
|
||||
|
||||
@ -88,12 +88,12 @@ class FormField
|
||||
public $comment;
|
||||
|
||||
/**
|
||||
* @var string Specifies the comment position
|
||||
* @var string Specifies the comment position.
|
||||
*/
|
||||
public $commentPosition = 'below';
|
||||
|
||||
/**
|
||||
* @var string Specifies if the comment is in HTML format
|
||||
* @var string Specifies if the comment is in HTML format.
|
||||
*/
|
||||
public $commentHtml = false;
|
||||
|
||||
|
@ -56,10 +56,20 @@ class ListColumn
|
||||
public $cssClass;
|
||||
|
||||
/**
|
||||
* @var string Specify a format or style for the column value, such as a Date
|
||||
* @var string Specify a format or style for the column value, such as a Date.
|
||||
*/
|
||||
public $format;
|
||||
|
||||
/**
|
||||
* @var string Specifies a path for partial-type fields.
|
||||
*/
|
||||
public $path;
|
||||
|
||||
/**
|
||||
* @var array Raw field configuration.
|
||||
*/
|
||||
public $config;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
@ -96,6 +106,7 @@ class ListColumn
|
||||
if (isset($config['select'])) $this->sqlSelect = $config['select'];
|
||||
if (isset($config['relation'])) $this->relation = $config['relation'];
|
||||
if (isset($config['format'])) $this->format = $config['format'];
|
||||
if (isset($config['path'])) $this->path = $config['path'];
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
@ -598,6 +598,14 @@ class Lists extends WidgetBase
|
||||
// Value processing
|
||||
//
|
||||
|
||||
/**
|
||||
* Process as boolean switch
|
||||
*/
|
||||
public function evalPartialTypeValue($value, $column)
|
||||
{
|
||||
return $this->controller->makePartial($column->path ?: $column->columnName, ['value' => $value, 'column' => $column]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Process as boolean switch
|
||||
*/
|
||||
|
@ -8,10 +8,10 @@ use Validator;
|
||||
use System\Classes\SystemException;
|
||||
use System\Classes\ApplicationException;
|
||||
use October\Rain\Support\ValidationException;
|
||||
use Exception;
|
||||
use RecursiveIteratorIterator;
|
||||
use RecursiveDirectoryIterator;
|
||||
use RecursiveIteratorIterator;
|
||||
use ArrayAccess;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* This is a base class for all CMS objects - content files, pages, partials and layouts.
|
||||
|
Loading…
x
Reference in New Issue
Block a user