1 | <?php |
---|
2 | /**************************************************************************\ |
---|
3 | * eGroupWare * |
---|
4 | * http://www.egroupware.org * |
---|
5 | * -------------------------------------------- * |
---|
6 | * This program is free software; you can redistribute it and/or modify it * |
---|
7 | * under the terms of the GNU General Public License as published by the * |
---|
8 | * Free Software Foundation; either version 2 of the License, or (at your * |
---|
9 | * option) any later version. * |
---|
10 | \**************************************************************************/ |
---|
11 | |
---|
12 | require_once dirname(__FILE__) . SEP . 'engine' . SEP . 'config.ajax.inc.php'; |
---|
13 | require_once GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ProcessManager.php'; |
---|
14 | require_once dirname(__FILE__) . SEP . 'class.ui_ajaxinterface.inc.php'; |
---|
15 | /** |
---|
16 | * @package Workflow |
---|
17 | * @license http://www.gnu.org/copyleft/gpl.html GPL |
---|
18 | * @author Rodrigo Daniel C Lira - rodrigo.lira@gmail.com |
---|
19 | * @author Sidnei Augusto Drovetto Junior - drovetto@gmail.com |
---|
20 | */ |
---|
21 | class ui_phpeditor extends ui_ajaxinterface |
---|
22 | { |
---|
23 | /** |
---|
24 | * @var array $public_functions public functions |
---|
25 | * @access public |
---|
26 | */ |
---|
27 | var $public_functions = array( |
---|
28 | 'form' => true, |
---|
29 | ); |
---|
30 | |
---|
31 | /** |
---|
32 | * @var object $bo |
---|
33 | * @access public |
---|
34 | */ |
---|
35 | var $bo; |
---|
36 | |
---|
37 | protected $HTMLFile; |
---|
38 | protected $type; |
---|
39 | |
---|
40 | /** |
---|
41 | * Constructor |
---|
42 | * @access public |
---|
43 | * @return object |
---|
44 | */ |
---|
45 | function ui_phpeditor() |
---|
46 | { |
---|
47 | $this->bo = CreateObject('workflow.bo_editor'); |
---|
48 | $this->loadVariables(); |
---|
49 | } |
---|
50 | |
---|
51 | protected function loadVariables() |
---|
52 | { |
---|
53 | $this->HTMLFile = 'editor.html'; |
---|
54 | $this->type = 'php'; |
---|
55 | } |
---|
56 | |
---|
57 | /** |
---|
58 | * Build php editor form |
---|
59 | * @access public |
---|
60 | * @return void |
---|
61 | */ |
---|
62 | function form() |
---|
63 | { |
---|
64 | $smarty = Factory::getInstance('workflow_smarty', false); |
---|
65 | $processManager = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); |
---|
66 | $proccessInfo = $processManager->get_process($_GET['proc_id']); |
---|
67 | |
---|
68 | $javaScripts = $this->get_common_js(); |
---|
69 | $javaScripts .= $this->get_js_link('workflow','phpeditor', 'main'); |
---|
70 | |
---|
71 | $css = $this->get_common_css(); |
---|
72 | |
---|
73 | $fileData = $this->bo->get_source($proccessInfo['wf_normalized_name'],$_REQUEST['file_name'],$_REQUEST['type']); |
---|
74 | |
---|
75 | $smarty->assign('type', $this->type); |
---|
76 | $smarty->assign('HTMLFile', $this->HTMLFile); |
---|
77 | $smarty->assign('javaScripts', $javaScripts); |
---|
78 | $smarty->assign('css', $css); |
---|
79 | $smarty->assign('txt_loading', lang('loading')); |
---|
80 | $smarty->assign('processName', $_GET['proc_name']); |
---|
81 | $smarty->assign('fileName', $_GET['file_name']); |
---|
82 | $smarty->assign('tipoCodigo', $_GET['type']); |
---|
83 | $smarty->assign('processID', $_GET['proc_id']); |
---|
84 | $smarty->assign('activityId', $_GET['activity_id']); |
---|
85 | $smarty->assign('processNameVersion', "{$proccessInfo['wf_name']} (v{$proccessInfo['wf_version']})"); |
---|
86 | $smarty->assign('fileData', $fileData); |
---|
87 | |
---|
88 | $smarty->display('editor.tpl'); |
---|
89 | } |
---|
90 | } |
---|
91 | ?> |
---|