responsive tools

This commit is contained in:
Roland Gruber 2018-05-19 08:15:34 +02:00
parent d5c1e06bac
commit 88a2bb9479
9 changed files with 48 additions and 45 deletions

View File

@ -60,6 +60,14 @@ This is a list of API changes for all LAM releases.
<br> <br>
<h2>6.3 -&gt; 6.4</h2>
<ul>
<li>Module API
<ul>
<li>get_profileOptions(): should no longer return a htmlTable but a htmlResponsiveRow</li>
</ul>
</li>
</ul>
<h2>6.2 -&gt; 6.3</h2> <h2>6.2 -&gt; 6.3</h2>
<ul> <ul>
<li>Module API <li>Module API

View File

@ -248,10 +248,10 @@ class asteriskAccount extends baseModule implements passwordService {
$selfServiceContainer->add(new htmlResponsiveInputField(_('Asterisk realm'), 'asteriskAccount_AsteriskRealm', null, array('AsteriskRealm', get_class($this))), 12); $selfServiceContainer->add(new htmlResponsiveInputField(_('Asterisk realm'), 'asteriskAccount_AsteriskRealm', null, array('AsteriskRealm', get_class($this))), 12);
$return['selfServiceSettings'] = $selfServiceContainer; $return['selfServiceSettings'] = $selfServiceContainer;
// profile options // profile options
$profileContainer = new htmlTable(); $profileContainer = new htmlResponsiveRow();
$profileContainer->addElement(new htmlTableExtendedInputField(_('Host'), 'asteriskAccount_AstAccountHost', null, 'AstAccountHost'), true); $profileContainer->add(new htmlResponsiveInputField(_('Host'), 'asteriskAccount_AstAccountHost', null, 'AstAccountHost'), 12);
$profileContainer->addElement(new htmlTableExtendedInputField(_('Account context'), 'asteriskAccount_AstAccountContext', null, 'AstAccountContext'), true); $profileContainer->add(new htmlResponsiveInputField(_('Account context'), 'asteriskAccount_AstAccountContext', null, 'AstAccountContext'), 12);
$profileContainer->addElement(new htmlTableExtendedInputField(_('Account type'), 'asteriskAccount_AstAccountType', null, 'AstAccountType'), true); $profileContainer->add(new htmlResponsiveInputField(_('Account type'), 'asteriskAccount_AstAccountType', null, 'AstAccountType'), 12);
$return['profile_options'] = $profileContainer; $return['profile_options'] = $profileContainer;
// profile mappings // profile mappings
$return['profile_mappings'] = array( $return['profile_mappings'] = array(

View File

@ -3,11 +3,10 @@ use \LAM\PDF\PDFTable;
use \LAM\PDF\PDFTableCell; use \LAM\PDF\PDFTableCell;
use \LAM\PDF\PDFTableRow; use \LAM\PDF\PDFTableRow;
/* /*
$Id$
This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam) This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam)
Copyright (C) 2009 - 2012 Pavel Pozdniak Copyright (C) 2009 - 2012 Pavel Pozdniak
2009 - 2017 Roland Gruber 2009 - 2018 Roland Gruber
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -127,8 +126,8 @@ class asteriskExtension extends baseModule {
); );
// profile options // profile options
$profileContainer = new htmlTable(); $profileContainer = new htmlResponsiveRow();
$profileContainer->addElement(new htmlTableExtendedInputField(_('Account context'), 'AsteriskExtension_AstContext', null, 'AstContext'), true); $profileContainer->add(new htmlResponsiveInputField(_('Account context'), 'AsteriskExtension_AstContext', null, 'AstContext'), 12);
$return['profile_options'] = $profileContainer; $return['profile_options'] = $profileContainer;
$return['profile_mappings'] = array( $return['profile_mappings'] = array(
'AsteriskExtension_AstContext' => 'AstContext', 'AsteriskExtension_AstContext' => 'AstContext',

View File

@ -121,10 +121,10 @@ class asteriskVoicemail extends baseModule implements passwordService {
), ),
); );
// profile options // profile options
$profileContainer = new htmlTable(); $profileContainer = new htmlResponsiveRow();
$profileContainer->addElement(new htmlTableExtendedInputField(_('Options'), 'asteriskVoicemail_AstVoicemailOptions', null, 'AstVoicemailOptions'), true); $profileContainer->add(new htmlResponsiveInputField(_('Options'), 'asteriskVoicemail_AstVoicemailOptions', null, 'AstVoicemailOptions'), 12);
$profileContainer->addElement(new htmlTableExtendedInputField(_('Voicemail context'), 'asteriskVoicemail_AstVoicemailContext', null, 'AstVoicemailContext'), true); $profileContainer->add(new htmlResponsiveInputField(_('Voicemail context'), 'asteriskVoicemail_AstVoicemailContext', null, 'AstVoicemailContext'), 12);
$profileContainer->addElement(new htmlTableExtendedInputField(_('Account context'), 'asteriskVoicemail_AstContext', null, 'AstContext'), true); $profileContainer->add(new htmlResponsiveInputField(_('Account context'), 'asteriskVoicemail_AstContext', null, 'AstContext'), 12);
$return['profile_options'] = $profileContainer; $return['profile_options'] = $profileContainer;
// profile mappings // profile mappings
$return['profile_mappings'] = array( $return['profile_mappings'] = array(

View File

@ -108,9 +108,9 @@ class authorizedServiceObject extends baseModule {
'authorizedService' => _('Authorized Services') 'authorizedService' => _('Authorized Services')
); );
// profile options // profile options
$profileContainer = new htmlTable(); $profileContainer = new htmlResponsiveRow();
$profileContainer->addElement(new htmlTableExtendedInputField(_('Authorized Services'), 'authorizedServiceObject_services', null, 'authorizedServices'), true); $profileContainer->add(new htmlResponsiveInputField(_('Authorized Services'), 'authorizedServiceObject_services', null, 'authorizedServices'), 12);
$profileContainer->addElement(new htmlTableExtendedInputCheckbox('authorizedServiceObject_addExt', false, _('Automatically add this extension'), 'autoAdd')); $profileContainer->add(new htmlResponsiveInputCheckbox('authorizedServiceObject_addExt', false, _('Automatically add this extension'), 'autoAdd'), 12);
$return['profile_options'] = $profileContainer; $return['profile_options'] = $profileContainer;
// profile checks // profile checks
$return['profile_checks']['authorizedServiceObject_services'] = array('type' => 'ext_preg', 'regex' => 'ascii', $return['profile_checks']['authorizedServiceObject_services'] = array('type' => 'ext_preg', 'regex' => 'ascii',

View File

@ -139,8 +139,8 @@ class courierMailAccount extends baseModule {
), ),
); );
// profile options // profile options
$profileContainer = new htmlTable(); $profileContainer = new htmlResponsiveRow();
$profileContainer->addElement(new htmlTableExtendedInputCheckbox('courierMailAccount_addExt', false, _('Automatically add this extension'), 'autoAdd'), true); $profileContainer->add(new htmlResponsiveInputCheckbox('courierMailAccount_addExt', false, _('Automatically add this extension'), 'autoAdd'), 12);
$return['profile_options'] = $profileContainer; $return['profile_options'] = $profileContainer;
// PDF fields // PDF fields
$return['PDF_fields'] = array( $return['PDF_fields'] = array(

View File

@ -1,10 +1,9 @@
<?php <?php
/* /*
$Id$
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
Copyright (C) 2008 Thomas Manninger Copyright (C) 2008 Thomas Manninger
2008 - 2017 Roland Gruber 2008 - 2018 Roland Gruber
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -223,19 +222,19 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
'unknownClients' => _('Unknown clients'), 'unknownClients' => _('Unknown clients'),
); );
// profile elements // profile elements
$profileContainer = new htmlTable(); $profileContainer = new htmlResponsiveRow();
$profileContainer->addElement(new htmlTableExtendedInputField(_('Subnet'), 'cn', null, 'subnet'), true); $profileContainer->add(new htmlResponsiveInputField(_('Subnet'), 'cn', null, 'subnet'), 12);
$profileContainer->addElement(new htmlTableExtendedInputField(_('Domain name'), 'domainname', null, 'domainname'), true); $profileContainer->add(new htmlResponsiveInputField(_('Domain name'), 'domainname', null, 'domainname'), 12);
$profileContainer->addElement(new htmlTableExtendedInputField(_('Lease time'), 'lease_time', null, 'leasetime'), true); $profileContainer->add(new htmlResponsiveInputField(_('Lease time'), 'lease_time', null, 'leasetime'), 12);
$profileContainer->addElement(new htmlTableExtendedInputField(_('Maximum lease time'), 'max_lease_time', null, 'max_leasetime'), true); $profileContainer->add(new htmlResponsiveInputField(_('Maximum lease time'), 'max_lease_time', null, 'max_leasetime'), 12);
$profileContainer->addElement(new htmlTableExtendedInputField(_('DNS'), 'dns', null, 'dns'), true); $profileContainer->add(new htmlResponsiveInputField(_('DNS'), 'dns', null, 'dns'), 12);
$profileContainer->addElement(new htmlTableExtendedInputField(_('Default gateway'), 'routers', null, 'gateway'), true); $profileContainer->add(new htmlResponsiveInputField(_('Default gateway'), 'routers', null, 'gateway'), 12);
$profileContainer->addElement(new htmlTableExtendedInputField(_('Netbios name servers'), 'netbios', null, 'netbios'), true); $profileContainer->add(new htmlResponsiveInputField(_('Netbios name servers'), 'netbios', null, 'netbios'), 12);
$nodeList = array_flip($this->all_netbios_node_types); $nodeList = array_flip($this->all_netbios_node_types);
$profileNodeSelect = new htmlTableExtendedSelect('netbios_node_type', $nodeList, null, _('Netbios node type'), 'netbios_type'); $profileNodeSelect = new htmlResponsiveSelect('netbios_node_type', $nodeList, null, _('Netbios node type'), 'netbios_type');
$profileNodeSelect->setHasDescriptiveElements(true); $profileNodeSelect->setHasDescriptiveElements(true);
$profileContainer->addElement($profileNodeSelect, true); $profileContainer->add($profileNodeSelect, 12);
$profileContainer->addElement(new htmlTableExtendedInputField(_('Subnet mask'), 'subnet', null, 'subnetmask'), true); $profileContainer->add(new htmlResponsiveInputField(_('Subnet mask'), 'subnet', null, 'subnetmask'), 12);
$return['profile_options'] = $profileContainer; $return['profile_options'] = $profileContainer;
// upload fields // upload fields
$uploadAllowDenyOption = $this->allowDenyOptions; $uploadAllowDenyOption = $this->allowDenyOptions;

View File

@ -1,9 +1,8 @@
<?php <?php
/* /*
$Id$
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
Copyright (C) 2009 - 2015 Roland Gruber Copyright (C) 2009 - 2018 Roland Gruber
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -151,8 +150,8 @@ class eduPerson extends baseModule {
"Text" => _("This will enable the extension automatically if this profile is loaded.") "Text" => _("This will enable the extension automatically if this profile is loaded.")
)); ));
// profile options // profile options
$profileContainer = new htmlTable(); $profileContainer = new htmlResponsiveRow();
$profileContainer->addElement(new htmlTableExtendedInputCheckbox('eduPerson_addExt', false, _('Automatically add this extension'), 'autoAdd')); $profileContainer->add(new htmlResponsiveInputCheckbox('eduPerson_addExt', false, _('Automatically add this extension'), 'autoAdd'), 12);
$return['profile_options'] = $profileContainer; $return['profile_options'] = $profileContainer;
// upload fields // upload fields
$return['upload_columns'] = array( $return['upload_columns'] = array(

View File

@ -1,9 +1,8 @@
<?php <?php
/* /*
$Id$
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
Copyright (C) 2011 - 2017 Roland Gruber Copyright (C) 2011 - 2018 Roland Gruber
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -131,7 +130,7 @@ class freeRadius extends baseModule {
// profile settings // profile settings
$profileElements = array(); $profileElements = array();
if (!$this->isBooleanConfigOptionSet('freeRadius_hideRadiusFramedIPNetmask')) { if (!$this->isBooleanConfigOptionSet('freeRadius_hideRadiusFramedIPNetmask')) {
$profileElements[] = new htmlTableExtendedInputField(_('Net mask'), 'freeRadius_radiusFramedIPNetmask', null, 'radiusFramedIPNetmask'); $profileElements[] = new htmlResponsiveInputField(_('Net mask'), 'freeRadius_radiusFramedIPNetmask', null, 'radiusFramedIPNetmask');
$return['profile_checks']['freeRadius_radiusFramedIPNetmask'] = array( $return['profile_checks']['freeRadius_radiusFramedIPNetmask'] = array(
'type' => 'ext_preg', 'type' => 'ext_preg',
'regex' => 'ip', 'regex' => 'ip',
@ -139,7 +138,7 @@ class freeRadius extends baseModule {
$return['profile_mappings']['freeRadius_radiusFramedIPNetmask'] = 'radiusFramedIPNetmask'; $return['profile_mappings']['freeRadius_radiusFramedIPNetmask'] = 'radiusFramedIPNetmask';
} }
if (!$this->isBooleanConfigOptionSet('freeRadius_hideRadiusRealm')) { if (!$this->isBooleanConfigOptionSet('freeRadius_hideRadiusRealm')) {
$profileElements[] = new htmlTableExtendedInputField(_('Realm'), 'freeRadius_radiusRealm', null, 'radiusRealm'); $profileElements[] = new htmlResponsiveInputField(_('Realm'), 'freeRadius_radiusRealm', null, 'radiusRealm');
$return['profile_checks']['freeRadius_radiusRealm'] = array( $return['profile_checks']['freeRadius_radiusRealm'] = array(
'type' => 'ext_preg', 'type' => 'ext_preg',
'regex' => 'DNSname', 'regex' => 'DNSname',
@ -147,10 +146,10 @@ class freeRadius extends baseModule {
$return['profile_mappings']['freeRadius_radiusRealm'] = 'radiusRealm'; $return['profile_mappings']['freeRadius_radiusRealm'] = 'radiusRealm';
} }
if (!$this->isBooleanConfigOptionSet('freeRadius_hideRadiusGroupName')) { if (!$this->isBooleanConfigOptionSet('freeRadius_hideRadiusGroupName')) {
$profileElements[] = new htmlTableExtendedInputField(_('Group names'), 'freeRadius_radiusGroupName', null, 'radiusGroupNameList'); $profileElements[] = new htmlResponsiveInputField(_('Group names'), 'freeRadius_radiusGroupName', null, 'radiusGroupNameList');
} }
if (!$this->isBooleanConfigOptionSet('freeRadius_hideRadiusIdleTimeout')) { if (!$this->isBooleanConfigOptionSet('freeRadius_hideRadiusIdleTimeout')) {
$profileElements[] = new htmlTableExtendedInputField(_('Idle timeout'), 'freeRadius_radiusIdleTimeout', null, 'radiusIdleTimeout'); $profileElements[] = new htmlResponsiveInputField(_('Idle timeout'), 'freeRadius_radiusIdleTimeout', null, 'radiusIdleTimeout');
$return['profile_checks']['freeRadius_radiusIdleTimeout'] = array( $return['profile_checks']['freeRadius_radiusIdleTimeout'] = array(
'type' => 'ext_preg', 'type' => 'ext_preg',
'regex' => 'digit', 'regex' => 'digit',
@ -159,7 +158,7 @@ class freeRadius extends baseModule {
} }
if (!$this->isBooleanConfigOptionSet('freeRadius_hideDialupAccess')) { if (!$this->isBooleanConfigOptionSet('freeRadius_hideDialupAccess')) {
$enabledOptions = array('-' => '', _('Yes') => 'true', _('No') => 'false'); $enabledOptions = array('-' => '', _('Yes') => 'true', _('No') => 'false');
$dialupAccessSelect = new htmlTableExtendedSelect('freeRadius_dialupAccess', $enabledOptions, array('true'), _('Enabled'), 'dialupAccess'); $dialupAccessSelect = new htmlResponsiveSelect('freeRadius_dialupAccess', $enabledOptions, array('true'), _('Enabled'), 'dialupAccess');
$dialupAccessSelect->setHasDescriptiveElements(true); $dialupAccessSelect->setHasDescriptiveElements(true);
$profileElements[] = $dialupAccessSelect; $profileElements[] = $dialupAccessSelect;
$return['profile_mappings']['freeRadius_dialupAccess'] = 'dialupAccess'; $return['profile_mappings']['freeRadius_dialupAccess'] = 'dialupAccess';
@ -169,16 +168,15 @@ class freeRadius extends baseModule {
foreach ($this->getProfiles() as $dn) { foreach ($this->getProfiles() as $dn) {
$profileOptions[getAbstractDN($dn)] = $dn; $profileOptions[getAbstractDN($dn)] = $dn;
} }
$profileSelect = new htmlTableExtendedSelect('freeRadius_radiusProfileDn', $profileOptions, array(''), _('Profile'), 'radiusProfileDn'); $profileSelect = new htmlResponsiveSelect('freeRadius_radiusProfileDn', $profileOptions, array(''), _('Profile'), 'radiusProfileDn');
$profileSelect->setHasDescriptiveElements(true); $profileSelect->setHasDescriptiveElements(true);
$profileElements[] = $profileSelect; $profileElements[] = $profileSelect;
$return['profile_mappings']['freeRadius_radiusProfileDn'] = 'radiusProfileDn'; $return['profile_mappings']['freeRadius_radiusProfileDn'] = 'radiusProfileDn';
} }
if (sizeof($profileElements) > 0) { if (sizeof($profileElements) > 0) {
$profileContainer = new htmlTable(); $profileContainer = new htmlResponsiveRow();
for ($i = 0; $i < sizeof($profileElements); $i++) { for ($i = 0; $i < sizeof($profileElements); $i++) {
$profileContainer->addElement($profileElements[$i]); $profileContainer->add($profileElements[$i], 12);
$profileContainer->addNewLine();
} }
$return['profile_options'] = $profileContainer; $return['profile_options'] = $profileContainer;
} }