1: <?php defined('_JOOS_CORE') or exit();
2:
3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15:
16: class joosAutoadmin
17: {
18: private static $js_onformsubmit = array();
19:
20: private static $data;
21: private static $data_overload = false;
22:
23: private static $option;
24: private static $task;
25:
26: 27: 28:
29: private static $active_model_name;
30: private static $active_actions_class;
31: private static $active_menu_name;
32:
33: public static function get($param)
34: {
35: return self::$$param;
36: }
37:
38: public static function dispatch()
39: {
40: $id = joosRequest::int('id', 0);
41: $page = joosRequest::int('page', false, $_GET);
42:
43: $page = $page ? $page : 0;
44: $id = $id ? $id : $page;
45:
46: $task = joosRequest::param('task', 'index');
47: $option = joosRequest::param('option', 'site');
48: $class = 'actionsAdmin' . joosInflector::camelize($option);
49:
50: self::$active_actions_class = $class;
51: self::$option = $option;
52: self::$task = $task;
53:
54:
55: joosDocument::instance()->add_js_file(JPATH_SITE . '/core/libraries/autoadmin/media/js/autoadmin.js');
56:
57: !JDEBUG ? : joosDebug::add('joosAutoadmin::dispatch() - ' . $class . '::' . $task);
58:
59:
60: method_exists($class, 'action_before') ? call_user_func_array($class . '::action_before', array(self::$task)) : null;
61:
62: $events_name = sprintf('controller.admin.*');
63: joosEvents::has_events($events_name) ? joosEvents::fire_events($events_name, $class, $task) : null;
64:
65: $events_name = sprintf('controller.admin.%s.*', $class);
66: joosEvents::has_events($events_name) ? joosEvents::fire_events($events_name, $task) : null;
67:
68: $events_name = sprintf('controller.admin.%s.%s', $class, $task);
69: joosEvents::has_events($events_name) ? joosEvents::fire_events($events_name) : null;
70:
71: if (method_exists($class, $task)) {
72:
73: $results = call_user_func_array($class . '::' . $task, array($option, $id, $page, $task));
74: method_exists($class, 'action_after') ? call_user_func_array($class . '::action_after', array(self::$task)) : null;
75: } elseif (method_exists($class, 'index')) {
76:
77: $results = call_user_func_array($class . '::index', array($option, $id, $page, $task));
78: method_exists($class, 'action_after') ? call_user_func_array($class . '::action_after', array(self::$task)) : null;
79: } else {
80:
81: throw new joosException('Контроллер :controller, либо требуемая задача :task не найдены.', array(':controller' => $class, ':task' => $task));
82: }
83:
84: if (is_array($results)) {
85:
86: self::views($results, self::$option, self::$task);
87: } elseif (is_string($results)) {
88:
89: echo $results;
90: }
91:
92:
93: method_exists($class, 'action_after') ? call_user_func_array($class . '::action_after', array()) : null;
94: }
95:
96: private static function views(array $params, $controller, $method)
97: {
98: $template = isset($params['template']) ? $params['template'] : 'default';
99: $views = isset($params['method']) ? $params['method'] : $method;
100:
101: extract($params, EXTR_OVERWRITE);
102: $viewfile = JPATH_BASE . DS . 'app' . DS . 'components' . DS . $controller . DS . 'views_admin' . DS . $views . DS . $template . '.php';
103:
104: joosFile::exists($viewfile) ? require ($viewfile) : null;
105: }
106:
107:
108: public static function dispatch_ajax()
109: {
110: $id = joosRequest::int('id', 0);
111: $page = joosRequest::int('page', false, $_GET);
112:
113: $page = $page ? $page : 0;
114: $id = $id ? $id : $page;
115:
116: $task = joosRequest::param('task', 'index');
117: $option = joosRequest::param('option');
118: $class = 'actionsAjaxAdmin' . ucfirst($option);
119:
120: JDEBUG ? joosDebug::add($class . '::' . $task) : null;
121:
122:
123: method_exists($class, 'action_before') ? call_user_func_array($class . '::action_before', array()) : null;
124:
125: $events_name = sprintf('ajax.controller.admin.*');
126: joosEvents::has_events($events_name) ? joosEvents::fire_events($events_name, $class, $task) : null;
127:
128: $events_name = sprintf('ajax.controller.admin.%s.*', $class);
129: joosEvents::has_events($events_name) ? joosEvents::fire_events($events_name, $task) : null;
130:
131: $events_name = sprintf('ajax.controller.admin.%s.%s', $class, $task);
132: joosEvents::has_events($events_name) ? joosEvents::fire_events($events_name) : null;
133:
134: if (method_exists($class, $task)) {
135: $result = call_user_func_array($class . '::' . $task, array($option, $id, $page, $task));
136: } else {
137: $result = call_user_func_array($class . '::index', array($option, $id, $page, $task));
138: }
139:
140:
141: method_exists($class, 'action_after') ? call_user_func_array($class . '::action_after', array($task, $result)) : null;
142:
143: if (is_array($result)) {
144: echo json_encode($result);
145: } elseif (is_string($result)) {
146: echo $result;
147: }
148: }
149:
150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160:
161: public static function listing(joosModel $obj, array $obj_list, joosAdminPagenator $pagenav, array $fields_list, $group_by = '')
162: {
163:
164: $option = joosRequest::param('option');
165: $task = joosRequest::param('task');
166:
167: $fields_info = $obj->get_fieldinfo();
168:
169: $header = $obj->get_tableinfo();
170:
171: $header_extra = self::get_extrainfo($obj);
172: $header_extra = self::prepare_extra($obj, $header_extra);
173:
174: joosAdminView::set_param('component_title', isset($header['header_main']) ? $header['header_main'] : '');
175: joosAdminView::set_param('component_header', $header['header_list']);
176:
177: $class = self::$active_actions_class;
178: joosAdminView::set_param('submenu', $class::get_submenu());
179: joosAdminView::set_param('current_model', self::get_active_menu_name());
180:
181:
182: $fields_to_table = array();
183:
184: $table_headers = '';
185:
186: foreach ($fields_list as $field) {
187:
188: if (isset($fields_info[$field]['in_admintable']) && $fields_info[$field]['in_admintable'] == TRUE) {
189:
190:
191: $width = isset($fields_info[$field]['html_table_element_param']['width']) ? ' width="' . $fields_info[$field]['html_table_element_param']['width'] . '"' : '';
192:
193:
194: $class = isset($fields_info[$field]['html_table_element_param']['class']) ? ' class="' . $fields_info[$field]['html_table_element_param']['class'] . '"' : '';
195:
196: $table_headers .= '<th ' . $width . $class . '>' . $fields_info[$field]['name'] . '</th>';
197: $fields_to_table[] = $field;
198: }
199: }
200: joosAdminView::set_listing_param('table_headers', $table_headers);
201:
202:
203: $table_body = '';
204: $n = count($fields_to_table);
205: $k = 1;
206: $i = 0;
207: foreach ($obj_list as $values) {
208: $dop_class = $group_by ? $group_by . '-' . $values->$group_by : '';
209:
210: $table_body .= '<tr class="row-' . $k . '" ' . ($group_by ? ' data-obj-ordering="' . $values->ordering . '"' : '') . ' data-obj-id="' . $values->{$obj->get_key_field()} . '" id="adminlist-row-' . $values->{$obj->get_key_field()} . '" rel="' . $dop_class . '">';
211: $table_body .= '<td align="center">' . joosHtml::id_box($i, $values->{$obj->get_key_field()}) . '</td>';
212: for ($index = 0; $index < $n; $index++) {
213: $current_value = isset($values->$fields_to_table[$index]) ? $values->$fields_to_table[$index] : null;
214: $data = joosAutoadmin::get_listing_html_element($obj, $fields_info[$fields_to_table[$index]], $fields_to_table[$index], $current_value, $values, $option);
215: $class = isset($fields_info[$fields_to_table[$index]]['html_table_element_param']['class']) ? ' class="' . $fields_info[$fields_to_table[$index]]['html_table_element_param']['class'] . '"' : '';
216: $align = isset($fields_info[$fields_to_table[$index]]['html_table_element_param']['align']) ? ' align="' . $fields_info[$fields_to_table[$index]]['html_table_element_param']['align'] . '" ' : '';
217:
218: $table_body .= '<td ' . $align . $class . '>' . $data . '</td>';
219: }
220: $table_body .= '</tr>';
221: $k = 1 - $k;
222: ++$i;
223: }
224: joosAdminView::set_listing_param('table_body', $table_body);
225:
226:
227:
228: require_once JTEMPLATE_ADMIN_BASE . DS . 'html' . DS . 'listing.php';
229:
230: }
231:
232: public static function get_listing_html_element(joosModel $obj, array $element_param, $key, $value, stdClass $values, $option)
233: {
234: $class_file = JPATH_BASE . '/app/plugins/autoadmin/table.' . $element_param['html_table_element'] . '.php';
235: $class_name = 'pluginAutoadminTable' . self::get_plugin_name($element_param['html_table_element']);
236:
237: if (!joosFile::exists($class_file)) {
238: throw new joosAutoadminFilePluginNotFoundException(sprintf('Файл плагина joosAutoadmin %s для вывода элемента %s не найден', $class_file, $class_name));
239: }
240:
241: require_once $class_file;
242:
243: if (!class_exists($class_name)) {
244: throw new joosAutoadminClassPlugionNotFoundException(sprintf('Класс для обработки %s средствами joosAutoadmin в файле %s не найден', $class_file, $class_name));
245: }
246:
247:
248: $text_limit = isset($element_param['html_table_element_param']['text_limit']) ? $element_param['html_table_element_param']['text_limit'] : false;
249: if ($text_limit) {
250: $value = joosText::character_limiter($value, $text_limit);
251: }
252:
253: return call_user_func_array($class_name . '::render', array($obj, $element_param, $key, $value, $values, $option));
254: }
255:
256: 257: 258: 259: 260: 261: 262: 263: 264:
265: public static function edit(joosModel $obj, $obj_data, $params = null)
266: {
267: self::$active_model_name = get_class($obj);
268:
269: $option = joosRequest::param('option');
270: $task = joosRequest::param('task');
271:
272:
273: if (!$params) {
274: $params = array(
275:
276:
277: 'label_begin' => '<div class="control-group">', 'label_end' => '', 'el_begin' => '<div class="controls">', 'el_end' => '</div></div>');
278:
279:
280:
281: }
282:
283:
284: $header = $obj->get_tableinfo();
285:
286: joosAdminView::set_param('component_title', isset($header['header_main']) ? $header['header_main'] : '');
287: joosAdminView::set_param('component_header', $obj_data->{$obj->get_key_field()} > 0 ? $header['header_edit'] : $header['header_new']);
288:
289: $class = self::$active_actions_class;
290: joosAdminView::set_param('submenu', $class::get_submenu());
291: joosAdminView::set_param('current_model', self::get_active_model_name());
292:
293:
294:
295:
296:
297:
298:
299:
300: $_elements = array();
301:
302: $fields_info = $obj->get_fieldinfo();
303: foreach ($fields_info as $key => $field) {
304: if ($field['editable'] == true && !(isset($field['hide_on']) && $field['hide_on'] === $task)):
305: $v = isset($obj_data->$key) ? $obj_data->$key : '';
306: $_elements[$key] = self::get_edit_html_element($field, $key, $v, $obj_data, $params);
307: endif;
308: }
309:
310:
311:
312: 313: 314: 315: 316: 317: 318: 319: 320: 321: 322: 323: 324: 325: 326: 327: 328: 329: 330: 331: 332: 333: 334: 335: 336: 337: 338: 339: 340: 341: 342: 343: 344: 345: 346: 347: 348: 349:
350:
351: 352: 353: 354: 355: 356: 357: 358: 359: 360: 361:
362:
363:
364:
365:
366:
367:
368:
369: require_once JTEMPLATE_ADMIN_BASE . DS . 'html' . DS . 'edit.php';
370: }
371:
372:
373: public static function get_edit_html_element($element_param, $key, $value, $obj_data, $params)
374: {
375: $class_file = JPATH_BASE . '/app/plugins/autoadmin/edit.' . $element_param['html_edit_element'] . '.php';
376: $class_name = 'pluginAutoadminEdit' . self::get_plugin_name($element_param['html_edit_element']);
377:
378: if (!joosFile::exists($class_file)) {
379: throw new joosAutoadminFilePluginNotFoundException(sprintf('Файл плагина joosAutoadmin %s для редактирования элемента %s не найден', $class_file, $class_name));
380: }
381:
382: require_once $class_file;
383:
384: if (!class_exists($class_name)) {
385: throw new joosAutoadminClassPlugionNotFoundException(sprintf('Класс для обработки %s средствами joosAutoadmin в файле %s не найден', $class_file, $class_name));
386: }
387:
388: return call_user_func_array($class_name . '::render', array($element_param, $key, $value, $obj_data, $params));
389: }
390:
391: public static function add_js_onformsubmit($js_raw_code)
392: {
393: self::$js_onformsubmit[] = $js_raw_code;
394: }
395:
396:
397: public static function pagenav($total)
398: {
399: $com_name = self::$option;
400:
401: $limit = (int) joosSession::get_user_state_from_request("{$com_name}_viewlistlimit", 'limit', joosConfig::get2('admin', 'list_limit', 25));
402: $limitstart = (int) joosSession::get_user_state_from_request("{$com_name}_limitstart" . self::get_active_model_name(), 'limitstart', 0);
403:
404: return new joosAdminPagenator($total, $limitstart, $limit);
405: }
406:
407: 408: 409: 410: 411: 412: 413: 414: 415: 416:
417: public static function header(array $extra = array(), $task = '')
418: {
419:
420: require_once JTEMPLATE_ADMIN_BASE . DS . 'html' . DS . 'table_header.php';
421:
422:
423: 424: 425:
426:
427:
428: }
429:
430:
431: public static function table_body()
432: {
433: require_once JTEMPLATE_ADMIN_BASE . DS . 'html' . DS . 'table_body.php';
434: }
435:
436:
437:
438:
439: public static function get_component_title($name)
440: {
441: 442: 443:
444: $admin_model = 'admin' . ucfirst($name);
445:
446: $admin_model = new $admin_model;
447: $titles = $admin_model->get_tableinfo();
448: $component_title = isset($titles['header_main']) ? $titles['header_main'] : '';
449:
450: return $component_title;
451: }
452:
453: 454: 455: 456: 457: 458: 459: 460:
461: public static function get_component_submenu($component)
462: {
463: $controller = 'actionsAdmin' . ucfirst($component);
464:
465: if (isset($controller::$submenu)) {
466: return $controller::$submenu;
467: }
468:
469: return false;
470: }
471:
472:
473: public static function autoajax()
474: {
475:
476:
477: $task = joosRequest::param('task');
478:
479: $obj_id = joosRequest::int('obj_id', 0, $_POST);
480:
481: $obj_key = joosRequest::post('obj_key');
482:
483: $model = joosRequest::param('obj_model');
484:
485: if (!$model) {
486: return false;
487: }
488:
489: $return_onj = new stdClass();
490:
491: if (class_exists($model)) {
492:
493: $obj = new $model;
494:
495: switch ($task) {
496:
497: case 'status_change':
498: $obj->load($obj_id);
499:
500: $obj->change_state($obj_key);
501:
502:
503: $fields_info = $obj->get_fieldinfo();
504:
505: $fields_info[$obj_key] = array_merge_recursive($fields_info[$obj_key], array('html_table_element_param' => array('statuses' => array(0 => 'Скрыто', 1 => 'Опубликовано'), 'images' => array(0 => 'publish_x.png', 1 => 'publish_g.png',))));
506:
507:
508: $return_onj->image = isset($fields_info[$obj_key]['html_table_element_param']['images'][!$obj->$obj_key]) ? $fields_info[$obj_key]['html_table_element_param']['images'][!$obj->$obj_key] : 'error.png';
509: $return_onj->mess = isset($fields_info[$obj_key]['html_table_element_param']['statuses'][!$obj->$obj_key]) ? $fields_info[$obj_key]['html_table_element_param']['statuses'][!$obj->$obj_key] : 'ERROR';
510: $return_onj->new_class = $obj->$obj_key ? 'icon-remove' : 'icon-ok';
511: break;
512:
513: default:
514: return false;
515: break;
516: }
517:
518: echo json_encode($return_onj);
519:
520: return true;
521: }
522:
523: $return_onj->image = 'error.png';
524: $return_onj->mess = 'error-class';
525:
526: echo json_encode($return_onj);
527:
528: return false;
529: }
530:
531: private static function prepare_extra(joosModel $obj, array $extra_data)
532: {
533: if (self::$data === NULL) {
534:
535: $results = array();
536: $hidden_elements = array();
537: $wheres_filter = array('true');
538: $wheres_search = array();
539:
540: foreach ($extra_data as $key => $value) {
541: switch ($key) {
542:
543: case 'search':
544: $results[] = joosHtml::label(array('for' => 'search_elements'), 'Поиск');
545:
546: $search_value = joosSession::get_user_state_from_request("search-" . $obj->get_class_name(), 'search', false);
547:
548: $results[] = joosHtml::input(array('name' => 'search_elements', 'id' => 'search_elements'), $search_value);
549: $hidden_elements[] = joosHtml::hidden('search', $search_value);
550:
551: if ($search_value !== false && joosString::trim($search_value) != '') {
552: foreach ($value as $selected_value) {
553: $wheres_search[] = sprintf('%s LIKE ( %s )', joosDatabase::instance()->get_name_quote($selected_value), joosDatabase::instance()->get_quoted("%" . $search_value . "%"));
554: }
555: }
556: break;
557:
558: case 'filter':
559:
560: foreach ($value as $params_key => $params_value) {
561:
562: $field_name = $params_key;
563: $field_title = $value[$field_name]['name'];
564:
565: $results[] = joosHtml::label(array('for' => 'filter_' . $field_name), $field_title);
566:
567: $datas_for_select = array(-1 => 'Всё сразу');
568: $datas_for_select += (isset($value[$field_name]['call_from']) && is_callable($value[$field_name]['call_from'])) ? call_user_func($value[$field_name]['call_from'], $obj, $params_key) : array();
569:
570: $selected_value = joosSession::get_user_state_from_request('filter-' . '-' . $field_name . '-' . $obj->get_class_name(), $field_name, -1);
571: $selected_value = $selected_value === '0' ? '0' : $selected_value;
572:
573: $results[] = joosHtml::dropdown(array('name' => 'filter_' . $field_name, 'data-obj-name' => $field_name, 'class' => 'filter_elements', 'selected' => $selected_value), $datas_for_select);
574:
575: $hidden_elements[] = joosHtml::hidden($field_name, $selected_value);
576: if (($selected_value && $selected_value != -1) OR $selected_value === '0') {
577: $wheres_filter[] = sprintf('%s=%s', joosDatabase::instance()->get_name_quote($field_name), joosDatabase::instance()->get_quoted($selected_value));
578: }
579: }
580: break;
581:
582: case 'extrafilter':
583: $datas_for_select = array(-1 => 'Всё сразу');
584: foreach ($value as $params_key => $params_value) {
585:
586: $field_name = $params_key;
587:
588: $datas_for_select += array($params_key => $value[$field_name]['name']);
589: }
590:
591: $selected_value = joosSession::get_user_state_from_request("extrafilter-" . $obj->get_class_name(), 'filter_extrafilter', -1);
592:
593: $results[] = joosHtml::label(array('for' => 'filter_extrafilter'), 'Фильтр');
594: $results[] = joosHtml::dropdown(array('name' => 'filter_extrafilter_selector', 'class' => 'extrafilter_elements', 'options' => $datas_for_select, 'selected' => $selected_value));
595: $hidden_elements[] = joosHtml::hidden('filter_extrafilter', $selected_value);
596:
597:
598: self::$data_overload = ($selected_value && isset($value[$selected_value]['call_from']) && is_callable($value[$selected_value]['call_from'])) ? $value[$selected_value]['call_from'] : array();
599: break;
600:
601: default:
602: break;
603: }
604: }
605:
606: $wheres = array(implode(' AND ', $wheres_filter),);
607:
608: if (count($wheres_search) > 0) {
609: $wheres[] = ' (' . implode(' OR ', $wheres_search) . ' )';
610: }
611:
612: self::$data = array('for_header' => $results, 'hidden_ellements' => implode("\n", $hidden_elements), 'wheres' => implode(' AND ', $wheres), 'data_overload' => self::$data_overload);
613: }
614:
615: return self::$data;
616: }
617:
618: private static function get_extrainfo(joosModel $obj)
619: {
620: $fields_info = $obj->get_fieldinfo();
621: $header_extra = $obj->get_extrainfo();
622:
623: if (isset($fields_info['state'])) {
624: $header_extra['filter'] = isset($header_extra['filter']) ? $header_extra['filter'] : array();
625: $header_extra['filter'] += array('state' => array('name' => 'Состояние', 'call_from' => 'joosAutoadmin::get_state_selector',));
626: }
627:
628: return $header_extra;
629: }
630:
631: public static function get_count(joosModel $obj)
632: {
633: $header_extra = self::get_extrainfo($obj);
634:
635: $header_extra = self::prepare_extra($obj, $header_extra);
636:
637: $params = array('where' => $header_extra['wheres'], 'only_count' => true);
638:
639: return self::$data_overload ? call_user_func(self::$data_overload, $params) : $obj->count('WHERE ' . $header_extra['wheres']);
640: }
641:
642: public static function get_list(joosModel $obj, $params)
643: {
644: $header_extra = self::get_extrainfo($obj);
645: $header_extra = self::prepare_extra($obj, $header_extra);
646:
647: if (isset($params['where'])) {
648: $params['where'] = $header_extra['wheres'] . ' AND ' . $params['where'];
649: } else {
650: $params['where'] = $header_extra['wheres'];
651: }
652:
653: return self::$data_overload ? call_user_func(self::$data_overload, $params) : $obj->get_list($params);
654: }
655:
656: public static function get_state_selector()
657: {
658: return array(0 => 'Не активно', 1 => 'Активно');
659: }
660:
661: private static function get_plugin_name($string)
662: {
663: return joosInflector::camelize($string);
664: }
665:
666: public static function set_active_model_name($model_name)
667: {
668: self::$active_model_name = $model_name;
669: }
670:
671: public static function get_active_model_name()
672: {
673: return self::$active_model_name;
674: }
675:
676: 677: 678: 679: 680:
681: public static function get_active_model_obj()
682: {
683: return new self::$active_model_name;
684: }
685:
686: public static function set_active_menu_name($menu_name)
687: {
688: return self::$active_menu_name = $menu_name;
689: }
690:
691: public static function get_active_menu_name()
692: {
693: return self::$active_menu_name;
694: }
695:
696: public static function get_option()
697: {
698: return self::$option;
699: }
700:
701: }
702:
703: class joosAutoadminHTML
704: {
705:
706: public static function controller_header($title, $class = 'config', array $extra = array())
707: {
708: $extra = count($extra) > 0 ? self::prepare_header_extra($extra) : '';
709: $title = $title != false ? sprintf('<th class="%s">%s</th>', $class, $title) : '';
710:
711: return sprintf('<table class="adminheading"><tbody><tr>%s%s</tr></tbody></table>', $title, $extra);
712: }
713:
714: private static function prepare_header_extra(array $elemets_array)
715: {
716: return '<td align="right">' . implode("\n", $elemets_array) . '</td>';
717: }
718:
719: }
720:
721: class joosAdminToolbarButtons
722: {
723: public static function listing($type = '')
724: {
725: switch ($type) {
726:
727: case 'create':
728: default:
729: return '
730: <button class="btn btn-large js-toolbar js-tooltip js-toolbar_once" data-toolbar="create" title="Добавить запись">
731: <i class="icon-plus-sign"></i> Добавить
732: </button>';
733: break;
734:
735: case 'publish':
736: return '
737: <button class="btn btn-large js-toolbar js-tooltip" data-toolbar="publish" title="Разрешить">
738: <i class="icon-ok"></i>
739: </button>';
740: break;
741:
742: case 'unpublish':
743: return '
744: <button class="btn btn-large js-toolbar js-tooltip" data-toolbar="unpublish" title="Запретить">
745: <i class="icon-remove"></i>
746: </button>';
747: break;
748:
749: case 'remove':
750: return '
751: <button class="btn btn-large js-toolbar js-tooltip" data-toolbar="remove" title="Удалить">
752: <i class="icon-trash"></i>
753: </button>';
754: break;
755:
756: }
757: }
758:
759: public static function edit($type = '')
760: {
761: switch ($type) {
762:
763: case 'save':
764: default:
765: return '
766: <button class="btn btn-large js-toolbar js-tooltip" data-toolbar="save" title="Сохранить изменения">
767: <i class="icon-ok-circle"></i> Сохранить
768: </button>';
769: break;
770:
771: case 'apply':
772: return '
773: <button class="btn btn-large js-toolbar js-tooltip" data-toolbar="apply" title="Применить изменения">
774: <i class="icon-ok-circle"></i> <i class="icon-refresh"></i>
775: </button>';
776: break;
777:
778: case 'save_and_new':
779: return '
780: <button class="btn btn-large js-toolbar js-tooltip" data-toolbar="save_and_new" title="Сохранить изменения и добавить новую запись">
781: <i class="icon-ok-circle"></i> <i class="icon-plus-sign"></i>
782: </button>';
783: break;
784:
785: case 'remove':
786: return '
787: <button class="btn btn-large js-toolbar js-tooltip" data-toolbar="remove" title="Удалить">
788: <i class="icon-trash"></i>
789: </button>';
790: break;
791:
792: case 'cancel':
793: return '
794: <button class="btn btn-large js-toolbar js-tooltip" data-toolbar="cancel" title="Отменить">
795: <i class="icon-ban-circle"></i> Отменить
796: </button>';
797: break;
798:
799: }
800: }
801: }
802:
803: interface joosAutoadminPluginsTable
804: {
805: public static function render(joosModel $obj, array $element_param, $key, $value, stdClass $values, $option);
806:
807: }
808:
809: interface joosAutoadminPluginsEdit
810: {
811: public static function render($element_param, $key, $value, $obj_data, $params);
812:
813: }
814:
815: class joosAutoadminFilePluginNotFoundException extends joosException
816: {
817: }
818:
819: class joosAutoadminClassPlugionNotFoundException extends joosException
820: {
821: }
822: