当前位置: 首页>>代码示例>>PHP>>正文


PHP getDateInLang函数代码示例

本文整理汇总了PHP中getDateInLang函数的典型用法代码示例。如果您正苦于以下问题:PHP getDateInLang函数的具体用法?PHP getDateInLang怎么用?PHP getDateInLang使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getDateInLang函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getForwardInformation

 private function getForwardInformation($ids)
 {
     $return = array();
     $converter = $this->_environment->getTextConverter();
     if (empty($ids) and isset($this->_item)) {
         $ids = array();
         $ids[] = $this->_item->getItemID();
     }
     // determe item positions for forward box
     $count = 0;
     $pos = 0;
     foreach ($ids as $id) {
         if (isset($this->_item) and $id == $this->_item->getItemID()) {
             $pos = $count;
         } else {
             $count++;
         }
     }
     $start = $pos - 4;
     $end = $pos + 4;
     if ($start < 0) {
         $end -= $start;
     }
     if ($end > count($ids)) {
         $end = count($ids);
         $start = $end - 9;
         if ($start < 0) {
             $start = 0;
         }
     }
     // get information
     $listed_ids = array();
     $count_items = 0;
     $i = 1;
     foreach ($ids as $id) {
         if ($count_items >= $start && $count_items <= $end) {
             $item_manager = $this->_environment->getItemManager();
             $tmp_item = $item_manager->getItem($id);
             //$text = '';
             if (isset($tmp_item)) {
                 $manager = $this->_environment->getManager($tmp_item->getItemType());
                 $item = $manager->getItem($ids[$count_items]);
                 $type = $tmp_item->getItemType();
                 if ($type == 'label') {
                     $label_manager = $this->_environment->getLabelManager();
                     $label_item = $label_manager->getItem($tmp_item->getItemID());
                     $type = $label_item->getLabelType();
                 }
             }
             $link_title = '';
             if (isset($item) && is_object($item) && $item->isA(CS_USER_TYPE)) {
                 $link_title = $item->getFullName();
             } elseif (isset($item) && is_object($item)) {
                 $link_title = $item->getTitle();
             }
             $params = $this->_environment->getCurrentParameterArray();
             unset($params['iid']);
             // append to return
             $activating_text = '';
             $current_user_item = $this->_environment->getCurrentUserItem();
             if (isset($item) && $item->isNotActivated() && !($item->getCreatorID() === $current_user_item->getItemID()) && !$current_user_item->isModerator()) {
                 $activating_date = $item->getActivatingDate();
                 if (strstr($activating_date, '9999-00-00')) {
                     $activating_text = $this->_environment->getTranslationObject()->getMessage('COMMON_NOT_ACTIVATED');
                 } else {
                     $activating_text = $this->_environment->getTranslationObject()->getMessage('COMMON_ACTIVATING_DATE') . ' ' . getDateInLang($item->getActivatingDate());
                 }
             }
             if (isset($item)) {
                 $return[] = array('title' => $link_title, 'is_current' => $item->getItemID() == $this->_item->getItemID(), 'item_id' => $item->getItemID(), 'type' => $type, 'params' => $params, 'position' => $count_items + 1, 'activating_text' => $activating_text);
                 unset($item);
             }
         }
         $count_items++;
     }
     return $return;
 }
开发者ID:a2call,项目名称:commsy,代码行数:77,代码来源:cs_detail_controller.php

