function Init() { $sql = Access::SqlBuilder(); $tblContainer = Container::Schema()->Table(); $orderBy = $sql->OrderList($sql->OrderAsc($tblContainer->Field('Name'))); $this->containers = Container::Schema()->Fetch(false, null, $orderBy); return parent::Init(); }
private function AddContainerField() { $name = 'Container'; $value = $this->container->Exists() ? $this->container->GetContainer()->GetID() : ''; $select = new Select($name, $value); $select->AddOption('', Trans('Core.PleaseSelect')); $sql = Access::SqlBuilder(); $tblContainer = Container::Schema()->Table(); $orderBy = $sql->OrderList($sql->OrderAsc($tblContainer->Field('Name'))); $containers = Container::Schema()->Fetch(false, null, $orderBy); foreach ($containers as $container) { $select->AddOption($container->GetID(), $container->GetName()); } $this->AddField($select); $this->SetRequired($name); }
/** * Adds the module type option, if allowed * @param Select $select The select box * @param string $type The module type */ private function AddModuleTypeOption(Select $select, $type) { if ($type != 'BuiltIn-Container' || !Request::GetData('container') && Container::Schema()->Count() > 0) { $select->AddOption($type, Trans($type)); } }