-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathlist_tools.php
44 lines (39 loc) · 1.32 KB
/
list_tools.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
/**
* Hilfsmethoden für rex_yfom_list.
*
* @package redaxo\yform\manager
*/
class rex_yform_list_tools
{
public static function listFormat($p, $value = '')
{
if ('' != $value) {
$p['value'] = $value;
}
switch ($p['list']->getValue('type_id')) {
case 'validate':
$styleClass = 'yform-manager-type-validate';
$p['value'] = str_replace(',', ', ', $p['value']);
break;
case 'action':
$styleClass = 'yform-manager-type-action';
break;
default:
$styleClass = 'yform-manager-type-default';
break;
}
if ('label' == $p['field']) {
$p['value'] = rex_i18n::translate($p['value']);
}
return '<td class="' . $styleClass . '">' . $p['value'] . '</td>';
}
public static function editFormat($p)
{
return self::listFormat($p, $p['list']->getColumnLink(rex_i18n::msg('yform_function'), '<i class="rex-icon rex-icon-editmode"></i> ' . rex_i18n::msg('yform_edit')));
}
public static function deleteFormat($p)
{
return self::listFormat($p, $p['list']->getColumnLink(rex_i18n::msg('yform_delete'), '<i class="rex-icon rex-icon-delete"></i> ' . rex_i18n::msg('yform_delete')));
}
}