public function initUploadForm() { global $ilCtrl, $lng; include_once "./Services/Form/classes/class.ilDragDropFileInputGUI.php"; include_once "./Services/jQuery/classes/class.iljQueryUtil.php"; $this->form = new ilPropertyFormGUI(); $this->form->setId("upload"); $this->form->setMultipart(true); $this->form->setHideLabels(); $file = new ilDragDropFileInputGUI($lng->txt("cld_upload_flies"), "upload_files"); $file->setRequired(true); $this->form->addItem($file); $this->form->addCommandButton("uploadFiles", $lng->txt("upload")); $this->form->addCommandButton("cancelAll", $lng->txt("cancel")); $this->form->setTableWidth("100%"); $this->form->setTitle($lng->txt("upload_files_title")); $this->form->setTitleIcon(ilUtil::getImagePath('icon_file.gif'), $lng->txt('obj_file')); $this->form->setTitle($lng->txt("upload_files")); $this->form->setFormAction($ilCtrl->getFormAction($this, "uploadFiles")); $this->form->setTarget("cld_blank_target"); }
protected function initNewAccountMailForm() { global $lng, $ilCtrl; $lng->loadLanguageModule("meta"); $lng->loadLanguageModule("mail"); include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($ilCtrl->getFormAction($this)); $form->setTitleIcon(ilUtil::getImagePath("icon_mail.png")); $form->setTitle($lng->txt("user_new_account_mail")); $form->setDescription($lng->txt("user_new_account_mail_desc")); $langs = $lng->getInstalledLanguages(); foreach ($langs as $lang_key) { $amail = $this->object->_lookupNewAccountMail($lang_key); $title = $lng->txt("meta_l_" . $lang_key); if ($lang_key == $lng->getDefaultLanguage()) { $title .= " (" . $lng->txt("default") . ")"; } $header = new ilFormSectionHeaderGUI(); $header->setTitle($title); $form->addItem($header); $subj = new ilTextInputGUI($lng->txt("subject"), "subject_" . $lang_key); // $subj->setRequired(true); $subj->setValue($amail["subject"]); $form->addItem($subj); $salg = new ilTextInputGUI($lng->txt("mail_salutation_general"), "sal_g_" . $lang_key); // $salg->setRequired(true); $salg->setValue($amail["sal_g"]); $form->addItem($salg); $salf = new ilTextInputGUI($lng->txt("mail_salutation_female"), "sal_f_" . $lang_key); // $salf->setRequired(true); $salf->setValue($amail["sal_f"]); $form->addItem($salf); $salm = new ilTextInputGUI($lng->txt("mail_salutation_male"), "sal_m_" . $lang_key); // $salm->setRequired(true); $salm->setValue($amail["sal_m"]); $form->addItem($salm); $body = new ilTextAreaInputGUI($lng->txt("message_content"), "body_" . $lang_key); // $body->setRequired(true); $body->setValue($amail["body"]); $body->setRows(10); $body->setCols(100); $form->addItem($body); $att = new ilFileInputGUI($lng->txt("attachment"), "att_" . $lang_key); $att->setAllowDeletion(true); if ($amail["att_file"]) { $att->setValue($amail["att_file"]); } $form->addItem($att); } $form->addCommandButton("saveNewAccountMail", $lng->txt("save")); $form->addCommandButton("cancelNewAccountMail", $lng->txt("cancel")); return $form; }
public function showDetails() { global $ilMainMenu, $ilTabs, $ilToolbar, $ilUser; $this->__initPaymentObject(); $this->__initPricesObject(); $this->__initShoppingCartObject(); $ilToolbar->addButton($this->lng->txt('payment_back_to_shop'), 'ilias.php?baseClass=ilShopController'); $this->tpl->getStandardTemplate(); $ilTabs->setTabActive('buy'); $ilMainMenu->setActive('shop'); if ($this->pobject->getStatus() == $this->pobject->STATUS_EXPIRES) { ilUtil::sendInfo($this->lng->txt('pay_expires_info')); return false; } $extension_prices = array(); if ($ilUser->getId() != ANONYMOUS_USER_ID) { include_once './Services/Payment/classes/class.ilPaymentBookings.php'; $has_extension_price = ilPaymentBookings::_hasAccesstoExtensionPrice($ilUser->getId(), $this->pobject->getPobjectId()); if ($has_extension_price) { $extension_prices = $this->price_obj->getExtensionPrices(); } } $org_prices = $this->price_obj->getPrices(); $tmp_prices = array_merge($org_prices, $extension_prices); $prices = array(); foreach ($tmp_prices as $price) { // expired prices must be filtered out if ($price['price_type'] == ilPaymentPrices::TYPE_DURATION_DATE && $price['duration_until'] < date('Y-m-d')) { //do nothing } else { $prices[] = $price; } } include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $buyedObject = ""; if ($this->sc_obj->isInShoppingCart($this->pobject->getPobjectId())) { $buyedObject = $this->sc_obj->getEntry($this->pobject->getPobjectId()); if (is_array($prices) && count($prices) > 1) { ilUtil::sendInfo($this->lng->txt('pay_item_already_in_sc_choose_another')); } else { ilUtil::sendInfo($this->lng->txt('pay_item_already_in_sc')); } } $this->ctrl->setParameter($this, "ref_id", $this->pobject->getRefId()); $subtype = ''; if ($this->object) { if ($this->object->getType() == 'exc') { $subtype = ' (' . $this->lng->txt($this->pobject->getSubtype()) . ')'; } $form->setTitle($this->object->getTitle() . ' ' . $subtype); $form->setTitleIcon(ilObject::_getIcon($this->object->getId())); } else { ilUtil::sendFailure($this->lng->txt('object_not_found')); } // payment infos $info = new ilNonEditableValueGUI($this->lng->txt('info')); $info->setValue($this->lng->txt('pay_info')); $form->addItem($info); if (is_array($buyedObject)) { if (is_array($prices) && count($prices) > 1) { $button_txt = $this->lng->txt('pay_change_price'); } else { $button_txt = $this->lng->txt('pay_add_to_shopping_cart'); } } else { $button_txt = $this->lng->txt('pay_add_to_shopping_cart'); } $rg_prices = new ilRadioGroupInputGUI($this->lng->txt('prices'), 'price_id'); if (is_array($prices)) { foreach ($prices as $price) { if (is_array($buyedObject) && $buyedObject["price_id"] == $price['price_id']) { $rg_prices->setValue($price['price_id']); } else { if (count($prices) == 1) { $rg_prices->setValue($price['price_id']); } } switch ($price['price_type']) { case ilPaymentPrices::TYPE_DURATION_MONTH: $txt_price = $price['duration'] . ' ' . $this->lng->txt('paya_months') . ': '; break; case ilPaymentPrices::TYPE_DURATION_DATE: $txt_price = ilDatePresentation::formatDate(new ilDate($price['duration_from'], IL_CAL_DATE)) . ' - ' . ilDatePresentation::formatDate(new ilDate($price['duration_until'], IL_CAL_DATE)) . ': '; break; case ilPaymentPrices::TYPE_UNLIMITED_DURATION: $txt_price = $this->lng->txt('unlimited_duration') . ': '; break; } $tmp_price = $price['price']; $extension_txt = ''; if ($price['extension'] == 1) { $extension_txt = '(' . $this->lng->txt('extension_price') . ')'; } $price_row = new ilRadioOption($txt_price . ' ' . ilPaymentPrices::_formatPriceToString((double) $tmp_price) . ' ' . $extension_txt, $price['price_id']); $price_row->setInfo($price['description']); $rg_prices->addOption($price_row); } $form->addItem($rg_prices); } $form->addCommandButton('addToShoppingCart', $button_txt); return $this->tpl->setContent($form->getHTML()); }
/** * Initializes the upload form for multiple files. * * @return object The created property form. */ public function initMultiUploadForm() { include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $dnd_form_gui = new ilPropertyFormGUI(); $dnd_form_gui->setMultipart(true); $dnd_form_gui->setHideLabels(); // file input include_once "Services/Form/classes/class.ilDragDropFileInputGUI.php"; $dnd_input = new ilDragDropFileInputGUI($this->lng->txt("files"), "upload_files"); $dnd_input->setArchiveSuffixes(array("zip")); $dnd_input->setCommandButtonNames("uploadFiles", "cancel"); $dnd_form_gui->addItem($dnd_input); // add commands $dnd_form_gui->addCommandButton("uploadFiles", $this->lng->txt("upload_files")); $dnd_form_gui->addCommandButton("cancel", $this->lng->txt("cancel")); $dnd_form_gui->setTableWidth("100%"); $dnd_form_gui->setTarget($this->getTargetFrame("save")); $dnd_form_gui->setTitle($this->lng->txt("upload_files_title")); $dnd_form_gui->setTitleIcon(ilUtil::getImagePath('icon_file.gif'), $this->lng->txt('obj_file')); $this->ctrl->setParameter($this, "new_type", "file"); $dnd_form_gui->setFormAction($this->ctrl->getFormAction($this, "uploadFiles")); return $dnd_form_gui; }
public function editStatisticObject($a_show_confirm_delete = false) { global $ilToolbar; include_once './Services/Payment/classes/class.ilPayMethods.php'; if (!isset($_GET['booking_id'])) { ilUtil::sendInfo($this->lng->txt('paya_no_booking_id_given')); $this->showStatistics(); return true; } $ilToolbar->addButton($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'statistic')); $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment'); $this->ctrl->setParameter($this, 'booking_id', (int) $_GET['booking_id']); // confirm delete if ($a_show_confirm_delete) { $oConfirmationGUI = new ilConfirmationGUI(); // set confirm/cancel commands $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this, "performDelete")); $oConfirmationGUI->setHeaderText($this->lng->txt("paya_sure_delete_stat")); $oConfirmationGUI->setCancel($this->lng->txt("cancel"), "statistic"); $oConfirmationGUI->setConfirm($this->lng->txt("confirm"), "performDelete"); $this->tpl->setVariable('CONFIRMATION', $oConfirmationGUI->getHTML()); return true; } $this->__initBookingObject(); $bookings = $this->booking_obj->getBookings(); $booking = $bookings[(int) $_GET['booking_id']]; // get customer_obj $tmp_user = ilObjectFactory::getInstanceByObjId($booking['customer_id'], false); $oForm = new ilPropertyFormGUI(); $oForm->setFormAction($this->ctrl->getFormAction($this)); $oForm->setId('stat_form'); $oForm->setTableWidth('50 %'); $oForm->setTitleIcon(ilUtil::getImagePath('icon_usr.png')); if (is_object($tmp_user)) { $frm_user = $tmp_user->getFullname() . ' [' . $tmp_user->getLogin() . ']'; } else { $frm_user = $this->lng->txt('user_deleted'); } $oForm->setTitle($frm_user); $pObj = new ilPaymentObject($this->user_obj, $booking['pobject_id']); $tmp_obj = ilObject::_lookupTitle(ilObject::_lookupObjId($pObj->getRefId())); // object_title $oTitleGUI = new ilNonEditableValueGUI($this->lng->txt('title')); $oTitleGUI->setValue($tmp_obj != '' ? $tmp_obj : $this->lng->txt('object_deleted')); $oForm->addItem($oTitleGUI); // transaction $oTransactionGUI = new ilNonEditableValueGUI($this->lng->txt('paya_transaction')); $oTransactionGUI->setValue($booking['transaction']); $oForm->addItem($oTransactionGUI); //vendor $oVendorGUI = new ilNonEditableValueGUI($this->lng->txt('paya_vendor')); $tmp_vendor = ilObjectFactory::getInstanceByObjId($booking['b_vendor_id'], false); if (is_object($tmp_vendor)) { $frm_vendor = $tmp_vendor->getFullname() . ' [' . $tmp_vendor->getLogin() . ']'; } else { $frm_vendor = $this->lng->txt('user_deleted'); } $oVendorGUI->setValue($frm_vendor); $oForm->addItem($oVendorGUI); // paymethod $oPaymethodGUI = new ilNonEditableValueGUI($this->lng->txt('paya_pay_method')); $oPaymethodGUI->setValue(ilPayMethods::getStringByPaymethod($booking['b_pay_method'])); $oForm->addItem($oPaymethodGUI); // order_date $oOrderdateGUI = new ilNonEditableValueGUI($this->lng->txt('paya_order_date')); $oOrderdateGUI->setValue(ilDatePresentation::formatDate(new ilDate($booking['order_date'], IL_CAL_UNIX))); $oForm->addItem($oOrderdateGUI); // duration $oDurationGUI = new ilNonEditableValueGUI($this->lng->txt('duration')); if ($booking['duration'] == 0 && $booking['access_enddate'] == NULL) { $frm_duration = $this->lng->txt("unlimited_duration"); } else { if ($booking['duration'] > 0) { $frm_duration = $booking['duration'] . ' ' . $this->lng->txt('paya_months') . '</br>'; } $frm_duration .= ilDatePresentation::formatDate(new ilDate($booking['access_startdate'], IL_CAL_DATETIME)) . ' - ' . ilDatePresentation::formatDate(new ilDate($booking['access_enddate'], IL_CAL_DATETIME)); } $oDurationGUI->setValue($frm_duration); $oForm->addItem($oDurationGUI); // price $oPriceGUI = new ilNonEditableValueGUI($this->lng->txt('price_a')); $oPriceGUI->setValue($booking['price'] . ' ' . $booking['currency_unit']); $oForm->addItem($oPriceGUI); //discount $oDiscountGUI = new ilNonEditableValueGUI($this->lng->txt('paya_coupons_coupon')); $oDiscountGUI->setValue($booking['discount'] . ' ' . $booking['currency_unit']); $oForm->addItem($oDiscountGUI); // payed $oPayedGUI = new ilSelectInputGUI(); $payed_option = array(0 => $this->lng->txt('no'), 1 => $this->lng->txt('yes')); $oPayedGUI->setTitle($this->lng->txt('paya_payed')); $oPayedGUI->setOptions($payed_option); $oPayedGUI->setValue($booking['payed']); $oPayedGUI->setPostVar('payed'); $oForm->addItem($oPayedGUI); // access $oAccessGUI = new ilSelectInputGUI(); $access_option = array(0 => $this->lng->txt('no'), 1 => $this->lng->txt('yes')); $oAccessGUI->setTitle($this->lng->txt('paya_access')); $oAccessGUI->setOptions($access_option); $oAccessGUI->setValue($booking['access_granted']); $oAccessGUI->setPostVar('access'); $oForm->addItem($oAccessGUI); $oForm->addCommandButton('updateStatistic', $this->lng->txt('save')); $oForm->addCommandButton('deleteStatistic', $this->lng->txt('delete')); // show CUSTOMER_DATA if isset -> setting: save_user_address if (ilPayMethods::_PMEnabled($booking['b_pay_method'])) { $oForm2 = new ilPropertyFormGUI(); $oForm2->setId('cust_form'); $oForm2->setTableWidth('50%'); $oForm2->setTitle($frm_user); // email $oEmailGUI = new ilNonEditableValueGUI($this->lng->txt('email')); $email = !$tmp_user ? $this->lng->txt('user_deleted') : $tmp_user->getEmail(); $oEmailGUI->setValue($email); $oForm2->addItem($oEmailGUI); // street $oStreetGUI = new ilNonEditableValueGUI($this->lng->txt('street')); $oStreetGUI->setValue($booking['street']); $oForm2->addItem($oStreetGUI); // pobox $oPoBoxGUI = new ilNonEditableValueGUI($this->lng->txt('pay_bmf_po_box')); $oPoBoxGUI->setValue($booking['po_box']); $oForm2->addItem($oPoBoxGUI); // zipcode $oPoBoxGUI = new ilNonEditableValueGUI($this->lng->txt('zipcode')); $oPoBoxGUI->setValue($booking['zipcode']); $oForm2->addItem($oPoBoxGUI); // city $oCityGUI = new ilNonEditableValueGUI($this->lng->txt('city')); $oCityGUI->setValue($booking['city']); $oForm2->addItem($oCityGUI); // country $oCountryGUI = new ilNonEditableValueGUI($this->lng->txt('country')); $oCountryGUI->setValue($booking['country']); $oForm2->addItem($oCountryGUI); } $this->tpl->setVariable('FORM', $oForm->getHTML()); $this->tpl->setVariable('FORM_2', $oForm2->getHTML()); return true; }
private function initTopicCreateForm() { /** * @var $ilUser ilObjUser * @var $rbacsystem ilRbacSystem * @var $ilias ILIAS * @var $ilSetting ilSetting */ global $ilUser, $rbacsystem, $ilias, $ilSetting; $this->create_topic_form_gui = new ilPropertyFormGUI(); $this->create_topic_form_gui->setTitle($this->lng->txt('forums_new_thread')); $this->create_topic_form_gui->setTitleIcon(ilUtil::getImagePath('icon_frm.svg')); $this->create_topic_form_gui->setTableWidth('100%'); // form action $this->create_topic_form_gui->setFormAction($this->ctrl->getFormAction($this, 'addThread')); if ($this->objProperties->isAnonymized() == 1) { $alias_gui = new ilTextInputGUI($this->lng->txt('forums_your_name'), 'alias'); $alias_gui->setInfo($this->lng->txt('forums_use_alias')); $alias_gui->setMaxLength(255); $alias_gui->setSize(50); $this->create_topic_form_gui->addItem($alias_gui); } else { $alias_gui = new ilNonEditableValueGUI($this->lng->txt('forums_your_name'), 'alias'); $alias_gui->setValue($ilUser->getLogin()); $this->create_topic_form_gui->addItem($alias_gui); } // topic $subject_gui = new ilTextInputGUI($this->lng->txt('forums_thread'), 'subject'); $subject_gui->setMaxLength(255); $subject_gui->setSize(50); $subject_gui->setRequired(true); $this->create_topic_form_gui->addItem($subject_gui); // message $post_gui = new ilTextAreaInputGUI($this->lng->txt('forums_the_post'), 'message'); $post_gui->setCols(50); $post_gui->setRows(15); $post_gui->setRequired(true); $post_gui->setUseRte(true); $post_gui->addPlugin('latex'); $post_gui->addButton('latex'); $post_gui->addButton('pastelatex'); $post_gui->addPlugin('ilfrmquote'); //$post_gui->addPlugin('code'); $post_gui->removePlugin('advlink'); $post_gui->usePurifier(true); $post_gui->setRTERootBlockElement(''); $post_gui->setRTESupport($ilUser->getId(), 'frm~', 'frm_post', 'tpl.tinymce_frm_post.html', false, '3.4.7'); $post_gui->disableButtons(array('charmap', 'undo', 'redo', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'anchor', 'fullscreen', 'cut', 'copy', 'paste', 'pastetext', 'formatselect')); // purifier require_once 'Services/Html/classes/class.ilHtmlPurifierFactory.php'; $post_gui->setPurifier(ilHtmlPurifierFactory::_getInstanceByType('frm_post')); $this->create_topic_form_gui->addItem($post_gui); // file $fi = new ilFileWizardInputGUI($this->lng->txt('forums_attachments_add'), 'userfile'); $fi->setFilenames(array(0 => '')); $this->create_topic_form_gui->addItem($fi); include_once 'Services/Mail/classes/class.ilMail.php'; $umail = new ilMail($ilUser->getId()); // catch hack attempts if ($rbacsystem->checkAccess('internal_mail', $umail->getMailObjectReferenceId()) && !$this->objProperties->isAnonymized()) { // direct notification $dir_notification_gui = new ilCheckboxInputGUI($this->lng->txt('forum_direct_notification'), 'notify'); $dir_notification_gui->setInfo($this->lng->txt('forum_notify_me_directly')); $dir_notification_gui->setValue(1); $this->create_topic_form_gui->addItem($dir_notification_gui); if ($ilias->getSetting('forum_notification') != 0) { // gen. notification $gen_notification_gui = new ilCheckboxInputGUI($this->lng->txt('forum_general_notification'), 'notify_posts'); $gen_notification_gui->setInfo($this->lng->txt('forum_notify_me_generally')); $gen_notification_gui->setValue(1); $this->create_topic_form_gui->addItem($gen_notification_gui); } } require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php'; if ($ilUser->isAnonymous() && !$ilUser->isCaptchaVerified() && ilCaptchaUtil::isActiveForForum()) { require_once 'Services/Captcha/classes/class.ilCaptchaInputGUI.php'; $captcha = new ilCaptchaInputGUI($this->lng->txt('cont_captcha_code'), 'captcha_code'); $captcha->setRequired(true); $this->create_topic_form_gui->addItem($captcha); } $this->create_topic_form_gui->addCommandButton('addThread', $this->lng->txt('create')); $this->create_topic_form_gui->addCommandButton('showThreads', $this->lng->txt('cancel')); }
/** * init form * * @access protected * @param * @return */ protected function initEditForm() { include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; include_once './Services/Calendar/classes/class.ilDateTime.php'; $form = new ilPropertyFormGUI(); $form->setTitle($this->lng->txt('crs_edit')); $form->setTitleIcon(ilUtil::getImagePath('icon_crs_s.png')); $form->addCommandButton('update', $this->lng->txt('save')); $form->addCommandButton('cancel', $this->lng->txt('cancel')); $form->setFormAction($this->ctrl->getFormAction($this, 'update')); // title $title = new ilTextInputGUI($this->lng->txt('title'), 'title'); $title->setSubmitFormOnEnter(true); $title->setValue($this->object->getTitle()); $title->setSize(40); $title->setMaxLength(128); $title->setRequired(true); $form->addItem($title); // desc $desc = new ilTextAreaInputGUI($this->lng->txt('description'), 'desc'); $desc->setValue($this->object->getLongDescription()); $desc->setRows(2); $desc->setCols(40); $form->addItem($desc); // Show didactic template type $this->initDidacticTemplate($form); // activation/availability $this->lng->loadLanguageModule('rep'); $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('rep_activation_availability')); $form->addItem($section); $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'activation_online'); $online->setChecked(!$this->object->getOfflineStatus()); $online->setInfo($this->lng->txt('crs_activation_online_info')); $form->addItem($online); $act_type = new ilRadioGroupInputGUI($this->lng->txt('rep_activation_access'), 'activation_type'); $act_type->setValue($this->object->getActivationType()); $opt = new ilRadioOption($this->lng->txt('crs_visibility_limitless'), IL_CRS_ACTIVATION_UNLIMITED); $opt->setInfo($this->lng->txt('crs_availability_limitless_info')); $act_type->addOption($opt); $opt = new ilRadioOption($this->lng->txt('crs_visibility_until'), IL_CRS_ACTIVATION_LIMITED); $opt->setInfo($this->lng->txt('crs_availability_until_info')); $start = new ilDateTimeInputGUI($this->lng->txt('rep_activation_limited_start'), 'activation_start'); #$start->setMode(ilDateTimeInputGUI::MODE_INPUT); $start->setShowTime(true); $start_date = new ilDateTime($this->object->getActivationStart(), IL_CAL_UNIX); $start->setDate($start_date); $opt->addSubItem($start); $end = new ilDateTimeInputGUI($this->lng->txt('rep_activation_limited_end'), 'activation_end'); #$end->setMode(ilDateTimeInputGUI::MODE_INPUT); $end->setShowTime(true); $end_date = new ilDateTime($this->object->getActivationEnd(), IL_CAL_UNIX); $end->setDate($end_date); $opt->addSubItem($end); $visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'activation_visibility'); $visible->setInfo($this->lng->txt('crs_activation_limited_visibility_info')); $visible->setChecked($this->object->getActivationVisibility()); $opt->addSubItem($visible); $act_type->addOption($opt); $form->addItem($act_type); $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('crs_reg')); $form->addItem($section); $reg_type = new ilRadioGroupInputGUI($this->lng->txt('crs_reg_period'), 'subscription_limitation_type'); $reg_type->setValue($this->object->getSubscriptionLimitationType()); $opt = new ilRadioOption($this->lng->txt('crs_reg_deactivated'), IL_CRS_SUBSCRIPTION_DEACTIVATED); $opt->setInfo($this->lng->txt('crs_registration_deactivated')); $reg_type->addOption($opt); $opt = new ilRadioOption($this->lng->txt('crs_registration_unlimited'), IL_CRS_SUBSCRIPTION_UNLIMITED); $opt->setInfo($this->lng->txt('crs_reg_unlim_info')); $reg_type->addOption($opt); $opt = new ilRadioOption($this->lng->txt('crs_registration_limited'), IL_CRS_SUBSCRIPTION_LIMITED); $opt->setInfo($this->lng->txt('crs_reg_lim_info')); $start = new ilDateTimeInputGUI($this->lng->txt('crs_start'), 'subscription_start'); $start->setShowTime(true); $start_date = new ilDateTime($this->object->getSubscriptionStart(), IL_CAL_UNIX); $start->setDate($start_date); $opt->addSubItem($start); $end = new ilDateTimeInputGUI($this->lng->txt('crs_end'), 'subscription_end'); $end->setShowTime(true); $end_date = new ilDateTime($this->object->getSubscriptionEnd(), IL_CAL_UNIX); $end->setDate($end_date); $opt->addSubItem($end); $reg_type->addOption($opt); $form->addItem($reg_type); $reg_proc = new ilRadioGroupInputGUI($this->lng->txt('crs_registration_type'), 'subscription_type'); $reg_proc->setValue($this->object->getSubscriptionType()); $reg_proc->setInfo($this->lng->txt('crs_reg_type_info')); $opt = new ilRadioOption($this->lng->txt('crs_subscription_options_confirmation'), IL_CRS_SUBSCRIPTION_CONFIRMATION); $reg_proc->addOption($opt); $opt = new ilRadioOption($this->lng->txt('crs_subscription_options_direct'), IL_CRS_SUBSCRIPTION_DIRECT); $reg_proc->addOption($opt); $opt = new ilRadioOption($this->lng->txt('crs_subscription_options_password'), IL_CRS_SUBSCRIPTION_PASSWORD); $pass = new ilTextInputGUI('', 'subscription_password'); $pass->setSubmitFormOnEnter(true); $pass->setSize(12); $pass->setMaxLength(12); $pass->setValue($this->object->getSubscriptionPassword()); $opt->addSubItem($pass); $reg_proc->addOption($opt); $form->addItem($reg_proc); // Registration codes $reg_code = new ilCheckboxInputGUI('', 'reg_code_enabled'); $reg_code->setChecked($this->object->isRegistrationAccessCodeEnabled()); $reg_code->setValue(1); $reg_code->setInfo($this->lng->txt('crs_reg_code_enabled_info')); $reg_code->setOptionTitle($this->lng->txt('crs_reg_code')); /* $code = new ilNonEditableValueGUI($this->lng->txt('crs_reg_code_value')); $code->setValue($this->object->getRegistrationAccessCode()); $reg_code->addSubItem($code); */ #$link = new ilNonEditableValueGUI($this->lng->txt('crs_reg_code_link')); // Create default access code if (!$this->object->getRegistrationAccessCode()) { include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php'; $this->object->setRegistrationAccessCode(ilMembershipRegistrationCodeUtils::generateCode()); } $reg_link = new ilHiddenInputGUI('reg_code'); $reg_link->setValue($this->object->getRegistrationAccessCode()); $form->addItem($reg_link); $link = new ilCustomInputGUI($this->lng->txt('crs_reg_code_link')); include_once './Services/Link/classes/class.ilLink.php'; $val = ilLink::_getLink($this->object->getRefId(), $this->object->getType(), array(), '_rcode' . $this->object->getRegistrationAccessCode()); $link->setHTML('<font class="small">' . $val . '</font>'); $reg_code->addSubItem($link); $form->addItem($reg_code); // Max members $lim = new ilCheckboxInputGUI($this->lng->txt('crs_subscription_max_members_short'), 'subscription_membership_limitation'); $lim->setValue(1); $lim->setOptionTitle($this->lng->txt('crs_subscription_max_members')); $lim->setChecked($this->object->isSubscriptionMembershipLimited()); $max = new ilTextInputGUI('', 'subscription_max'); $max->setSubmitFormOnEnter(true); $max->setSize(4); $max->setMaxLength(4); $max->setValue($this->object->getSubscriptionMaxMembers() ? $this->object->getSubscriptionMaxMembers() : ''); $max->setTitle($this->lng->txt('members') . ':'); $max->setInfo($this->lng->txt('crs_reg_max_info')); $lim->addSubItem($max); $wait = new ilCheckboxInputGUI('', 'waiting_list'); $wait->setOptionTitle($this->lng->txt('crs_waiting_list')); $wait->setChecked($this->object->enabledWaitingList()); $wait->setInfo($this->lng->txt('crs_wait_info')); $lim->addSubItem($wait); $form->addItem($lim); $not = new ilCheckboxInputGUI($this->lng->txt('crs_auto_notification'), 'auto_notification'); $not->setValue(1); $not->setInfo($this->lng->txt('crs_auto_notification_info')); $not->setChecked($this->object->getAutoNotification()); $form->addItem($not); $pres = new ilFormSectionHeaderGUI(); $pres->setTitle($this->lng->txt('crs_view_mode')); $form->addItem($pres); // presentation type $view_type = new ilRadioGroupInputGUI($this->lng->txt('crs_presentation_type'), 'view_mode'); $view_type->setValue($this->object->getViewMode()); $opts = new ilRadioOption($this->lng->txt('cntr_view_sessions'), IL_CRS_VIEW_SESSIONS); $opts->setInfo($this->lng->txt('cntr_view_info_sessions')); $view_type->addOption($opts); // Limited sessions $sess = new ilCheckboxInputGUI($this->lng->txt('sess_limit'), 'sl'); $sess->setValue(1); $sess->setChecked($this->object->isSessionLimitEnabled()); $sess->setInfo($this->lng->txt('sess_limit_info')); $prev = new ilNumberInputGUI($this->lng->txt('sess_num_prev'), 'sp'); #$prev->setSubmitFormOnEnter(true); $prev->setMinValue(0); $prev->setValue($this->object->getNumberOfPreviousSessions() == -1 ? '' : $this->object->getNumberOfPreviousSessions()); $prev->setSize(2); $prev->setMaxLength(3); $sess->addSubItem($prev); $next = new ilNumberInputGUI($this->lng->txt('sess_num_next'), 'sn'); #$next->setSubmitFormOnEnter(true); $next->setMinValue(0); $next->setValue($this->object->getNumberOfNextSessions() == -1 ? '' : $this->object->getNumberOfnextSessions()); $next->setSize(2); $next->setMaxLength(3); $sess->addSubItem($next); $opts->addSubItem($sess); $optsi = new ilRadioOption($this->lng->txt('cntr_view_simple'), IL_CRS_VIEW_SIMPLE); $optsi->setInfo($this->lng->txt('cntr_view_info_simple')); $view_type->addOption($optsi); $optbt = new ilRadioOption($this->lng->txt('cntr_view_by_type'), IL_CRS_VIEW_BY_TYPE); $optbt->setInfo($this->lng->txt('cntr_view_info_by_type')); $view_type->addOption($optbt); $opto = new ilRadioOption($this->lng->txt('crs_view_objective'), IL_CRS_VIEW_OBJECTIVE); $opto->setInfo($this->lng->txt('crs_view_info_objective')); $view_type->addOption($opto); $optt = new ilRadioOption($this->lng->txt('crs_view_timing'), IL_CRS_VIEW_TIMING); $optt->setInfo($this->lng->txt('crs_view_info_timing')); $view_type->addOption($optt); /* $opt = new ilRadioOption($this->lng->txt('crs_view_archive'),IL_CRS_VIEW_ARCHIVE); $opt->setInfo($this->lng->txt('crs_archive_info')); $down = new ilCheckboxInputGUI('','archive_type'); $down->setOptionTitle($this->lng->txt('crs_archive_download')); $down->setChecked($this->object->getArchiveType() == IL_CRS_ARCHIVE_DOWNLOAD); $opt->addSubItem($down); $start = new ilDateTimeInputGUI($this->lng->txt('crs_start'),'archive_start'); $start->setShowTime(true); $start_date = new ilDateTime($this->object->getArchiveStart(),IL_CAL_UNIX); $start->setDate($start_date); $opt->addSubItem($start); $end = new ilDateTimeInputGUI($this->lng->txt('crs_end'),'archive_end'); $end->setShowTime(true); $end_date = new ilDateTime($this->object->getArchiveEnd(),IL_CAL_UNIX); $end->setDate($end_date); $opt->addSubItem($end); $view_type->addOption($opt); */ $form->addItem($view_type); // sorting type $sort = new ilRadioGroupInputGUI($this->lng->txt('crs_sortorder_abo'), 'order_type'); $sort->setValue($this->object->getOrderType()); $opt = new ilRadioOption($this->lng->txt('crs_sort_title'), ilContainer::SORT_TITLE); $opt->setInfo($this->lng->txt('crs_sort_title_info')); $sort->addOption($opt); $opt = new ilRadioOption($this->lng->txt('crs_sort_manual'), ilContainer::SORT_MANUAL); $opt->setInfo($this->lng->txt('crs_sort_manual_info')); $sort->addOption($opt); $opt = new ilRadioOption($this->lng->txt('crs_sort_activation'), ilContainer::SORT_ACTIVATION); $opt->setInfo($this->lng->txt('crs_sort_timing_info')); $sort->addOption($opt); $form->addItem($sort); include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php'; ilObjectServiceSettingsGUI::initServiceSettingsForm($this->object->getId(), $form, array(ilObjectServiceSettingsGUI::CALENDAR_VISIBILITY, ilObjectServiceSettingsGUI::NEWS_VISIBILITY)); // lp vs. course status include_once "Services/Tracking/classes/class.ilObjUserTracking.php"; if (ilObjUserTracking::_enabledLearningProgress()) { include_once './Services/Tracking/classes/class.ilLPObjSettings.php'; $lp_settings = new ilLPObjSettings($this->object->getId()); if ($lp_settings->getMode()) { $lp_status = new ilFormSectionHeaderGUI(); $lp_status->setTitle($this->lng->txt('crs_course_status_of_users')); $form->addItem($lp_status); $lp_status_options = new ilRadioGroupInputGUI($this->lng->txt('crs_status_determination'), "status_dt"); $lp_status_options->setRequired(true); $lp_status_options->setValue($this->object->getStatusDetermination()); $lp_option = new ilRadioOption($this->lng->txt('crs_status_determination_lp'), ilObjCourse::STATUS_DETERMINATION_LP); $lp_status_options->addOption($lp_option); $lp_status_options->addOption(new ilRadioOption($this->lng->txt('crs_status_determination_manual'), ilObjCourse::STATUS_DETERMINATION_MANUAL)); $form->addItem($lp_status_options); } } $further = new ilFormSectionHeaderGUI(); $further->setTitle($this->lng->txt('crs_further_settings')); $form->addItem($further); $desk = new ilCheckboxInputGUI($this->lng->txt('crs_add_remove_from_desktop'), 'abo'); $desk->setChecked($this->object->getAboStatus()); $desk->setInfo($this->lng->txt('crs_add_remove_from_desktop_info')); $form->addItem($desk); $mem = new ilCheckboxInputGUI($this->lng->txt('crs_show_members'), 'show_members'); $mem->setChecked($this->object->getShowMembers()); $mem->setInfo($this->lng->txt('crs_show_members_info')); $form->addItem($mem); // Edit ecs export settings include_once 'Modules/Course/classes/class.ilECSCourseSettings.php'; $ecs = new ilECSCourseSettings($this->object); $ecs->addSettingsToForm($form, 'crs'); return $form; }
public function showSelectedObject() { global $ilToolbar; if (!(int) $_GET['sell_id']) { ilUtil::sendInfo($this->lng->txt('paya_no_object_selected')); return $this->showObjectSelector(); } $ilToolbar->addButton($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'showObjectSelector')); // save ref_id of selected object $this->ctrl->setParameter($this, 'sell_id', (int) $_GET['sell_id']); include_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; $oForm = new ilPropertyFormGUI(); $oForm->setFormAction($this->ctrl->getFormAction($this, 'updateDetails')); $oForm->setTitle($this->lng->txt('details')); $oForm->setTitleIcon(ilUtil::getImagePath('icon_pays.png', false)); $tmp_obj = ilObjectFactory::getInstanceByRefId($_GET['sell_id'], false); if (is_object($tmp_obj)) { $tmp_object['title'] = $tmp_obj->getTitle(); $tmp_object['description'] = $tmp_obj->getDescription(); $tmp_object['owner'] = $tmp_obj->getOwnerName(); $tmp_object['path'] = $this->__getHTMLPath((int) $_GET['sell_id']); } else { $tmp_object['title'] = $this->lng->txt('object_not_found'); $tmp_object['description'] = ''; $tmp_object['owner'] = ''; $tmp_object['path'] = ''; } // title $oTitleGUI = new ilNonEditableValueGUI($this->lng->txt('title')); $oTitleGUI->setValue($tmp_object['title']); $oForm->addItem($oTitleGUI); // description $oDescriptionGUI = new ilNonEditableValueGUI($this->lng->txt('description')); $oDescriptionGUI->setValue($tmp_object['description']); $oForm->addItem($oDescriptionGUI); // owner $oOwnerGUI = new ilNonEditableValueGUI($this->lng->txt('owner')); $oOwnerGUI->setValue($tmp_object['owner']); $oForm->addItem($oOwnerGUI); // repository path $oPathGUI = new ilNonEditableValueGUI($this->lng->txt('path')); $oPathGUI->setValue($tmp_object['path']); $oForm->addItem($oPathGUI); // vendors $oVendorsGUI = new ilSelectInputGUI($this->lng->txt('paya_vendor'), 'vendor'); $oVendorsGUI->setOptions($this->__getVendors()); $oForm->addItem($oVendorsGUI); // buttons $oForm->addCommandButton('addObject', $this->lng->txt('next')); $oForm->addCommandButton('showObjects', $this->lng->txt('cancel')); $this->tpl->setVariable('ADM_CONTENT', $oForm->getHTML()); return true; }
/** * FORM: Init zip upload form. */ public function initZipUploadForm($a_mode = "create") { global $lng; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $zip_form_gui = new ilPropertyFormGUI(); $zip_form_gui->setMultipart(true); // File $in_file = new ilFileInputGUI($lng->txt("file"), "zip_file"); $in_file->setRequired(true); $in_file->setSuffixes(array("zip")); $zip_form_gui->addItem($in_file); // Take over structure $in_str = new ilCheckboxInputGUI($this->lng->txt("take_over_structure"), "adopt_structure"); $in_str->setInfo($this->lng->txt("take_over_structure_info")); $zip_form_gui->addItem($in_str); $zip_form_gui->addCommandButton("saveUnzip", $this->lng->txt($this->type . "_add")); $zip_form_gui->addCommandButton("cancel", $lng->txt("cancel")); $zip_form_gui->setTableWidth("600px"); $zip_form_gui->setTarget($this->getTargetFrame("save")); $zip_form_gui->setTitle($this->lng->txt("header_zip")); $zip_form_gui->setTitleIcon(ilUtil::getImagePath('icon_file.png'), $this->lng->txt('obj_file')); $this->ctrl->setParameter($this, "new_type", "file"); $zip_form_gui->setFormAction($this->ctrl->getFormAction($this, "saveUnzip")); return $zip_form_gui; }
/** * Show settings screen. */ function editSettings() { global $ilUser, $lng, $ilCtrl, $ilSetting; $news_set = new ilSetting("news"); $enable_internal_rss = $news_set->get("enable_rss_for_internal"); $allow_shorter_periods = $news_set->get("allow_shorter_periods"); $allow_longer_periods = $news_set->get("allow_longer_periods"); $enable_private_feed = $news_set->get("enable_private_feed"); include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; if ($allow_shorter_periods || $allow_longer_periods) { $form = new ilPropertyFormGUI(); include_once "./Services/News/classes/class.ilNewsItem.php"; $default_per = ilNewsItem::_lookupDefaultPDPeriod(); $per = ilNewsItem::_lookupUserPDPeriod($ilUser->getId()); $form->setTitle($lng->txt("news_settings")); $form->setTitleIcon(ilUtil::getImagePath("icon_news.png")); $form->setTableWidth("100%"); $per_opts = array(2 => "2 " . $lng->txt("days"), 3 => "3 " . $lng->txt("days"), 5 => "5 " . $lng->txt("days"), 7 => "1 " . $lng->txt("week"), 14 => "2 " . $lng->txt("weeks"), 30 => "1 " . $lng->txt("month"), 60 => "2 " . $lng->txt("months"), 120 => "4 " . $lng->txt("months"), 180 => "6 " . $lng->txt("months"), 366 => "1 " . $lng->txt("year")); $unset = array(); foreach ($per_opts as $k => $opt) { if (!$allow_shorter_periods && $k < $default_per) { $unset[$k] = $k; } if (!$allow_longer_periods && $k > $default_per) { $unset[$k] = $k; } } foreach ($unset as $k) { unset($per_opts[$k]); } $per_sel = new ilSelectInputGUI($lng->txt("news_pd_period"), "news_pd_period"); //$per_sel->setInfo($lng->txt("news_pd_period_info")); $per_sel->setOptions($per_opts); $per_sel->setValue((int) $per); $form->addItem($per_sel); //$form->addCheckboxProperty($lng->txt("news_public_feed"), "notifications_public_feed", // "1", $public_feed, $lng->txt("news_public_feed_info")); //if ($this->getProperty("public_notifications_option")) //{ // $form->addCheckboxProperty($lng->txt("news_notifications_public"), "notifications_public", // "1", $public, $lng->txt("news_notifications_public_info")); //} $form->addCommandButton("saveSettings", $lng->txt("save")); $form->addCommandButton("cancelSettings", $lng->txt("cancel")); $form->setFormAction($ilCtrl->getFormaction($this)); $returnForm = $form->getHTML(); } if ($enable_private_feed) { $feed_form = new ilPropertyFormGUI(); $feed_form->setTitle($lng->txt("priv_feed_settings")); $feed_form->setTitleIcon(ilUtil::getImagePath("privrss.png")); $feed_form->setTableWidth("100%"); $enable_private_feed = new ilCheckboxInputGUI($lng->txt("news_enable_private_feed"), "enable_private_feed"); $retype_pass = new ilTextInputGUI($lng->txt("retype_password"), "retype_password"); $desired_pass = new ilTextInputGUI($lng->txt("desired_password"), "desired_password"); // user has already valid password if (ilObjUser::_getFeedPass($_SESSION[AccountId]) != false) { $enable_private_feed->setChecked(true); $desired_pass->setValue("******"); } $desired_pass->setInputType("password"); $retype_pass->setInputType("password"); $feed_form->addItem($enable_private_feed); $feed_form->addItem($desired_pass); $feed_form->addItem($retype_pass); $feed_form->addCommandButton("changeFeedSettings", $lng->txt("save")); $feed_form->addCommandButton("cancelSettings", $lng->txt("cancel")); $feed_form->setFormAction($ilCtrl->getFormaction($this)); $returnForm .= $returnForm == "" ? $feed_form->getHTML() : "<br>" . $feed_form->getHTML(); } return $returnForm; }