function Settings::IsInList that tests if an option of a multi-select setting is set
This commit is contained in:
@@ -124,6 +124,23 @@ class Settings {
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* tests if a setting-value that i s a comma separated list contains an entry
|
||||||
|
*
|
||||||
|
* @param string $setting a group and a varname separated by a dot (group.varname)
|
||||||
|
* @param string $entry the entry that is expected to be in the list
|
||||||
|
*
|
||||||
|
* @return boolean true, if the list contains $entry
|
||||||
|
*/
|
||||||
|
public function pIsInList($setting = null, $entry = null) {
|
||||||
|
$s=Settings::Get($setting);
|
||||||
|
if ($s==null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$slist = explode(",",$s);
|
||||||
|
return in_array($entry, $slist);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* update a setting / set a new value
|
* update a setting / set a new value
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ return array (
|
|||||||
'email' => array (
|
'email' => array (
|
||||||
'url' => 'customer_email.php',
|
'url' => 'customer_email.php',
|
||||||
'label' => $lng['menue']['email']['email'],
|
'label' => $lng['menue']['email']['email'],
|
||||||
'show_element' => ( !in_array('email',explode(',',Settings::Get('panel.customer_hide_options'))) ),
|
'show_element' => ( !Settings::IsInList('panel.customer_hide_options','email') ),
|
||||||
'elements' => array (
|
'elements' => array (
|
||||||
array (
|
array (
|
||||||
'url' => 'customer_email.php?page=emails',
|
'url' => 'customer_email.php?page=emails',
|
||||||
@@ -72,7 +72,7 @@ return array (
|
|||||||
'mysql' => array (
|
'mysql' => array (
|
||||||
'url' => 'customer_mysql.php',
|
'url' => 'customer_mysql.php',
|
||||||
'label' => $lng['menue']['mysql']['mysql'],
|
'label' => $lng['menue']['mysql']['mysql'],
|
||||||
'show_element' => ( !in_array('mysql',explode(',',Settings::Get('panel.customer_hide_options'))) ),
|
'show_element' => ( !Settings::IsInList('panel.customer_hide_options','mysql') ),
|
||||||
'elements' => array (
|
'elements' => array (
|
||||||
array (
|
array (
|
||||||
'url' => 'customer_mysql.php?page=mysqls',
|
'url' => 'customer_mysql.php?page=mysqls',
|
||||||
@@ -91,7 +91,7 @@ return array (
|
|||||||
'domains' => array (
|
'domains' => array (
|
||||||
'url' => 'customer_domains.php',
|
'url' => 'customer_domains.php',
|
||||||
'label' => $lng['menue']['domains']['domains'],
|
'label' => $lng['menue']['domains']['domains'],
|
||||||
'show_element' => ( !in_array('domains',explode(',',Settings::Get('panel.customer_hide_options'))) ),
|
'show_element' => ( !Settings::IsInList('panel.customer_hide_options','domains') ),
|
||||||
'elements' => array (
|
'elements' => array (
|
||||||
array (
|
array (
|
||||||
'url' => 'customer_domains.php?page=domains',
|
'url' => 'customer_domains.php?page=domains',
|
||||||
@@ -102,7 +102,7 @@ return array (
|
|||||||
'ftp' => array (
|
'ftp' => array (
|
||||||
'url' => 'customer_ftp.php',
|
'url' => 'customer_ftp.php',
|
||||||
'label' => $lng['menue']['ftp']['ftp'],
|
'label' => $lng['menue']['ftp']['ftp'],
|
||||||
'show_element' => ( !in_array('ftp',explode(',',Settings::Get('panel.customer_hide_options'))) ),
|
'show_element' => ( !Settings::IsInList('panel.customer_hide_options','ftp') ),
|
||||||
'elements' => array (
|
'elements' => array (
|
||||||
array (
|
array (
|
||||||
'url' => 'customer_ftp.php?page=accounts',
|
'url' => 'customer_ftp.php?page=accounts',
|
||||||
@@ -119,34 +119,34 @@ return array (
|
|||||||
'extras' => array (
|
'extras' => array (
|
||||||
'url' => 'customer_extras.php',
|
'url' => 'customer_extras.php',
|
||||||
'label' => $lng['menue']['extras']['extras'],
|
'label' => $lng['menue']['extras']['extras'],
|
||||||
'show_element' => ( !in_array('extras',explode(',',Settings::Get('panel.customer_hide_options'))) ),
|
'show_element' => ( !Settings::IsInList('panel.customer_hide_options','extras') ),
|
||||||
'elements' => array (
|
'elements' => array (
|
||||||
array (
|
array (
|
||||||
'url' => 'customer_extras.php?page=htpasswds',
|
'url' => 'customer_extras.php?page=htpasswds',
|
||||||
'label' => $lng['menue']['extras']['directoryprotection'],
|
'label' => $lng['menue']['extras']['directoryprotection'],
|
||||||
'show_element' => ( !in_array('extras.directoryprotection',explode(',',Settings::Get('panel.customer_hide_options'))) ),
|
'show_element' => ( !Settings::IsInList('panel.customer_hide_options','extras.directoryprotection') ),
|
||||||
),
|
),
|
||||||
array (
|
array (
|
||||||
'url' => 'customer_extras.php?page=htaccess',
|
'url' => 'customer_extras.php?page=htaccess',
|
||||||
'label' => $lng['menue']['extras']['pathoptions'],
|
'label' => $lng['menue']['extras']['pathoptions'],
|
||||||
'show_element' => ( !in_array('extras.pathoptions',explode(',',Settings::Get('panel.customer_hide_options'))) ),
|
'show_element' => ( !Settings::IsInList('panel.customer_hide_options','extras.pathoptions') ),
|
||||||
),
|
),
|
||||||
array (
|
array (
|
||||||
'url' => 'customer_logger.php?page=log',
|
'url' => 'customer_logger.php?page=log',
|
||||||
'label' => $lng['menue']['logger']['logger'],
|
'label' => $lng['menue']['logger']['logger'],
|
||||||
'show_element' => ( Settings::Get('logger.enabled') == true ) && ( !in_array('extras.logger',explode(',',Settings::Get('panel.customer_hide_options'))) )
|
'show_element' => ( Settings::Get('logger.enabled') == true ) && ( !Settings::IsInList('panel.customer_hide_options','extras.logger') ),
|
||||||
),
|
),
|
||||||
array (
|
array (
|
||||||
'url' => 'customer_extras.php?page=backup',
|
'url' => 'customer_extras.php?page=backup',
|
||||||
'label' => $lng['menue']['extras']['backup'],
|
'label' => $lng['menue']['extras']['backup'],
|
||||||
'show_element' => ( Settings::Get('system.backupenabled') == true ),
|
'show_element' => ( Settings::Get('system.backupenabled') == true ) && ( !Settings::IsInList('panel.customer_hide_options','extras.backup') ),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
'traffic' => array (
|
'traffic' => array (
|
||||||
'url' => 'customer_traffic.php',
|
'url' => 'customer_traffic.php',
|
||||||
'label' => $lng['menue']['traffic']['traffic'],
|
'label' => $lng['menue']['traffic']['traffic'],
|
||||||
'show_element' => ( !in_array('traffic',explode(',',Settings::Get('panel.customer_hide_options'))) ),
|
'show_element' => ( !Settings::IsInList('panel.customer_hide_options','traffic') ),
|
||||||
'elements' => array (
|
'elements' => array (
|
||||||
array (
|
array (
|
||||||
'url' => 'customer_traffic.php?page=current',
|
'url' => 'customer_traffic.php?page=current',
|
||||||
|
|||||||
@@ -37,15 +37,15 @@ $header
|
|||||||
</form>
|
</form>
|
||||||
|
|
||||||
<div id="charts" class="hidden">
|
<div id="charts" class="hidden">
|
||||||
<if !in_array('traffic.http',explode(',',Settings::Get('panel.customer_hide_options')))>
|
<if !Settings::IsInList('panel.customer_hide_options','traffic.http')>
|
||||||
<h3>HTTP {$lng['admin']['traffic']} ({$lng['traffic']['months']['total']} {$traffic_complete['http']})</h3>
|
<h3>HTTP {$lng['admin']['traffic']} ({$lng['traffic']['months']['total']} {$traffic_complete['http']})</h3>
|
||||||
<div id="httpchart" class="trafficchart"></div>
|
<div id="httpchart" class="trafficchart"></div>
|
||||||
</if>
|
</if>
|
||||||
<if !in_array('traffic.ftp',explode(',',Settings::Get('panel.customer_hide_options')))>
|
<if !Settings::IsInList('panel.customer_hide_options','traffic.ftp')>
|
||||||
<h3>FTP {$lng['admin']['traffic']} ({$lng['traffic']['months']['total']} {$traffic_complete['ftp']})</h3>
|
<h3>FTP {$lng['admin']['traffic']} ({$lng['traffic']['months']['total']} {$traffic_complete['ftp']})</h3>
|
||||||
<div id="ftpchart" class="trafficchart"></div>
|
<div id="ftpchart" class="trafficchart"></div>
|
||||||
</if>
|
</if>
|
||||||
<if !in_array('traffic.mail',explode(',',Settings::Get('panel.customer_hide_options')))>
|
<if !Settings::IsInList('panel.customer_hide_options','traffic.mail')>
|
||||||
<h3>Mail {$lng['admin']['traffic']} ({$lng['traffic']['months']['total']} {$traffic_complete['mail']})</h3>
|
<h3>Mail {$lng['admin']['traffic']} ({$lng['traffic']['months']['total']} {$traffic_complete['mail']})</h3>
|
||||||
<div id="mailchart" class="trafficchart"></div>
|
<div id="mailchart" class="trafficchart"></div>
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@@ -31,15 +31,15 @@ $header
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div id="charts" class="hidden">
|
<div id="charts" class="hidden">
|
||||||
<if !in_array('traffic.http',explode(',',Settings::Get('panel.customer_hide_options')))>
|
<if !Settings::IsInList('panel.customer_hide_options','traffic.http')>
|
||||||
<h3>HTTP {$lng['admin']['traffic']} ({$lng['traffic']['months']['total']} {$traffic_complete['http']})</h3>
|
<h3>HTTP {$lng['admin']['traffic']} ({$lng['traffic']['months']['total']} {$traffic_complete['http']})</h3>
|
||||||
<div id="httpchart" class="trafficchart"></div>
|
<div id="httpchart" class="trafficchart"></div>
|
||||||
</if>
|
</if>
|
||||||
<if !in_array('traffic.ftp',explode(',',Settings::Get('panel.customer_hide_options')))>
|
<if !Settings::IsInList('panel.customer_hide_options','traffic.ftp')>
|
||||||
<h3>FTP {$lng['admin']['traffic']} ({$lng['traffic']['months']['total']} {$traffic_complete['ftp']})</h3>
|
<h3>FTP {$lng['admin']['traffic']} ({$lng['traffic']['months']['total']} {$traffic_complete['ftp']})</h3>
|
||||||
<div id="ftpchart" class="trafficchart"></div>
|
<div id="ftpchart" class="trafficchart"></div>
|
||||||
</if>
|
</if>
|
||||||
<if !in_array('traffic.mail',explode(',',Settings::Get('panel.customer_hide_options')))>
|
<if !Settings::IsInList('panel.customer_hide_options','traffic.mail')>
|
||||||
<h3>Mail {$lng['admin']['traffic']} ({$lng['traffic']['months']['total']} {$traffic_complete['mail']})</h3>
|
<h3>Mail {$lng['admin']['traffic']} ({$lng['traffic']['months']['total']} {$traffic_complete['mail']})</h3>
|
||||||
<div id="mailchart" class="trafficchart"></div>
|
<div id="mailchart" class="trafficchart"></div>
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
Reference in New Issue
Block a user