7 * @license http://www.gnu.org/licenses/agpl.html AGPL Version 3
8 * @copyright Copyright (c) 2007-2014 Metaways Infosystems GmbH (http://www.metaways.de)
9 * @author Philipp Schüle <p.schuele@metaways.de>
14 * the class provides functions to handle config options
19 * @todo remove all deprecated stuff
21 class Tinebase_Config extends Tinebase_Config_Abstract
42 const SIEVE = 'sieve';
45 * authentication backend config
49 const AUTHENTICATIONBACKEND = 'Tinebase_Authentication_BackendConfiguration';
52 * authentication backend type config
56 const AUTHENTICATIONBACKENDTYPE = 'Tinebase_Authentication_BackendType';
59 * save automatic alarms when creating new record
63 const AUTOMATICALARM = 'automaticalarm';
70 const USERBACKEND = 'Tinebase_User_BackendConfiguration';
73 * user backend type config
77 const USERBACKENDTYPE = 'Tinebase_User_BackendType';
84 const CRONUSERID = 'cronuserid';
87 * FEATURE_SHOW_ADVANCED_SEARCH
91 const FEATURE_SHOW_ADVANCED_SEARCH = 'featureShowAdvancedSearch';
94 * FEATURE_SHOW_ACCOUNT_EMAIL
98 const FEATURE_SHOW_ACCOUNT_EMAIL = 'featureShowAccountEmail';
101 * user defined page title postfix for browser page title
105 const PAGETITLEPOSTFIX = 'pagetitlepostfix';
108 * logout redirect url
112 const REDIRECTURL = 'redirectUrl';
119 const REDIRECTALWAYS = 'redirectAlways';
122 * Config key for Setting "Redirect to referring site if exists?"
126 const REDIRECTTOREFERRER = 'redirectToReferrer';
129 * Config key for configuring allowed origins of the json frontend
133 const ALLOWEDJSONORIGINS = 'allowedJsonOrigins';
136 * Config key for acceptedTermsVersion
139 const ACCEPTEDTERMSVERSION = 'acceptedTermsVersion';
142 * Config key for map panel in addressbook / include geoext code
145 const MAPPANEL = 'mapPanel';
148 * disable ldap certificate check
152 const LDAP_DISABLE_TLSREQCERT = 'ldapDisableTlsReqCert';
155 * overwritten ldap fields
159 const LDAP_OVERWRITE_CONTACT_FIELDS = 'ldapOverwriteContactFields';
162 * configure hook class for user sync
166 const SYNC_USER_HOOK_CLASS = 'syncUserHookClass';
169 * configure if user contact data should be synced from sync backend
173 const SYNC_USER_CONTACT_DATA = 'syncUserContactData';
176 * Config key for session ip validation -> if this is set to FALSE no Zend_Session_Validator_IpAddress is registered
180 const SESSIONIPVALIDATION = 'sessionIpValidation';
183 * Config key for session user agent validation -> if this is set to FALSE no Zend_Session_Validator_HttpUserAgent is registered
187 const SESSIONUSERAGENTVALIDATION = 'sessionUserAgentValidation';
190 * filestore directory
194 const FILESDIR = 'filesdir';
199 * @deprecated move to app config
202 const XLSEXPORTCONFIG = 'xlsexportconfig';
207 * @deprecated move to app and split
210 const APPDEFAULTS = 'appdefaults';
213 * REUSEUSERNAME_SAVEUSERNAME
217 const REUSEUSERNAME_SAVEUSERNAME = 'saveusername';
224 const PASSWORD_CHANGE = 'changepw';
227 * PASSWORD_POLICY_ACTIVE
231 const PASSWORD_POLICY_ACTIVE = 'pwPolicyActive';
234 * PASSWORD_POLICY_ONLYASCII
238 const PASSWORD_POLICY_ONLYASCII = 'pwPolicyOnlyASCII';
241 * PASSWORD_POLICY_MIN_LENGTH
245 const PASSWORD_POLICY_MIN_LENGTH = 'pwPolicyMinLength';
248 * PASSWORD_POLICY_MIN_WORD_CHARS
252 const PASSWORD_POLICY_MIN_WORD_CHARS = 'pwPolicyMinWordChars';
255 * PASSWORD_POLICY_MIN_UPPERCASE_CHARS
259 const PASSWORD_POLICY_MIN_UPPERCASE_CHARS = 'pwPolicyMinUppercaseChars';
262 * PASSWORD_POLICY_MIN_SPECIAL_CHARS
266 const PASSWORD_POLICY_MIN_SPECIAL_CHARS = 'pwPolicyMinSpecialChars';
269 * PASSWORD_POLICY_MIN_NUMBERS
273 const PASSWORD_POLICY_MIN_NUMBERS = 'pwPolicyMinNumbers';
276 * PASSWORD_POLICY_FORBID_USERNAME
280 const PASSWORD_POLICY_FORBID_USERNAME = 'pwPolicyForbidUsername';
283 * AUTOMATIC_BUGREPORTS
287 const AUTOMATIC_BUGREPORTS = 'automaticBugreports';
290 * LAST_SESSIONS_CLEANUP_RUN
294 const LAST_SESSIONS_CLEANUP_RUN = 'lastSessionsCleanupRun';
297 * WARN_LOGIN_FAILURES
301 const WARN_LOGIN_FAILURES = 'warnLoginFailures';
304 * ANYONE_ACCOUNT_DISABLED
308 const ANYONE_ACCOUNT_DISABLED = 'anyoneAccountDisabled';
315 const ALARMS_EACH_JOB = 'alarmsEachJob';
318 * ACCOUNT_DEACTIVATION_NOTIFICATION
322 const ACCOUNT_DEACTIVATION_NOTIFICATION = 'accountDeactivationNotification';
325 * ACCOUNT_DELETION_EVENTCONFIGURATION
329 const ACCOUNT_DELETION_EVENTCONFIGURATION = 'accountDeletionEventConfiguration';
336 const ROLE_CHANGE_ALLOWED = 'roleChangeAllowed';
339 * max username length
343 const MAX_USERNAME_LENGTH = 'max_username_length';
350 const CONFD_FOLDER = 'confdfolder';
357 const MAINTENANCE_MODE = 'maintenanceMode';
360 * @var array of strings
362 const FAT_CLIENT_CUSTOM_JS = 'fatClientCustomJS';
365 * @var array of strings
367 const VERSION_CHECK = 'versionCheck';
371 * @see tine20/Tinebase/Config/Definition::$_properties
373 protected static $_properties = array(
377 * $_deletePersonalContainers => delete personal containers
378 * $_keepAsContact => keep "account" as contact in the addressbook
379 * $_keepOrganizerEvents => keep accounts organizer events as external events in the calendar
380 * $_keepAsContact => keep accounts calender event attendee as external attendee
382 * TODO add more options (like move to another container)
384 self::ACCOUNT_DELETION_EVENTCONFIGURATION => array(
385 //_('Account Deletion Event')
386 'label' => 'Account Deletion Event',
387 //_('Configure what should happen to data of deleted users')
388 'description' => 'Configure what should happen to data of deleted users',
390 'class' => 'Tinebase_Config_Struct',
391 'clientRegistryInclude' => FALSE,
392 'setByAdminModule' => TRUE,
393 'setBySetupModule' => TRUE,
397 'label' => 'System IMAP',
398 //_('System IMAP server configuration.')
399 'description' => 'System IMAP server configuration.',
401 'class' => 'Tinebase_Config_Struct',
402 'clientRegistryInclude' => FALSE,
403 'setByAdminModule' => FALSE,
404 'setBySetupModule' => TRUE,
408 'label' => 'System SMTP',
409 //_('System SMTP server configuration.')
410 'description' => 'System SMTP server configuration.',
412 'class' => 'Tinebase_Config_Struct',
413 'clientRegistryInclude' => FALSE,
414 'setByAdminModule' => FALSE,
415 'setBySetupModule' => TRUE,
417 self::SIEVE => array(
419 'label' => 'System SIEVE',
420 //_('System SIEVE server configuration.')
421 'description' => 'System SIEVE server configuration.',
423 'class' => 'Tinebase_Config_Struct',
424 'clientRegistryInclude' => FALSE,
425 'setByAdminModule' => FALSE,
426 'setBySetupModule' => TRUE,
428 self::AUTHENTICATIONBACKENDTYPE => array(
429 //_('Authentication Backend')
430 'label' => 'Authentication Backend',
431 //_('Backend adapter for user authentication.')
432 'description' => 'Backend adapter for user authentication.',
434 'clientRegistryInclude' => FALSE,
435 'setByAdminModule' => FALSE,
436 'setBySetupModule' => TRUE,
438 self::AUTHENTICATIONBACKEND => array(
439 //_('Authentication Configuration')
440 'label' => 'Authentication Configuration',
441 //_('Authentication backend configuration.')
442 'description' => 'Authentication backend configuration.',
444 'class' => 'Tinebase_Config_Struct',
445 'clientRegistryInclude' => FALSE,
446 'setByAdminModule' => FALSE,
447 'setBySetupModule' => TRUE,
449 self::USERBACKENDTYPE => array(
451 'label' => 'User Backend',
452 //_('Backend adapter for user data.')
453 'description' => 'Backend adapter for user data.',
455 'clientRegistryInclude' => FALSE,
456 'setByAdminModule' => FALSE,
457 'setBySetupModule' => TRUE,
459 self::USERBACKEND => array(
460 //_('User Configuration')
461 'label' => 'User Configuration',
462 //_('User backend configuration.')
463 'description' => 'User backend configuration.',
465 'class' => 'Tinebase_Config_Struct',
466 'clientRegistryInclude' => FALSE,
467 'setByAdminModule' => FALSE,
468 'setBySetupModule' => TRUE,
470 self::ENABLED_FEATURES => array(
471 //_('Enabled Features')
472 'label' => 'Enabled Features',
473 'description' => 'Enabled Features',
475 'class' => 'Tinebase_Config_Struct',
476 'clientRegistryInclude' => TRUE,
478 self::FEATURE_SHOW_ADVANCED_SEARCH => array(
479 'label' => 'Show Advanced Search', //_('Show Advanced Search')
480 'description' => 'Show toggle button to switch on or off the advanced search for the quickfilter',
481 //_('Show toggle button to switch on or off the advanced search for the quickfilter')
483 self::FEATURE_SHOW_ACCOUNT_EMAIL => array(
484 'label' => 'Show Account Email Address', //_('Show Account Email Address')
485 'description' => 'Show email address in account picker and attendee grids',
486 //_('Show email address in account picker and attendee grids')
490 self::FEATURE_SHOW_ADVANCED_SEARCH => false,
491 self::FEATURE_SHOW_ACCOUNT_EMAIL => false,
494 self::CRONUSERID => array(
496 'label' => 'Cronuser ID',
497 //_('User ID of the cron user.')
498 'description' => 'User ID of the cron user.',
500 'clientRegistryInclude' => FALSE,
501 'setByAdminModule' => TRUE,
502 'setBySetupModule' => TRUE,
504 self::PAGETITLEPOSTFIX => array(
506 'label' => 'Title Postfix',
507 //_('Postfix string appended to the title of this installation.')
508 'description' => 'Postfix string appended to the title of this installation.',
510 'clientRegistryInclude' => FALSE,
511 'setByAdminModule' => TRUE,
512 'setBySetupModule' => TRUE,
514 self::REDIRECTURL => array(
516 'label' => 'Redirect URL',
517 //_('Redirect to this URL after logout.')
518 'description' => 'Redirect to this URL after logout.',
520 'clientRegistryInclude' => FALSE,
521 'setByAdminModule' => FALSE,
522 'setBySetupModule' => TRUE,
524 self::REDIRECTTOREFERRER => array(
525 //_('Redirect to Referrer')
526 'label' => 'Redirect to Referrer',
527 //_('Redirect to referrer after logout.')
528 'description' => 'Redirect to referrer after logout.',
530 'clientRegistryInclude' => FALSE,
531 'setByAdminModule' => FALSE,
532 'setBySetupModule' => TRUE,
534 self::REDIRECTALWAYS => array(
535 //_('Redirect Always')
536 'label' => 'Redirect Always',
537 //_('Redirect to configured redirect URL also for login.')
538 'description' => 'Redirect to configured redirect URL also for login.',
540 'clientRegistryInclude' => FALSE,
541 'setByAdminModule' => FALSE,
542 'setBySetupModule' => TRUE,
544 self::ALLOWEDJSONORIGINS => array(
545 //_('Allowed Origins')
546 'label' => 'Allowed Origins',
547 //_('Allowed Origins for the JSON API.')
548 'description' => 'Allowed Origins for the JSON API.',
550 'clientRegistryInclude' => FALSE,
551 'setByAdminModule' => FALSE,
552 'setBySetupModule' => FALSE,
554 self::ACCEPTEDTERMSVERSION => array(
555 //_('Accepted Terms Version')
556 'label' => 'Accepted Terms Version',
557 //_('Accepted version number of the terms and conditions document.')
558 'description' => 'Accepted version number of the terms and conditions document.',
560 'clientRegistryInclude' => FALSE,
561 'setByAdminModule' => FALSE,
562 'setBySetupModule' => FALSE,
564 self::MAPPANEL => array(
565 //_('Use Geolocation Services')
566 'label' => 'Use Geolocation Services',
567 //_('Use of external Geolocation services is allowed.')
568 'description' => 'Use of external Geolocation services is allowed.',
570 'clientRegistryInclude' => TRUE,
571 'setByAdminModule' => FALSE,
572 'setBySetupModule' => TRUE,
574 self::LDAP_DISABLE_TLSREQCERT => array(
575 //_('Disable LDAP TLS Certificate Check')
576 'label' => 'Disable LDAP TLS Certificate Check',
577 //_('LDAP TLS Certificate should not be checked')
578 'description' => 'LDAP TLS Certificate should not be checked',
580 'clientRegistryInclude' => false,
581 'setByAdminModule' => false,
582 'setBySetupModule' => true,
585 // TODO should this be added to LDAP config array/struct?
586 // TODO does this depend on LDAP readonly option?
587 self::LDAP_OVERWRITE_CONTACT_FIELDS => array(
588 //_('Contact fields overwritten by LDAP')
589 'label' => 'Contact fields overwritten by LDAP',
590 //_('These fields are overwritten during LDAP sync if empty')
591 'description' => 'These fields are overwritten during LDAP sync if empty',
593 'clientRegistryInclude' => false,
594 'setByAdminModule' => false,
595 'setBySetupModule' => true,
598 self::SYNC_USER_HOOK_CLASS => array(
599 //_('Configure hook class for user sync')
600 'label' => 'Configure hook class for user sync',
601 //_('Allows to change data after fetching user from sync backend')
602 'description' => 'Allows to change data after fetching user from sync backend',
604 'clientRegistryInclude' => false,
605 'setByAdminModule' => false,
606 'setBySetupModule' => true,
608 self::SYNC_USER_CONTACT_DATA => array(
609 //_('Sync contact data from sync backend')
610 'label' => 'Sync contact data from sync backend',
611 //_('Sync user contact data from sync backend')
612 'description' => 'Sync user contact data from sync backend',
614 'clientRegistryInclude' => FALSE,
615 'setByAdminModule' => FALSE,
616 'setBySetupModule' => FALSE,
619 self::SESSIONIPVALIDATION => array(
620 //_('IP Session Validator')
621 'label' => 'IP Session Validator',
622 //_('Destroy session if the users IP changes.')
623 'description' => 'Destroy session if the users IP changes.',
625 'clientRegistryInclude' => FALSE,
626 'setByAdminModule' => FALSE,
627 'setBySetupModule' => TRUE,
629 self::SESSIONUSERAGENTVALIDATION => array(
630 //_('UA Session Validator')
631 'label' => 'UA Session Validator',
632 //_('Destroy session if the users user agent string changes.')
633 'description' => 'Destroy session if the users user agent string changes.',
635 'clientRegistryInclude' => FALSE,
636 'setByAdminModule' => FALSE,
637 'setBySetupModule' => TRUE,
639 self::FILESDIR => array(
640 //_('Files Directory')
641 'label' => 'Files Directory',
642 //_('Directory with web server write access for user files.')
643 'description' => 'Directory with web server write access for user files.',
645 'clientRegistryInclude' => FALSE,
646 'setByAdminModule' => FALSE,
647 'setBySetupModule' => TRUE,
649 self::REUSEUSERNAME_SAVEUSERNAME => array(
650 //_('Reuse last username logged')
651 'label' => 'Reuse last username logged',
652 //_('Reuse last username logged')
653 'description' => 'Reuse last username logged',
655 'clientRegistryInclude' => FALSE,
656 'setByAdminModule' => FALSE,
657 'setBySetupModule' => TRUE,
659 self::PASSWORD_CHANGE => array(
660 //_('User may change password')
661 'label' => 'User may change password',
662 //_('User may change password')
663 'description' => 'User may change password',
665 'clientRegistryInclude' => TRUE,
666 'setByAdminModule' => FALSE,
667 'setBySetupModule' => TRUE,
670 self::PASSWORD_POLICY_ACTIVE => array(
671 //_('Enable password policy')
672 'label' => 'Enable password policy',
673 //_('Enable password policy')
674 'description' => 'Enable password policy',
676 'clientRegistryInclude' => FALSE,
677 'setByAdminModule' => FALSE,
678 'setBySetupModule' => TRUE,
680 self::PASSWORD_POLICY_ONLYASCII => array(
682 'label' => 'Only ASCII',
683 //_('Only ASCII characters are allowed in passwords.')
684 'description' => 'Only ASCII characters are allowed in passwords.',
686 'clientRegistryInclude' => FALSE,
687 'setByAdminModule' => FALSE,
688 'setBySetupModule' => TRUE,
690 self::PASSWORD_POLICY_MIN_LENGTH => array(
691 //_('Minimum length')
692 'label' => 'Minimum length',
693 //_('Minimum password length')
694 'description' => 'Minimum password length.',
696 'clientRegistryInclude' => FALSE,
697 'setByAdminModule' => FALSE,
698 'setBySetupModule' => TRUE,
700 self::PASSWORD_POLICY_MIN_WORD_CHARS => array(
701 //_('Minimum word chars')
702 'label' => 'Minimum word chars',
703 //_('Minimum word chars in password')
704 'description' => 'Minimum word chars in password',
706 'clientRegistryInclude' => FALSE,
707 'setByAdminModule' => FALSE,
708 'setBySetupModule' => TRUE,
710 self::PASSWORD_POLICY_MIN_UPPERCASE_CHARS => array(
711 //_('Minimum uppercase chars')
712 'label' => 'Minimum uppercase chars',
713 //_('Minimum uppercase chars in password')
714 'description' => 'Minimum uppercase chars in password',
716 'clientRegistryInclude' => FALSE,
717 'setByAdminModule' => FALSE,
718 'setBySetupModule' => TRUE,
720 self::PASSWORD_POLICY_MIN_SPECIAL_CHARS => array(
721 //_('Minimum special chars')
722 'label' => 'Minimum special chars',
723 //_('Minimum special chars in password')
724 'description' => 'Minimum special chars in password',
726 'clientRegistryInclude' => FALSE,
727 'setByAdminModule' => FALSE,
728 'setBySetupModule' => TRUE,
730 self::PASSWORD_POLICY_MIN_NUMBERS => array(
731 //_('Minimum numbers')
732 'label' => 'Minimum numbers',
733 //_('Minimum numbers in password')
734 'description' => 'Minimum numbers in password',
736 'clientRegistryInclude' => FALSE,
737 'setByAdminModule' => FALSE,
738 'setBySetupModule' => TRUE,
740 self::PASSWORD_POLICY_FORBID_USERNAME => array(
741 //_('Forbid part of username')
742 'label' => 'Forbid part of username',
743 //_('Forbid part of username in password')
744 'description' => 'Forbid part of username in password',
746 'clientRegistryInclude' => FALSE,
747 'setByAdminModule' => FALSE,
748 'setBySetupModule' => TRUE,
750 self::AUTOMATIC_BUGREPORTS => array(
751 //_('Automatic bugreports')
752 'label' => 'Automatic bugreports',
753 //_('Always send bugreports, even on timeouts and other exceptions / failures.')
754 'description' => 'Always send bugreports, even on timeouts and other exceptions / failures.',
756 'clientRegistryInclude' => TRUE,
757 'setByAdminModule' => FALSE,
758 'setBySetupModule' => TRUE,
760 self::LAST_SESSIONS_CLEANUP_RUN => array(
761 //_('Last sessions cleanup run')
762 'label' => 'Last sessions cleanup run',
763 //_('Stores the timestamp of the last sessions cleanup task run.')
764 'description' => 'Stores the timestamp of the last sessions cleanup task run.',
765 'type' => self::TYPE_DATETIME,
766 'clientRegistryInclude' => FALSE,
767 'setByAdminModule' => FALSE,
768 'setBySetupModule' => FALSE,
770 self::WARN_LOGIN_FAILURES => array(
771 //_('Warn after X login failures')
772 'label' => 'Warn after X login failures',
773 //_('Maximum allowed login failures before writing warn log messages')
774 'description' => 'Maximum allowed login failures before writing warn log messages',
776 'clientRegistryInclude' => FALSE,
777 'setByAdminModule' => FALSE,
778 'setBySetupModule' => TRUE,
781 self::ANYONE_ACCOUNT_DISABLED => array(
782 //_('Disable Anyone Account')
783 'label' => 'Disable Anyone Account',
784 //_('Disallow anyone account in grant configurations')
785 'description' => 'Disallow anyone account in grant configurations',
787 'clientRegistryInclude' => TRUE,
788 'setByAdminModule' => FALSE,
789 'setBySetupModule' => TRUE,
791 self::ALARMS_EACH_JOB => array(
792 //_('Alarms sent each job')
793 'label' => 'Alarms sent each job',
794 //_('Allows to configure the maximum number of alarm notifications in each run of sendPendingAlarms (0 = no limit)')
795 'description' => 'Allows to configure the maximum number of alarm notifications in each run of sendPendingAlarms (0 = no limit)',
797 'clientRegistryInclude' => FALSE,
798 'setByAdminModule' => FALSE,
799 'setBySetupModule' => TRUE,
801 self::ACCOUNT_DEACTIVATION_NOTIFICATION => array(
802 //_('Account deactivation notfication')
803 'label' => 'Account deactivation notfication',
804 //_('Send E-Mail to user if the account is deactivated or the user tries to login with deactivated account')
805 'description' => 'Send E-Mail to User if the account is deactivated or the user tries to login with deactivated account',
807 'clientRegistryInclude' => FALSE,
808 'setByAdminModule' => FALSE,
809 'setBySetupModule' => TRUE,
811 self::ROLE_CHANGE_ALLOWED => array(
812 //_('Role change allowed')
813 'label' => 'Role change allowed',
814 //_('Allows to configure which user is allowed to switch to another users account')
815 'description' => 'Allows to configure which user is allowed to switch to another users account',
816 'type' => 'Tinebase_Config_Struct',
817 'clientRegistryInclude' => TRUE,
818 'setByAdminModule' => FALSE,
819 'setBySetupModule' => TRUE,
821 self::MAX_USERNAME_LENGTH => array(
822 //_('Max username length')
823 'label' => 'Max username length',
824 //_('Max username length')
825 'description' => 'Max username length',
828 'clientRegistryInclude' => FALSE,
830 self::CONFD_FOLDER => array(
831 //_('conf.d folder name')
832 'label' => 'conf.d folder name',
833 //_('Folder for additional config files (conf.d) - NOTE: this is only used if set in config.inc.php!')
834 'description' => 'Folder for additional config files (conf.d) - NOTE: this is only used if set in config.inc.php!',
837 'clientRegistryInclude' => FALSE,
838 'setByAdminModule' => FALSE,
839 'setBySetupModule' => FALSE,
841 self::MAINTENANCE_MODE => array(
842 //_('Maintenance mode enabled')
843 'label' => 'Maintenance mode enabled',
844 //_('Folder for additional config files (conf.d) - NOTE: this is only used if set in config.inc.php!')
845 'description' => 'Installation is in maintenance mode. With this only users having the maintenance right can login',
848 'clientRegistryInclude' => FALSE,
849 'setByAdminModule' => TRUE,
850 'setBySetupModule' => TRUE,
852 self::VERSION_CHECK => array(
853 //_('Version check enabled')
854 'label' => 'Version check enabled',
855 'description' => 'Version check enabled',
858 'clientRegistryInclude' => true,
859 'setByAdminModule' => false,
860 'setBySetupModule' => false,
862 self::FAT_CLIENT_CUSTOM_JS => array(
863 // NOTE: it's possible to deliver customjs vom vfs by using the tine20:// streamwrapper
864 // tine20://<applicationid>/folders/shared/<containerid>/custom.js
865 //_('Custom Javascript includes for Fat-Client')
866 'label' => 'Custom Javascript includes for Fat-Client',
867 //_('An array of javascript files to include for the fat client. This files might be stored outside the docroot of the webserver.')
868 'description' => "An array of javascript files to include for the fat client. This files might be stored outside the docroot of the webserver.",
870 'default' => array(),
871 'clientRegistryInclude' => FALSE,
872 'setByAdminModule' => FALSE,
873 'setBySetupModule' => FALSE,
879 * @see tine20/Tinebase/Config/Abstract::$_appName
881 protected $_appName = 'Tinebase';
884 * holds the instance of the singleton
886 * @var Tinebase_Config
888 private static $_instance = NULL;
895 protected static $_serverPlugins = array(
896 'Tinebase_Server_Plugin_Json' => 80,
897 'Tinebase_Server_Plugin_WebDAV' => 80,
898 'Tinebase_Server_Plugin_Cli' => 90,
899 'Tinebase_Server_Plugin_Http' => 100
905 * don't use the constructor. use the singleton
907 private function __construct() {}
912 * don't use the constructor. use the singleton
914 private function __clone() {}
917 * Returns instance of Tinebase_Config
919 * @return Tinebase_Config
921 public static function getInstance()
923 if (self::$_instance === NULL) {
924 self::$_instance = new Tinebase_Config();
927 return self::$_instance;
932 * @see tine20/Tinebase/Config/Abstract::getProperties()
934 public static function getProperties()
936 return self::$_properties;
940 * get config for client registry
942 * @return Tinebase_Config_Struct
944 public function getClientRegistryConfig()
946 // get all config names to be included in registry
947 $clientProperties = new Tinebase_Config_Struct(array());
948 $userApplications = Tinebase_Core::getUser()->getApplications(TRUE);
949 foreach ($userApplications as $application) {
950 $config = Tinebase_Config_Abstract::factory($application->name);
952 $clientProperties[$application->name] = new Tinebase_Config_Struct(array());
953 $properties = $config->getProperties();
954 foreach ((array) $properties as $name => $definition) {
956 if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__
957 . ' ' . print_r($definition, TRUE));
959 if ((isset($definition['clientRegistryInclude']) || array_key_exists('clientRegistryInclude', $definition))
960 && $definition['clientRegistryInclude'] === TRUE)
962 // add definition here till we have a better place
964 $configRegistryItem = new Tinebase_Config_Struct(array(
965 'value' => $config->{$name},
966 'definition' => new Tinebase_Config_Struct($definition),
968 if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__
969 . ' ' . print_r($configRegistryItem->toArray(), TRUE));
970 $clientProperties[$application->name][$name] = $configRegistryItem;
971 } catch (Exception $e) {
972 Tinebase_Exception::log($e);
976 if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__
977 . ' Got ' . count($clientProperties[$application->name]) . ' config items for ' . $application->name . '.');
981 return $clientProperties;
985 * get application config
987 * @param string $applicationName Application name
988 * @return Tinebase_Config_Abstract $configClass
990 public static function getAppConfig($applicationName)
992 $configClassName = $applicationName . '_Config';
993 if (@class_exists($configClassName)) {
994 return $configClassName::getInstance();
996 if (Tinebase_Core::isLogLevel(Zend_Log::INFO)) Tinebase_Core::getLogger()->info(__METHOD__ . '::' . __LINE__
997 . ' Application ' . $applicationName . ' has no config.');
1003 * get option setting string
1006 * @param Tinebase_Record_Interface $_record
1007 * @param string $_id
1008 * @param string $_label
1011 public static function getOptionString($_record, $_label)
1013 $controller = Tinebase_Core::getApplicationInstance($_record->getApplication());
1014 $settings = $controller->getConfigSettings();
1015 $idField = $_label . '_id';
1017 $option = $settings->getOptionById($_record->{$idField}, $_label . 's');
1019 $result = (isset($option[$_label])) ? $option[$_label] : '';