1: <?php
2:
3: 4: 5: 6: 7: 8: 9: 10: 11:
12:
13:
14: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
15:
16: 17: 18: 19: 20:
21: class PifaLeftBottomPage extends cGuiPage {
22:
23: 24: 25: 26:
27: public function __construct() {
28:
29: 30: 31: 32:
33: global $action;
34:
35: 36: 37: 38:
39: global $idform;
40:
41: parent::__construct('left_bottom', Pifa::getName());
42:
43: $this->addScript('left_bottom.js');
44:
45: $this->set('s', 'menu', $this->_getMenu());
46:
47:
48: $this->set('s', 'I18N', json_encode(array(
49: 'confirm_delete_form' => Pifa::i18n('CONFIRM_DELETE_FORM')
50: )));
51: }
52:
53: 54: 55:
56: private function () {
57: global $area;
58:
59: $cfg = cRegistry::getConfig();
60: $client = cRegistry::getClientId();
61: $lang = cRegistry::getLanguageId();
62:
63:
64: $forms = PifaFormCollection::getByClientAndLang($client, $lang);
65: if (false === $forms) {
66: return '<!-- no forms for current client/language -->';
67: }
68:
69:
70:
71:
72: $menu = new cGuiMenu();
73: while (false !== $form = $forms->next()) {
74:
75: $idform = $form->get('idform');
76: $formName = $form->get('name');
77:
78: $menu->setTitle($idform, $formName);
79:
80:
81: $link = new cHTMLLink();
82: $link->setMultiLink($area, '', $area, PifaRightBottomFormPage::SHOW_FORM);
83: $link->setCustom('idform', $idform);
84: $menu->setLink($idform, $link);
85:
86:
87: if (cRegistry::getPerm()->have_perm_area_action('form', PifaRightBottomFormPage::DELETE_FORM)) {
88: $link = new cHTMLLink();
89: $link->setMultiLink($area, PifaRightBottomFormPage::DELETE_FORM, $area, PifaRightBottomFormPage::DELETE_FORM);
90: $link->setCustom('idform', $idform);
91: $link->setClass('pifa-icon-delete-form');
92: $deleteForm = Pifa::i18n('DELETE_FORM');
93: $link->setAlt($deleteForm);
94: $link->setContent('<img src="' . $cfg['path']['images'] . 'delete.gif" title="' . $deleteForm . '" alt="' . $deleteForm . '">');
95:
96: $menu->setActions($idform, 'delete', $link);
97: } else {
98: $menu->setActions($idform, 'delete', '<img src="' . $cfg['path']['images'] . 'delete_inact.gif" title="' . $deleteForm . '" alt="' . $deleteForm . '">');
99: }
100: }
101:
102: return $menu->render(false);
103: }
104: }
105:
106: 107: 108: 109: 110:
111: class PifaRightBottomFormPage extends cGuiPage {
112:
113: 114: 115: 116:
117: const SHOW_FORM = 'pifa_show_form';
118:
119: 120: 121: 122:
123: const STORE_FORM = 'pifa_store_form';
124:
125: 126: 127: 128:
129: const DELETE_FORM = 'pifa_delete_form';
130:
131: 132: 133: 134: 135:
136: private $_pifaForm = NULL;
137:
138: 139: 140: 141: 142: 143: 144: 145: 146:
147: public function __construct() {
148:
149: 150: 151: 152:
153: global $action;
154:
155: 156: 157: 158:
159: global $idform;
160:
161: 162: 163: 164:
165: global $idfield;
166:
167: parent::__construct('right_bottom', Pifa::getName());
168:
169: $this->addStyle('smoothness/jquery-ui-1.8.20.custom.css');
170: $this->addStyle('right_bottom.css');
171: $this->addScript('right_bottom.js');
172:
173:
174: $this->_pifaForm = new PifaForm();
175:
176:
177: $idform = cSecurity::toInteger($idform);
178: if (0 < $idform) {
179: if (false === $this->_pifaForm->loadByPrimaryKey($idform)) {
180: $msg = Pifa::i18n('FORM_LOAD_ERROR');
181: throw new PifaException($msg);
182: }
183: }
184:
185:
186: $this->set('s', 'I18N', json_encode(array(
187: 'cancel' => Pifa::i18n('CANCEL'),
188: 'save' => Pifa::i18n('SAVE')
189: )));
190:
191:
192: try {
193: $this->_dispatch($action);
194: } catch (PifaException $e) {
195: $cGuiNotification = new cGuiNotification();
196: $notification = $cGuiNotification->returnNotification(cGuiNotification::LEVEL_ERROR, $e->getMessage());
197: $this->set('s', 'notification', $notification);
198: $this->set('s', 'content', '');
199: }
200: }
201:
202: 203: 204: 205: 206: 207: 208:
209: protected function _dispatch($action, $notification = '') {
210: global $area;
211:
212:
213: if (!cRegistry::getPerm()->have_perm_area_action($area, $action)) {
214: $msg = Pifa::i18n('NO_PERMISSIONS');
215: throw new PifaIllegalStateException($msg);
216: }
217:
218: if (NULL === $action) {
219: $cGuiNotification = new cGuiNotification();
220: $notification = $cGuiNotification->returnNotification(cGuiNotification::LEVEL_INFO, Pifa::i18n('please select a form'));
221: $this->set('s', 'notification', $notification);
222: $this->set('s', 'content', '');
223: return;
224: }
225:
226:
227: switch ($action) {
228: case PifaRightBottomFormPage::SHOW_FORM:
229: $this->set('s', 'notification', $notification);
230: try {
231: $this->set('s', 'content', $this->_showForm());
232: } catch (SmartyCompilerException $e) {
233: $this->set('s', 'content', Pifa::notifyException($e));
234: }
235: break;
236:
237: case PifaRightBottomFormPage::STORE_FORM:
238: $notification = '';
239: try {
240: $this->_storeForm();
241: $this->setReload();
242:
243: $idform = $this->_pifaForm->get('idform');
244: $url = "main.php?area=form&frame=3&idform=$idform&action=" . PifaRightBottomFormPage::SHOW_FORM;
245: $url = cRegistry::getSession()->url($url);
246: $this->addScript("<script type=\"text/javascript\">
247: parent.parent.frames['right'].frames['right_top'].location.href = '$url';
248: </script>");
249: } catch (Exception $e) {
250: $notification = Pifa::notifyException($e);
251: }
252: $this->_dispatch(PifaRightBottomFormPage::SHOW_FORM, $notification);
253: break;
254:
255: case PifaRightBottomFormPage::DELETE_FORM:
256: $notification = '';
257: try {
258: $this->_deleteForm();
259: $cGuiNotification = new cGuiNotification();
260: $this->set('s', 'notification', $cGuiNotification->returnNotification(cGuiNotification::LEVEL_INFO, Pifa::i18n('FORM_DELETED')));
261: $this->set('s', 'content', '');
262: $this->setReload();
263: } catch (Exception $e) {
264: $notification = Pifa::notifyException($e);
265: }
266: break;
267:
268: default:
269: $msg = Pifa::i18n('UNKNOWN_ACTION');
270: throw new PifaException($msg);
271: }
272: }
273:
274: 275: 276: 277: 278:
279: private function _showForm() {
280: global $area;
281:
282: $cfg = cRegistry::getConfig();
283:
284:
285: $formAction = '';
286: if (cRegistry::getPerm()->have_perm_area_action('form', self::STORE_FORM)) {
287: $formAction = new cHTMLLink();
288: $formAction->setCLink($area, 4, PifaRightBottomFormPage::STORE_FORM);
289: $formAction = $formAction->getHref();
290: }
291:
292:
293: if (!is_null($this->_pifaForm) && $this->_pifaForm->isLoaded()) {
294: $idform = $this->_pifaForm->get('idform');
295: $nameValue = $this->_pifaForm->get('name');
296: $dataTableValue = $this->_pifaForm->get('data_table');
297: $methodValue = $this->_pifaForm->get('method');
298: $withTimestampValue = (bool) $this->_pifaForm->get('with_timestamp');
299: } else {
300: $idform = NULL;
301:
302:
303: $nameValue = empty($_POST['name']) ? '':$_POST['name'];
304: $nameValue = cSecurity::unescapeDB($nameValue);
305: $nameValue = cSecurity::toString($nameValue);
306: $nameValue = trim($nameValue);
307:
308: $dataTableValue = empty($_POST['data_table']) ? '':$_POST['data_table'];
309: $dataTableValue = trim($dataTableValue);
310: $dataTableValue = strtolower($dataTableValue);
311: $dataTableValue = preg_replace('/[^a-z0-9_]/', '_', $dataTableValue);
312:
313: $methodValue = '';
314: $withTimestampValue = true;
315: }
316:
317: $tpl = Contenido_SmartyWrapper::getInstance(true);
318: $tpl->assign('formAction', $formAction);
319: $tpl->assign('idform', $idform);
320: $tpl->assign('nameValue', $nameValue);
321: $tpl->assign('dataTableValue', $dataTableValue);
322: $tpl->assign('methodValue', strtoupper($methodValue));
323: $tpl->assign('withTimestampValue', $withTimestampValue);
324: $tpl->assign('hasWithTimestamp', Pifa::TIMESTAMP_BYFORM === Pifa::getTimestampSetting());
325: $tpl->assign('trans', array(
326: 'legend' => Pifa::i18n('form'),
327: 'name' => Pifa::i18n('form name'),
328: 'dataTable' => Pifa::i18n('data table'),
329: 'method' => Pifa::i18n('method'),
330: 'withTimestamp' => Pifa::i18n('with timestamp'),
331: 'pleaseChoose' => Pifa::i18n('please choose'),
332: 'saveForm' => Pifa::i18n('save form')
333: ));
334:
335: $out = $tpl->fetch($cfg['templates']['pifa_right_bottom_form']);
336:
337: return $out;
338: }
339:
340: 341: 342: 343: 344:
345: private function _storeForm() {
346:
347:
348: $isLoaded = $this->_pifaForm->isLoaded();
349:
350:
351: $name = $_POST['name'];
352: $name = cSecurity::unescapeDB($name);
353: $name = cSecurity::toString($name);
354: $name = trim($name);
355:
356: $dataTable = $_POST['data_table'];
357: $dataTable = trim($dataTable);
358: $dataTable = strtolower($dataTable);
359: $dataTable = preg_replace('/[^a-z0-9_]/', '_', $dataTable);
360:
361: $method = $_POST['method'];
362: $method = trim($method);
363: $method = strtoupper($method);
364:
365: switch (Pifa::getTimestampSetting()) {
366: case Pifa::TIMESTAMP_NEVER:
367: $withTimestamp = false;
368: break;
369: case Pifa::TIMESTAMP_BYFORM:
370: $withTimestamp = 'on' === $_POST['with_timestamp'];
371: break;
372: case Pifa::TIMESTAMP_ALWAYS:
373: $withTimestamp = true;
374: break;
375: }
376:
377:
378: if (0 === strlen($name)) {
379: $msg = Pifa::i18n('EMPTY_FORMNAME_ERROR');
380: throw new PifaException($msg);
381: }
382: if (0 === strlen($dataTable)) {
383: $msg = Pifa::i18n('EMPTY_DATETABLENAME_ERROR');
384: throw new PifaException($msg);
385: }
386: if (!in_array($method, array(
387: 'GET',
388: 'POST'
389: ))) {
390: $msg = Pifa::i18n('FORM_METHOD_ERROR');
391: throw new PifaException($msg);
392: }
393:
394: if ($isLoaded) {
395:
396: $oldDataTable = $this->_pifaForm->get('data_table');
397: $oldWithTimestamp = (bool) $this->_pifaForm->get('with_timestamp');
398: } else {
399:
400: $pifaFormCollection = new PifaFormCollection();
401: $this->_pifaForm = $pifaFormCollection->createNewItem(array(
402: 'idclient' => cRegistry::getClientId(),
403: 'idlang' => cRegistry::getLanguageId()
404: ));
405: }
406:
407:
408:
409:
410:
411:
412: if ($name !== $this->_pifaForm->get('name')) {
413: $this->_pifaForm->set('name', $name);
414: }
415: if ($dataTable !== $this->_pifaForm->get('data_table')) {
416: $this->_pifaForm->set('data_table', $dataTable);
417: }
418: if (0 !== strcasecmp($method, $this->_pifaForm->get('method'))) {
419: $this->_pifaForm->set('method', $method);
420: }
421: if ($withTimestamp !== (bool) $this->_pifaForm->get('with_timestamp')) {
422: $this->_pifaForm->set('with_timestamp', $withTimestamp);
423: }
424:
425:
426: if (false === $this->_pifaForm->store()) {
427: $msg = Pifa::i18n('FORM_STORE_ERROR');
428: $msg = sprintf($msg, $this->_pifaForm->getLastError());
429: throw new PifaException($msg);
430: }
431:
432: if ($isLoaded) {
433:
434:
435:
436:
437: $this->_pifaForm->alterTable($oldDataTable, $oldWithTimestamp);
438: } else {
439:
440: $this->_pifaForm->createTable($withTimestamp);
441: }
442: }
443:
444: 445:
446: private function _deleteForm() {
447: $this->_pifaForm->delete();
448: $this->_pifaForm = NULL;
449: }
450: }
451:
452: 453: 454: 455: 456:
457: class PifaRightBottomFormFieldsPage extends cGuiPage {
458:
459: 460: 461: 462:
463: const SHOW_FIELDS = 'pifa_show_fields';
464:
465: 466: 467: 468: 469:
470: private $_pifaForm = NULL;
471:
472: 473: 474: 475: 476: 477: 478: 479: 480:
481: public function __construct() {
482:
483: 484: 485: 486:
487: global $action;
488:
489: 490: 491: 492:
493: global $idform;
494:
495: 496: 497: 498:
499: global $idfield;
500:
501: parent::__construct('right_bottom', Pifa::getName());
502:
503: $this->addStyle('smoothness/jquery-ui-1.8.20.custom.css');
504: $this->addStyle('right_bottom.css');
505: $this->addScript('right_bottom.js');
506:
507:
508: $this->_pifaForm = new PifaForm();
509:
510:
511: $idform = cSecurity::toInteger($idform);
512: if (0 < $idform) {
513: $ret = $this->_pifaForm->loadByPrimaryKey($idform);
514: if (false === $ret) {
515: $msg = Pifa::i18n('FORM_LOAD_ERROR');
516: throw new PifaException($msg);
517: }
518: }
519:
520:
521: $this->set('s', 'I18N', json_encode(array(
522: 'cancel' => Pifa::i18n('CANCEL'),
523: 'save' => Pifa::i18n('SAVE'),
524: 'confirm_delete_field' => Pifa::i18n('CONFIRM_DELETE_FIELD')
525: )));
526:
527:
528: try {
529: $this->_dispatch($action);
530: } catch (PifaException $e) {
531: $cGuiNotification = new cGuiNotification();
532: $notification = $cGuiNotification->returnNotification(cGuiNotification::LEVEL_ERROR, $e->getMessage());
533: $this->set('s', 'notification', $notification);
534: $this->set('s', 'content', '');
535: }
536: }
537:
538: 539: 540: 541: 542: 543: 544:
545: protected function _dispatch($action, $notification = '') {
546: global $area;
547:
548:
549: if (!cRegistry::getPerm()->have_perm_area_action($area, $action)) {
550: $msg = Pifa::i18n('NO_PERMISSIONS');
551: throw new PifaIllegalStateException($msg);
552: }
553:
554: if (NULL === $action) {
555: $this->set('s', 'notification', Pifa::i18n('please select a form'));
556: $this->set('s', 'content', '');
557: return;
558: }
559:
560:
561: switch ($action) {
562:
563: case PifaRightBottomFormFieldsPage::SHOW_FIELDS:
564: $this->set('s', 'notification', $notification);
565: try {
566: $this->set('s', 'content', $this->_showFields());
567: } catch (SmartyCompilerException $e) {
568: $this->set('s', 'content', Pifa::notifyException($e));
569: }
570: break;
571:
572: default:
573: $msg = Pifa::i18n('UNKNOWN_ACTION');
574: throw new PifaException($msg);
575: }
576: }
577:
578: 579:
580: private function _showFields() {
581: global $area;
582:
583: $cfg = cRegistry::getConfig();
584:
585: $idform = $idfield = NULL;
586: $fieldTypes = $fields = NULL;
587: $editField = $deleteField = NULL;
588: if ($this->_pifaForm->isLoaded()) {
589:
590: $idform = $this->_pifaForm->get('idform');
591: $idfield = $_GET['idfield'];
592:
593: $fieldTypes = $this->_getFieldTypes();
594: $fields = $this->_pifaForm->getFields();
595:
596: if (cRegistry::getPerm()->have_perm_area_action('form_ajax', PifaAjaxHandler::GET_FIELD_FORM)) {
597: $editField = new cHTMLLink();
598: $editField->setCLink('form_ajax', 4, PifaAjaxHandler::GET_FIELD_FORM);
599: $editField->setCustom('idform', $idform);
600: $editField = $editField->getHref();
601: }
602:
603: if (cRegistry::getPerm()->have_perm_area_action('form_ajax', PifaAjaxHandler::DELETE_FIELD)) {
604: $deleteField = new cHTMLLink();
605: $deleteField->setCLink('form_ajax', 4, PifaAjaxHandler::DELETE_FIELD);
606: $deleteField->setCustom('idform', $idform);
607: $deleteField = $deleteField->getHref();
608: }
609: }
610:
611:
612: $tpl = Contenido_SmartyWrapper::getInstance(true);
613:
614:
615: $tpl->assign('trans', array(
616: 'legend' => Pifa::i18n('fields'),
617: 'pleaseSaveFirst' => Pifa::i18n('please save first'),
618: 'dialogTitle' => Pifa::i18n('edit field'),
619: 'edit' => Pifa::i18n('EDIT'),
620: 'delete' => Pifa::i18n('DELETE'),
621: 'obligatory' => Pifa::i18n('OBLIGATORY')
622: ));
623:
624:
625: $tpl->assign('ajaxParams', implode('&', array(
626: 'area=form_ajax',
627: 'frame=4',
628: 'contenido=' . cRegistry::getBackendSessionId()
629: )));
630: if (cRegistry::getPerm()->have_perm_area_action('form_ajax', PifaAjaxHandler::GET_FIELD_FORM)) {
631: $tpl->assign('dragParams', implode('&', array(
632: 'area=form_ajax',
633: 'frame=4',
634: 'contenido=' . cRegistry::getBackendSessionId(),
635: 'action=' . PifaAjaxHandler::GET_FIELD_FORM,
636: 'idform=' . $idform
637: )));
638: }
639: if (cRegistry::getPerm()->have_perm_area_action('form_ajax', PifaAjaxHandler::REORDER_FIELDS)) {
640: $tpl->assign('sortParams', implode('&', array(
641: 'area=form_ajax',
642: 'frame=4',
643: 'contenido=' . cRegistry::getBackendSessionId(),
644: 'action=' . PifaAjaxHandler::REORDER_FIELDS,
645: 'idform=' . $this->_pifaForm->get('idform')
646: )));
647: }
648:
649:
650: $tpl->assign('idform', $idform);
651: $tpl->assign('idfield', $idfield);
652:
653: $tpl->assign('fields', $fields);
654:
655: $tpl->assign('fieldTypes', PifaField::getFieldTypeNames());
656:
657:
658: $tpl->assign('editField', $editField);
659: $tpl->assign('deleteField', $deleteField);
660:
661: $tpl->assign('partialFieldRow', $cfg['templates']['pifa_ajax_field_row']);
662:
663: $out = $tpl->fetch($cfg['templates']['pifa_right_bottom_fields']);
664:
665: return $out;
666: }
667:
668: 669: 670: 671: 672: 673:
674: private function _getFieldTypes() {
675: $fieldTypes = array();
676: foreach (PifaField::getFieldTypeIds() as $fieldTypeId) {
677: $fieldTypes[$fieldTypeId] = array();
678: $fieldTypes[$fieldTypeId]['id'] = $fieldTypeId;
679: $fieldTypes[$fieldTypeId]['label'] = PifaField::getFieldTypeName($fieldTypeId);
680:
681: $fieldTypes[$fieldTypeId]['icon'] = PifaField::getFieldTypeIcon($fieldTypeId);
682: }
683:
684: return $fieldTypes;
685: }
686: }
687:
688: 689: 690: 691: 692:
693: class PifaRightBottomFormDataPage extends cGuiPage {
694:
695: 696: 697: 698:
699: const SHOW_DATA = 'pifa_show_data';
700:
701: 702: 703: 704: 705:
706: private $_pifaForm = NULL;
707:
708: 709: 710: 711: 712: 713: 714: 715: 716:
717: public function __construct() {
718:
719: 720: 721: 722:
723: global $action;
724:
725: 726: 727: 728:
729: global $idform;
730:
731: 732: 733: 734:
735: global $idfield;
736:
737: parent::__construct('right_bottom', Pifa::getName());
738:
739: $this->addStyle('smoothness/jquery-ui-1.8.20.custom.css');
740: $this->addStyle('right_bottom.css');
741: $this->addScript('right_bottom.js');
742:
743:
744: $this->_pifaForm = new PifaForm();
745:
746:
747: $idform = cSecurity::toInteger($idform);
748: if (0 < $idform) {
749: if (false === $this->_pifaForm->loadByPrimaryKey($idform)) {
750: $msg = Pifa::i18n('FORM_LOAD_ERROR');
751: throw new PifaException($msg);
752: }
753: }
754:
755:
756: $this->set('s', 'I18N', json_encode(array(
757: 'cancel' => Pifa::i18n('CANCEL'),
758: 'save' => Pifa::i18n('SAVE')
759: )));
760:
761:
762: try {
763: $this->_dispatch($action);
764: } catch (PifaException $e) {
765: $cGuiNotification = new cGuiNotification();
766: $notification = $cGuiNotification->returnNotification(cGuiNotification::LEVEL_ERROR, $e->getMessage());
767: $this->set('s', 'notification', $notification);
768: $this->set('s', 'content', '');
769: }
770: }
771:
772: 773: 774: 775: 776: 777: 778:
779: protected function _dispatch($action, $notification = '') {
780: global $area;
781:
782:
783: if (!cRegistry::getPerm()->have_perm_area_action($area, $action)) {
784: $msg = Pifa::i18n('NO_PERMISSIONS');
785: throw new PifaIllegalStateException($msg);
786: }
787:
788: if (NULL === $action) {
789: $this->set('s', 'notification', Pifa::i18n('please select a form'));
790: $this->set('s', 'content', '');
791: return;
792: }
793:
794:
795: switch ($action) {
796:
797: case PifaRightBottomFormDataPage::SHOW_DATA:
798: $this->set('s', 'notification', $notification);
799: try {
800: $this->set('s', 'content', $this->_showData());
801: } catch (SmartyCompilerException $e) {
802: $this->set('s', 'content', Pifa::notifyException($e));
803: }
804: break;
805:
806: default:
807: $msg = Pifa::i18n('UNKNOWN_ACTION');
808: throw new PifaException($msg);
809: }
810: }
811:
812: 813:
814: private function _showData() {
815: $cfg = cRegistry::getConfig();
816:
817: $tpl = Contenido_SmartyWrapper::getInstance(true);
818:
819:
820: $tpl->assign('trans', array(
821: 'legend' => Pifa::i18n('data'),
822: 'pleaseSaveFirst' => Pifa::i18n('please save first'),
823: 'export' => Pifa::i18n('download data as CSV')
824: ));
825:
826: if (cRegistry::getPerm()->have_perm_area_action('form_ajax', PifaAjaxHandler::EXPORT_DATA)) {
827: $tpl->assign('exportUrl', 'main.php?' . implode('&', array(
828: 'area=form_ajax',
829: 'frame=4',
830: 'contenido=' . cRegistry::getBackendSessionId(),
831: 'action=' . PifaAjaxHandler::EXPORT_DATA,
832: 'idform=' . $this->_pifaForm->get('idform')
833: )));
834: }
835: $tpl->assign('form', $this->_pifaForm);
836: $tpl->assign('getFileUrl', 'main.php?' . implode('&', array(
837: 'area=form_ajax',
838: 'frame=4',
839: 'contenido=' . cRegistry::getBackendSessionId(),
840: 'action=' . PifaAjaxHandler::GET_FILE
841: )));
842:
843: try {
844: $tpl->assign('fields', $this->_pifaForm->getFields());
845: } catch (Exception $e) {
846: $tpl->assign('fields', Pifa::notifyException($e));
847: }
848:
849: $tpl->assign('withTimestamp', (bool) $this->_pifaForm->get('with_timestamp'));
850:
851: try {
852: $tpl->assign('data', $this->_pifaForm->getData());
853: } catch (Exception $e) {
854: $tpl->assign('data', Pifa::notifyException($e));
855: }
856:
857: $out = $tpl->fetch($cfg['templates']['pifa_right_bottom_data']);
858:
859: return $out;
860: }
861: }
862: