/** * Add manual sorting options * */ protected function initManualSortingOptionForm(ilContainerSortingSettings $settings, $element, $a_prefix, $a_sorting_settings) { $position = new ilRadioGroupInputGUI($this->lng->txt('sorting_new_items_position'), $a_prefix . '_new_items_position'); $position->setValue($settings->getSortNewItemsPosition()); $position->setRequired(TRUE); //new items insert on top $new_top = new ilRadioOption($this->lng->txt('sorting_new_items_at_top'), ilContainer::SORT_NEW_ITEMS_POSITION_TOP); $position->addOption($new_top); //new items insert at bottom $new_bottom = new ilRadioOption($this->lng->txt('sorting_new_items_at_bottom'), ilContainer::SORT_NEW_ITEMS_POSITION_BOTTOM); $position->addOption($new_bottom); $element->addSubItem($position); $order = new ilRadioGroupInputGUI($this->lng->txt('sorting_new_items_order'), $a_prefix . '_new_items_order'); $order->setValue($settings->getSortNewItemsOrder()); $order->setRequired(TRUE); if (in_array(ilContainer::SORT_TITLE, $a_sorting_settings)) { //new items sort in alphabetical order $new_title = new ilRadioOption($this->lng->txt('sorting_title_header'), ilContainer::SORT_NEW_ITEMS_ORDER_TITLE); $order->addOption($new_title); } if (in_array(ilContainer::SORT_CREATION, $a_sorting_settings)) { //new items sort by creation date $new_creation = new ilRadioOption($this->lng->txt('sorting_creation_header'), ilContainer::SORT_NEW_ITEMS_ORDER_CREATION); $order->addOption($new_creation); } if (in_array(ilContainer::SORT_ACTIVATION, $a_sorting_settings)) { //new items by activation $new_activation = new ilRadioOption($this->lng->txt('crs_sort_activation'), ilContainer::SORT_NEW_ITEMS_ORDER_ACTIVATION); $order->addOption($new_activation); } $element->addSubItem($order); $this->initSortingDirectionForm($settings, $element, 'manual'); return $element; }