Exemple #1
0
 /** create the form, INTERNAL
  * this methods creates the form with the form definitions
  *
  * @author CommSy Development Group
  */
 function _createForm()
 {
     // Get linked rubric
     $session = $this->_environment->getSession();
     if (!empty($_GET['module'])) {
         $linked_rubric = $_GET['module'];
         $session->setValue($this->_environment->getCurrentModule() . '_linked_rubric', $linked_rubric);
     } elseif ($session->issetValue($this->_environment->getCurrentModule() . '_linked_rubric')) {
         $linked_rubric = $session->getValue($this->_environment->getCurrentModule() . '_linked_rubric');
     }
     include_once 'functions/text_functions.php';
     $i = 0;
     $this->_form->addSubHeadline('headline1', cs_ucfirst($this->_translator->getMessage('COMMON_ADD_BUTTON')), '', '', 3);
     $this->_form->addTextField('new_buzzword', '', '', '', '', 46, '');
     $this->_form->combine('horizontal');
     $this->_form->addButton('option', $this->_translator->getMessage('BUZZWORDS_NEW_BUTTON'), '', '', mb_strlen($this->_translator->getMessage('BUZZWORDS_NEW_BUTTON')) * 7);
     $this->_form->addSubHeadline('headline3', cs_ucfirst($this->_translator->getMessage('BUZZWORDS_COMBINE_BUTTON')), '', '', 3);
     $this->_form->addSelect('sel1', $this->_buzzword_array, '', '', '', 1, false, false, false, '', '', '', '', 13.2);
     $this->_form->combine('horizontal');
     $this->_form->addSelect('sel2', $this->_buzzword_array, '', '', '', 1, false, false, false, '', '', '', '', 13.2);
     $this->_form->combine('horizontal');
     $this->_form->addButton('option', $this->_translator->getMessage('BUZZWORDS_COMBINE_BUTTON'), '', '', mb_strlen($this->_translator->getMessage('BUZZWORDS_COMBINE_BUTTON')) * 9);
     $this->_form->addEmptyline();
     $this->_form->addSubHeadline('headline2', cs_ucfirst($this->_translator->getMessage('COMMON_EDIT')), '', '', 3);
     foreach ($this->_buzzword_array as $buzzword) {
         $i++;
         $this->_form->addTextField('buzzword' . '#' . $buzzword['value'], $buzzword['text'], $i . '.', '', '', 32);
         $this->_form->combine('horizontal');
         $this->_form->addButton('option' . '#' . $buzzword['value'], $this->_translator->getMessage('BUZZWORDS_CHANGE_BUTTON'), '', '', mb_strlen($this->_translator->getMessage('BUZZWORDS_CHANGE_BUTTON')) * 9);
         $this->_form->combine('horizontal');
         $this->_form->addButton('right_box_option' . '#' . $buzzword['value'], $this->_translator->getMessage('COMMON_ITEM_NEW_ATTACH'), '', '', mb_strlen($this->_translator->getMessage('COMMON_ITEM_NEW_ATTACH')) * 7);
         $this->_form->combine('horizontal');
         $this->_form->addButton('option' . '#' . $buzzword['value'], $this->_translator->getMessage('COMMON_DELETE_BUTTON'), '', '', mb_strlen($this->_translator->getMessage('COMMON_DELETE_BUTTON')) * 9, '', '', '', '', '', 'delete_confirm_option' . '#' . $buzzword['value']);
     }
     $session = $this->_environment->getSession();
     if (!empty($_GET['module'])) {
         $linked_rubric = $_GET['module'];
         $this->_form->addHidden('module', $linked_rubric);
         $session->setValue($this->_environment->getCurrentModule() . '_linked_rubric', $linked_rubric);
     }
     unset($session);
 }
Exemple #2
0
 /** get _getRubricNameArticle - INTERNAL
  * this method gets the rubric article
  *
  * @param string rubric
  * @param string def or undef
  * @param string postion
  * @param string first letter BIG or not
  *
  * @return array value name cases
  */
 function _getRubricNameArticle($rubric, $mode, $position, $upper_case)
 {
     // default article arrays
     $cs_article['DE']['DEF']['M']['NOMS'] = 'der';
     $cs_article['DE']['DEF']['M']['GENS'] = 'des';
     $cs_article['DE']['DEF']['M']['AKKS'] = 'den';
     $cs_article['DE']['DEF']['M']['DATS'] = 'dem';
     $cs_article['DE']['DEF']['M']['NOMPL'] = 'die';
     $cs_article['DE']['DEF']['M']['GENPL'] = 'der';
     $cs_article['DE']['DEF']['M']['AKKPL'] = 'die';
     $cs_article['DE']['DEF']['M']['DATPL'] = 'den';
     $cs_article['DE']['DEF']['F']['NOMS'] = 'die';
     $cs_article['DE']['DEF']['F']['GENS'] = 'der';
     $cs_article['DE']['DEF']['F']['AKKS'] = 'die';
     $cs_article['DE']['DEF']['F']['DATS'] = 'der';
     $cs_article['DE']['DEF']['F']['NOMPL'] = 'die';
     $cs_article['DE']['DEF']['F']['GENPL'] = 'der';
     $cs_article['DE']['DEF']['F']['AKKPL'] = 'die';
     $cs_article['DE']['DEF']['F']['DATPL'] = 'den';
     $cs_article['DE']['DEF']['N']['NOMS'] = 'das';
     $cs_article['DE']['DEF']['N']['GENS'] = 'des';
     $cs_article['DE']['DEF']['N']['AKKS'] = 'das';
     $cs_article['DE']['DEF']['N']['DATS'] = 'dem';
     $cs_article['DE']['DEF']['N']['NOMPL'] = 'die';
     $cs_article['DE']['DEF']['N']['GENPL'] = 'der';
     $cs_article['DE']['DEF']['N']['AKKPL'] = 'die';
     $cs_article['DE']['DEF']['N']['DATPL'] = 'den';
     $cs_article['DE']['UNDEF']['M']['NOMS'] = 'ein';
     $cs_article['DE']['UNDEF']['M']['GENS'] = 'eines';
     $cs_article['DE']['UNDEF']['M']['AKKS'] = 'einen';
     $cs_article['DE']['UNDEF']['M']['DATS'] = 'einem';
     $cs_article['DE']['UNDEF']['F']['NOMS'] = 'eine';
     $cs_article['DE']['UNDEF']['F']['GENS'] = 'einer';
     $cs_article['DE']['UNDEF']['F']['AKKS'] = 'eine';
     $cs_article['DE']['UNDEF']['F']['DATS'] = 'einer';
     $cs_article['DE']['UNDEF']['N']['NOMS'] = 'ein';
     $cs_article['DE']['UNDEF']['N']['GENS'] = 'eines';
     $cs_article['DE']['UNDEF']['N']['AKKS'] = 'ein';
     $cs_article['DE']['UNDEF']['N']['DATS'] = 'einem';
     $cs_article['EN'] = 'the';
     $rubric_array = $this->_getRubricArray($rubric);
     $language = cs_strtoupper($this->_selected_language);
     if ($this->_issetSessionLanguage()) {
         $language = cs_strtoupper($this->_getSessionLanguage());
     } else {
         $language = cs_strtoupper($this->_selected_language);
     }
     if ($language == 'EN') {
         $text = $cs_article[$language];
     } else {
         $text = $cs_article[$language][$mode][$rubric_array[$language]['GENUS']][cs_strtoupper($position)];
     }
     if ($upper_case == 'BIG') {
         include_once 'functions/text_functions.php';
         $text = cs_ucfirst($text);
     }
     return $text;
 }
