@@ -253,6 +253,53 @@ function onShowEnd() {
253253 // add limits to template to be able to hide settings
254254 foreach ($ read_limits as $ limit ) $ app ->tpl ->setVar ($ limit , $ client [$ limit ]);
255255
256+ $ sites_config = $ app ->getconf ->get_global_config ('sites ' );
257+ if ($ sites_config ['reseller_can_use_options ' ]) {
258+ // Directive Snippets
259+ $ php_directive_snippets = $ app ->db ->queryAllRecords ("SELECT * FROM directive_snippets WHERE type = 'php' AND active = 'y' " );
260+ $ php_directive_snippets_txt = '' ;
261+ if (is_array ($ php_directive_snippets ) && !empty ($ php_directive_snippets )){
262+ foreach ($ php_directive_snippets as $ php_directive_snippet ){
263+ $ php_directive_snippets_txt .= '<a href="javascript:void(0);" class="addPlaceholderContent">[ ' .$ php_directive_snippet ['name ' ].']<pre class="addPlaceholderContent" style="display:none;"> ' .htmlentities ($ php_directive_snippet ['snippet ' ]).'</pre></a> ' ;
264+ }
265+ }
266+ if ($ php_directive_snippets_txt == '' ) $ php_directive_snippets_txt = '------ ' ;
267+ $ app ->tpl ->setVar ("php_directive_snippets_txt " ,$ php_directive_snippets_txt );
268+
269+ if ($ server_type == 'apache ' ){
270+ $ apache_directive_snippets = $ app ->db ->queryAllRecords ("SELECT * FROM directive_snippets WHERE type = 'apache' AND active = 'y' " );
271+ $ apache_directive_snippets_txt = '' ;
272+ if (is_array ($ apache_directive_snippets ) && !empty ($ apache_directive_snippets )){
273+ foreach ($ apache_directive_snippets as $ apache_directive_snippet ){
274+ $ apache_directive_snippets_txt .= '<a href="javascript:void(0);" class="addPlaceholderContent">[ ' .$ apache_directive_snippet ['name ' ].']<pre class="addPlaceholderContent" style="display:none;"> ' .htmlentities ($ apache_directive_snippet ['snippet ' ]).'</pre></a> ' ;
275+ }
276+ }
277+ if ($ apache_directive_snippets_txt == '' ) $ apache_directive_snippets_txt = '------ ' ;
278+ $ app ->tpl ->setVar ("apache_directive_snippets_txt " ,$ apache_directive_snippets_txt );
279+ }
280+
281+ if ($ server_type == 'nginx ' ){
282+ $ nginx_directive_snippets = $ app ->db ->queryAllRecords ("SELECT * FROM directive_snippets WHERE type = 'nginx' AND active = 'y' " );
283+ $ nginx_directive_snippets_txt = '' ;
284+ if (is_array ($ nginx_directive_snippets ) && !empty ($ nginx_directive_snippets )){
285+ foreach ($ nginx_directive_snippets as $ nginx_directive_snippet ){
286+ $ nginx_directive_snippets_txt .= '<a href="javascript:void(0);" class="addPlaceholderContent">[ ' .$ nginx_directive_snippet ['name ' ].']<pre class="addPlaceholderContent" style="display:none;"> ' .htmlentities ($ nginx_directive_snippet ['snippet ' ]).'</pre></a> ' ;
287+ }
288+ }
289+ if ($ nginx_directive_snippets_txt == '' ) $ nginx_directive_snippets_txt = '------ ' ;
290+ $ app ->tpl ->setVar ("nginx_directive_snippets_txt " ,$ nginx_directive_snippets_txt );
291+ }
292+
293+ $ proxy_directive_snippets = $ app ->db ->queryAllRecords ("SELECT * FROM directive_snippets WHERE type = 'proxy' AND active = 'y' " );
294+ $ proxy_directive_snippets_txt = '' ;
295+ if (is_array ($ proxy_directive_snippets ) && !empty ($ proxy_directive_snippets )){
296+ foreach ($ proxy_directive_snippets as $ proxy_directive_snippet ){
297+ $ proxy_directive_snippets_txt .= '<a href="javascript:void(0);" class="addPlaceholderContent">[ ' .$ proxy_directive_snippet ['name ' ].']<pre class="addPlaceholderContent" style="display:none;"> ' .htmlentities ($ proxy_directive_snippet ['snippet ' ]).'</pre></a> ' ;
298+ }
299+ }
300+ if ($ proxy_directive_snippets_txt == '' ) $ proxy_directive_snippets_txt = '------ ' ;
301+ $ app ->tpl ->setVar ("proxy_directive_snippets_txt " ,$ proxy_directive_snippets_txt );
302+ }
256303
257304 //* Admin: If the logged in user is admin
258305 } else {
0 commit comments