コード例 #1
0
 protected function initEditCustomForm(ilPropertyFormGUI $a_form)
 {
     global $lng, $ilSetting;
     $this->setSettingsSubTabs("properties");
     if ($this->id_type == self::REPOSITORY_NODE_ID) {
         $appr = new ilCheckboxInputGUI($lng->txt("blog_enable_approval"), "approval");
         $appr->setInfo($lng->txt("blog_enable_approval_info"));
         $a_form->addItem($appr);
     }
     $notes = new ilCheckboxInputGUI($lng->txt("blog_enable_notes"), "notes");
     $a_form->addItem($notes);
     if ($ilSetting->get('enable_global_profiles')) {
         $rss = new ilCheckboxInputGUI($lng->txt("blog_enable_rss"), "rss");
         $rss->setInfo($lng->txt("blog_enable_rss_info"));
         $a_form->addItem($rss);
     }
     // navigation
     $nav = new ilFormSectionHeaderGUI();
     $nav->setTitle($lng->txt("blog_settings_navigation"));
     $a_form->addItem($nav);
     $nav_mode = new ilRadioGroupInputGUI($lng->txt("blog_nav_mode"), "nav");
     $nav_mode->setRequired(true);
     $a_form->addItem($nav_mode);
     $opt = new ilRadioOption($lng->txt("blog_nav_mode_month_list"), ilObjBlog::NAV_MODE_LIST);
     $opt->setInfo($lng->txt("blog_nav_mode_month_list_info"));
     $nav_mode->addOption($opt);
     $detail_num = new ilNumberInputGUI($lng->txt("blog_nav_mode_month_list_num_detail"), "nav_list_detail");
     $detail_num->setInfo($lng->txt("blog_nav_mode_month_list_num_detail_info"));
     $detail_num->setRequired(true);
     $detail_num->setSize(3);
     $detail_num->setMinValue(0);
     $opt->addSubItem($detail_num);
     $mon_num = new ilNumberInputGUI($lng->txt("blog_nav_mode_month_list_num_month"), "nav_list_mon");
     $mon_num->setInfo($lng->txt("blog_nav_mode_month_list_num_month_info"));
     $mon_num->setSize(3);
     $mon_num->setMinValue(1);
     $opt->addSubItem($mon_num);
     $opt = new ilRadioOption($lng->txt("blog_nav_mode_month_single"), ilObjBlog::NAV_MODE_MONTH);
     $opt->setInfo($lng->txt("blog_nav_mode_month_single_info"));
     $nav_mode->addOption($opt);
     $order_options = array();
     if ($this->object->getOrder()) {
         foreach ($this->object->getOrder() as $item) {
             $order_options[] = $lng->txt("blog_" . $item);
         }
     }
     if (!in_array($lng->txt("blog_navigation"), $order_options)) {
         $order_options[] = $lng->txt("blog_navigation");
     }
     if ($this->id_type == self::REPOSITORY_NODE_ID) {
         if (!in_array($lng->txt("blog_authors"), $order_options)) {
             $order_options[] = $lng->txt("blog_authors");
         }
         $auth = new ilCheckboxInputGUI($lng->txt("blog_enable_nav_authors"), "nav_authors");
         $auth->setInfo($lng->txt("blog_enable_nav_authors_info"));
         $a_form->addItem($auth);
     }
     $keyw = new ilCheckboxInputGUI($lng->txt("blog_enable_keywords"), "keywords");
     $keyw->setInfo($lng->txt("blog_enable_keywords_info"));
     $a_form->addItem($keyw);
     if (!in_array($lng->txt("blog_keywords"), $order_options)) {
         $order_options[] = $lng->txt("blog_keywords");
     }
     $order = new ilNonEditableValueGUI($lng->txt("blog_nav_sortorder"), "order");
     $order->setMultiValues($order_options);
     $order->setValue(array_shift($order_options));
     $order->setMulti(true, true, false);
     $a_form->addItem($order);
     // presentation (frame)
     $pres = new ilFormSectionHeaderGUI();
     $pres->setTitle($lng->txt("blog_presentation_frame"));
     $a_form->addItem($pres);
     $ppic = new ilCheckboxInputGUI($lng->txt("blog_profile_picture"), "ppic");
     $a_form->addItem($ppic);
     if ($this->id_type == self::REPOSITORY_NODE_ID) {
         $ppic->setInfo($lng->txt("blog_profile_picture_repository_info"));
     }
     $blga_set = new ilSetting("blga");
     if ($blga_set->get("banner")) {
         include_once "Services/Form/classes/class.ilFileInputGUI.php";
         ilFileInputGUI::setPersonalWorkspaceQuotaCheck(true);
         $dimensions = " (" . $blga_set->get("banner_width") . "x" . $blga_set->get("banner_height") . ")";
         $img = new ilImageFileInputGUI($lng->txt("blog_banner") . $dimensions, "banner");
         $a_form->addItem($img);
         // show existing file
         $file = $this->object->getImageFullPath(true);
         if ($file) {
             $img->setImage($file);
         }
     }
     /* #15000
     		$bg_color = new ilColorPickerInputGUI($lng->txt("blog_background_color"), "bg_color");
     		$a_form->addItem($bg_color);
     
     		$font_color = new ilColorPickerInputGUI($lng->txt("blog_font_color"), "font_color");
     		$a_form->addItem($font_color);	
     		*/
     // presentation (overview)
     $list = new ilFormSectionHeaderGUI();
     $list->setTitle($lng->txt("blog_presentation_overview"));
     $a_form->addItem($list);
     $post_num = new ilNumberInputGUI($lng->txt("blog_list_num_postings"), "ov_list_post_num");
     $post_num->setInfo($lng->txt("blog_list_num_postings_info"));
     $post_num->setSize(3);
     $post_num->setMinValue(1);
     $post_num->setRequired(true);
     $a_form->addItem($post_num);
     $abs_shorten = new ilCheckboxInputGUI($lng->txt("blog_abstract_shorten"), "abss");
     $a_form->addItem($abs_shorten);
     $abs_shorten_len = new ilNumberInputGUI($lng->txt("blog_abstract_shorten_length"), "abssl");
     $abs_shorten_len->setSize(5);
     $abs_shorten_len->setRequired(true);
     $abs_shorten_len->setSuffix($lng->txt("blog_abstract_shorten_characters"));
     $abs_shorten_len->setMinValue(50, true);
     $abs_shorten->addSubItem($abs_shorten_len);
     $abs_img = new ilCheckboxInputGUI($lng->txt("blog_abstract_image"), "absi");
     $abs_img->setInfo($lng->txt("blog_abstract_image_info"));
     $a_form->addItem($abs_img);
     $abs_img_width = new ilNumberInputGUI($lng->txt("blog_abstract_image_width"), "absiw");
     $abs_img_width->setSize(5);
     $abs_img_width->setRequired(true);
     $abs_img_width->setSuffix($lng->txt("blog_abstract_image_pixels"));
     $abs_img_width->setMinValue(32, true);
     $abs_img->addSubItem($abs_img_width);
     $abs_img_height = new ilNumberInputGUI($lng->txt("blog_abstract_image_height"), "absih");
     $abs_img_height->setSize(5);
     $abs_img_height->setRequired(true);
     $abs_img_height->setSuffix($lng->txt("blog_abstract_image_pixels"));
     $abs_img_height->setMinValue(32, true);
     $abs_img->addSubItem($abs_img_height);
 }