Example #1
0
 function _getAllLinkedItemsAsHTML($spaces = 0)
 {
     $html = '';
     $current_context = $this->_environment->getCurrentContextItem();
     $html .= '<div style="margin-bottom:1px;">' . LF;
     $html .= '<div class="right_box">' . LF;
     $connections = $this->getRubricConnections();
     $current_context = $this->_environment->getCurrentContextItem();
     $current_user = $this->_environment->getCurrentUserItem();
     $params = $this->_environment->getCurrentParameterArray();
     $session = $this->_environment->getSessionItem();
     $attached_ids = array();
     if ($session->issetValue('cid' . $this->_environment->getCurrentContextID() . '_linked_items_index_selected_ids')) {
         $attached_ids = $session->getValue('cid' . $this->_environment->getCurrentContextID() . '_linked_items_index_selected_ids');
     }
     $count_linked_items = count($attached_ids);
     $item_manager = $this->_environment->getItemManager();
     $linked_items = $item_manager->getItemList($attached_ids);
     if ($this->_environment->inCommunityRoom() and $this->_environment->getCurrentModule() == CS_USER_TYPE) {
         $html .= '<div class="right_box_title">' . $this->_translator->getMessage('COMMON_ATTACHED_INSTITUTIONS') . ' (' . $count_linked_items . ')</div>';
     } elseif ($this->_environment->getCurrentModule() == CS_USER_TYPE) {
         $html .= '<div class="right_box_title">' . $this->_translator->getMessage('COMMON_ATTACHED_GROUPS') . ' (' . $count_linked_items . ')</div>';
     } else {
         $html .= '<div class="right_box_title">' . $this->_translator->getMessage('COMMON_ATTACHED_ENTRIES') . ' (' . $count_linked_items . ')</div>';
     }
     $html .= '     <div class="right_box_main">     ' . LF;
     if ($linked_items->isEmpty()) {
         $html .= '  <div style="padding:0px 5px; font-size:8pt;" class="disabled">' . $this->_translator->getMessage('COMMON_NONE') . '&nbsp;</div>' . LF;
     } else {
         $html .= '     <ul style="list-style-type: circle; font-size:8pt; list-style-position:inside; margin:0px; padding:0px;">' . LF;
         $linked_item = $linked_items->getFirst();
         while ($linked_item) {
             $fragment = '';
             // there is no anchor defined by default
             $type = $linked_item->getItemType();
             if ($type == 'label') {
                 $label_manager = $this->_environment->getLabelManager();
                 $label_item = $label_manager->getItem($linked_item->getItemID());
                 $type = $label_item->getLabelType();
             }
             $manager = $this->_environment->getManager($type);
             $item = $manager->getItem($linked_item->getItemID());
             $text = getRubricMessageTageName($type);
             $text .= ' - ' . $item->getTitle();
             $html .= '   <li  style="padding-left:5px; list-style-type:none;">';
             $type = $item->getType();
             if ($type == 'label') {
                 $type = $item->getLabelType();
             }
             switch (mb_strtoupper($type, 'UTF-8')) {
                 case 'ANNOUNCEMENT':
                     $img = 'images/commsyicons/netnavigation/announcement.png';
                     break;
                 case 'DATE':
                     $img = 'images/commsyicons/netnavigation/date.png';
                     break;
                 case 'DISCUSSION':
                     $img = 'images/commsyicons/netnavigation/discussion.png';
                     break;
                 case 'GROUP':
                     $img = 'images/commsyicons/netnavigation/group.png';
                     break;
                 case 'INSTITUTION':
                     $img = '';
                     break;
                 case 'MATERIAL':
                     $img = 'images/commsyicons/netnavigation/material.png';
                     break;
                 case 'PROJECT':
                     $img = '';
                     break;
                 case 'TODO':
                     $img = 'images/commsyicons/netnavigation/todo.png';
                     break;
                 case 'TOPIC':
                     $img = 'images/commsyicons/netnavigation/topic.png';
                     break;
                 case 'USER':
                     $img = 'images/commsyicons/netnavigation/user.png';
                     break;
                 default:
                     $img = '';
                     break;
             }
             $html .= '<img src="' . $img . '" style="padding-right:3px;" title="' . $text . '"/>';
             if ($type == CS_USER_TYPE) {
                 $html .= '<a title="' . $text . '">' . $this->_text_as_html_short(chunkText($item->getFullName(), 35)) . '</a>';
             } else {
                 if ($item->isNotActivated() and !($item->getCreatorID() == $current_user->getItemID() or $current_user->isModerator())) {
                     $html .= '<a title="' . $text . '" class="disabled">' . $this->_text_as_html_short(chunkText($item->getTitle(), 35)) . '</a>';
                 } else {
                     $html .= '<a title="' . $text . '">' . $this->_text_as_html_short(chunkText($item->getTitle(), 35)) . '</a>';
                 }
             }
             $html .= '</li>' . LF;
             $linked_item = $linked_items->getNext();
         }
         $html .= '</ul>' . LF;
     }
     $html .= '<div style="width:235px; font-size:8pt; text-align:right; padding-top:5px;">';
     $params = $this->_environment->getCurrentParameterArray();
     if ($session->issetValue('javascript')) {
         $javascript = $session->getValue('javascript');
         if ($javascript == 1) {
             if ($this->_environment->inCommunityRoom() and $this->_environment->getCurrentModule() == CS_USER_TYPE) {
                 $html .= '<a href="javascript:right_box_send(\'edit\',\'right_box_option\',\'' . $this->_translator->getMessage('COMMON_INSTITUTION_ATTACH') . '\');">' . $this->_translator->getMessage('COMMON_INSTITUTION_ATTACH') . '</a>' . LF;
             } elseif ($this->_environment->getCurrentModule() == CS_USER_TYPE) {
                 $html .= '<a href="javascript:right_box_send(\'edit\',\'right_box_option\',\'' . $this->_translator->getMessage('COMMON_GROUP_ATTACH') . '\');">' . $this->_translator->getMessage('COMMON_GROUP_ATTACH') . '</a>' . LF;
             } else {
                 $html .= '<a href="javascript:right_box_send(\'edit\',\'right_box_option\',\'' . $this->_translator->getMessage('COMMON_ITEM_NEW_ATTACH') . '\');">' . $this->_translator->getMessage('COMMON_ITEM_NEW_ATTACH') . '</a>' . LF;
             }
         } else {
             if ($this->_environment->inCommunityRoom() and $this->_environment->getCurrentModule() == CS_USER_TYPE) {
                 $html .= '<input id="right_box_option" type="submit" style="font-size:8pt;" name="right_box_option" value="' . $this->_translator->getMessage('COMMON_INSTITUTION_ATTACH') . '"/>';
             } elseif ($this->_environment->getCurrentModule() == CS_USER_TYPE) {
                 $html .= '<input id="right_box_option" type="submit" style="font-size:8pt;" name="right_box_option" value="' . $this->_translator->getMessage('COMMON_GROUP_ATTACH') . '"/>';
             } else {
                 $html .= '<input id="right_box_option" type="submit" style="font-size:8pt;" name="right_box_option" value="' . $this->_translator->getMessage('COMMON_ITEM_NEW_ATTACH') . '"/>';
             }
         }
     } else {
         if ($this->_environment->inCommunityRoom() and $this->_environment->getCurrentModule() == CS_USER_TYPE) {
             $html .= '<input id="right_box_option" type="submit" style="font-size:8pt;" name="right_box_option" value="' . $this->_translator->getMessage('COMMON_INSTITUTION_ATTACH') . '"/>';
         } elseif ($this->_environment->getCurrentModule() == CS_USER_TYPE) {
             $html .= '<input id="right_box_option" type="submit" style="font-size:8pt;" name="right_box_option" value="' . $this->_translator->getMessage('COMMON_GROUP_ATTACH') . '"/>';
         } else {
             $html .= '<input id="right_box_option" type="submit" style="font-size:8pt;" name="right_box_option" value="' . $this->_translator->getMessage('COMMON_ITEM_NEW_ATTACH') . '"/>';
         }
     }
     $html .= '</div>' . LF;
     $html .= '</div>' . LF;
     $html .= '</div>' . LF;
     $html .= '      </div>';
     return $html;
 }
 function asHTML()
 {
     $html = LF . '<!-- BEGIN OF LIST VIEW -->' . LF;
     $html .= '<div id="profile_content" style="width:700px; background-color:#FFFFFF; text-align:left;">' . LF;
     $html .= '<script type="text/javascript"> ' . LF;
     $html .= 'function quark(elem) { ' . LF;
     $html .= 'var cookie_value = \'\'; ' . LF;
     $html .= 'if (elem.checked) ' . LF;
     $html .= 'cookie_value = elem.name + \'=1\' ' . LF;
     $html .= 'else ' . LF;
     $html .= 'cookie_value = elem.name + \'=0\'' . LF;
     $html .= 'document.cookie=cookie_value; ' . LF;
     $html .= '} ' . LF;
     $html .= '</script>' . LF;
     $params = $this->_environment->getCurrentParameterArray();
     unset($params['attach_view']);
     unset($params['attach_type']);
     unset($params['from']);
     unset($params['pos']);
     unset($params['mode']);
     $params['return_attach_item_list'] = 'true';
     $title = ahref_curl($this->_environment->getCurrentContextID(), $this->_environment->getCurrentModule(), $this->_environment->getCurrentFunction(), $params, 'X', '', '', '', '', '', '', 'class="titlelink"');
     $html .= '<form style="padding:0px; margin:0px;" action="';
     $params = $this->_environment->getCurrentParameterArray();
     $html .= curl($this->_environment->getCurrentContextID(), $this->_environment->getCurrentModule(), $this->_environment->getCurrentFunction(), $params) . '" name="item_list_form" id="item_list_form"';
     $html .= ' method="post">' . LF;
     # post values from real item
     $post_values_orig = array();
     foreach ($this->_hidden_field_array as $field_name => $value) {
         if ($field_name != 'from' and $field_name != 'count_all_shown' and $field_name != 'interval' and $field_name != 'iid') {
             if (is_array($value)) {
                 foreach ($value as $key2 => $value2) {
                     $html .= '<input type="hidden" name="' . $field_name . '[' . $key2 . ']" value="' . $this->_text_as_form($value2) . '"/>' . LF;
                 }
             } else {
                 $html .= '<input type="hidden" name="' . $field_name . '" value="' . $this->_text_as_form($value) . '"/>' . LF;
             }
             $post_values_orig[] = $field_name;
         }
     }
     if (!empty($post_values_orig)) {
         $html .= '<input type="hidden" name="orig_post_keys" value="' . $this->_text_as_form(implode('ยง', $post_values_orig)) . '" />' . LF;
     }
     $html .= '<div>' . LF;
     $html .= '<div class="profile_title" style="float:right">' . $title . '</div>';
     if (count($this->_checked_ids) > 0) {
         $desc = ' (' . count($this->_checked_ids) . ' ' . $this->_translator->getMessage('COMMON_ACTUAL_ATTACHED') . ')';
     } else {
         $desc = '';
     }
     $html .= '<h2 id="profile_title">' . $this->_translator->getMessage('COMMON_ITEM_NEW_ATTACH') . $desc . '</h2>';
     $html .= '</div>' . LF;
     $html .= '<div style="padding:5px;">' . LF;
     if ($this->_environment->getCurrentModule() != CS_USER_TYPE) {
         $html .= '<div id="right_boxes_area" style="float:right; width:28%; padding-top:5px; vertical-align:top; text-align:left;">' . LF;
         $html .= '<div style="width:180px;">' . LF;
         $current_context = $this->_environment->getCurrentContextItem();
         $list_box_conf = $current_context->getListBoxConf();
         $first_box = true;
         $title_string = '';
         $desc_string = '';
         $config_text = '';
         $size_string = '';
         $html .= $this->_getHiddenFieldsAsHTML();
         $html .= '<div>' . LF;
         $params = $this->_environment->getCurrentParameterArray();
         $html .= '<div class="commsy_no_panel" style="margin-bottom:1px;">' . LF;
         $tempMessage = getRubricMessageTageName($this->_environment->getCurrentModule(), true);
         $html .= $this->_getListInfosAsHTML();
         $html .= '</div>' . LF;
         $html .= '</div>' . LF;
         $context_item = $this->_environment->getCurrentContextItem();
         /*********Expert Search*******/
         if (!strstr($list_box_conf, 'search_nodisplay') and ($context_item->withActivatingContent() or $this->_environment->getCurrentModule() == CS_DATE_TYPE or $this->_environment->getCurrentModule() == CS_USER_TYPE or $this->_environment->getCurrentModule() == CS_MATERIAL_TYPE or $this->_environment->getCurrentModule() == CS_TODO_TYPE)) {
             if ($first_box) {
                 $first_box = false;
                 $additional_text = '';
             } else {
                 $additional_text = ',';
             }
             if ($this->_environment->getCurrentModule() != 'campus_search') {
                 $title_string .= $additional_text . '"' . $this->_translator->getMessage('COMMON_RESTRICTIONS') . '"';
             } else {
                 $title_string .= $additional_text . '"' . $this->_translator->getMessage('COMMON_RESTRICTION_SEARCH') . '"';
             }
             $desc_string .= $additional_text . '""';
             $size_string .= $additional_text . '"10"';
             $parameter_array = $this->_environment->getCurrentParameterArray();
             if (isset($parameter_array['attribute_limit']) and $parameter_array['attribute_limit'] != '0' or isset($parameter_array['selactivatingstatus']) and $parameter_array['selactivatingstatus'] != '0' or isset($parameter_array['selstatus']) and $parameter_array['selstatus'] != '0' or isset($parameter_array['selrubric']) and !empty($parameter_array['selrubric']) or isset($parameter_array['selrestriction']) and !empty($parameter_array['selrestriction']) or $this->_environment->getCurrentModule() == 'campus_search') {
                 if ($this->_environment->getCurrentModule() != CS_USER_TYPE or isset($parameter_array['selstatus']) and $parameter_array['selstatus'] == '3') {
                     $config_text .= $additional_text . 'true';
                 } else {
                     $config_text .= $additional_text . 'false';
                 }
             } else {
                 $config_text .= $additional_text . 'false';
             }
             #           $html .= $this->_getExpertSearchAsHTML();
         }
         $html .= '</div>' . LF;
         $html .= '</div>' . LF;
         $current_browser = mb_strtolower($this->_environment->getCurrentBrowser(), 'UTF-8');
         $current_browser_version = $this->_environment->getCurrentBrowserVersion();
         if ($current_browser == 'msie' and (strstr($current_browser_version, '5.') or strstr($current_browser_version, '6.'))) {
             $width = ' width:100%; padding-right:10px;';
         } else {
             $width = '';
         }
         if (!(isset($_GET['mode']) and $_GET['mode'] == 'print')) {
             $html .= '</div>' . LF;
             $html .= '<div class="index_content_display_width" style="' . $width . 'padding-top:5px; vertical-align:bottom;">' . LF;
         } else {
             $html .= '</div>' . LF;
             $html .= '<div style="width:100%; padding-top:5px; vertical-align:bottom;">' . LF;
         }
         $params = $this->_environment->getCurrentParameterArray();
         if ($this->hasCheckboxes() and $this->_has_checkboxes != 'list_actions') {
             $html .= '   <input type="hidden" name="ref_iid" value="' . $this->_text_as_form($this->getRefIID()) . '"/>' . LF;
         }
         $html .= '<table class="list" style="width: 100%; border-collapse: collapse;" summary="Layout">' . LF;
     } else {
         $html .= '</div>' . LF;
         $html .= '<div style="width:100%; vertical-align:bottom; padding:5px;">' . LF;
         $params = $this->_environment->getCurrentParameterArray();
         if ($this->hasCheckboxes() and $this->_has_checkboxes != 'list_actions') {
             $html .= '   <input type="hidden" name="ref_iid" value="' . $this->_text_as_form($this->getRefIID()) . '"/>' . LF;
         }
         $html .= '<table class="list" style="width: 690px; border-collapse: collapse;" summary="Layout">' . LF;
     }
     $html .= $this->_getTableheadAsHTML();
     if (!$this->_clipboard_mode) {
         $html .= $this->_getContentAsHTML();
     } else {
         $html .= $this->_getClipboardContentAsHTML();
     }
     if (!(isset($_GET['mode']) and $_GET['mode'] == 'print')) {
         $html .= $this->_getTablefootAsHTML();
     }
     $html .= '</table>' . LF;
     $html .= '</div>' . LF;
     $html .= '<div style="clear:both;">' . LF;
     $html .= '</div>' . LF;
     $html .= '</div>' . LF;
     $html .= '</form>' . LF;
     $html .= '</div>' . LF;
     $html .= '<!-- END OF PLAIN LIST VIEW -->' . LF . LF;
     return $html;
 }