1: <?php defined('_JOOS_CORE') or exit();
2:
3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15:
16: class modelAdminPages extends modelPages
17: {
18: public function get_fieldinfo()
19: {
20: return array('id' => array(
21: 'name' => 'ID',
22: 'editable' => false,
23: 'in_admintable' => false,
24: 'html_table_element' => 'value',
25: 'html_table_element_param' => array(
26: 'width' => '20px',
27: 'align' => 'center'
28: )
29: ),
30: 'title' => array('name' => 'Заголовок',
31: 'editable' => true,
32: 'sortable' => true,
33: 'in_admintable' => true,
34: 'html_edit_element' => 'edit',
35: 'html_table_element' => 'editlink',
36: ),
37: 'state' => array('name' => 'Состояние',
38: 'editable' => true,
39: 'sortable' => true,
40: 'in_admintable' => true,
41: 'editlink' => true,
42: 'html_edit_element' => 'checkbox',
43: 'html_table_element' => 'status_change',
44: 'html_edit_element_param' => array(
45: 'text' => 'Разрешён / Активирован',
46: ),
47: ),
48: 'slug' => array('name' => 'Ссылка',
49: 'editable' => true,
50: 'sortable' => true,
51: 'in_admintable' => true,
52: 'html_table_element' => 'value',
53: 'html_table_element_param' => array(),
54: 'html_edit_element' => 'extra',
55: 'html_edit_element_param' => array(
56: 'call_from' => 'modelAdminPages::get_slug',
57: ),
58: ),
59: 'text' => array('name' => 'Описание',
60: 'editable' => true,
61: 'html_edit_element' => 'wysiwyg',
62: 'html_edit_element_param' => array('editor'=>'redactor'),
63: ),
64: 'created_at' => array(
65: 'name' => 'Создано',
66: 'editable' => true,
67: 'in_admintable' => true,
68: 'html_edit_element' => 'value',
69: 'html_table_element' => 'date_format',
70: 'html_table_element_param' => array(
71: 'date_format' => 'd F в H:m',
72: 'width' => '200px',
73: 'align' => 'center'
74: )
75: ),
76:
77: );
78: }
79:
80: public function get_tableinfo()
81: {
82: return array('header_main' => 'Страницы',
83: 'header_list' => 'Все страницы',
84: 'header_new' => 'Создание страницы',
85: 'header_edit' => 'Редактирование страницы');
86: }
87:
88: public function get_tabsinfo()
89: {
90: return array(
91: 'first' => array(
92: 'title' => 'Основное',
93: 'fields' => array('title', 'created_at', 'state', 'slug', 'text')
94: ),
95: 'second' => array(
96: 'title' => 'Вторая вкладка',
97: 'fields' => array('text')
98: )
99: );
100: }
101:
102: public static function get_slug($item)
103: {
104: return '
105: <input type="text" style="width: 50%;" class="text_area" size="30" value="' . $item->slug . '" name="slug" id="slug">
106: <span class="g-pseudolink" id="pages_slug_generator" obj_id="' . $item->id . '">Сформировать</span>
107: ';
108: }
109:
110: }
111: