source: branches/2.2/workflow/inc/class.ui_phpeditor.inc.php @ 3167

Revision 3167, 2.8 KB checked in by viani, 14 years ago (diff)

Ticket #1135 - Merged r1990:3166 from /trunk/workflow into /branches/2.2/workflow

  • Property svn:executable set to *
Line 
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
12require_once dirname(__FILE__) . SEP . 'engine' . SEP . 'config.ajax.inc.php';
13require_once dirname(__FILE__) . SEP . 'class.ui_ajaxinterface.inc.php';
14/**
15 * @package Workflow
16 * @license http://www.gnu.org/copyleft/gpl.html GPL
17 * @author Rodrigo Daniel C Lira - rodrigo.lira@gmail.com
18 * @author Sidnei Augusto Drovetto Junior - drovetto@gmail.com
19 */
20class ui_phpeditor extends ui_ajaxinterface
21{
22        /**
23         * @var array $public_functions public functions
24         * @access public
25         */
26        var $public_functions = array(
27                'form'  => true,
28        );
29
30        /**
31         * @var object $bo
32         * @access public
33         */
34        var $bo;
35
36        protected $HTMLFile;
37        protected $type;
38
39        /**
40         * Constructor
41         * @access public
42         * @return object
43         */
44        function ui_phpeditor()
45        {
46                $this->bo = Factory::getInstance('bo_editor');
47                $this->loadVariables();
48        }
49
50        protected function loadVariables()
51        {
52                $this->HTMLFile = 'editor.html';
53                $this->type = 'php';
54        }
55
56        /**
57         * Build php editor form
58         * @access public
59         * @return void
60         */
61        function form()
62        {
63                $smarty = Factory::getInstance('workflow_smarty', false);
64                $processManager = &Factory::newInstance('ProcessManager');
65                $proccessInfo = $processManager->get_process($_GET['proc_id']);
66
67                $javaScripts = $this->get_common_js();
68                $javaScripts .= $this->get_js_link('workflow','phpeditor', 'main');
69
70                $css = $this->get_common_css();
71
72                $fileData = $this->bo->get_source($proccessInfo['wf_normalized_name'],$_REQUEST['file_name'],$_REQUEST['type']);
73
74                $smarty->assign('type', $this->type);
75                $smarty->assign('HTMLFile', $this->HTMLFile);
76                $smarty->assign('javaScripts', $javaScripts);
77                $smarty->assign('css', $css);
78                $smarty->assign('txt_loading', lang('loading'));
79                $smarty->assign('processName', $_GET['proc_name']);
80                $smarty->assign('fileName', $_GET['file_name']);
81                $smarty->assign('tipoCodigo', $_GET['type']);
82                $smarty->assign('processID', $_GET['proc_id']);
83                $smarty->assign('activityId', $_GET['activity_id']);
84                $smarty->assign('processNameVersion', "{$proccessInfo['wf_name']} (v{$proccessInfo['wf_version']})");
85                $smarty->assign('fileData', $fileData);
86
87                $smarty->display('editor.tpl');
88        }
89}
90?>
Note: See TracBrowser for help on using the repository browser.