1: <?php
2:
3:
4: defined('_JOOS_CORE') or exit();
5:
6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17:
18: class pluginAutoadminTableStatusChange implements joosAutoadminPluginsTable
19: {
20: public static function render(joosModel $obj, array $element_param, $key, $value, stdClass $values, $option)
21: {
22: $element_param = array_merge_recursive($element_param, array(
23: 'html_table_element_param' =>
24: array(
25: 'statuses' =>
26: array(
27: 0 => 'Активно',
28: 1 => 'Не активно'
29: ),
30: 'images' => array(
31: 0 => 'remove',
32: 1 => 'ok'
33: )
34: ),
35: )
36: );
37:
38: $style = isset($element_param['html_table_element_param']['images'][$value]) ? $element_param['html_table_element_param']['images'][$value] : 'error.png';
39: $text = isset($element_param['html_table_element_param']['statuses'][$value]) ? $element_param['html_table_element_param']['statuses'][$value] : 'ERROR';
40:
41: return '
42: <button class="btn btn-mini js-tooltip js-set_state" title="' . $text . '" data-id="' . $values->id . '" data-state="'.$values->state.'">
43: <i class="icon-'.$style.'"></i>
44: </button>';
45:
46: }
47:
48: }
49: