Newer
Older
function filter($text, $row) {
$link = $this->getLink($row);
return sprintf('<a class="preview" data-preview="#tickets/%d/preview" href="%s">%s</a>',
$row['ticket_id'], $link, $text);
}
}
QueueColumnFilter::register('TicketLinkWithPreviewFilter');
class QueueColDataConfigForm
extends AbstractForm {
function buildFields() {
return array(
'primary' => new DataSourceField(array(
'label' => __('Primary Data Source'),
'required' => true,
'configuration' => array(
'root' => 'Ticket',
),
'layout' => new GridFluidCell(6),
)),
'secondary' => new DataSourceField(array(
'label' => __('Secondary Data Source'),
'configuration' => array(
'root' => 'Ticket',
),
'layout' => new GridFluidCell(6),
)),
'heading' => new TextboxField(array(
'label' => __('Heading'),
'required' => true,
'layout' => new GridFluidCell(3),
)),
'filter' => new ChoiceField(array(
'label' => __('Filter'),
'choices' => QueueColumnFilter::getFilters(),
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
'layout' => new GridFluidCell(3),
)),
'width' => new TextboxField(array(
'label' => __('Width'),
'default' => 75,
'configuration' => array(
'validator' => 'number',
),
'layout' => new GridFluidCell(3),
)),
'truncate' => new ChoiceField(array(
'label' => __('Text Overflow'),
'choices' => array(
'wrap' => __("Wrap Lines"),
'ellipsis' => __("Add Ellipsis"),
'clip' => __("Clip Text"),
),
'default' => 'wrap',
'layout' => new GridFluidCell(3),
)),
);
}
}