Modifications for module installer in openemr.
[openemr.git] / interface / modules / zend_modules / module / Installer / view / installer / installer / configure.phtml
blobbb659d4b244cc4b6a9a436f8db011bc67a3a3826
1 <?php
2 /* +-----------------------------------------------------------------------------+
3 *    OpenEMR - Open Source Electronic Medical Record
4 *    Copyright (C) 2013 Z&H Consultancy Services Private Limited <sam@zhservices.com>
6 *    This program is free software: you can redistribute it and/or modify
7 *    it under the terms of the GNU Affero General Public License as
8 *    published by the Free Software Foundation, either version 3 of the
9 *    License, or (at your option) any later version.
11 *    This program is distributed in the hope that it will be useful,
12 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
13 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 *    GNU Affero General Public License for more details.
16 *    You should have received a copy of the GNU Affero General Public License
17 *    along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 *    @author  Jacob T.Paul <jacob@zhservices.com>
19 *    @author  Vipin Kumar <vipink@zhservices.com>
20  *   @author  Remesh Babu S <remesh@zhservices.com>
21 * +------------------------------------------------------------------------------+
24 $listener       = $this->listenerObject;
25 $hangers  = $this->hangers;
26 $Hooks    = $this->Hooks;
27 $hookObj  =  $this->hookObject;
28 $mod_id   = $this->mod_id;
29 $title    = $listener->z_xlt('Module Installer');
30 $this->headTitle($title);
31 $baseModuleDir    = $GLOBALS['baseModDir'];
32 $customDir        = $GLOBALS['customModDir'];
33 $zendModDir       = $GLOBALS['zendModDir'];
34 $confirmationMSG  = $listener->z_xlt("Do you really want to delete?");
35 if(count($TabSettings)>0){
36     
38 <div class="easyui-tabs" id="tab<?php echo $this->escapeHtml($mod_id); ?>" style="width:950px;height:auto;">
39 <?php
40   if($TabSettings[1]['cnt'] > 0){            
42     <div title="<?php echo $listener->z_xla('Access Control');?>" id="tab_acl<?php echo $this->escapeHtml($mod_id); ?>" iconCls="icon-acl">
43       <div class="easyui-accordion" id="configaccord<?php echo $this->escapeHtml($mod_id); ?>" style="width:930px;height:auto;align:center;margin:5px">
44         <iframe src="<?php echo $GLOBALS['webroot']; ?>/interface/modules/zend_modules/public/acl/acltab?module_id=<?php echo $this->escapeHtml($this->mod_id); ?>" style="width:100%;height: 700px;overflow: hidden;" frameborder="0"></iframe>
45       </div>    
46     </div>
47   <?php       
48   }else{
49   ?>
50     <div class="easyui-accordion" id="configaccord<?php echo $this->escapeHtml($mod_id); ?>" style="width:930px;height:auto;align:center;margin:5px"></div>
51   <?php
52   }
53   if($TabSettings[2]['cnt'] > 0){
55     <div title="<?php echo $listener->z_xla('Preference');?>" id="tab_preference<?php echo $this->escapeHtml($mod_id); ?>" iconCls="icon-preference">  
56     <!-- For Future Development-->
57     </div>
58 <?php
60 if($TabSettings[3]['cnt'] > 0){
61   $modID = '';
63     <div title="<?php echo $listener->z_xla('Hooks');?>" id="tab_hooks<?php echo $this->escapeHtml($mod_id); ?>" iconCls="icon-plug" > 
64       <table width="100%">
65             <tr>
66               <td colspan="2" align="center" style="font-size:14px;font-weight:bold">
67                  <?php echo $listener->z_xlt("Manage Hooks");?>
68               </td>
69             </tr>
70             <tr>
71                 <td>
72                   <form name="hooksform<?php echo $this->escapeHtml($mod_id); ?>" id="hooksform<?php echo $this->escapeHtml($mod_id); ?>">                    
73                     <table  width="100%">
74                         <tr>
75                             <td style="width: 150px"><span id="hook_response<?php echo $this->escapeHtml($mod_id); ?>">&nbsp;</span></td>
76                             <?php
77                                 $hanger_count = 0;
78                                 foreach($hangers as $value => $title){ 
79                                 ?>
80                                     <td align="center"><?php echo $listener->z_xlt($title);?></td>
81                             <?php
82                                     $hanger_count++;
83                                 }
84                                 ?>                                
85                         </tr>
86                         <?php
87                         if(count($Hooks)> 0){
88                             foreach($Hooks as $obj_hooks){                               
89                             ?>
90                             <tr>
91                                 <td><?php echo $listener->z_xlt($obj_hooks['title']);?></td>
92                                 <?php
93                                     foreach($hangers as $value => $title){
94                                         $checked = "";
95                                         if($hookObj->getHookStatus($mod_id,$obj_hooks['name'],$value) == "1"){
96                                             $checked = "checked=\"checked\"";
97                                         }
98                                     ?>
99                                         <td align="center">
100                                             <input type="checkbox" <?php echo $this->escapeHtml($checked); ?>
101                                                 name="hook_hanger[<?php echo $this->escapeHtml($obj_hooks['name']);?>][<?php echo $this->escapeHtml($value); ?>]"
102                                                 id="hook_hanger_<?php echo $this->escapeHtml($obj_hooks['name']);?>_<?php echo $this->escapeHtml($value); ?>"
103                                                 value="<?php echo $this->escapeHtml($obj_hooks['name']).",".$this->escapeHtml($value);?>"
104                                                 onclick="javascript:SaveMe('hooksform',<?php echo $this->escapeHtml($mod_id);?>)" >
105                                         </td>
106                                 <?php
107                                     }
108                                     ?>    
109                             </tr>    
110                         <?php
111                             }
112                         }  
113                                 else{ ?>
114                             <tr>                            
115                             <td  colspan="<?php echo $this->escapeHtml($hanger_count)+1; ?>" align="center" style="font-size:14px">
116                                 <?php echo $listener->z_xlt('No Hooks Available in this Module'); ?>
117                             </td>
118                         </tr>
119                         <?php
120                             }
121                                     ?>                            
122                     </table>
123                     <input type="hidden" name="mod_id" value="<?php echo $this->escapeHtml($mod_id);?>">
124                   </form>
125                 </td>
126             </tr>            
127         </table>
128     </div>
129     <!-- Start Configuration Tab -->
130      <div title="<?php echo $listener->z_xla('Settings');?>" id="tab_config<?php echo $this->escapeHtml($mod_id); ?>" iconCls="icon-preference"> 
131         <?php
132             if(is_object($this->settings) && count($this->settings) > 0){
133                 
134             $form = $this->settings;
135                 if(method_exists($form,'prepare')){
136                     $form->prepare();                
137         ?>
138          <form name="configform" id="configform<?php echo $this->escapeHtml($mod_id); ?>">
139             <table style="width:100%; margin: 0px; height: 140px">
140                     <?php
141                             
142                     $i = 0;
143                     foreach ($form as $element) : 
144                     ?>
145                     <tr>
146                       <td width='15%'><?php echo $listener->z_xlt($element->getLabel()) ?></td>
147                       <td><?php echo $this->formElement($element->setValue($configuration[$element->getAttribute('id')]['field_value'])); ?></td>
148                     </tr>
149                     <?php
150                     $i++;
151                      endforeach;        
152                     ?>
153                 <tr>
154                     <td></td>
155                     <td>
156                        <a href="#" class="easyui-linkbutton" iconCls="icon-save" 
157                           plain="true" onclick="javascript:saveConfig('configform',<?php echo $this->escapeHtml($mod_id);?>)">
158                               <?php echo $listener->z_xlt('Save'); ?>
159                        </a>
160                         <span id='target<?php echo $this->escapeHtml($mod_id); ?>' style="color: #996600" ></span>
161                     </td>
162                 </tr>
163             </table>
164              <input type="hidden" name="module_id" value="<?php echo $this->escapeHtml($mod_id);?>">
165          </form>
166          <?php
167          }
168                 else {
169                     echo $listener->z_xlt('No Settings avaliable in this module');
170                 }
171             }
172             else {
173                 echo $listener->z_xlt('No Settings avaliable in this module');
174             }
175          ?>
176      </div>
177     <!-- End Configuration Tab -->
178     <?php    
179     }
180     ?>
181     <?php if (count($setup) > 0) { ?>
182     <div title="<?php echo $listener->z_xla($setup['title']);?>"  style="width:800px;height:auto;"
183          id="tab_config<?php echo $this->escapeHtml($mod_id); ?>" 
184          iconCls="icon-setup">
185       <iframe scrolling="yes" frameborder="0"  
186               src="<?php echo $this->basePath() . '/' . $this->escapeHtml($setup[module_dir]); ?>/setup/index" 
187               style="width:100%;height:400px;">
188       </iframe>
189     </div>
190     <?php } ?>
191 </div>
192 <?php
193 } else if (count($setup) > 0) { ?>
194   <div class="easyui-tabs" id="tab<?php echo $this->escapeHtml($mod_id); ?>" style="width:800px;height:auto;">
195     <div title="<?php echo $listener->z_xla($setup['title']);?>" 
196          id="tab_config<?php echo $mod_id; ?>" 
197          iconCls="icon-setup">
198       <iframe scrolling="yes" frameborder="0"  
199               src="<?php echo $this->basePath() . '/' . $this->escapeHtml($setup[module_dir]); ?>/setup/index" 
200               style="width:100%;height:400px;">
201       </iframe>
202     </div>
203   </div>
204 <?php
205 } else{
207     <div class="easyui-tabs" id="tab<?php echo $this->escapeHtml($mod_id); ?>" style="width:800px;height:auto;">
208     <?php echo $listener->z_xlt('No Configuration Defined for this Module');?>
209     </div>
210 <?php
213    
214