From 7028ac28e428fa413853ab035a57e51e7bb66b68 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Fri, 13 Mar 2015 17:15:45 +0000 Subject: [PATCH] added addPDFKeyValue() --- lam/lib/modules/pykotaGroup.inc | 2 +- lam/lib/modules/pykotaPrinter.inc | 6 ++--- lam/lib/modules/pykotaUser.inc | 2 +- lam/lib/modules/sambaDomain.inc | 6 ++--- lam/lib/modules/sambaGroupMapping.inc | 2 +- lam/lib/modules/sambaSamAccount.inc | 32 +++++++++++++-------------- lam/lib/modules/shadowAccount.inc | 6 ++--- 7 files changed, 28 insertions(+), 28 deletions(-) diff --git a/lam/lib/modules/pykotaGroup.inc b/lam/lib/modules/pykotaGroup.inc index 744ed6dc..cdfead4b 100644 --- a/lam/lib/modules/pykotaGroup.inc +++ b/lam/lib/modules/pykotaGroup.inc @@ -474,7 +474,7 @@ class pykotaGroup extends baseModule { if (!empty($this->attributes['pykotaLimitBy'][0]) && isset($limitByOptions[$this->attributes['pykotaLimitBy'][0]])) { $limitByValue = $limitByOptions[$this->attributes['pykotaLimitBy'][0]]; } - $return[get_class($this) . '_pykotaLimitBy'] = array('' . _('Limit type') . '' . $limitByValue . ''); + $this->addPDFKeyValue($return, 'pykotaLimitBy', _('Limit type'), $limitByValue); return $return; } diff --git a/lam/lib/modules/pykotaPrinter.inc b/lam/lib/modules/pykotaPrinter.inc index cf1233ab..64cd4e88 100644 --- a/lam/lib/modules/pykotaPrinter.inc +++ b/lam/lib/modules/pykotaPrinter.inc @@ -595,7 +595,7 @@ class pykotaPrinter extends baseModule { if (!empty($this->attributes['pykotaPassThrough'][0]) && isset($passthroughOptions[$this->attributes['pykotaPassThrough'][0]])) { $passthroughValue = $passthroughOptions[$this->attributes['pykotaPassThrough'][0]]; } - $return[get_class($this) . '_pykotaPassThrough'] = array('' . _('Passthrough') . '' . $passthroughValue . ''); + $this->addPDFKeyValue($return, 'pykotaPassThrough', _('Passthrough'), $passthroughValue); // members if (!empty($this->attributes['uniqueMember'][0])) { $members = array(); @@ -607,7 +607,7 @@ class pykotaPrinter extends baseModule { $members[] = getAbstractDN($member); } } - $return[get_class($this) . '_uniqueMember'] = array('' . _('Group members') . '' . implode(', ', $members) . ''); + $this->addPDFKeyValue($return, 'uniqueMember', _('Group members'), implode(', ', $members)); } // printer groups $parentGroups = array(); @@ -621,7 +621,7 @@ class pykotaPrinter extends baseModule { } } if (sizeof($parentGroups) > 0) { - $return[get_class($this) . '_parentUniqueMember'] = array('' . _('Printer groups') . '' . implode(', ', $parentGroups) . ''); + $this->addPDFKeyValue($return, 'parentUniqueMember', _('Printer groups'), implode(', ', $parentGroups)); } return $return; } diff --git a/lam/lib/modules/pykotaUser.inc b/lam/lib/modules/pykotaUser.inc index c8a3c68e..2699d26c 100644 --- a/lam/lib/modules/pykotaUser.inc +++ b/lam/lib/modules/pykotaUser.inc @@ -898,7 +898,7 @@ class pykotaUser extends baseModule { if (!empty($this->attributes['pykotaLimitBy'][0]) && isset($limitByOptions[$this->attributes['pykotaLimitBy'][0]])) { $limitByValue = $limitByOptions[$this->attributes['pykotaLimitBy'][0]]; } - $return[get_class($this) . '_pykotaLimitBy'] = array('' . _('Limit type') . '' . $limitByValue . ''); + $this->addPDFKeyValue($return, 'pykotaLimitBy', _('Limit type'), $limitByValue); $this->addSimplePDFField($return, 'pykotaOverCharge', _('Overcharge factor')); $this->addSimplePDFField($return, 'pykotaBalance', _('Balance')); $this->addSimplePDFField($return, 'pykotaLifeTimePaid', _('Total paid')); diff --git a/lam/lib/modules/sambaDomain.inc b/lam/lib/modules/sambaDomain.inc index 4aa00402..83368624 100644 --- a/lam/lib/modules/sambaDomain.inc +++ b/lam/lib/modules/sambaDomain.inc @@ -614,17 +614,17 @@ class sambaDomain extends baseModule { if (isset($this->attributes['sambaLogonToChgPwd'])) { $logonToChgPwd = _('Off'); if ($this->attributes['sambaPwdHistoryLength'][0] == 2) $logonToChgPwd = _('On'); - $return['sambaDomain_logonToChgPwd'][0] = '' . _('Logon for password change') . '' . $logonToChgPwd . ''; + $this->addPDFKeyValue($return, 'logonToChgPwd', _('Logon for password change'), $logonToChgPwd); } if (isset($this->attributes['sambaForceLogoff'])) { $forceLogoff = _('Off'); if ($this->attributes['sambaForceLogoff'][0] == 0) $forceLogoff = _('On'); - $return['sambaDomain_forceLogoff'][0] = '' . _('Disconnect users outside logon hours') . '' . $forceLogoff . ''; + $this->addPDFKeyValue($return, 'forceLogoff', _('Disconnect users outside logon hours'), $forceLogoff); } if (isset($this->attributes['sambaRefuseMachinePwdChange'])) { $refuseMachinePwdChange = _('Off'); if ($this->attributes['sambaRefuseMachinePwdChange'][0] == 0) $refuseMachinePwdChange = _('On'); - $return['sambaDomain_refuseMachinePwdChange'][0] = '' . _('Allow machine password changes') . '' . $refuseMachinePwdChange . ''; + $this->addPDFKeyValue($return, 'refuseMachinePwdChange', _('Allow machine password changes'), $refuseMachinePwdChange); } return $return; } diff --git a/lam/lib/modules/sambaGroupMapping.inc b/lam/lib/modules/sambaGroupMapping.inc index 5f707d4a..6c93537e 100644 --- a/lam/lib/modules/sambaGroupMapping.inc +++ b/lam/lib/modules/sambaGroupMapping.inc @@ -553,7 +553,7 @@ class sambaGroupMapping extends baseModule { $members[] = $member; } } - $return[get_class($this) . '_sambaSIDList'] = array('' . _('Local members') . '' . implode(', ', $members) . ''); + $this->addPDFKeyValue($return, 'sambaSIDList', _('Local members'), implode(', ', $members)); } return $return; } diff --git a/lam/lib/modules/sambaSamAccount.inc b/lam/lib/modules/sambaSamAccount.inc index fba486d9..3e57b77e 100644 --- a/lam/lib/modules/sambaSamAccount.inc +++ b/lam/lib/modules/sambaSamAccount.inc @@ -1920,35 +1920,35 @@ class sambaSamAccount extends baseModule implements passwordService { if (!$mDial->getTsLogin()) { $tsAllowLogin = _('no'); } - $return['sambaSamAccount_tsAllowLogin'] = array('' . _('Allow terminal server login') . '' . $tsAllowLogin . ''); - $return['sambaSamAccount_tsHomeDir'] = array('' . _('Home directory') . ' (TS)' . $mDial->ctx['CtxWFHomeDir'] . ''); - $return['sambaSamAccount_tsHomeDrive'] = array('' . _('Home drive') . ' (TS)' . $mDial->ctx['CtxWFHomeDirDrive'] . ''); - $return['sambaSamAccount_tsProfilePath'] = array('' . _('Profile path') . ' (TS)' . $mDial->ctx['CtxWFProfilePath'] . ''); + $this->addPDFKeyValue($return, 'tsAllowLogin', _('Allow terminal server login'), $tsAllowLogin); + $this->addPDFKeyValue($return, 'tsHomeDir', _('Home directory'). ' (TS)', $mDial->ctx['CtxWFHomeDir']); + $this->addPDFKeyValue($return, 'tsHomeDrive', _('Home drive') . ' (TS)', $mDial->ctx['CtxWFHomeDirDrive']); + $this->addPDFKeyValue($return, 'tsProfilePath', _('Profile path') . ' (TS)', $mDial->ctx['CtxWFProfilePath']); $tsInherit = _('yes'); if (!$mDial->getInheritMode()) { $tsInherit = _('no'); } - $return['sambaSamAccount_tsInherit'] = array('' . _('Inherit client startup configuration') . ' (TS)' . $tsInherit . ''); - $return['sambaSamAccount_tsInitialProgram'] = array('' . _('Initial program') . ' (TS)' . $mDial->ctx['CtxInitialProgram'] . ''); - $return['sambaSamAccount_tsWorkDirectory'] = array('' . _('Working directory') . ' (TS)' . $mDial->ctx['CtxWorkDirectory'] . ''); - $return['sambaSamAccount_tsConnectionLimit'] = array('' . _('Connection time limit') . ' (TS)' . $mDial->ctx['CtxMaxConnectionTime'] . ''); - $return['sambaSamAccount_tsDisconnectionLimit'] = array('' . _('Disconnection time limit') . ' (TS)' . $mDial->ctx['CtxMaxDisconnectionTime'] . ''); - $return['sambaSamAccount_tsIdleLimit'] = array('' . _('Idle time limit') . ' (TS)' . $mDial->ctx['CtxMaxIdleTime'] . ''); + $this->addPDFKeyValue($return, 'tsInherit', _('Inherit client startup configuration') . ' (TS)', $tsInherit); + $this->addPDFKeyValue($return, 'tsInitialProgram', _('Initial program') . ' (TS)', $mDial->ctx['CtxInitialProgram']); + $this->addPDFKeyValue($return, 'tsWorkDirectory', _('Working directory') . ' (TS)', $mDial->ctx['CtxWorkDirectory']); + $this->addPDFKeyValue($return, 'tsConnectionLimit', _('Connection time limit') . ' (TS)', $mDial->ctx['CtxMaxConnectionTime']); + $this->addPDFKeyValue($return, 'tsDisconnectionLimit', _('Disconnection time limit') . ' (TS)', $mDial->ctx['CtxMaxDisconnectionTime']); + $this->addPDFKeyValue($return, 'tsIdleLimit', _('Idle time limit') . ' (TS)', $mDial->ctx['CtxMaxIdleTime']); $tsConnectDrives = _('yes'); if (!$mDial->getConnectClientDrives()) { $tsConnectDrives = _('no'); } - $return['sambaSamAccount_tsConnectDrives'] = array('' . _('Connect client drives') . ' (TS)' . $tsConnectDrives . ''); + $this->addPDFKeyValue($return, 'tsConnectDrives', _('Connect client drives') . ' (TS)', $tsConnectDrives); $tsConnectPrinters = _('yes'); if (!$mDial->getConnectClientPrinters()) { $tsConnectPrinters = _('no'); } - $return['sambaSamAccount_tsConnectPrinters'] = array('' . _('Connect client printers') . ' (TS)' . $tsConnectPrinters . ''); + $this->addPDFKeyValue($return, 'tsConnectPrinters', _('Connect client printers') . ' (TS)', $tsConnectPrinters); $tsClientPrinterDefault = _('yes'); if (!$mDial->getDefaultPrinter()) { $tsClientPrinterDefault = _('no'); } - $return['sambaSamAccount_tsClientPrinterDefault'] = array('' . _('Client printer is default') . ' (TS)' . $tsClientPrinterDefault . ''); + $this->addPDFKeyValue($return, 'tsClientPrinterDefault', _('Client printer is default') . ' (TS)', $tsClientPrinterDefault); $shadowOptions = array( '0' => _("disabled"), '1' => _("input on, notify on"), @@ -1959,7 +1959,7 @@ class sambaSamAccount extends baseModule implements passwordService { if (($mDial->getShadow() != null) && is_numeric($mDial->getShadow())) { $tsShadowing = $shadowOptions[$mDial->getShadow()]; } - $return['sambaSamAccount_tsShadowing'] = array('' . _('Shadowing') . ' (TS)' . $tsShadowing . ''); + $this->addPDFKeyValue($return, 'tsShadowing', _('Shadowing') . ' (TS)', $tsShadowing); $brokenConnOptions = array( '0' => _("disconnect"), '1' => _("reset")); @@ -1967,7 +1967,7 @@ class sambaSamAccount extends baseModule implements passwordService { if (($mDial->getBrokenConn() != null) && is_numeric($mDial->getBrokenConn())) { $tsBrokenConn = $brokenConnOptions[$mDial->getBrokenConn()]; } - $return['sambaSamAccount_tsBrokenConn'] = array('' . _('On broken or timed out connection') . ' (TS)' . $tsBrokenConn . ''); + $this->addPDFKeyValue($return, 'tsBrokenConn', _('On broken or timed out connection') . ' (TS)', $tsBrokenConn); $reconnectOptions = array( '0' => _("from any client"), '1' => _("from previous client only")); @@ -1975,7 +1975,7 @@ class sambaSamAccount extends baseModule implements passwordService { if (($mDial->getReConn() != null) && is_numeric($mDial->getReConn())) { $tsReconnect = $reconnectOptions[$mDial->getReConn()]; } - $return['sambaSamAccount_tsReconnect'] = array('' . _('Reconnect if disconnected') . ' (TS)' . $tsReconnect . ''); + $this->addPDFKeyValue($return, 'tsReconnect', _('Reconnect if disconnected') . ' (TS)', $tsReconnect); } return $return; } diff --git a/lam/lib/modules/shadowAccount.inc b/lam/lib/modules/shadowAccount.inc index a7ffe5fe..11b89f52 100644 --- a/lam/lib/modules/shadowAccount.inc +++ b/lam/lib/modules/shadowAccount.inc @@ -496,9 +496,9 @@ class shadowAccount extends baseModule implements passwordService { if (isset($this->attributes['shadowExpire'][0])) { $shadowExpire = date('d. m. Y',$this->attributes['shadowExpire'][0]*24*3600); } - $return = array('shadowAccount_shadowLastChange' => array('' . _('Last password change') . '' . $shadowLastChange . ''), - 'shadowAccount_shadowExpire' => array('' . _('Account expiration date') . '' . $shadowExpire . ''), - ); + $return = array(); + $this->addPDFKeyValue($return, 'shadowLastChange', _('Last password change'), $shadowLastChange); + $this->addPDFKeyValue($return, 'shadowExpire', _('Account expiration date'), $shadowExpire); $this->addSimplePDFField($return, 'shadowWarning', _('Password warning')); $this->addSimplePDFField($return, 'shadowInactive', _('Password expiration')); $this->addSimplePDFField($return, 'shadowMinAge', _('Minimum password age'), 'shadowMin');