Marius Burkard
2016-04-20 4569cae57f127afd093794310ccd290d2d9fdf36
commit | author | age
ef55b5 1 <?php
F 2
3 /*
4 Copyright (c) 2008, Till Brehm, projektfarm Gmbh
5 All rights reserved.
6
7 Redistribution and use in source and binary forms, with or without modification,
8 are permitted provided that the following conditions are met:
9
10     * Redistributions of source code must retain the above copyright notice,
11       this list of conditions and the following disclaimer.
12     * Redistributions in binary form must reproduce the above copyright notice,
13       this list of conditions and the following disclaimer in the documentation
14       and/or other materials provided with the distribution.
15     * Neither the name of ISPConfig nor the names of its contributors
16       may be used to endorse or promote products derived from this software without
17       specific prior written permission.
18
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
26 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
28 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
b1a6a5 31 require_once '../../lib/config.inc.php';
MC 32 require_once '../../lib/app.inc.php';
ef55b5 33
F 34 /******************************************
35 * Begin Form configuration
36 ******************************************/
37
38 $list_def_file = "list/directive_snippets.list.php";
39
40 /******************************************
41 * End Form configuration
42 ******************************************/
43
44 //* Check permissions for module
45 $app->auth->check_module_permissions('admin');
46
47 $app->uses('listform_actions');
48
d22277 49 class list_action extends listform_actions {
MB 50
51     public function prepareDataRow($rec)
52     {
53         global $app;
54
55         $rec = $app->listform->decode($rec);
56
57         //* Alternating datarow colors
58         $this->DataRowColor = ($this->DataRowColor == '#FFFFFF') ? '#EEEEEE' : '#FFFFFF';
59         $rec['bgcolor'] = $this->DataRowColor;
60         
61         $rec['is_master'] = $rec['master_directive_snippets_id'];
62
63         //* substitute value for select fields
64         if(is_array($app->listform->listDef['item']) && count($app->listform->listDef['item']) > 0) {
65             foreach($app->listform->listDef['item'] as $field) {
66                 $key = $field['field'];
67                 if(isset($field['formtype']) && $field['formtype'] == 'SELECT') {
68                     if(strtolower($rec[$key]) == 'y' or strtolower($rec[$key]) == 'n') {
69                         // Set a additional image variable for bolean fields
70                         $rec['_'.$key.'_'] = (strtolower($rec[$key]) == 'y')?'x16/tick_circle.png':'x16/cross_circle.png';
71                     }
72                     //* substitute value for select field
73                     $rec[$key] = @$field['value'][$rec[$key]];
74                 }
75             }
76         }
77
78         //* The variable "id" contains always the index variable
79         $rec['id'] = $rec[$this->idx_key];
80         return $rec;
81     }
82     
83 }
84 $list = new list_action;
85 $list->SQLOrderBy = 'ORDER BY directive_snippets.name';
86 $list->onLoad();
87
88 //$app->listform_actions->SQLExtWhere = 'master_directive_snippets_id = 0';
89 /*
90 $app->listform_actions->SQLOrderBy = 'ORDER BY directive_snippets.name';
ef55b5 91 $app->listform_actions->onLoad();
d22277 92 */
b1a6a5 93 ?>