Exemple #3
0
 /** create the form, INTERNAL
  * this methods creates the form with the form definitions
  */
 function _createForm()
 {
     include_once 'functions/text_functions.php';
     $this->_form->addSubHeadline('headline1', cs_ucfirst($this->_translator->getMessage('COMMON_ADD_BUTTON')), '', '', 3);
     $this->_form->addTextField('new_tag', '', '', '', '', 30, false, '', '', '', '', '', '', false, $this->_translator->getMessage('TAG_WORD_TO'));
     $this->_form->combine('horizontal');
     $this->_form->addSelect('father_id', $this->_values_tree, '', '', '', 1, false, false, false, '', '', '', '', 12);
     $this->_form->combine('horizontal');
     $this->_form->addButton('option', $this->_translator->getMessage('COMMON_ADD_BUTTON'), '', '', 80);
     $this->_form->addSubHeadline('headline2', cs_ucfirst($this->_translator->getMessage('COMMON_SORT_BUTTON')), '', '', 3);
     $this->_form->addSelect('sort1', $this->_first_sort_tree, '', '', '', 1, false, false, false, '', '', '', '', 11);
     $this->_form->combine('horizontal');
     $this->_form->addSelect('sort_action', $this->_sort_actions, '', '', '', 1, false, false, false, '', '', '', '', 7);
     $this->_form->combine('horizontal');
     $this->_form->addSelect('sort2', $this->_second_sort_tree, '', '', '', 1, false, false, false, '', '', '', '', 11);
     $this->_form->combine('horizontal');
     $this->_form->addButton('option', $this->_translator->getMessage('TAG_SORT_BUTTON'), '', '', 80);
     $this->_form->addButton('option', $this->_translator->getMessage('TAG_SORT_ABC'));
     $this->_form->addSubHeadline('headline3', cs_ucfirst($this->_translator->getMessage('TAG_COMBINE_BUTTON')), '', '', 3);
     $session_item = $this->_environment->getSessionItem();
     if ($session_item->issetValue('tag_cannot_combine') && $session_item->getValue('tag_cannot_combine') == 'true') {
         $this->_form->addText('tag_cannot_combine', '', $this->_translator->getMessage('TAG_CANNOT_COMBINE'), '', true, '', '', '', '', 'style="color: #FF0000;"');
         $session_item->unsetValue('tag_cannot_combine');
     }
     unset($session_item);
     $this->_form->addSelect('sel1', $this->_first_sort_tree, '', '', '', 1, false, false, false, '', '', '', '', 13.2);
     $this->_form->combine('horizontal');
     $this->_form->addSelect('sel2', $this->_first_sort_tree, '', '', '', 1, false, false, false, '', '', '', '', 13.2);
     $this->_form->combine('horizontal');
     $this->_form->addSelect('combine_father_id', $this->_values_tree, '', '', '', 1, false, false, false, '', '', '', $this->_translator->getMessage('TAG_WORD_TO'), 12);
     $this->_form->combine('horizontal');
     $this->_form->addButton('option', $this->_translator->getMessage('TAG_COMBINE_BUTTON'));
     $this->_form->addEmptyline();
     if (isset($this->_root_tag)) {
         $this->_form->addSubHeadline('headline4', cs_ucfirst($this->_translator->getMessage('COMMON_EDIT')), '', '', 3);
         $this->_createFormForChildren($this->_root_tag, 0);
     }
     $session = $this->_environment->getSession();
     if (!empty($_GET['module'])) {
         $linked_rubric = $_GET['module'];
         $this->_form->addHidden('module', $linked_rubric);
         $session->setValue($this->_environment->getCurrentModule() . '_linked_rubric', $linked_rubric);
     }
     unset($session);
 }
