Esempio n. 1
0
 function init()
 {
     parent::init();
     $oContentField = new AnwContentFieldSettings_radio(self::FIELD_STORAGE);
     $asEnumValues = AnwStorageDriver::getAvailableComponents(AnwComponent::TYPE_STORAGEDRIVER);
     $oContentField->setEnumValuesFromList($asEnumValues);
     $oContentField->setMandatory(true);
     $this->addContentField($oContentField);
     $oContentField = new AnwContentFieldSettings_radio(self::FIELD_SESSIONS);
     $asEnumValues = AnwSessionsDriver::getAvailableComponents(AnwComponent::TYPE_SESSIONSDRIVER);
     $oContentField->setEnumValuesFromList($asEnumValues);
     $oContentField->setMandatory(true);
     $this->addContentField($oContentField);
     $oContentField = new AnwContentFieldSettings_radio(self::FIELD_USERS);
     $asEnumValues = AnwUsersDriver::getAvailableComponents(AnwComponent::TYPE_USERSDRIVER);
     $oContentField->setEnumValuesFromList($asEnumValues);
     $oContentField->setMandatory(true);
     $this->addContentField($oContentField);
     $oContentField = new AnwContentFieldSettings_radio(self::FIELD_ACLS);
     $asEnumValues = AnwAclsDriver::getAvailableComponents(AnwComponent::TYPE_ACLSDRIVER);
     $oContentField->setEnumValuesFromList($asEnumValues);
     $oContentField->setMandatory(true);
     $this->addContentField($oContentField);
 }
 function init()
 {
     parent::init();
     //lang policy
     $oContentField = new AnwContentFieldSettings_radio(self::FIELD_POLICY);
     $asEnumValues = array(self::POLICY_ALL_LANGS => $this->getComponent()->t_contentfieldsettings("policy_all_langs"), self::POLICY_SELECTED_LANGS => $this->getComponent()->t_contentfieldsettings("policy_selected_langs"));
     $oContentField->setEnumValues($asEnumValues);
     $oContentField->setDefaultValue(self::POLICY_ALL_LANGS);
     $this->addContentField($oContentField);
     //langs selection
     $oContentField = new AnwContentFieldSettings_checkboxGroup(self::FIELD_LANGS);
     $asLangs = AnwComponent::globalCfgLangs();
     $asEnumValues = array();
     foreach ($asLangs as $sLang) {
         $sLangName = $sLang . " - " . Anwi18n::langName($sLang);
         $asEnumValues[$sLang] = $sLangName;
     }
     $oContentField->setEnumValues($asEnumValues);
     $oMultiplicity = new AnwContentMultiplicity_multiple();
     $oMultiplicity->setSortable(false);
     $oContentField->setMultiplicity($oMultiplicity);
     $this->addContentField($oContentField);
 }