示例2: getNetnavigation

 public function getNetnavigation($item)
 {
     $return = array();
     if (isset($item)) {
         $current_context = $this->_environment->getCurrentContextItem();
         $current_user = $this->_environment->getCurrentUser();
         $translator = $this->_environment->getTranslationObject();
         $converter = $this->_environment->getTextConverter();
         $link_items = $item->getAllLinkItemList();
         // remove items from list the current user is not allowed to see or ???
         $count_item = $link_items->getFirst();
         while ($count_item) {
             $linked_item = $count_item->getLinkedItem($item);
             if (isset($linked_item)) {
                 $type = $linked_item->getType();
             }
             // 					$module = Type2Module($type);
             // 					if($module === CS_USER_TYPE && ($item->getItemType()== CS_GROUP_TYPE || (!$linked_item->isUser() || !$linked_item->maySee($current_user)))) {
             // 						$link_items->removeElement($count_item);
             // 					}
             $count_item = $link_items->getNext();
         }
         $count_link_item = $link_items->getCount();
         $return['count'] = $count_link_item;
         /*
          *
         $this->_right_box_config['title_string'] .= $separator.'"'.$this->_translator->getMessage('COMMON_NETNAVIGATION_ENTRIES').' ('.$count_link_item.')"';
         $this->_right_box_config['desc_string'] .= $separator.'""';
         $this->_right_box_config['size_string'] .= $separator.'"10"';
         	
         if($current_context->isNetnavigationShowExpanded()){
         $this->_right_box_config['config_string'] .= $separator.'true';
         } else {
         $this->_right_box_config['config_string'] .= $separator.'false';
         }
         $html .= '<div class="commsy_panel" style="margin-bottom:1px;">'.LF;
         $html .= '<div class="right_box">'.LF;
         */
         $return['items'] = array();
         if (!$link_items->isEmpty()) {
             $link_item = $link_items->getFirst();
             while ($link_item) {
                 $entry = array('creator' => '');
                 $link_creator = $link_item->getCreatorItem();
                 if (isset($link_creator) && !$link_creator->isDeleted()) {
                     $entry['creator'] = $link_creator->getFullname();
                     // create the list entry
                     $linked_item = $link_item->getLinkedItem($item);
                     if (isset($linked_item)) {
                         $type = $linked_item->getType();
                         if ($type === 'label') {
                             $type = $linked_item->getLabelType();
                         }
                         $link_created = $translator->getDateInLang($link_item->getCreationDate());
                         switch (mb_strtoupper($type, 'UTF-8')) {
                             case 'ANNOUNCEMENT':
                                 $text = $translator->getMessage('COMMON_ONE_ANNOUNCEMENT');
                                 $img = 'announcement.png';
                                 break;
                             case 'DATE':
                                 $text = $translator->getMessage('COMMON_ONE_DATE');
                                 $img = 'date.png';
                                 break;
                             case 'DISCUSSION':
                                 $text = $translator->getMessage('COMMON_ONE_DISCUSSION');
                                 $img = 'discussion.png';
                                 break;
                             case 'GROUP':
                                 $text = $translator->getMessage('COMMON_ONE_GROUP');
                                 $img = 'group.png';
                                 break;
                             case 'INSTITUTION':
                                 $text = $translator->getMessage('COMMON_ONE_INSTITUTION');
                                 $img = '';
                                 break;
                             case 'MATERIAL':
                                 $text = $translator->getMessage('COMMON_ONE_MATERIAL');
                                 $img = 'material.png';
                                 break;
                             case 'PROJECT':
                                 $text = $translator->getMessage('COMMON_ONE_PROJECT');
                                 $img = '';
                                 break;
                             case 'TODO':
                                 $text = $translator->getMessage('COMMON_ONE_TODO');
                                 $img = 'todo.png';
                                 break;
                             case 'TOPIC':
                                 $text = $translator->getMessage('COMMON_ONE_TOPIC');
                                 $img = 'topic.png';
                                 break;
                             case 'USER':
                                 $text = $translator->getMessage('COMMON_ONE_USER');
                                 $img = 'user.png';
                                 break;
                             default:
                                 $text = $translator->getMessage('COMMON_MESSAGETAB_ERROR');
                                 $img = '';
                                 break;
                         }
//.........这里部分代码省略.........
开发者ID:a2call,项目名称:commsy,代码行数:101,代码来源:cs_utils_controller.php

示例3: _prepareValues

 /** loads the selected and given values to the form
  * this methods loads the selected and given values to the form from the material item or the form_post data
  */
 function _prepareValues()
 {
     $current_context = $this->_environment->getCurrentContextItem();
     if (isset($this->_form_post)) {
         $this->_values = $this->_form_post;
         $tmp_array = array();
         if (isset($this->_form_post['dayStart'])) {
             $tmp_array['dayStart'] = $this->_form_post['dayStart'];
         } else {
             $tmp_array['dayStart'] = '';
         }
         if (isset($this->_form_post['timeStart'])) {
             $tmp_array['timeStart'] = $this->_form_post['timeStart'];
         } else {
             $tmp_array['timeStart'] = '';
         }
         $this->_values['start_date_time'] = $tmp_array;
         if ($current_context->withWorkflow()) {
             $this->_values['workflow_traffic_light'] = $this->_form_post['workflow_traffic_light'];
             $this->_values['workflow_resubmission_date'] = array('workflow_resubmission_date' => $this->_form_post['workflow_resubmission_date']);
             $this->_values['workflow_resubmission_who'] = $this->_form_post['workflow_resubmission_who'];
             $this->_values['workflow_resubmission_who_additional'] = $this->_form_post['workflow_resubmission_who_additional'];
             $this->_values['workflow_resubmission_traffic_light'] = $this->_form_post['workflow_resubmission_traffic_light'];
             $this->_values['workflow_validity_date'] = array('workflow_validity_date' => $this->_form_post['workflow_validity_date']);
             $this->_values['workflow_validity_who'] = $this->_form_post['workflow_validity_who'];
             $this->_values['workflow_validity_who_additional'] = $this->_form_post['workflow_validity_who_additional'];
             $this->_values['workflow_validity_traffic_light'] = $this->_form_post['workflow_validity_traffic_light'];
         }
     } elseif (isset($this->_item)) {
         $this->_values['modification_date'] = $this->_item->getModificationDate();
         $this->_values['iid'] = $this->_item->getItemID();
         $this->_values['vid'] = $this->_item->getVersionID();
         $this->_values['publishing_date'] = $this->_item->getPublishingDate();
         $this->_values['title'] = $this->_item->getTitle();
         $this->_values['description'] = $this->_item->getDescription();
         $this->_values['external_viewer'] = $this->_item->issetExternalViewerStatus();
         $this->_values['external_viewer_accounts'] = $this->_item->getExternalViewerString();
         // file
         $file_array = array();
         $file_list = $this->_item->getFileList();
         if ($file_list->getCount() > 0) {
             $file_item = $file_list->getFirst();
             while ($file_item) {
                 $file_array[] = $file_item->getFileID();
                 $file_item = $file_list->getNext();
             }
         }
         if (isset($this->_form_post['filelist'])) {
             $this->_values['filelist'] = $this->_form_post['filelist'];
         } else {
             $this->_values['filelist'] = $file_array;
         }
         if ($current_context->withActivatingContent()) {
             if ($this->_item->isPrivateEditing()) {
                 $this->_values['private_editing'] = 1;
             } else {
                 $this->_values['private_editing'] = $this->_item->isPrivateEditing();
             }
         } else {
             $this->_values['public'] = $this->_item->isPublic();
         }
         if ($current_context->withWorkflow()) {
             $this->_values['workflow_traffic_light'] = $this->_item->getWorkflowTrafficLight();
             $this->_values['workflow_resubmission'] = $this->_item->getWorkflowResubmission();
             if ($this->_item->getWorkflowResubmissionDate() != '' and $this->_item->getWorkflowResubmissionDate() != '0000-00-00 00:00:00') {
                 $this->_values['workflow_resubmission_date']['workflow_resubmission_date'] = getDateInLang($this->_item->getWorkflowResubmissionDate());
             } else {
                 $this->_values['workflow_resubmission_date']['workflow_resubmission_date'] = '';
             }
             $this->_values['workflow_resubmission_who'] = $this->_item->getWorkflowResubmissionWho();
             $this->_values['workflow_resubmission_who_additional'] = $this->_item->getWorkflowResubmissionWhoAdditional();
             $this->_values['workflow_resubmission_traffic_light'] = $this->_item->getWorkflowResubmissionTrafficLight();
             $this->_values['workflow_validity'] = $this->_item->getWorkflowValidity();
             if ($this->_item->getWorkflowValidityDate() != '' and $this->_item->getWorkflowValidityDate() != '0000-00-00 00:00:00') {
                 $this->_values['workflow_validity_date']['workflow_validity_date'] = getDateInLang($this->_item->getWorkflowValidityDate());
             } else {
                 $this->_values['workflow_validity_date']['workflow_validity_date'] = '';
             }
             $this->_values['workflow_validity_who'] = $this->_item->getWorkflowValidityWho();
             $this->_values['workflow_validity_who_additional'] = $this->_item->getWorkflowValidityWhoAdditional();
             $this->_values['workflow_validity_traffic_light'] = $this->_item->getWorkflowValidityTrafficLight();
         }
         // rubric connections
         $this->_setValuesForRubricConnections();
         $this->_values['author'] = $this->_item->getAuthor();
         // no encode here - encode in form-views
         $this->_values['bib_kind'] = $this->_item->getBibKind();
         $this->_values['publisher'] = $this->_item->getPublisher();
         $this->_values['address'] = $this->_item->getAddress();
         $this->_values['edition'] = $this->_item->getEdition();
         $this->_values['series'] = $this->_item->getSeries();
         $this->_values['volume'] = $this->_item->getVolume();
         $this->_values['isbn'] = $this->_item->getISBN();
         $this->_values['issn'] = $this->_item->getISSN();
         $this->_values['editor'] = $this->_item->getEditor();
         $this->_values['booktitle'] = $this->_item->getBooktitle();
         $this->_values['pages'] = $this->_item->getPages();
//.........这里部分代码省略.........
开发者ID:a2call,项目名称:commsy,代码行数:101,代码来源:cs_material_form.php

示例4: _getItemAsHTML

 /** get the item of the list view as HTML
  * this method returns the single item in HTML-Code
  *
  * overwritten method form the upper class
  *
  * @return string item as HMTL
  */
 function _getItemAsHTML($item, $pos = 0, $with_links = TRUE)
 {
     $html = '';
     $shown_entry_number = $pos;
     $shown_entry_number = $pos + $this->_count_headlines;
     if ($shown_entry_number % 2 == 0) {
         $style = 'class="odd"';
     } else {
         $style = 'class="even"';
     }
     if ($this->_clipboard_mode) {
         $sort_criteria = $item->getContextID();
         if ($sort_criteria != $this->_last_sort_criteria) {
             $this->_last_sort_criteria = $sort_criteria;
             $this->_count_headlines++;
             $room_manager = $this->_environment->getProjectManager();
             $sort_room = $room_manager->getItem($sort_criteria);
             $html .= '                     <tr class="list"><td ' . $style . ' width="100%" style="font-weight:bold;" colspan="6">' . LF;
             if (empty($sort_room)) {
                 $community_manager = $this->_environment->getCommunityManager();
                 $sort_community = $community_manager->getItem($sort_criteria);
                 $html .= '                        ' . $this->_translator->getMessage('COPY_FROM') . '&nbsp;' . $this->_translator->getMessage('COMMON_COMMUNITY_ROOM_TITLE') . '&nbsp;"' . $sort_community->getTitle() . '"' . "\n";
             } elseif ($sort_room->isPrivateRoom()) {
                 $user = $this->_environment->getCurrentUserItem();
                 $html .= '                        ' . $this->_translator->getMessage('COPY_FROM_PRIVATEROOM') . '&nbsp;"' . $user->getFullname() . '"' . "\n";
             } elseif ($sort_room->isGroupRoom()) {
                 $html .= '                        ' . $this->_translator->getMessage('COPY_FROM_GROUPROOM') . '&nbsp;"' . $sort_room->getTitle() . '"' . LF;
             } else {
                 $html .= '                        ' . $this->_translator->getMessage('COPY_FROM_PROJECTROOM') . '&nbsp;"' . $sort_room->getTitle() . '"' . "\n";
             }
             $html .= '                     </td></tr>' . "\n";
             if ($style == 'class="odd"') {
                 $style = 'class="even"';
             } else {
                 $style = 'class="odd"';
             }
         }
     }
     $html .= '   <tr class="list">' . LF;
     $checked_ids = $this->getCheckedIDs();
     $dontedit_ids = $this->getDontEditIDs();
     $key = $item->getItemID();
     $fileicons = $this->_getItemFiles($item, $with_links);
     if (!empty($fileicons)) {
         $fileicons = ' ' . $fileicons;
     }
     if (!(isset($_GET['mode']) and $_GET['mode'] == 'print') or !empty($download) and $download == 'zip') {
         $html .= '      <td ' . $style . ' style="vertical-align:middle;" width="2%">' . LF;
         if (empty($download) or $download != 'zip') {
             $html .= '         <input style="color:blue; font-size:8pt; padding-left:0px; padding-right:0px; margin-left:0px; margin-right:0px;" type="checkbox" onClick="quark(this)" name="attach[' . $key . ']" value="1"';
             $user = $this->_environment->getCurrentUser();
             if ($item->isNotActivated() and !($item->getCreatorID() == $user->getItemID() or $user->isModerator())) {
                 $html .= ' disabled="disabled"' . LF;
             } elseif (isset($checked_ids) and !empty($checked_ids) and in_array($key, $checked_ids)) {
                 $html .= ' checked="checked"' . LF;
                 if (in_array($key, $dontedit_ids)) {
                     $html .= ' disabled="disabled"' . LF;
                 }
             }
             $html .= '/>' . LF;
             $html .= '         <input type="hidden" name="shown[' . $this->_text_as_form($key) . ']" value="1"/>' . LF;
         }
         $html .= '      </td>' . LF;
         if ($item->isNotActivated()) {
             $title = $item->getTitle();
             $title = $this->_compareWithSearchText($title);
             $user = $this->_environment->getCurrentUser();
             if ($item->getCreatorID() == $user->getItemID() or $user->isModerator()) {
                 $params = array();
                 $params['iid'] = $item->getItemID();
                 $title = ahref_curl($this->_environment->getCurrentContextID(), CS_DATE_TYPE, 'detail', $params, $title, '', '', '', '', '', '', '', '', CS_DATE_TYPE . $item->getItemID());
                 unset($params);
             }
             $activating_date = $item->getActivatingDate();
             if (strstr($activating_date, '9999-00-00')) {
                 $title .= BR . $this->_translator->getMessage('COMMON_NOT_ACTIVATED');
             } else {
                 $title .= BR . $this->_translator->getMessage('COMMON_ACTIVATING_DATE') . ' ' . getDateInLang($item->getActivatingDate());
             }
             $title = '<span class="disabled">' . $title . '</span>';
             $html .= '      <td ' . $style . '>' . $title . LF;
         } else {
             if ($with_links) {
                 $html .= '      <td ' . $style . '>' . $this->_getItemTitle($item) . $fileicons . LF;
             } else {
                 $title = $this->_text_as_html_short($item->getTitle());
                 $html .= '      <td ' . $style . '>' . $title . LF;
             }
         }
     } else {
         $html .= '      <td colspan="2" ' . $style . ' style="font-size:10pt;">' . $this->_getItemTitle($item) . $fileicons . '</td>' . LF;
     }
     $html .= '      <td ' . $style . ' style="font-size:8pt;">' . $this->_getItemDate($item);
//.........这里部分代码省略.........
开发者ID:a2call,项目名称:commsy,代码行数:101,代码来源:cs_date_index_view.php

示例5: _getTodosListAsHTML

 function _getTodosListAsHTML($todo_list, $number_of_portlets)
 {
     $html = '';
     #$html .= '</div>'.LF;
     #$html .= '</div>'.LF;
     $html .= '<div class="portlet" style="width:200px;">' . LF;
     $html .= '<div id="mycalendar_todo_portlet" class="portlet-header">';
     $html .= $this->_translator->getMessage('TODO_INDEX');
     $html .= '<div style="float:right;"><a name="mycalendar_remove" style="cursor:pointer;"><img src="images/commsyicons/16x16/delete.png" /></a></div>';
     $html .= '</div>' . LF;
     $html .= '<div class="portlet-content">' . LF;
     $width = '';
     #$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:170px;';
     #} else {
     #   $width = 'width:170px;';
     #}
     #if ( isset($parameter_array['show_todo_selections'])
     #     and $parameter_array['show_todo_selections'] == 'true'
     #   ) {
     #   if ( $current_browser == 'msie' and (strstr($current_browser_version,'5.') or (strstr($current_browser_version,'6.'))) ){
     #      $width = 'width:170px;'; // TBD
     #   } else {
     #      $width = 'width:190px;';
     #   }
     #   if ($this->_presentation_mode == '2'){
     #      $html .= '<div class="" style="'.$width.' height:393px; overflow-y:auto;">'.LF;
     #   }else{
     #      $html .= '<div class="" style="'.$width.' height:273px; overflow-y:auto;">'.LF;
     #   }
     #   $html .= $this->_getAdditionalFormFieldsForPrivateRoomAsHTML(CS_TODO_TYPE);
     #   $html .= '</div>'.LF;
     #}else{
     #if ($this->_presentation_mode == '2'){
     #   $html .= '<div class="" style="'.$width.' height:398px; overflow-y:auto; padding:0px;">'.LF;
     #}else{
     #   $html .= '<div class="" style="'.$width.' height:278px; overflow-y:auto; padding:0px;">'.LF;
     #}
     $height = '300px';
     if ($number_of_portlets == 1) {
         $height = '614px';
     } elseif ($number_of_portlets == 2) {
         $height = '369px';
     } elseif ($number_of_portlets == 3) {
         $height = '200px';
     }
     $html .= '<div class="" style="height:' . $height . '; overflow-y:auto; padding:0px;">' . LF;
     // show selections
     $html .= $this->_getTodoSelectionsAsHTML();
     if (isset($todo_list) and !$todo_list->isEmpty()) {
         $todo_array_for_jQuery = array();
         $todo_tooltip_array = array();
         $todo_item = $todo_list->getFirst();
         $i = 1;
         while ($todo_item) {
             if ($i % 2 == 0) {
                 $color = '#DFDFDF';
             } else {
                 $color = '#FFFFFF';
             }
             $html .= '<div style="background-color:' . $color . '; width:100%; overflow-x:hidden; white-space:nowrap;">';
             $html .= '<div style="padding:2px 3px;" id="todo_tooltip_' . $todo_item->getItemID() . '" data-tooltip="todo_tooltip_' . $todo_item->getItemID() . '">' . LF;
             $params = array();
             $params['iid'] = $todo_item->getItemID();
             $original_date = $todo_item->getDate();
             $date = getDateInLang($original_date);
             $actual_date = date("Y-m-d H:i:s");
             if ($original_date < $actual_date) {
                 $style = 'class="required" style="font-weight:normal;"';
                 $color_link = 'red';
             } else {
                 $style = 'style="color:#05860F;"';
                 $color_link = '#05860F';
             }
             $link = ahref_curl($todo_item->getContextID(), CS_TODO_TYPE, 'detail', $params, $this->_text_as_html_short($todo_item->getTitle()), '', '', '', '', '', '', $style) . LF;
             $html .= $link;
             $html .= '</div></div>';
             // tooltip
             $todo_tooltip = array();
             $todo_tooltip['iid'] = $todo_item->getItemID();
             $todo_tooltip['title'] = $todo_item->getTitle();
             $todo_tooltip['participants'] = $todo_item->getProcessorItemList();
             $original_date = $todo_item->getDate();
             $date = getDateTimeInLang($original_date);
             if ($date != '00.00.0000, 00:00 Uhr' and $date != '00.00.9999, 00:00 Uhr') {
                 $todo_tooltip['date'] = $date;
             } else {
                 $todo_tooltip['date'] = $this->_translator->getMessage('TODO_NO_END_DATE_LONG');
             }
             $todo_tooltip['color'] = $color_link;
             $todo_context_item = $todo_item->getContextItem();
             if (isset($todo_context_item)) {
                 $room_title = $todo_context_item->getTitle();
                 if (!empty($room_title)) {
                     $todo_tooltip['context'] = encode(AS_HTML_SHORT, $room_title);
                 }
                 unset($todo_context_item);
             }
//.........这里部分代码省略.........
开发者ID:a2call,项目名称:commsy,代码行数:101,代码来源:cs_date_calendar_index_view.php

示例6: getFormalData

 private function getFormalData()
 {
     $return = array();
     $translator = $this->_environment->getTranslationObject();
     $converter = $this->_environment->getTextConverter();
     $context_item = $this->_environment->getCurrentContextItem();
     $current_user = $this->_environment->getCurrentUserItem();
     $formal_data = array();
     if ($this->_item->isNotActivated()) {
         $activating_date = $this->_item->getActivatingDate();
         $text = '';
         if (strstr($activating_date, '9999-00-00')) {
             $activating_text = $translator->getMessage('COMMON_NOT_ACTIVATED');
         } else {
             $activating_text = $translator->getMessage('COMMON_ACTIVATING_DATE') . ' ' . getDateInLang($this->_item->getActivatingDate());
         }
         $temp_array = array();
         $temp_array[] = $translator->getMessage('COMMON_RIGHTS');
         $temp_array[] = $activating_text;
         $return[] = $temp_array;
     }
     $temp_array = array();
     $temp_array[0] = $translator->getMessage('ANNOUNCEMENT_SHOW_HOME_DATE');
     $temp_array[1] = getDateTimeInLang($this->_item->getSeconddateTime());
     $return[] = $temp_array;
     return $return;
 }
开发者ID:a2call,项目名称:commsy,代码行数:27,代码来源:cs_announcement_detail_controller.php

示例7: _getNewestLinkedItemsAsHTML

 function _getNewestLinkedItemsAsHTML($item)
 {
     $current_context = $this->_environment->getCurrentContextItem();
     $path_shown = false;
     $html = '';
     if ($current_context->withPath() and $item->isPathActive()) {
         $item_list = $item->getPathItemList();
         if (!$item_list->isEmpty()) {
             $path_shown = true;
             $html .= '<h3 class="subitemtitle" style="margin-top:0px; margin-bottom:5px;">' . $this->_translator->getMessage('TOPIC_PATH');
             $html .= '</h3>' . LF;
             $i = 0;
             $html .= '<ul style="list-style-type: none; list-style-position:inside; font-size:8pt; padding-left:0px; margin-left:0px; margin-top:0px; margin-bottom:20px; padding-bottom:0px;">  ' . LF;
             $linked_item = $item_list->getFirst();
             while ($linked_item) {
                 $params = array();
                 $params['iid'] = $linked_item->getItemID();
                 $params['path'] = $item->getItemID();
                 $mod = type2Module($linked_item->getItemType());
                 $type = $linked_item->getItemType();
                 if ($type == 'date') {
                     $type .= 's';
                 }
                 $temp_type = mb_strtoupper($type, 'UTF-8');
                 switch ($temp_type) {
                     case 'ANNOUNCEMENT':
                         $type = $this->_translator->getMessage('COMMON_ANNOUNCEMENT');
                         break;
                     case 'DATES':
                         $type = $this->_translator->getMessage('COMMON_DATES');
                         break;
                     case 'DISCUSSION':
                         $type = $this->_translator->getMessage('COMMON_DISCUSSION');
                         break;
                     case 'GROUP':
                         $type = $this->_translator->getMessage('COMMON_GROUP');
                         break;
                     case 'INSTITUTION':
                         $type = $this->_translator->getMessage('COMMON_INSTITUTION');
                         break;
                     case 'MATERIAL':
                         $type = $this->_translator->getMessage('COMMON_MATERIAL');
                         break;
                     case 'PROJECT':
                         $type = $this->_translator->getMessage('COMMON_PROJECT');
                         break;
                     case 'TODO':
                         $type = $this->_translator->getMessage('COMMON_TODO');
                         break;
                     case 'TOPIC':
                         $type = $this->_translator->getMessage('COMMON_TOPIC');
                         break;
                     case 'USER':
                         $type = $this->_translator->getMessage('COMMON_USER');
                         break;
                     default:
                         $type = $this->_translator->getMessage('COMMON_MESSAGETAG_ERROR' . ' cs_topic_detail(' . __LINE__ . ') ');
                         break;
                 }
                 $user = $this->_environment->getCurrentUser();
                 if ($linked_item->isNotActivated() and !($linked_item->getCreatorID() == $user->getItemID() or $user->isModerator())) {
                     $activating_date = $linked_item->getActivatingDate();
                     if (strstr($activating_date, '9999-00-00')) {
                         $link_creator_text = $this->_translator->getMessage('COMMON_NOT_ACTIVATED');
                     } else {
                         $link_creator_text = $this->_translator->getMessage('COMMON_ACTIVATING_DATE') . ' ' . getDateInLang($linked_item->getActivatingDate());
                     }
                     $html_text = ahref_curl($this->_environment->getCurrentContextID(), $mod, 'detail', $params, $linked_item->getTitle(), $link_creator_text, '', '', '', '', '', 'class="disabled"', '', '', true) . LF;
                 } else {
                     $html_text = ahref_curl($this->_environment->getCurrentContextID(), $mod, 'detail', $params, $linked_item->getTitle(), $type . ' - ' . $linked_item->getTitle()) . LF;
                 }
                 $html .= '      <li style="font-size:10pt;">' . ($i + 1) . '. ' . $html_text . '</li>' . LF;
                 unset($params);
                 $linked_item = $item_list->getNext();
                 $i++;
             }
             $html .= '</ul>' . LF . LF;
         }
     }
     return $html;
 }
开发者ID:a2call,项目名称:commsy,代码行数:81,代码来源:cs_topic_detail_view.php

示例8: _getLinkedItemsAsHTML

 function _getLinkedItemsAsHTML($item, $link_items, $connection, $is_perspective = false, $always = false, $attach_link = false)
 {
     $current_context = $this->_environment->getCurrentContextItem();
     $user = $this->_environment->getCurrentUserItem();
     $mod = $this->_with_modifying_actions;
     $module = Type2Module($connection);
     $html = '<div>' . LF;
     $html .= '<ul style="list-style-type: circle; font-size:8pt;">  ' . LF;
     if (isset($link_items) and $link_items->isEmpty()) {
         $html .= '   <li><a><span class="disabled">' . $this->_translator->getMessage('COMMON_NONE') . '</span></a></li>' . LF;
     } else {
         $count = $link_items->getCount();
         if (!$is_perspective and $count > 10) {
             // Only show up to five items
             $limit = 9;
             $count_shown = 1;
         } else {
             $limit = 0;
             $count_shown = 0;
         }
         $link_item = $link_items->getFirst();
         while ($link_item and $count_shown <= $limit) {
             // Get link creator
             $link_creator = $link_item->getCreatorItem();
             if (isset($link_creator) and !$link_creator->isDeleted()) {
                 $fullname = $link_creator->getFullname();
             } else {
                 $fullname = $this->_translator->getMessage('COMMON_DELETED_USER');
             }
             $link_created = $this->_translator->getDateInLang($link_item->getCreationDate());
             $link_creator_text = $this->_translator->getMessage('COMMON_LINK_CREATOR') . ' ' . $fullname . ', ' . $link_created;
             // Create the list entry
             $linked_item = $link_item->getLinkedItem($item);
             // Get the linked item
             if (isset($linked_item)) {
                 $fragment = '';
                 // there is no anchor defined by default
                 switch ($connection) {
                     case CS_DISCARTICLE_TYPE:
                         $linked_iid = $linked_item->getDiscussionID();
                         $fragment = $linked_item->getItemID();
                         $discussion_manager = $this->_environment->getDiscussionManager();
                         $linked_item = $discussion_manager->getItem($linked_iid);
                         break;
                     case CS_SECTION_TYPE:
                         $linked_iid = $linked_item->getLinkedItemID();
                         $fragment = $linked_item->getItemID();
                         $material_manager = $this->_environment->getMaterialManager();
                         $linked_item = $material_manager->getItem($linked_iid);
                         break;
                     default:
                         $linked_iid = $linked_item->getItemID();
                 }
                 $html .= '   <li>';
                 $params = array();
                 $params['iid'] = $linked_iid;
                 $user = $this->_environment->getCurrentUser();
                 if ($linked_item->isNotActivated() and !($linked_item->getCreatorID() == $user->getItemID() or $user->isModerator())) {
                     $activating_date = $linked_item->getActivatingDate();
                     if (strstr($activating_date, '9999-00-00')) {
                         $link_creator_text .= ' (' . $this->_translator->getMessage('COMMON_NOT_ACTIVATED') . ')';
                     } else {
                         $link_creator_text .= ' (' . $this->_translator->getMessage('COMMON_ACTIVATING_DATE') . ' ' . getDateInLang($linked_item->getActivatingDate()) . ')';
                     }
                     $html .= ahref_curl($this->_environment->getCurrentContextID(), $module, 'detail', $params, chunkText($linked_item->getTitle(), 27), $link_creator_text, '_self', $fragment, '', '', '', 'class="disabled"', '', '', true);
                     unset($params);
                 } else {
                     $html .= ahref_curl($this->_environment->getCurrentContextID(), $module, 'detail', $params, chunkText($linked_item->getTitle(), 27), $link_creator_text, '_self', $fragment);
                     unset($params);
                 }
                 $html .= '</li>' . LF;
             }
             // Show all linked perspectives
             if ($limit > 0) {
                 $count_shown++;
             }
             $link_item = $link_items->getNext();
         }
         if ($limit > 0) {
             $html .= '   <li>';
             $params = array();
             $params['ref_iid'] = $item->getItemID();
             $params['mode'] = 'attached';
             $html .= ahref_curl($this->_environment->getCurrentContextID(), $module, 'index', $params, $this->_translator->getMessage('RUBRIC_ALL_ATTACHMENTS', $link_items->getCount()));
             unset($params);
             $html .= '</li>' . LF;
         }
     }
     $html .= '</ul> ';
     $html .= '				<div style="text-align:right; border-top:0px solid black; padding-bottom:5px; font-size:8pt; padding-right: 3px; font-size:8pt;">' . LF;
     if ($attach_link) {
         if ($user->isUser() and $mod) {
             $params = array();
             $params['ref_iid'] = $item->getItemID();
             $params['mode'] = 'detailattach';
             $html .= ahref_curl($this->_environment->getCurrentContextID(), $module, 'index', $params, $this->_translator->getMessage('COMMON_ATTACH_LINK')) . LF;
             unset($params);
         } else {
             $html .= $this->_translator->getMessage('COMMON_ATTACH_LINK') . LF;
         }
//.........这里部分代码省略.........
开发者ID:a2call,项目名称:commsy,代码行数:101,代码来源:cs_detail_view.php

示例9: _getItemAsHTML

 function _getItemAsHTML($item, $pos = 0, $with_links = TRUE)
 {
     $html = '';
     $shown_entry_number = $pos;
     $shown_entry_number = $pos + $this->_count_headlines;
     if ($shown_entry_number % 2 == 0) {
         $style = 'class="odd"';
     } else {
         $style = 'class="even"';
     }
     if ($this->_clipboard_mode) {
         $sort_criteria = $item->getContextID();
         if ($sort_criteria != $this->_last_sort_criteria) {
             $this->_last_sort_criteria = $sort_criteria;
             $this->_count_headlines++;
             $room_manager = $this->_environment->getProjectManager();
             $sort_room = $room_manager->getItem($sort_criteria);
             $html .= '                     <tr class="list"><td ' . $style . ' width="100%" style="font-weight:bold;" colspan="5">' . "\n";
             if (empty($sort_room)) {
                 $community_manager = $this->_environment->getCommunityManager();
                 $sort_community = $community_manager->getItem($sort_criteria);
                 if (!empty($sort_community)) {
                     $html .= '                        ' . $this->_translator->getMessage('COPY_FROM') . '&nbsp;' . $this->_translator->getMessage('COMMON_COMMUNITY_ROOM_TITLE') . '&nbsp;"' . $sort_community->getTitle() . '"' . "\n";
                 }
             } elseif ($sort_room->isPrivateRoom()) {
                 $user = $this->_environment->getCurrentUserItem();
                 $html .= '                        ' . $this->_translator->getMessage('COPY_FROM_PRIVATEROOM') . '&nbsp;"' . $user->getFullname() . '"' . LF;
             } elseif ($sort_room->isGroupRoom()) {
                 $html .= '                        ' . $this->_translator->getMessage('COPY_FROM_GROUPROOM') . '&nbsp;"' . $sort_room->getTitle() . '"' . LF;
             } else {
                 $html .= '                        ' . $this->_translator->getMessage('COPY_FROM_PROJECTROOM') . '&nbsp;"' . $sort_room->getTitle() . '"' . LF;
             }
             $html .= '                     </td></tr>' . "\n";
             if ($style == 'class="odd"') {
                 $style = 'class="even"';
             } else {
                 $style = 'class="odd"';
             }
         }
     }
     $html .= '   <tr class="list">' . LF;
     $checked_ids = $this->getCheckedIDs();
     $dontedit_ids = $this->getDontEditIDs();
     $key = $item->getItemID();
     $fileicons = $this->_getItemFiles($item, $with_links);
     if (!empty($fileicons)) {
         $fileicons = ' ' . $fileicons;
     }
     if (!(isset($_GET['mode']) and $_GET['mode'] == 'print')) {
         $html .= '      <td ' . $style . ' style="vertical-align:middle;" width="2%">' . LF;
         $html .= '         <input style="font-size:8pt; padding-left:0px; padding-right:0px; margin-left:0px; margin-right:0px;" type="checkbox" onClick="quark(this)" name="attach[' . $key . ']" value="1"';
         $user = $this->_environment->getCurrentUser();
         if ($item->isNotActivated() and !($item->getCreatorID() == $user->getItemID() or $user->isModerator())) {
             $html .= ' disabled="disabled"' . LF;
         } elseif (isset($checked_ids) and !empty($checked_ids) and in_array($key, $checked_ids)) {
             $html .= ' checked="checked"' . LF;
             if (in_array($key, $dontedit_ids)) {
                 $html .= ' disabled="disabled"' . LF;
             }
         }
         $html .= '/>' . LF;
         $html .= '         <input type="hidden" name="shown[' . $this->_text_as_form($key) . ']" value="1"/>' . LF;
         $html .= '      </td>' . LF;
         if ($item->isNotActivated()) {
             $title = $item->getTitle();
             $title = $this->_compareWithSearchText($this->_text_as_html_short($title));
             $user = $this->_environment->getCurrentUser();
             if ($item->getCreatorID() == $user->getItemID() or $user->isModerator()) {
                 $params = array();
                 $params['iid'] = $item->getItemID();
                 $title = ahref_curl($this->_environment->getCurrentContextID(), CS_ANNOUNCEMENT_TYPE, 'detail', $params, $title, '', '', '', '', '', '', '', '', CS_ANNOUNCEMENT_TYPE . $item->getItemID());
                 unset($params);
                 if (!$this->_environment->inPrivateRoom()) {
                     $title .= $this->_getItemChangeStatus($item);
                     $title .= $this->_getItemAnnotationChangeStatus($item);
                 }
             }
             $activating_date = $item->getActivatingDate();
             if (strstr($activating_date, '9999-00-00')) {
                 $title .= BR . $this->_translator->getMessage('COMMON_NOT_ACTIVATED');
             } else {
                 $title .= BR . $this->_translator->getMessage('COMMON_ACTIVATING_DATE') . ' ' . getDateInLang($item->getActivatingDate());
             }
             $title = '<span class="disabled">' . $title . '</span>';
             $html .= '      <td ' . $style . '>' . $title . LF;
         } else {
             if ($with_links) {
                 $html .= '      <td ' . $style . '>' . $this->_getItemTitle($item) . LF;
             } else {
                 $title = $this->_text_as_html_short($item->getTitle());
                 $html .= '      <td ' . $style . '>' . $title . LF;
             }
         }
     } else {
         $html .= '      <td colspan="2" ' . $style . ' style="font-size:10pt;">' . $this->_getItemTitle($item) . $fileicons . '</td>' . LF;
     }
     $text = '';
     switch (mb_strtoupper($item->getItemType(), 'UTF-8')) {
         case 'ANNOUNCEMENT':
             $text .= $this->_translator->getMessage('ANNOUNCEMENTS');
//.........这里部分代码省略.........
开发者ID:a2call,项目名称:commsy,代码行数:101,代码来源:cs_copy_index_view.php

示例10: actionUpdateLinkedItem


//.........这里部分代码省略.........
                 $img = 'discussion.png';
                 break;
             case 'GROUP':
                 $text = $translator->getMessage('COMMON_ONE_GROUP');
                 $img = 'group.png';
                 break;
             case 'INSTITUTION':
                 $text = $translator->getMessage('COMMON_ONE_INSTITUTION');
                 $img = '';
                 break;
             case 'MATERIAL':
                 $text = $translator->getMessage('COMMON_ONE_MATERIAL');
                 $img = 'material.png';
                 break;
             case 'PROJECT':
                 $text = $translator->getMessage('COMMON_ONE_PROJECT');
                 $img = '';
                 break;
             case 'TODO':
                 $text = $translator->getMessage('COMMON_ONE_TODO');
                 $img = 'todo.png';
                 break;
             case 'TOPIC':
                 $text = $translator->getMessage('COMMON_ONE_TOPIC');
                 $img = 'topic.png';
                 break;
             case 'USER':
                 $text = $translator->getMessage('COMMON_ONE_USER');
                 $img = 'user.png';
                 break;
             default:
                 $text = $translator->getMessage('COMMON_MESSAGETAB_ERROR');
                 $img = '';
                 break;
         }
         $link_creator_text = $text . ' - ' . $translator->getMessage('COMMON_LINK_CREATOR') . ' ' . $entry['creator'];
         switch ($type) {
             case CS_DISCARTICLE_TYPE:
                 $linked_iid = $linked_item->getDiscussionID();
                 $discussion_manager = $this->_environment->getDiscussionManager();
                 $linked_item = $discussion_manager->getItem($linked_iid);
                 break;
             case CS_SECTION_TYPE:
                 $linked_iid = $linked_item->getLinkedItemID();
                 $material_manager = $this->_environment->getMaterialManager();
                 $linked_item = $material_manager->getItem($linked_iid);
                 break;
             default:
                 $linked_iid = $linked_item->getItemID();
         }
         $entry['linked_iid'] = $linked_iid;
         $module = Type2Module($type);
         if ($linked_item->isNotActivated() && !($linked_item->getCreatorID() === $user->getItemID() || $user->isModerator())) {
             $activating_date = $linked_item->getActivatingDate();
             if (strstr($activating_date, '9999-00-00')) {
                 $link_creator_text .= ' (' . $translator->getMessage('COMMON_NOT_ACTIVATED') . ')';
             } else {
                 $link_creator_text .= ' (' . $translator->getMessage('COMMON_ACTIVATING_DATE') . ' ' . getDateInLang($linked_item->getActivatingDate()) . ')';
             }
             if ($module === CS_USER_TYPE) {
                 $title = $linked_item->getFullName();
             } else {
                 $title = $linked_item->getTitle();
             }
             $title = $converter->text_as_html_short($title);
             $entry['module'] = $module;
             $entry['img'] = $img;
             $entry['title'] = $link_creator_text;
             $entry['link_text'] = $title;
         } else {
             if ($module === CS_USER_TYPE) {
                 $title = $linked_item->getFullName();
             } else {
                 $title = $linked_item->getTitle();
             }
             $title = $converter->text_as_html_short($title);
             $entry['module'] = $module;
             $entry['img'] = $img;
             $entry['title'] = $link_creator_text;
             $entry['link_text'] = $title;
         }
         $return['linked_item'] = $entry;
     } else {
         // remove
         if (($offset = array_search($link_id, $selected_ids)) !== false) {
             array_splice($selected_ids, $offset, 1);
         }
     }
     // update item
     if (isset($item)) {
         if ($item->isA(CS_LABEL_TYPE) && $item->getLabelType() == CS_BUZZWORD_TYPE) {
             $item->saveLinksByIDArray($selected_ids);
         } else {
             $item->setLinkedItemsByIDArray($selected_ids);
             $item->save();
         }
     }
     $this->setSuccessfullDataReturn($return);
     echo $this->_return;
 }
开发者ID:a2call,项目名称:commsy,代码行数:101,代码来源:cs_ajax_path_controller.php

示例11: _getItemAsHTML

 /** get the item of the list view as HTML
  * this method returns the single item in HTML-Code
  *
  * overwritten method form the upper class
  *
  * @return string item as HMTL
  *
  * @author CommSy Development Group
  */
 function _getItemAsHTML($item, $pos = 0, $with_links = TRUE)
 {
     $html = '';
     $shown_entry_number = $pos + $this->_count_headlines;
     if ($shown_entry_number % 2 == 0) {
         $style = 'class="odd"';
     } else {
         $style = 'class="even"';
     }
     if ($this->_clipboard_mode) {
         $sort_criteria = $item->getContextID();
         if ($sort_criteria != $this->_last_sort_criteria) {
             $this->_last_sort_criteria = $sort_criteria;
             $this->_count_headlines++;
             $room_manager = $this->_environment->getProjectManager();
             $sort_room = $room_manager->getItem($sort_criteria);
             $html .= '                     <tr class="list"><td ' . $style . ' width="100%" style="font-weight:bold;" colspan="5">' . "\n";
             if (empty($sort_room)) {
                 $community_manager = $this->_environment->getCommunityManager();
                 $sort_community = $community_manager->getItem($sort_criteria);
                 $html .= '                        ' . $this->_translator->getMessage('COPY_FROM') . '&nbsp;' . $this->_translator->getMessage('COMMON_COMMUNITY_ROOM_TITLE') . '&nbsp;"' . $sort_community->getTitle() . '"' . "\n";
             } elseif ($sort_room->isPrivateRoom()) {
                 $user = $this->_environment->getCurrentUserItem();
                 $html .= '                        ' . $this->_translator->getMessage('COPY_FROM_PRIVATEROOM') . '&nbsp;"' . $user->getFullname() . '"' . LF;
             } elseif ($sort_room->isCommunityRoom()) {
                 $html .= '                        ' . $this->_translator->getMessage('COPY_FROM_COMMUNITYROOM') . '&nbsp;"' . $sort_room->getTitle() . '"' . LF;
             } elseif ($sort_room->isGroupRoom()) {
                 $html .= '                        ' . $this->_translator->getMessage('COPY_FROM_GROUPROOM') . '&nbsp;"' . $sort_room->getTitle() . '"' . LF;
             } else {
                 $html .= '                        ' . $this->_translator->getMessage('COPY_FROM_PROJECTROOM') . '&nbsp;"' . $sort_room->getTitle() . '"' . LF;
             }
             $html .= '                     </td></tr>' . "\n";
             if ($style == 'class="odd"') {
                 $style = 'class="even"';
             } else {
                 $style = 'class="odd"';
             }
         }
     }
     $html .= '   <tr class="list">' . LF;
     $checked_ids = $this->getCheckedIDs();
     $dontedit_ids = $this->getDontEditIDs();
     $key = $item->getItemID();
     if (!(isset($_GET['mode']) and $_GET['mode'] == 'print') or !empty($download) and $download == 'zip') {
         $html .= '      <td ' . $style . ' style="vertical-align:middle;" width="2%">' . LF;
         if (empty($download) or $download != 'zip') {
             $html .= '         <input style="font-size:8pt; padding-left:0px; padding-right:0px; margin-left:0px; margin-right:0px;" type="checkbox" onClick="quark(this)" name="attach[' . $key . ']" value="1"';
             $user = $this->_environment->getCurrentUser();
             if ($item->isNotActivated() and !($item->getCreatorID() == $user->getItemID() or $user->isModerator())) {
                 $html .= ' disabled="disabled"' . LF;
             } elseif (isset($checked_ids) and !empty($checked_ids) and in_array($key, $checked_ids)) {
                 $html .= ' checked="checked"' . LF;
                 if (in_array($key, $dontedit_ids)) {
                     $html .= ' disabled="disabled"' . LF;
                 }
             }
             $html .= '/>' . LF;
             $html .= '         <input type="hidden" name="shown[' . $this->_text_as_form($key) . ']" value="1"/>' . LF;
         }
         $html .= '      </td>' . LF;
         if ($item->isNotActivated()) {
             $title = $this->_getItemTitle($item);
             $title = $this->_compareWithSearchText($title);
             $user = $this->_environment->getCurrentUser();
             if ($item->getCreatorID() == $user->getItemID() or $user->isModerator()) {
                 $params = array();
                 $params['iid'] = $item->getItemID();
                 $title = ahref_curl($this->_environment->getCurrentContextID(), CS_MATERIAL_TYPE, 'detail', $params, $title, '', '', '', '', '', '', '', '', CS_MATERIAL_TYPE . $item->getItemID());
                 unset($params);
             }
             $activating_date = $item->getActivatingDate();
             if (strstr($activating_date, '9999-00-00')) {
                 $title .= BR . $this->_translator->getMessage('COMMON_NOT_ACTIVATED');
             } else {
                 $title .= BR . $this->_translator->getMessage('COMMON_ACTIVATING_DATE') . ' ' . getDateInLang($item->getActivatingDate());
             }
             $title = '<span class="disabled">' . $title . '</span>';
             $html .= '      <td ' . $style . '>' . $title . LF;
         } else {
             if ($with_links) {
                 $html .= '      <td ' . $style . '>' . $this->_getItemTitle($item) . LF;
             } else {
                 $title = $this->_text_as_html_short($this->_getItemTitle($item));
                 $html .= '      <td ' . $style . '>' . $title . LF;
             }
         }
     } else {
         if ($with_links) {
             $html .= '      <td colspan="2" ' . $style . '>' . $this->_getItemTitle($item) . LF;
         } else {
             $title = $this->_text_as_html_short($this->_getItemTitle($item));
//.........这里部分代码省略.........
开发者ID:a2call,项目名称:commsy,代码行数:101,代码来源:cs_material_index_view.php

示例12: getDetailContent

 protected function getDetailContent()
 {
     $converter = $this->_environment->getTextConverter();
     $translator = $this->_environment->getTranslationObject();
     $return = array();
     $return['title'] = $this->_item->getTitle();
     $return['show_picture'] = false;
     $return['moredetails'] = $this->getCreatorInformationAsArray($this->_item);
     // description
     $desc = $this->_item->getDescription();
     if (!empty($desc)) {
         $converter->setFileArray($this->getItemFileList());
         $desc = $converter->textFullHTMLFormatting($desc);
     }
     $path_shown = false;
     $path_items = array();
     $item_list = $this->_item->getPathItemList();
     if (!$item_list->isEmpty()) {
         $path_shown = true;
         $linked_item = $item_list->getFirst();
         while ($linked_item) {
             $entry = array();
             $entry['iid'] = $linked_item->getItemID();
             $mod = Type2Module($linked_item->getItemType());
             $type = $linked_item->getItemType();
             if ($type === 'date') {
                 $type .= 's';
             }
             $temp_type = mb_strtoupper($type, 'UTF-8');
             switch ($temp_type) {
                 case 'ANNOUNCEMENT':
                     $type = $translator->getMessage('COMMON_ANNOUNCEMENT');
                     break;
                 case 'DATES':
                     $type = $translator->getMessage('COMMON_DATES');
                     break;
                 case 'DISCUSSION':
                     $type = $translator->getMessage('COMMON_DISCUSSION');
                     break;
                 case 'GROUP':
                     $type = $translator->getMessage('COMMON_GROUP');
                     break;
                 case 'INSTITUTION':
                     $type = $translator->getMessage('COMMON_INSTITUTION');
                     break;
                 case 'MATERIAL':
                     $type = $translator->getMessage('COMMON_MATERIAL');
                     break;
                 case 'PROJECT':
                     $type = $translator->getMessage('COMMON_PROJECT');
                     break;
                 case 'TODO':
                     $type = $translator->getMessage('COMMON_TODO');
                     break;
                 case 'TOPIC':
                     $type = $translator->getMessage('COMMON_TOPIC');
                     break;
                 case 'USER':
                     $type = $translator->getMessage('COMMON_USER');
                     break;
                 default:
                     $type = $translator->getMessage('COMMON_MESSAGETAG_ERROR');
                     break;
             }
             if (isset($user) and $linked_item->isNotActivated() && !($linked_item->getCreatorID() === $user->getItemID() || $user->isModerator())) {
                 $activatring_date = $linked_item->getActivatingDate();
                 if (strstr($activating_date, '9999-00-00')) {
                     $link_creator_text = $translator->getMessage('COMMON_NOT_ACTIVATED');
                 } else {
                     $link_creator_text = $translator->getMessage('COMMON_ACTIVATING_DATE') . ' ' . getDateInLang($linked_item->getActivatingDate());
                 }
                 $entry['title'] = $linked_item->getTitle();
                 $entry['link_text'] = $link_creator_text;
                 $entry['not_activated'] = true;
             } else {
                 $entry['title'] = $linked_item->getTitle();
                 $entry['type'] = $type;
                 $entry['mod'] = $mod;
                 $entry['not_activated'] = false;
             }
             $path_items[] = $entry;
             $linked_item = $item_list->getNext();
         }
     }
     if ($this->_item->isNotActivated()) {
         $activating_date = $this->_item->getActivatingDate();
         $text = '';
         if (strstr($activating_date, '9999-00-00')) {
             $activating_text = $this->_environment->getTranslationObject()->getMessage('COMMON_NOT_ACTIVATED');
         } else {
             $activating_text = $this->_environment->getTranslationObject()->getMessage('COMMON_ACTIVATING_DATE') . ' ' . getDateInLang($this->_item->getActivatingDate());
         }
         $temp_array = array();
         $temp_array[] = $this->_environment->getTranslationObject()->getMessage('COMMON_RIGHTS');
         $temp_array[] = $activating_text;
         $formal[] = $temp_array;
     }
     $temp_array = array();
     $return = array('formal' => $formal, 'title' => $this->_item->getTitle(), 'files' => $this->getFileContent(), 'description' => $desc, 'item_id' => $this->_item->getItemID(), 'path_shown' => $path_shown, 'path_items' => $path_items, 'moredetails' => $this->getCreatorInformationAsArray($this->_item));
     return $return;
//.........这里部分代码省略.........
开发者ID:a2call,项目名称:commsy,代码行数:101,代码来源:cs_topic_detail_controller.php

示例13: _createForm

 /** create the form, INTERNAL
  * this methods creates the form with the form definitions
  *
  * @author CommSy Development Topic
  */
 function _createForm()
 {
     // rubrics
     $iid = $_GET['iid'];
     $manager = $this->_environment->getItemManager();
     $item = $manager->getItem($iid);
     $module = $item->getItemType();
     $link_module = $module;
     if ($module == 'label' or $module == 'labels') {
         $label_manager = $this->_environment->getLabelManager();
         $label = $label_manager->getItem($iid);
         $link_module = $label->getLabelType();
     }
     $item_manager = $this->_environment->getManager($module);
     $item = $item_manager->getItem($iid);
     $item_name = $item->getTitle();
     $context_name = $this->_context_name;
     $article = '';
     // Wenn man mit HTTPS auf Commsy surft und eine Email generiert
     // sollte diese Mail auch https links erstellen.
     if (!empty($_SERVER["HTTPS"]) and $_SERVER["HTTPS"]) {
         $url = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . '?cid=' . $this->_environment->getCurrentContextID() . '&mod=' . $link_module . '&fct=detail' . '&iid=' . $item->getItemID();
     } else {
         $url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . '?cid=' . $this->_environment->getCurrentContextID() . '&mod=' . $link_module . '&fct=detail' . '&iid=' . $item->getItemID();
     }
     $link = $url;
     $rubric_type_pretty = '';
     $content = '';
     //generate module name for the interface- a pretty version of module...
     if ($module == 'new' or $module == 'news') {
         $news_content = $this->_translator->getMessage('COMMON_NEWS') . ': ' . $item->getTitle() . LF;
         $content = $news_content;
     } elseif ($module == CS_DATE_TYPE) {
         $rubric_type_pretty = $this->_translator->getMessage('COMMON_DATES');
         // set up style of days and times
         $parse_time_start = convertTimeFromInput($item->getStartingTime());
         $conforms = $parse_time_start['conforms'];
         if ($conforms == TRUE) {
             $start_time_print = getTimeLanguage($parse_time_start['datetime']);
         } else {
             $start_time_print = $item->getStartingTime();
         }
         $parse_time_end = convertTimeFromInput($item->getEndingTime());
         $conforms = $parse_time_end['conforms'];
         if ($conforms == TRUE) {
             $end_time_print = getTimeLanguage($parse_time_end['datetime']);
         } else {
             $end_time_print = $item->getEndingTime();
         }
         $parse_day_start = convertDateFromInput($item->getStartingDay(), $this->_environment->getSelectedLanguage());
         $conforms = $parse_day_start['conforms'];
         if ($conforms == TRUE) {
             $start_day_print = getDateInLang($parse_day_start['datetime']);
         } else {
             $start_day_print = $item->getStartingDay();
         }
         $parse_day_end = convertDateFromInput($item->getEndingDay(), $this->_environment->getSelectedLanguage());
         $conforms = $parse_day_end['conforms'];
         if ($conforms == TRUE) {
             $end_day_print = getDateLanguage($parse_day_end['datetime']);
         } else {
             $end_day_print = $item->getEndingDay();
         }
         //formating dates and times for displaying
         $date_print = "";
         $time_print = "";
         if ($end_day_print != "") {
             //with ending day
             $date_print = $this->_translator->getMessage('DATES_AS_OF') . ' ' . $start_day_print . ' ' . $this->_translator->getMessage('DATES_TILL') . ' ' . $end_day_print;
             if ($parse_day_start['conforms'] and $parse_day_end['conforms']) {
                 //start and end are dates, not strings
                 $date_print .= ' (' . getDifference($parse_day_start['timestamp'], $parse_day_end['timestamp']) . ' ' . $this->_translator->getMessage('DATES_DAYS') . ')';
             }
             if ($start_time_print != "" and $end_time_print == "") {
                 //starting time given
                 $time_print = $this->_translator->getMessage('DATES_AS_OF_LOWER') . ' ' . $start_time_print;
                 if ($parse_time_start['conforms'] == true) {
                     $time_print .= ' ' . $this->_translator->getMessage('DATES_OCLOCK');
                 }
             } elseif ($start_time_print == "" and $end_time_print != "") {
                 //endtime given
                 $time_print = $this->_translator->getMessage('DATES_TILL') . ' ' . $end_time_print;
                 if ($parse_time_end['conforms'] == true) {
                     $time_print .= ' ' . $this->_translator->getMessage('DATES_OCLOCK');
                 }
             } elseif ($start_time_print != "" and $end_time_print != "") {
                 //all times given
                 if ($parse_time_end['conforms'] == true) {
                     $end_time_print .= ' ' . $this->_translator->getMessage('DATES_OCLOCK');
                 }
                 if ($parse_time_start['conforms'] == true) {
                     $start_time_print .= ' ' . $this->_translator->getMessage('DATES_OCLOCK');
                 }
                 $date_print = $this->_translator->getMessage('DATES_AS_OF') . ' ' . $start_day_print . ', ' . $start_time_print . '<br />' . $this->_translator->getMessage('DATES_TILL') . ' ' . $end_day_print . ', ' . $end_time_print;
                 if ($parse_day_start['conforms'] and $parse_day_end['conforms']) {
//.........这里部分代码省略.........
开发者ID:a2call,项目名称:commsy,代码行数:101,代码来源:cs_rubric_mail_form.php

示例14: _getPathItemsAsHTML

 function _getPathItemsAsHTML($topic_item, $item_id, $path_item_list)
 {
     $html = '<div>' . LF;
     $html .= '<ol style="list-style-type: decimal; list-style-position:inside; font-size:8pt; margin:0px; padding:0px;">  ' . LF;
     $path_item_list = $topic_item->getPathItemList();
     $path_item = $path_item_list->getFirst();
     while ($path_item) {
         $path_item_id = $path_item->getItemID();
         $path_item_type = $path_item->getItemType();
         if ($path_item_id == $item_id) {
             $html .= '<li style="padding-left:7px;"  class="detail_list_entry">' . LF;
             $html .= '<a title="' . $path_item->getTitle() . '">' . chunkText($path_item->getTitle(), 35) . '</a>';
         } else {
             $html .= '<li style="padding-left:7px;">' . LF;
             $params = array();
             $params['iid'] = $path_item_id;
             $params['path'] = $topic_item->getItemID();
             $user = $this->_environment->getCurrentUser();
             if ($path_item->isNotActivated() and !($path_item->getCreatorID() == $user->getItemID() or $user->isModerator())) {
                 $activating_date = $path_item->getActivatingDate();
                 if (strstr($activating_date, '9999-00-00')) {
                     $link_creator_text = $path_item->getTitle() . ' (' . $this->_translator->getMessage('COMMON_NOT_ACTIVATED') . ')';
                 } else {
                     $link_creator_text = $path_item->getTitle() . ' (' . $this->_translator->getMessage('COMMON_ACTIVATING_DATE') . ' ' . getDateInLang($path_item->getActivatingDate()) . ')';
                 }
                 $html .= ahref_curl($this->_environment->getCurrentContextID(), type2Module($path_item_type), 'detail', $params, chunkText($path_item->getTitle(), 35), $link_creator_text);
                 unset($params);
             } else {
                 $html .= ahref_curl($this->_environment->getCurrentContextID(), type2Module($path_item_type), 'detail', $params, chunkText($path_item->getTitle(), 35), $path_item->getTitle());
                 unset($params);
             }
         }
         $html .= '</li>' . LF;
         $path_item = $path_item_list->getNext();
     }
     $html .= '</ol>' . LF;
     $html .= ' </div>' . LF;
     return $html;
 }
开发者ID:a2call,项目名称:commsy,代码行数:39,代码来源:cs_detail_view.php

示例15: asHTML

 function asHTML()
 {
     $item = $this->getItem();
     $html = LF . '<!-- BEGIN OF DETAIL VIEW -->' . LF;
     $html .= '<div style="width:100%;">' . LF;
     $rubric = $this->_environment->getCurrentModule();
     $current_context = $this->_environment->getCurrentContextItem();
     $detail_box_conf = $current_context->getDetailBoxConf();
     $html .= $this->_getDetailPageHeaderAsHTML();
     if (!(isset($_GET['mode']) and $_GET['mode'] == 'print')) {
         $this->_right_box_config['size_string'] = '';
         $current_context = $this->_environment->getCurrentContextItem();
         $html .= '<div style="float:right; width:27%; margin-top:5px; vertical-align:top; text-align:left;">' . LF;
         $html .= '<div>' . LF;
         $html .= '<div style="width:250px;">' . LF;
         $html .= '<div id="commsy_panels">' . LF;
         if (!isset($this->_browse_ids) or count($this->_browse_ids) == 0) {
             $this->_browse_ids[] = $this->_item->getItemID();
         }
         $html .= '<div class="commsy_no_panel" style="margin-bottom:1px;">' . LF;
         $html .= $this->_getForwardBoxAsHTML($item);
         $html .= '</div>' . LF;
         $separator = '';
         $html .= $this->_getConfigurationOverviewAsHTML();
         $html .= '<div>&nbsp;' . LF;
         $html .= '</div>' . LF;
         $html .= '</div>' . LF;
         $html .= '</div>' . LF;
         $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 class="infoborder" style="width:100%; margin-top:5px; vertical-align:bottom;">' . LF;
     } else {
         $html .= '<div class="infoborder_display_content"  style="' . $width . 'margin-top:5px; vertical-align:bottom;">' . LF;
     }
     $html .= '<div id="detail_headline">' . LF;
     $html .= '<div style="padding:3px 5px 4px 5px;">' . LF;
     if ($rubric == CS_DISCUSSION_TYPE) {
         $html .= '<h2 class="contenttitle">' . $this->_getTitleAsHTML();
     } elseif ($rubric != CS_USER_TYPE and $rubric != 'account') {
         $html .= '<h2 class="contenttitle">' . $this->_text_as_html_short($item->getTitle());
     } elseif ($rubric == 'account') {
         $html .= '<h2 class="contenttitle">' . $item->getFullName();
     } else {
         $html .= '<h2 class="contenttitle">' . $item->getFullName();
     }
     $html .= '</h2>' . LF;
     $html .= '</div>' . LF;
     $html .= '</div>' . LF;
     $html .= '<div id="detail_content" style="' . $width . '">' . LF;
     $formal_data1 = array();
     if ($item->isNotActivated()) {
         $temp_array = array();
         $temp_array[] = $this->_translator->getMessage('COMMON_RIGHTS');
         $activating_date = $item->getActivatingDate();
         if (strstr($activating_date, '9999-00-00')) {
             $title = $this->_translator->getMessage('COMMON_NOT_ACTIVATED');
         } else {
             $title = $this->_translator->getMessage('COMMON_ACTIVATING_DATE') . ' ' . getDateInLang($item->getActivatingDate());
         }
         $temp_array[] = $title;
         $formal_data1[] = $temp_array;
     }
     if ($this->_environment->getCurrentModule() == CS_DATE_TYPE and $item->issetPrivatDate()) {
         $temp_array = array();
         $temp_array[] = $this->_translator->getMessage('COMMON_PRIVATE_DATE');
         $title = $this->_translator->getMessage('COMMON_NOT_ACCESSIBLE');
         $temp_array[] = $title;
         $formal_data1[] = $temp_array;
     }
     if (!empty($formal_data1)) {
         $html .= $this->_getFormalDataAsHTML($formal_data1);
     }
     $html .= $this->_getContentAsHTML();
     $html .= '<div class="infoborder" style="margin-top:5px; padding-top:10px; vertical-align:top;">';
     $mode = 'short';
     if (in_array($item->getItemID(), $this->_openCreatorInfo)) {
         $mode = 'long';
     }
     if (!(isset($_GET['mode']) and $_GET['mode'] == 'print')) {
         $html .= $this->_getCreatorInformationAsHTML($item, 3, $mode) . LF;
     }
     if ($this->_environment->getCurrentModule() != 'user' or !$this->_environment->inPrivateRoom()) {
         ############SQL-Statements reduzieren
         $html .= $this->_getSubItemsAsHTML($item);
     }
     $html .= '</div>' . LF;
     $html .= '</div>' . LF;
     $html .= '<div style="clear:both;">' . LF;
     $html .= '</div>' . LF;
     $html .= '</div>' . LF;
     $html .= '<!-- END OF DETAIL VIEW -->' . LF . LF;
//.........这里部分代码省略.........
开发者ID:a2call,项目名称:commsy,代码行数:101,代码来源:cs_material_admin_detail_view.php


注:本文中的getDateInLang函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。