Exemple #4
0
 function exportItemToWiki_soap($current_item_id, $rubric)
 {
     global $c_commsy_path_file;
     global $c_pmwiki_path_file;
     global $c_pmwiki_absolute_path_file;
     global $c_pmwiki_path_url;
     global $c_commsy_domain;
     global $c_commsy_url_path;
     $translator = $this->_environment->getTranslationObject();
     $client = $this->getSoapClient();
     $client->createDir('uploads/Main', $this->_environment->getSessionID());
     $author = '';
     $description = '';
     if ($rubric == CS_MATERIAL_TYPE) {
         // Material Item
         $material_manager = $this->_environment->getMaterialManager();
         $material_version_list = $material_manager->getVersionList($current_item_id);
         $item = $material_version_list->getFirst();
         // Informationen
         $author = $item->getAuthor();
         if (empty($author)) {
             $author = $item->getModificatorItem()->getFullName();
             $description = $item->getDescription();
         }
         $informations = '!' . $item->getTitle() . '%0a%0a';
         $informations .= '(:table border=0 style="margin-left:0px;":)%0a';
         $informations .= '(:cell:)\'\'\'AutorInnen:\'\'\' %0a(:cell:)' . $author . ' %0a';
         // Kurzfassung fuer Wiki vorbereiten
         if (!preg_match('~<!-- KFC TEXT -->[\\S|\\s]*<!-- KFC TEXT -->~u', $description)) {
             $text_converter = $this->_environment->getTextConverter();
             $description = $text_converter->text_for_wiki_export($description);
             //$description = _text_php2html_long($description);
         }
     } elseif ($rubric == CS_DISCUSSION_TYPE) {
         // Discussion Item
         $discussion_manager = $this->_environment->getDiscussionManager();
         $item = $discussion_manager->getItem($current_item_id);
         $informations = '!' . $item->getTitle() . '%0a%0a';
     }
     if ($rubric == CS_MATERIAL_TYPE or $rubric == CS_DISCUSSION_TYPE) {
         global $class_factory;
         $params = array();
         $params['environment'] = $this->_environment;
         $wiki_view = $class_factory->getClass(WIKI_VIEW, $params);
         $wiki_view->setItem($item);
         $description = $wiki_view->formatForWiki($description);
         $description = $this->encodeUmlaute($description);
         $description = $this->encodeUrl($description);
         if ($rubric == CS_MATERIAL_TYPE) {
             $html_wiki_file = 'Main.CommSyMaterial' . $current_item_id . '.html';
         } elseif ($rubric == CS_DISCUSSION_TYPE) {
             $html_wiki_file = 'Main.CommSy' . $translator->getMessage('COMMON_DISCUSSION') . $current_item_id . '.html';
         }
         $old_dir = getcwd();
         $description = '<br />' . "\n" . $description;
         $client->uploadFile($html_wiki_file, base64_encode($description), 'uploads/Main', $this->_environment->getSessionID());
         $c_pmwiki_path_url_upload = preg_replace('~http://[^/]*~u', '', $c_pmwiki_path_url);
         $returnwiki = '(:includeupload /' . $c_pmwiki_path_url_upload . '/wikis/' . $this->_environment->getCurrentPortalID() . '/' . $this->_environment->getCurrentContextID() . '/uploads/Main/' . $html_wiki_file . ':)';
         if ($rubric == CS_MATERIAL_TYPE) {
             $informations .= '(:cellnr:)\'\'\'Kurzfassung:\'\'\' %0a(:cell:)' . $returnwiki . ' %0a';
         }
         // Dateien
         $file_list = $item->getFileList();
         if (!$file_list->isEmpty()) {
             $file_array = $file_list->to_array();
             $file_link_array = array();
             foreach ($file_array as $file) {
                 $new_filename = $this->encodeUrl($file->getDiskFileNameWithoutFolder());
                 $new_filename = preg_replace('~cid([0-9]*)_~u', '', $new_filename);
                 $new_filename = $new_filename . '.' . $file->getExtension();
                 $temp_file = file_get_contents($c_commsy_path_file . '/' . $file->getDiskFileName());
                 $client->uploadFile($new_filename, base64_encode($temp_file), 'uploads/Main', $this->_environment->getSessionID());
                 $new_link = $this->encodeUrlToHtml($file->getFileName());
                 $file_link_array[] = '[[' . $c_pmwiki_path_url . '/wikis/' . $this->_environment->getCurrentPortalID() . '/' . $this->_environment->getCurrentContextID() . '/uploads/Main/' . $new_filename . '|' . $new_link . ']]';
             }
             $file_links = implode('\\\\%0a', $file_link_array);
             $informations .= '(:cellnr:)\'\'\'Dateien:\'\'\' %0a(:cell:)' . $file_links . ' %0a';
         }
         if ($rubric == CS_MATERIAL_TYPE) {
             // Abschnitte
             $sub_item_list = $item->getSectionList();
         } elseif ($rubric == CS_DISCUSSION_TYPE) {
             $discussionarticles_manager = $this->_environment->getDiscussionArticlesManager();
             $discussionarticles_manager->setDiscussionLimit($item->getItemID(), array());
             $discussion_type = $item->getDiscussionType();
             if ($discussion_type == 'threaded') {
                 $discussionarticles_manager->setSortPosition();
             }
             if (isset($_GET['status']) and $_GET['status'] == 'all_articles') {
                 $discussionarticles_manager->setDeleteLimit(false);
             }
             $discussionarticles_manager->select();
             $sub_item_list = $discussionarticles_manager->get();
         }
         $sub_item_descriptions = '';
         if (!$sub_item_list->isEmpty()) {
             $size = $sub_item_list->getCount();
             $index_start = 1;
             if ($rubric == CS_DISCUSSION_TYPE and $size > 0) {
                 $size = $size - 1;
                 $index_start = 0;
             }
             $sub_item_link_array = array();
             $sub_item_description_array = array();
             for ($index = $index_start; $index <= $size; $index++) {
                 $sub_item = $sub_item_list->get($index);
                 if ($rubric == CS_DISCUSSION_TYPE) {
                     $sub_item_link_array[] = '(:cellnr width=50%:)' . ($index + 1) . '. [[#' . $sub_item->getSubject() . '|' . $sub_item->getSubject() . ']] %0a(:cell width=30%:)' . $sub_item->getCreatorItem()->getFullName() . ' %0a(:cell:)' . getDateTimeInLang($sub_item->getModificationDate()) . '%0a';
                 } else {
                     $sub_item_link_array[] = '[[#' . $sub_item->getTitle() . '|' . $sub_item->getTitle() . ']]';
                 }
                 // Abschnitt fuer Wiki vorbereiten
                 $description = $sub_item->getDescription();
                 if (!preg_match('~<!-- KFC TEXT -->[\\S|\\s]*<!-- KFC TEXT -->~u', $description)) {
                     $text_converter = $this->_environment->getTextConverter();
                     $description = $text_converter->text_for_wiki_export($description);
                     //$description = _text_php2html_long($sub_item->getDescription());
                 }
                 $params = array();
                 $params['environment'] = $this->_environment;
                 $params['with_modifying_actions'] = true;
                 $wiki_view = $this->_class_factory->getClass(WIKI_VIEW, $params);
                 unset($params);
                 $wiki_view->setItem($sub_item);
                 $description = $wiki_view->formatForWiki($description);
                 $description = $this->encodeUmlaute($description);
                 $description = $this->encodeUrl($description);
                 if ($rubric == CS_MATERIAL_TYPE) {
                     $html_wiki_file = 'Main.CommSyMaterial' . $current_item_id . '.sub_item.' . $sub_item->getItemID() . '.html';
                 } elseif ($rubric == CS_DISCUSSION_TYPE) {
                     $html_wiki_file = 'Main.CommSy' . $translator->getMessage('COMMON_DISCUSSION') . $current_item_id . '.sub_item.' . $sub_item->getItemID() . '.html';
                 }
                 $html_wiki_file = $this->encodeUmlaute($html_wiki_file);
                 $html_wiki_file = $this->encodeUrl($html_wiki_file);
                 $description = '<br />' . "\n" . $description;
                 $client->uploadFile($html_wiki_file, base64_encode($description), 'uploads/Main', $this->_environment->getSessionID());
                 $c_pmwiki_path_url_upload = preg_replace('~http://[^/]*~u', '', $c_pmwiki_path_url);
                 $returnwiki = '(:includeupload /' . $c_pmwiki_path_url_upload . '/wikis/' . $this->_environment->getCurrentPortalID() . '/' . $this->_environment->getCurrentContextID() . '/uploads/Main/' . $html_wiki_file . ':)';
                 $description_sub_item_link = str_replace(' ', '', $sub_item->getTitle());
                 // Dateien (Abschnitte)
                 $files = '%0a%0a';
                 $file_list = $sub_item->getFileList();
                 if (!$file_list->isEmpty()) {
                     $file_array = $file_list->to_array();
                     $file_link_array = array();
                     foreach ($file_array as $file) {
                         $new_filename = $this->encodeUrl($file->getDiskFileNameWithoutFolder());
                         $new_filename = preg_replace('~cid([0-9]*)_~u', '', $new_filename);
                         $new_filename = $new_filename . '.' . $file->getExtension();
                         $temp_file = file_get_contents($c_commsy_path_file . '/' . $file->getDiskFileName());
                         $client->uploadFile($new_filename, base64_encode($temp_file), 'uploads/Main', $this->_environment->getSessionID());
                         $new_link = $this->encodeUrlToHtml($file->getFileName());
                         $file_link_array[] = '[[' . $c_pmwiki_path_url . '/wikis/' . $this->_environment->getCurrentPortalID() . '/' . $this->_environment->getCurrentContextID() . '/uploads/Main/' . $new_filename . '|' . $new_link . ']]';
                     }
                     $file_links = implode('\\\\%0a', $file_link_array);
                     $files .= '(:table border=0 style="margin-left:0px;":)%0a';
                     $files .= '(:cell:)\'\'\'Dateien:\'\'\' %0a(:cell:)' . $file_links . ' %0a';
                     $files .= '(:tableend:) %0a';
                 }
                 $sub_item_description_array[] = '%0a----%0a%0a====%0a%0a!!' . $sub_item->getTitle() . '%0a[[#' . $description_sub_item_link . ']]%0a' . $returnwiki . $files;
             }
             if ($rubric == CS_MATERIAL_TYPE) {
                 $sub_item_links = implode('\\\\%0a', $sub_item_link_array);
                 $informations .= '(:cellnr:)\'\'\'' . $translator->getMessage('MATERIAL_SECTIONS') . ':\'\'\' %0a(:cell:)' . $sub_item_links . ' %0a';
             } elseif ($rubric == CS_DISCUSSION_TYPE) {
                 $sub_item_links = implode('', $sub_item_link_array);
                 $informations .= '(:cellnr:)%0a(:cell:)%0a';
                 $informations .= '(:table border=0 style="margin-left:0px;":)%0a';
                 $informations .= $sub_item_links;
                 $informations .= '(:tableend:) %0a';
             }
             $informations .= '(:tableend:) %0a';
             $sub_item_descriptions = implode('\\\\%0a', $sub_item_description_array);
         }
         $buzzword_text = '';
         $buzzword_list = $item->getBuzzwordList();
         $buzzword = $buzzword_list->getFirst();
         $buzzword_file_text = '';
         $commentbox_text = '';
         while ($buzzword) {
             if (!empty($buzzword_text)) {
                 $buzzword_text .= ', ';
             }
             if (!empty($buzzword_file_text)) {
                 $buzzword_file_text .= ',';
             }
             $buzzword_title = cs_ucfirst(str_replace('.', '', str_replace(' ', '', $buzzword->getTitle())));
             $buzzword_text .= '[[!' . $buzzword_title . ']]';
             $exists_file = $client->getPageExists('Category.' . $buzzword_title, $this->_environment->getSessionID());
             if (!$exists_file) {
                 $file_buzzword_contents = file_get_contents($c_commsy_path_file . '/etc/pmwiki/Category.Keyword');
                 $file_buzzword_contents = str_replace('CS_KEYWORD', $buzzword_title, $file_buzzword_contents);
                 $client->createPage('Category.' . $buzzword_title, $file_buzzword_contents, $this->_environment->getSessionID());
             }
             $buzzword_file_text .= 'Category.' . $buzzword_title;
             $buzzword = $buzzword_list->getNext();
         }
         if (!empty($buzzword_text)) {
             $buzzword_text = '%0a\\\\%0a' . $translator->getMessage('COMMON_BUZZWORDS') . ': ' . $buzzword_text;
         }
         if ($item->getItemType() == CS_MATERIAL_TYPE) {
             $wiki_file = 'Main.CommSyMaterial' . $current_item_id . '-Comments';
         } elseif ($item->getItemType() == CS_DISCUSSION_TYPE) {
             $wiki_file = 'Main.CommSy' . $translator->getMessage('COMMON_DISCUSSION') . $current_item_id . '-Comments';
         }
         $exists_file = $client->getPageExists($wiki_file, $this->_environment->getSessionID());
         if (!$exists_file) {
             $commentbox_text = '%0a%0a----%0a\\\\%0a' . '(:include Site.FoxCommentBox:)';
         }
         // Link zurueck ins CommSy
         global $c_single_entry_point;
         $link = '[[' . $c_commsy_domain . $c_commsy_url_path . '/' . $c_single_entry_point . '?cid=' . $this->_environment->getCurrentContextID() . '&mod=' . $rubric . '&fct=detail&iid=' . $current_item_id . '|"' . $item->getTitle() . '" im CommSy]]';
         $old_dir = getcwd();
         // Kurzfassung fuer Wiki vorbereiten
         if ($rubric == CS_MATERIAL_TYPE) {
             $file_contents = file_get_contents($c_commsy_path_file . '/etc/pmwiki/Main.Material');
         } elseif ($rubric == CS_DISCUSSION_TYPE) {
             $file_contents = file_get_contents($c_commsy_path_file . '/etc/pmwiki/Main.' . $translator->getMessage('COMMON_DISCUSSION'));
         }
         $file_contents_array = explode("\n", $file_contents);
         for ($index = 0; $index < sizeof($file_contents_array); $index++) {
             if (stripos($file_contents_array[$index], 'name=') !== false) {
                 if ($rubric == CS_MATERIAL_TYPE) {
                     $file_contents_array[$index] = 'name=Main.CommSyMaterial' . $current_item_id;
                 } elseif ($rubric == CS_DISCUSSION_TYPE) {
                     $file_contents_array[$index] = 'name=Main.CommSy' . $translator->getMessage('COMMON_DISCUSSION') . $current_item_id;
                 }
             }
             if (stripos($file_contents_array[$index], 'text=') !== false) {
                 if ($rubric == CS_MATERIAL_TYPE) {
                     $title_text = '(:title CommSy-Material "' . $item->getTitle() . '":)';
                 } elseif ($rubric == CS_DISCUSSION_TYPE) {
                     $title_text = '(:title CommSy-' . $translator->getMessage('COMMON_DISCUSSION') . ' "' . $item->getTitle() . '":)';
                 }
                 $file_contents_array[$index] = 'text=' . $informations . $sub_item_descriptions . '%0a%0a----%0a\\\\%0a' . $buzzword_text . '%0a\\\\%0a' . $link . $commentbox_text . '%0a%0a' . $title_text;
             }
             if (stripos($file_contents_array[$index], 'targets=') !== false and !empty($buzzword_file_text)) {
                 $file_contents_array[$index] = 'targets=' . $buzzword_file_text;
             }
         }
         $file_contents = implode("\n", $file_contents_array);
         if (!strstr($file_contents, 'targets=') and !empty($buzzword_file_text)) {
             $file_contents .= '"\\n"' . 'targets=' . $buzzword_file_text;
         }
         if ($rubric == CS_MATERIAL_TYPE) {
             $file_contents = $file_contents . "\n" . 'title=CommSy-Material "' . $item->getTitle() . '"';
             $client->createPage('Main.CommSyMaterial' . $current_item_id, $file_contents, $this->_environment->getSessionID());
         } elseif ($rubric == CS_DISCUSSION_TYPE) {
             $file_contents = $file_contents . 'title=CommSy-' . $translator->getMessage('COMMON_DISCUSSION') . ' "' . $item->getTitle() . '"';
             $client->createPage('Main.CommSy' . $translator->getMessage('COMMON_DISCUSSION') . '' . $current_item_id, $file_contents, $this->_environment->getSessionID());
         }
         $item->setExportToWiki('1');
         $item->save();
         $link_modifier_item_manager = $this->_environment->getLinkModifierItemManager();
         $modifiers = $link_modifier_item_manager->getModifiersOfItem($item->getItemID());
         $user_manager = $this->_environment->getUserManager();
         $user_manager->reset();
         $user_manager->setContextLimit($this->_environment->getCurrentContextID());
         $user_manager->setIDArrayLimit($modifiers);
         $user_manager->select();
         $user_list = $user_manager->get();
         if ($user_list->getCount() >= 1) {
             $user_item = $user_list->getFirst();
             include_once 'classes/cs_mail.php';
             $translator = $this->_environment->getTranslationObject();
             while ($user_item) {
                 $mail = new cs_mail();
                 $mail->set_to($user_item->getEmail());
                 $room = $this->_environment->getCurrentContextItem();
                 $room_title = '';
                 if (isset($room)) {
                     $room_title = $room->getTitle();
                 }
                 $from = $translator->getMessage('SYSTEM_MAIL_MESSAGE', $room_title);
                 $mail->set_from_name($from);
                 $server_item = $this->_environment->getServerItem();
                 $default_sender_address = $server_item->getDefaultSenderAddress();
                 if (!empty($default_sender_address)) {
                     $mail->set_from_email($default_sender_address);
                 } else {
                     $mail->set_from_email('@');
                 }
                 $subject = $translator->getMessage('MATERIAL_EXPORT_WIKI_MAIL_SUBJECT') . ': ' . $room_title;
                 $mail->set_subject($subject);
                 $body = $translator->getMessage('MATERIAL_EXPORT_WIKI_MAIL_BODY', $room_title, $this->_environment->getCurrentUserItem()->getFullname(), $item->getTitle(), $item->getExportToWikiLink());
                 $mail->set_message($body);
                 $mail->setSendAsHTML();
                 $mail->send();
                 $user_item = $user_list->getNext();
             }
         }
     }
     $this->updateExportLists($rubric);
 }
 function _getTagBoxAsHTML()
 {
     $html = '<div class="portlet" id="my_tag_box">' . LF;
     $html .= '<div class="portlet-header">' . LF;
     $html .= $this->_translator->getMessage('PRIVATEROOM_MY_ENTRIES_TAG_BOX') . LF;
     $html .= '<div style="float:right;"><a name="myentries_remove" style="cursor:pointer;"><img src="images/commsyicons/16x16/delete.png" /></a></div>';
     $html .= '</div>' . LF;
     $html .= '<div class="portlet-content">' . LF;
     $html .= '<div id="my_tag_content_div">' . LF;
     $tag_manager = $this->_environment->getTagManager();
     $root_item = $tag_manager->getRootTagItem();
     $selected_id = '';
     $father_id_array = array();
     $tag_array = $this->_getSelectedTagArray();
     $count = count($tag_array);
     if ($count > 0) {
         $selected_id = $tag_array[0];
         $tag2tag_manager = $this->_environment->getTag2TagManager();
         $father_id_array = $tag2tag_manager->getFatherItemIDArray($selected_id);
     }
     $html .= $this->_getTagContentAsHTMLWithJavascript($root_item, 0, $selected_id, $father_id_array, 0, true);
     $html .= '</div>' . LF;
     $html .= '</div>' . LF;
     // Preferences link
     $html .= '<div class="portlet-turn portlet-front" style="float:right;">' . LF;
     $html .= '<a class="preferences_flip" name="portlet_preferences" style="cursor:pointer;"><img src="images/config_home.png" /></a>' . LF;
     $html .= '&nbsp;</div>' . LF;
     $html .= '</div>' . LF;
     // Preferences content
     $html .= '<div class="portlet" style="display:none;" id="my_tag_box_preferences">' . LF;
     $html .= '<div class="portlet-header">' . $this->_translator->getMessage('PRIVATEROOM_MY_ENTRIES_TAG_BOX') . ' - ' . $this->_translator->getMessage('COMMON_CONFIGURATION') . '</div>' . LF;
     $html .= '<div class="portlet-content">' . LF;
     // form
     $html .= '<table id="my_tag_form_table" summary="layout">' . LF;
     $html .= '<tr>' . LF;
     $html .= '<td class="formfield" colspan="3">' . LF;
     $html .= cs_ucfirst($this->_translator->getMessage('COMMON_ADD_BUTTON')) . LF;
     $html .= '</td>' . LF;
     $html .= '</tr>' . LF;
     $values_tree = array();
     $first_sort_tree = array();
     $second_sort_tree = array();
     if (isset($root_item)) {
         $temp_array = array();
         $temp_array['value'] = $root_item->getItemID();
         $temp_array['text'] = '*' . $this->_translator->getMessage('TAG_FORM_ROOT_LEVEL');
         $values_tree[] = $temp_array;
         unset($temp_array);
         $first_sort_tree = $this->_initFormChildren($root_item, 0);
         $values_tree = array_merge($values_tree, $first_sort_tree);
         $second_sort_tree = $values_tree;
     }
     $html .= '<tr>' . LF;
     $html .= '<td class="formfield" colspan="3">' . LF;
     $html .= '<input type="text" id="my_tag_form_new_tag" value="" maxlength="255" size="30" tabindex="18" class="text"/>' . LF;
     $html .= $this->_translator->getMessage('TAG_WORD_TO') . LF;
     $html .= '<select id="my_tag_form_father_id" size="1" tabindex="19">' . LF;
     foreach ($values_tree as $value) {
         $html .= '<option value="' . $value['value'] . '">' . $value['text'] . '</option>' . LF;
     }
     $html .= '</select>' . LF;
     $html .= '<input type="submit" id="my_tag_form_button_add" value="' . $this->_translator->getMessage('COMMON_ADD_BUTTON') . '" tabindex="20"/>' . LF;
     $html .= '</td>' . LF;
     $html .= '</tr>' . LF;
     $html .= '<tr>' . LF;
     $html .= '<td class="formfield" colspan="3">' . LF;
     $html .= '<br/>' . LF;
     $html .= '' . $this->_translator->getMessage('COMMON_SORT_BUTTON') . '' . LF;
     $html .= '</td>' . LF;
     $html .= '</tr>' . LF;
     $html .= '<tr>' . LF;
     $html .= '<td class="formfield" colspan="3">' . LF;
     $html .= '<select id="my_tag_form_sort_1" size="1" tabindex="21">' . LF;
     foreach ($first_sort_tree as $value) {
         $html .= '<option value="' . $value['value'] . '">' . $value['text'] . '</option>' . LF;
     }
     $html .= '</select>' . LF;
     $html .= '<select id="my_tag_form_sort_action" size="1" tabindex="22">' . LF;
     $html .= '<option value="3">' . $this->_translator->getMessage('TAG_ACTIONS_UNDER') . '</option>' . LF;
     $html .= '<option value="1">' . $this->_translator->getMessage('TAG_ACTIONS_BEFORE') . '</option>' . LF;
     $html .= '<option value="2">' . $this->_translator->getMessage('TAG_ACTIONS_AFTER') . '</option>' . LF;
     $html .= '</select>' . LF;
     $html .= '<select id="my_tag_form_sort_2" size="1" tabindex="23">' . LF;
     foreach ($second_sort_tree as $value) {
         $html .= '<option value="' . $value['value'] . '">' . $value['text'] . '</option>' . LF;
     }
     $html .= '</select>' . LF;
     $html .= '<input type="submit" id="my_tag_form_button_sort" value="' . $this->_translator->getMessage('TAG_SORT_BUTTON') . '" tabindex="24"/>' . LF;
     $html .= '</td>' . LF;
     $html .= '</tr>' . LF;
     $html .= '<tr>' . LF;
     $html .= '<td class="formfield" colspan="3">' . LF;
     $html .= '<input type="submit" id="my_tag_form_button_sort_abc" value="' . $this->_translator->getMessage('TAG_SORT_ABC') . '" tabindex="25"/>' . LF;
     $html .= '</td>' . LF;
     $html .= '</tr>' . LF;
     $html .= '<tr>' . LF;
     $html .= '<td class="formfield" colspan="3">' . LF;
     $html .= '<br/>' . LF;
     $html .= cs_ucfirst($this->_translator->getMessage('TAG_COMBINE_BUTTON')) . LF;
     $html .= '</td>' . LF;
     $html .= '</tr>' . LF;
     $html .= '<tr>' . LF;
     $html .= '<td class="formfield" colspan="3">' . LF;
     $html .= '<select id="my_tag_form_combine_1" size="1" tabindex="26">' . LF;
     foreach ($first_sort_tree as $value) {
         $html .= '<option value="' . $value['value'] . '">' . $value['text'] . '</option>' . LF;
     }
     $html .= '</select>' . LF;
     $html .= '<select id="my_tag_form_combine_2" size="1" tabindex="27">' . LF;
     foreach ($first_sort_tree as $value) {
         $html .= '<option value="' . $value['value'] . '">' . $value['text'] . '</option>' . LF;
     }
     $html .= '</select>' . LF;
     $html .= $this->_translator->getMessage('TAG_WORD_TO') . LF;
     $html .= '<select id="my_tag_form_combine_father" size="1" tabindex="28">' . LF;
     foreach ($second_sort_tree as $value) {
         $html .= '<option value="' . $value['value'] . '">' . $value['text'] . '</option>' . LF;
     }
     $html .= '</select>' . LF;
     $html .= '<input type="submit" id="my_tag_form_button_combine" value="' . $this->_translator->getMessage('TAG_COMBINE_BUTTON') . '" tabindex="29"/><br/><br/>' . LF;
     $html .= '</td>' . LF;
     $html .= '</tr>' . LF;
     $html .= '<tr>' . LF;
     $html .= '<td class="infoborder" style="width: 70%;" colspan="3">' . LF;
     $html .= '</td>' . LF;
     $html .= '</tr>' . LF;
     $html .= '<tr>' . LF;
     $html .= '<td class="formfield" colspan="3">' . LF;
     $html .= 'Bearbeiten' . LF;
     $html .= '</td>' . LF;
     $html .= '</tr>' . LF;
     $html .= '<tr>' . LF;
     $html .= '<td class="formfield" colspan="3">' . LF;
     $html .= '<table id="my_tag_form_change_table">' . LF;
     $html .= $this->_createFormForChildren($root_item, 0);
     $html .= '</table>' . LF;
     $html .= '</td>' . LF;
     $html .= '</tr>' . LF;
     $html .= '</table>' . LF;
     // /form
     $html .= '</div>' . LF;
     $html .= '<div class="portlet-turn portlet-back" style="float:right;"><a class="preferences_flip" name="portlet_preferences_back_button" style="cursor:pointer;"><img src="images/commsyicons/16x16/room.png" height="18" width="18"/></a>&nbsp;</div>' . LF;
     $html .= '</div>' . LF;
     $html .= '<script type="text/javascript">' . LF;
     $html .= '<!--' . LF;
     $html .= 'var tag_message = "";' . LF;
     $html .= '-->' . LF;
     $html .= '</script>' . LF;
     return $html;
 }
 function getPreferencesAsHTML()
 {
     $room = $this->_environment->getCurrentContextItem();
     $html = '';
     $html .= '<table id="my_tag_form_table" summary="layout">' . LF;
     $html .= '<tr>' . LF;
     $html .= '<td class="formfield" colspan="3">' . LF;
     $html .= cs_ucfirst($this->_translator->getMessage('COMMON_ADD_BUTTON')) . LF;
     $html .= '</td>' . LF;
     $html .= '</tr>' . LF;
     $tag_manager = $this->_environment->getTagManager();
     $root_item = $tag_manager->getRootTagItem();
     $values_tree = array();
     $first_sort_tree = array();
     $second_sort_tree = array();
     if (isset($root_item)) {
         $temp_array = array();
         $temp_array['value'] = $root_item->getItemID();
         $temp_array['text'] = '*' . $this->_translator->getMessage('TAG_FORM_ROOT_LEVEL');
         $values_tree[] = $temp_array;
         unset($temp_array);
         $first_sort_tree = $this->_initFormChildren($root_item, 0);
         $values_tree = array_merge($values_tree, $first_sort_tree);
         $second_sort_tree = $values_tree;
     }
     $html .= '<tr>' . LF;
     $html .= '<td class="formfield" colspan="3">' . LF;
     $html .= '<input type="text" id="my_tag_form_new_tag" value="" maxlength="255" size="30" tabindex="18" class="text"/>' . LF;
     $html .= $this->_translator->getMessage('TAG_WORD_TO') . LF;
     $html .= '<select id="my_tag_form_father_id" size="1" tabindex="19">' . LF;
     foreach ($values_tree as $value) {
         $html .= '<option value="' . $value['value'] . '">' . $value['text'] . '</option>' . LF;
     }
     $html .= '</select>' . LF;
     $html .= '<input type="submit" id="my_tag_form_button_add" value="' . $this->_translator->getMessage('COMMON_ADD_BUTTON') . '" tabindex="20"/>' . LF;
     $html .= '</td>' . LF;
     $html .= '</tr>' . LF;
     $html .= '<tr>' . LF;
     $html .= '<td class="formfield" colspan="3">' . LF;
     $html .= '<br/>' . LF;
     $html .= '' . $this->_translator->getMessage('COMMON_SORT_BUTTON') . '' . LF;
     $html .= '</td>' . LF;
     $html .= '</tr>' . LF;
     $html .= '<tr>' . LF;
     $html .= '<td class="formfield" colspan="3">' . LF;
     $html .= '<select id="my_tag_form_sort_1" size="1" tabindex="21">' . LF;
     foreach ($first_sort_tree as $value) {
         $html .= '<option value="' . $value['value'] . '">' . $value['text'] . '</option>' . LF;
     }
     $html .= '</select>' . LF;
     $html .= '<select id="my_tag_form_sort_action" size="1" tabindex="22">' . LF;
     $html .= '<option value="3">' . $this->_translator->getMessage('TAG_ACTIONS_UNDER') . '</option>' . LF;
     $html .= '<option value="1">' . $this->_translator->getMessage('TAG_ACTIONS_BEFORE') . '</option>' . LF;
     $html .= '<option value="2">' . $this->_translator->getMessage('TAG_ACTIONS_AFTER') . '</option>' . LF;
     $html .= '</select>' . LF;
     $html .= '<select id="my_tag_form_sort_2" size="1" tabindex="23">' . LF;
     foreach ($second_sort_tree as $value) {
         $html .= '<option value="' . $value['value'] . '">' . $value['text'] . '</option>' . LF;
     }
     $html .= '</select>' . LF;
     $html .= '<input type="submit" id="my_tag_form_button_sort" value="' . $this->_translator->getMessage('TAG_SORT_BUTTON') . '" tabindex="24"/>' . LF;
     $html .= '</td>' . LF;
     $html .= '</tr>' . LF;
     $html .= '<tr>' . LF;
     $html .= '<td class="formfield" colspan="3">' . LF;
     $html .= '<input type="submit" id="my_tag_form_button_sort_abc" value="' . $this->_translator->getMessage('TAG_SORT_ABC') . '" tabindex="25"/>' . LF;
     $html .= '</td>' . LF;
     $html .= '</tr>' . LF;
     $html .= '<tr>' . LF;
     $html .= '<td class="formfield" colspan="3">' . LF;
     $html .= '<br/>' . LF;
     $html .= cs_ucfirst($this->_translator->getMessage('TAG_COMBINE_BUTTON')) . LF;
     $html .= '</td>' . LF;
     $html .= '</tr>' . LF;
     $html .= '<tr>' . LF;
     $html .= '<td class="formfield" colspan="3">' . LF;
     $html .= '<select id="my_tag_form_combine_1" size="1" tabindex="26">' . LF;
     foreach ($first_sort_tree as $value) {
         $html .= '<option value="' . $value['value'] . '">' . $value['text'] . '</option>' . LF;
     }
     $html .= '</select>' . LF;
     $html .= '<select id="my_tag_form_combine_2" size="1" tabindex="27">' . LF;
     foreach ($first_sort_tree as $value) {
         $html .= '<option value="' . $value['value'] . '">' . $value['text'] . '</option>' . LF;
     }
     $html .= '</select>' . LF;
     $html .= $this->_translator->getMessage('TAG_WORD_TO') . LF;
     $html .= '<select id="my_tag_form_combine_father" size="1" tabindex="28">' . LF;
     foreach ($second_sort_tree as $value) {
         $html .= '<option value="' . $value['value'] . '">' . $value['text'] . '</option>' . LF;
     }
     $html .= '</select>' . LF;
     $html .= '<input type="submit" id="my_tag_form_button_combine" value="' . $this->_translator->getMessage('TAG_COMBINE_BUTTON') . '" tabindex="29"/><br/><br/>' . LF;
     $html .= '</td>' . LF;
     $html .= '</tr>' . LF;
     $html .= '<tr>' . LF;
     $html .= '<td class="infoborder" style="width: 70%;" colspan="3">' . LF;
     $html .= '</td>' . LF;
     $html .= '</tr>' . LF;
     $html .= '<tr>' . LF;
     $html .= '<td class="formfield" colspan="3">' . LF;
     $html .= 'Bearbeiten' . LF;
     $html .= '</td>' . LF;
     $html .= '</tr>' . LF;
     $html .= '<tr>' . LF;
     $html .= '<td class="formfield" colspan="3">' . LF;
     $html .= '<table id="my_tag_form_change_table">' . LF;
     $html .= $this->_createFormForChildren($root_item, 0);
     $html .= '</table>' . LF;
     $html .= '</td>' . LF;
     $html .= '</tr>' . LF;
     $html .= '</table>' . LF;
     return $html;
 }