|
113 | 113 | if($(this).is(':checked'))
|
114 | 114 | {
|
115 | 115 | modulevalue='true';
|
| 116 | + var dependencies = $(this).attr('dependencies'); |
| 117 | + dependencies=dependencies.split(','); |
| 118 | + $.each(dependencies, function(i, l){ |
| 119 | + if(l != '') |
| 120 | + { |
| 121 | + if(!$('input[module='+l+']').is(':checked')) |
| 122 | + { |
| 123 | + $.post(json.global.webroot+'/admin/index', {submitModule: true, modulename: l , modulevalue:modulevalue}); |
| 124 | + createNotive("Dependancy: Enabling module "+l,1500); |
| 125 | + } |
| 126 | + $('input[module='+l+']').attr('checked',true); |
| 127 | + } |
| 128 | + }); |
116 | 129 | }
|
117 | 130 | else
|
118 | 131 | {
|
119 | 132 | modulevalue='false';
|
| 133 | + var moduleDependencies = new Array(); |
| 134 | + $.each($('input[dependencies='+$(this).attr('module')+']:checked'),function(){ |
| 135 | + moduleDependencies.push($(this).attr('module')); |
| 136 | + }); |
| 137 | + $.each($('input[dependencies*=",'+$(this).attr('module')+'"]:checked'),function(){ |
| 138 | + moduleDependencies.push($(this).attr('module')); |
| 139 | + }); |
| 140 | + $.each($('input[dependencies*="'+$(this).attr('module')+',"]:checked'),function(){ |
| 141 | + moduleDependencies.push($(this).attr('module')); |
| 142 | + }); |
| 143 | + var found = false; |
| 144 | + |
| 145 | + var mainModule = $(this).attr('module'); |
| 146 | + |
| 147 | + $.each(moduleDependencies, function(i, l){ |
| 148 | + var module = l; |
| 149 | + if(module != '') |
| 150 | + { |
| 151 | + found =true; |
| 152 | + createNotive("Dependancy: The module "+module+" requires "+mainModule+". Please, disable it first.",3500); |
| 153 | + } |
| 154 | + }); |
| 155 | + if(found) |
| 156 | + { |
| 157 | + $(this).attr('checked',true); |
| 158 | + return; |
| 159 | + } |
120 | 160 | }
|
| 161 | + |
| 162 | + |
121 | 163 | $.post(json.global.webroot+'/admin/index', {submitModule: true, modulename: $(this).attr('module') , modulevalue:modulevalue},
|
122 | 164 | function(data) {
|
123 | 165 | jsonResponse = jQuery.parseJSON(data);
|
|
126 | 168 | createNotive('Error',4000);
|
127 | 169 | return;
|
128 | 170 | }
|
129 |
| - createNotive(jsonResponse[1],1500); |
| 171 | + createNotive(jsonResponse[1],3500); |
130 | 172 | initModulesConfigLinks();
|
131 | 173 | });
|
132 | 174 | });
|
| 175 | + |
| 176 | + $('a.moduleVisibleCategoryLink').click(function(){ |
| 177 | + if($(this).prev('span').html() == '>') |
| 178 | + { |
| 179 | + $(this).prev('span').html('v'); |
| 180 | + $('.'+$(this).html()+'VisibleElement').show(); |
| 181 | + } |
| 182 | + else |
| 183 | + { |
| 184 | + $(this).prev('span').html('>'); |
| 185 | + $('.'+$(this).html()+'VisibleElement').hide(); |
| 186 | + } |
| 187 | + }); |
| 188 | + |
| 189 | + $('a.moduleHiddenCategoryLink').click(function(){ |
| 190 | + if($(this).prev('span').html() == '>') |
| 191 | + { |
| 192 | + $(this).prev('span').html('v'); |
| 193 | + $('.'+$(this).html()+'HiddenElement').show(); |
| 194 | + } |
| 195 | + else |
| 196 | + { |
| 197 | + $(this).prev('span').html('>'); |
| 198 | + $('.'+$(this).html()+'HiddenElement').hide(); |
| 199 | + } |
| 200 | + }); |
133 | 201 | initModulesConfigLinks();
|
134 | 202 | });
|
135 | 203 |
|
|
0 commit comments