コード例 #1
0
function attach_redirect ($rubric_type, $current_iid) {
   global $session, $environment;
   $infix = '_'.$rubric_type;
   if ( !empty($_FILES['upload']['tmp_name']) ) {
      $new_temp_name = $_FILES['logo']['tmp_name'].'_TEMP_'.$_FILES['logo']['name'];
      move_uploaded_file($_FILES['logo']['tmp_name'],$new_temp_name);
      $_FILES['logo']['tmp_name'] = $new_temp_name;
      $_POST = array_merge($_POST,$_FILES);
   }
   if ( !empty($_FILES['upload']['tmp_name']) ) {
      $new_temp_name = $_FILES['picture']['tmp_name'].'_TEMP_'.$_FILES['picture']['name'];
      move_uploaded_file($_FILES['picture']['tmp_name'],$new_temp_name);
      $_FILES['picture']['tmp_name'] = $new_temp_name;
      $_POST = array_merge($_POST,$_FILES);
   }
   $session->setValue($current_iid.'_post_vars', $_POST);
   if ( isset($_POST[$rubric_type]) ) {
      $session->setValue($current_iid.$infix.'_attach_ids', $_POST[$rubric_type]);
   } else {
      $session->setValue($current_iid.$infix.'_attach_ids', array());
   }
   if ( $environment->getCurrentModule() == CS_MYROOM_TYPE ) {
      $session->setValue($current_iid.$infix.'_back_module', CS_MYROOM_TYPE);
   } elseif ( $environment->getCurrentModule() == CS_MYROOM_TYPE ) {
      $session->setValue($current_iid.$infix.'_back_module', CS_PROJECT_TYPE);
   }
   $params = array();
   $params['ref_iid'] = $current_iid;
   $params['mode'] = 'formattach';
   redirect($environment->getCurrentContextID(), type2Module($rubric_type), 'index', $params);
}
コード例 #2
0
ファイル: homepage_edit.php プロジェクト: a2call/commsy
function attach_redirect ($rubric_type, $current_iid) {
   global $session, $environment;

   if ( $session->issetValue('cookie')
        and $session->getValue('cookie') == 1 ) {
      $session_id = $session->getSessionID();
      $session_manager = $environment->getSessionManager();
      $session2 = $session_manager->get($session->getValue('commsy_session_id'));
      if ( isset($session2) ) {
         $session = $session2;
      }
      $session->setValue('homepage_session_id',$session_id);
   }

   $infix = '_'.$rubric_type;
   $session->setValue($current_iid.'_post_vars', $_POST);
   if ( isset($_POST[$rubric_type]) ) {
      $session->setValue($current_iid.$infix.'_attach_ids', $_POST[$rubric_type]);
   } else {
      $session->setValue($current_iid.$infix.'_attach_ids', array());
   }
   $session->setValue($current_iid.$infix.'_back_module', 'homepage');
   $session->setValue($current_iid.$infix.'_back_tool', 'homepage');

   $params = array();
   $params['ref_iid'] = $current_iid;
   $params['mode'] = 'formattach';
   global $c_single_entry_point;
   redirect($environment->getCurrentContextID(), type2Module($rubric_type), 'index', $params,'','',$c_single_entry_point);
}
コード例 #3
0
 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;
 }
コード例 #4
0
 function _getDetailActionsAsHTML($item)
 {
     $current_context = $this->_environment->getCurrentContextItem();
     $current_user = $this->_environment->getCurrentUserItem();
     $html = '';
     $html .= $this->_getEditAction($item, $current_user);
     $html .= $this->_getDetailItemActionsAsHTML($item) . '&nbsp;&nbsp;&nbsp;';
     $html .= $this->_getPrintAction($item, $current_user);
     $html .= $this->_getMailAction($item, $current_user, type2Module(CS_INSTITUTION_TYPE));
     $html .= $this->_getDownloadAction($item, $current_user);
     $html .= $this->_getNewAction($item, $current_user);
     $html .= $this->_initDropDownMenus();
     return $html;
 }
コード例 #5
0
ファイル: index_attach_inc.php プロジェクト: a2call/commsy
       } else {
          $item_manager = $environment->getItemManager();
          $ref_item_type = $item_manager->getItemType($ref_iid);
          $ref_item_manager = $environment->getManager($ref_item_type);
          $ref_item = $ref_item_manager->getItem($ref_iid);
          $ref_item_type = $ref_item->getItemType();   // Get precise item type (for labels)
       }
    }
    if ( $environment->inPrivateRoom()
         and ( $ref_item_type == CS_PROJECT_TYPE
               or $ref_item_type == CS_COMMUNITY_TYPE
             )
       ) {
       $back_module = CS_MYROOM_TYPE;
    } else {
       $back_module = type2Module($ref_item_type);
    }
 }
 if ( $session->issetValue($ref_iid.$infix.'_back_function') ) {
    $back_function = $session->getValue($ref_iid.$infix.'_back_function');
 } else {
    if ( $mode == 'formattach' ) {
       $back_function = 'edit';
    } else {
       $back_function = 'detail';
    }
 }
 if ( $session->issetValue($ref_iid.$infix.'_back_iid') ) {
    $back_iid = $session->getValue($ref_iid.$infix.'_back_iid');
 } else {
    $back_iid = $ref_iid;
コード例 #6
0
ファイル: cs_detail_view.php プロジェクト: a2call/commsy
 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; padding-left:0px; margin-left:0px; margin-top:2px; padding-bottom:2px;">  ' . 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:5px;"  class="path_list">' . LF;
             $html .= '<a title="' . $path_item->getTitle() . '">' . chunkText($path_item->getTitle(), 25) . '</a>';
         } else {
             $html .= '<li style="padding-left:5px;">' . 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(), 25), $link_creator_text, '', '', '', '', '', 'class="disabled"', '', '', true);
                 unset($params);
             } else {
                 $html .= ahref_curl($this->_environment->getCurrentContextID(), type2Module($path_item_type), 'detail', $params, chunkText($path_item->getTitle(), 25), $path_item->getTitle());
                 unset($params);
             }
         }
         $html .= '</li>' . LF;
         $path_item = $path_item_list->getNext();
     }
     $html .= '</ol>' . LF;
     $html .= ' </div>' . LF;
     $html .= ' </div>';
     return $html;
 }
コード例 #7
0
ファイル: commsy.php プロジェクト: a2call/commsy
        }
        if (isset($_GET['fct'])) {
            $current_function = $_GET['fct'];
        }
    }
}
$environment->setCurrentContextID($current_context);
$environment->setCurrentModule($current_module);
$environment->setCurrentFunction($current_function);
unset($current_context);
#unset($current_module);
#unset($current_function);
// HTML text area corrections
$_POST = $environment->getTextConverter()->correctPostValuesForTextEditor($_POST);
// set output mode: default is html
if ($environment->getCurrentFunction() == 'index' and $environment->getCurrentModule() == type2Module(CS_MATERIAL_TYPE) or $environment->getCurrentModule() == 'ajax' or $environment->getCurrentModule() == 'scorm') {
    if (!empty($_GET['output'])) {
        $environment->setOutputMode($_GET['output']);
    } elseif (!empty($_POST['output'])) {
        $environment->setOutputMode($_POST['output']);
    }
}
if ($environment->inPortal() or $environment->inServer()) {
    $class_factory->setDesignTo6();
} else {
    $class_factory->setDesignTo7();
}
$server_item = $environment->getServerItem();
if ($server_item->showOutOfService()) {
    $current_context_id_save = $environment->getCurrentContextID();
    $current_module_save = $current_module;
コード例 #8
0
 /** create the form, INTERNAL
  * this methods creates the form with the form definitions
  *
  * @author CommSy Development Group
  */
 function _createForm()
 {
     $current_module = $this->_environment->getCurrentModule();
     // form fields
     $this->_form->addHidden('iid', $this->_iid);
     if (!$this->_environment->inPrivateRoom() or $current_module == 'myroom') {
         $this->_form->addTitleField('title', '', $this->_translator->getMessage('COMMON_TITLE'), '', 50, 46, true);
         if (empty($this->_iid) or $this->_iid == 'NEW' or $this->_type == CS_PROJECT_TYPE and $this->_environment->inCommunityRoom()) {
             $this->_form->addHidden('show_title', '');
         } else {
             //PREFERENCES_SHOW_TITLE_OPTION
             $this->_form->addCheckbox('show_title', 'yes', '', $this->_translator->getMessage('COMMON_TITLE'), $this->_translator->getMessage('PREFERENCES_SHOW_TITLE_OPTION'), '');
         }
         if (empty($this->_iid) or $this->_iid == 'NEW' or $this->_type == CS_PROJECT_TYPE and $this->_environment->inCommunityRoom() or $this->_type == CS_SERVER_TYPE) {
             // do nothing
         } else {
             $this->_form->addImage('logo', '', $this->_translator->getMessage('LOGO_UPLOAD'), $this->_translator->getMessage('LOGO_UPLOAD_DESC'));
             if (!empty($this->_with_logo)) {
                 $this->_form->combine();
                 $this->_form->addCheckbox('delete_logo', '', false, '', $this->_translator->getMessage('LOGO_DELETE_OPTION'), '');
             }
             $this->_form->addHidden('logo_hidden', '');
             $this->_form->addHidden('with_logo', $this->_with_logo);
         }
         // type
         if (!empty($this->_iid) and $this->_iid != 'NEW' or $this->_environment->getCurrentModule() == CS_PROJECT_TYPE or $this->_environment->getCurrentModule() == CS_COMMUNITY_TYPE or $this->_environment->inServer() and $this->_iid == 'NEW') {
             $this->_form->addHidden('type', $this->_type);
         } else {
             // enter new room
             $radio_values = array();
             $with_project = true;
             $with_community = true;
             if ($this->_environment->inPrivateRoom()) {
                 $current_portal_item = $this->_environment->getCurrentPortalItem();
                 if ($current_portal_item->openProjectRoomOnlyInCommunityRoom()) {
                     $with_project = false;
                 }
             }
             if ($this->_environment->inPrivateRoom()) {
                 $current_portal_item = $this->_environment->getCurrentPortalItem();
                 $current_user = $this->_environment->getCurrentUserItem();
                 $portal_user = $current_user->getRelatedCommSyUserItem();
                 if ($current_portal_item->openCommunityRoomOnlyByModeration() and isset($portal_user) and !$portal_user->isModerator()) {
                     $with_community = false;
                 }
             }
             if ($with_project and $with_community) {
                 $radio_values[0]['text'] = $this->_translator->getMessage('ROOM_TYPE_PROJECT');
                 $radio_values[0]['value'] = CS_PROJECT_TYPE;
                 $radio_values[0]['extention'] = 'onclick="enable()"';
                 $radio_values[1]['text'] = $this->_translator->getMessage('ROOM_TYPE_COMMUNITY');
                 $radio_values[1]['value'] = CS_COMMUNITY_TYPE;
                 $radio_values[1]['extention'] = 'onclick="disable()"';
                 $this->_form->addRadioGroup('type', $this->_translator->getMessage('ROOM_TYPE'), $this->_translator->getMessage('ROOM_TYPE_DESC'), $radio_values, '', true, false);
                 unset($radio_values);
             } elseif (!$with_project) {
                 $this->_form->addText('type_text', $this->_translator->getMessage('ROOM_TYPE'), $this->_translator->getMessage('ROOM_TYPE_COMMUNITY'));
                 $this->_form->addHidden('type', CS_COMMUNITY_TYPE);
             } elseif (!$with_community) {
                 $this->_form->addText('type_text', $this->_translator->getMessage('ROOM_TYPE'), $this->_translator->getMessage('ROOM_TYPE_PROJECT'));
                 $this->_form->addHidden('type', CS_PROJECT_TYPE);
             }
         }
         if ($this->_environment->inPortal() and $this->_type == CS_PORTAL_TYPE) {
             $this->_form->addImage('picture', '', $this->_translator->getMessage('PICTURE_UPLOAD'), '');
             if (!empty($this->_with_picture)) {
                 $this->_form->combine();
                 $this->_form->addCheckbox('delete_picture', '', false, '', $this->_translator->getMessage('CONFIGURATION_PICTURE_LOGO_DELETE_OPTION'), '');
             }
             $this->_form->addHidden('picture_hidden', '');
             $this->_form->addHidden('with_picture', $this->_with_picture);
         }
         // template functions
         if ($this->_with_template_form_element2) {
             $this->_form->addSelect('template_select', $this->_template_array, '', $this->_translator->getMessage('CONFIGURATION_TEMPLATE_FORM_ELEMENT_SHORT_TITLE'), $this->_translator->getMessage('CONFIGURATION_TEMPLATE_FORM_SELECT_DESC'), 0, false, false, '', '', '', '', '', '27', false, false, '10', 'onChange="cs_toggle_template()"');
             $this->_form->combine('vertical');
             $this->_form->addText('template_select_text', '', $this->_translator->getMessage('CONFIGURATION_TEMPLATE_FORM_SELECT_DESC'), '', false, '', '', 'left', '', 'id="template_extention"');
         }
         // template functions
         if ($this->_with_template_form_element3) {
             $this->_form->addSelect('template_select', $this->_community_template_array, '', $this->_translator->getMessage('CONFIGURATION_TEMPLATE_FORM_ELEMENT_SHORT_TITLE'), $this->_translator->getMessage('CONFIGURATION_TEMPLATE_FORM_SELECT_DESC'), 0, false, false, '', '', '', '', '', '27');
             $this->_form->combine('vertical');
             $this->_form->addText('template_select_text', '', $this->_translator->getMessage('CONFIGURATION_TEMPLATE_FORM_SELECT_DESC'), '', false, '', '', 'left', '', 'id="template_extention"');
         }
     }
     // template
     if ($this->_environment->inPrivateRoom() and $this->_with_template_form_element and $this->_environment->getCurrentModule() != type2Module(CS_MYROOM_TYPE)) {
         $this->_form->addSelect('template_select', $this->_template_array, '', $this->_translator->getMessage('CONFIGURATION_TEMPLATE_FORM_ELEMENT_SHORT_TITLE'), $this->_translator->getMessage('CONFIGURATION_TEMPLATE_FORM_SELECT_DESC'), 0, false, false, '', '', '', '', '', '27', false, false, '10', 'onChange="cs_toggle_template()"');
         $this->_form->combine('vertical');
         $this->_form->addText('template_select_text', '', $this->_translator->getMessage('CONFIGURATION_TEMPLATE_FORM_SELECT_DESC'), '', false, '', '', 'left', '', 'id="template_extention"');
     }
     // language
     if ($this->_type == CS_PROJECT_TYPE and $this->_environment->inCommunityRoom() and $this->_iid != 'NEW' or $this->_type == CS_PORTAL_TYPE or $this->_type == CS_SERVER_TYPE or $this->_environment->inServer()) {
         // do nothing
     } else {
         $languageArray = array();
         $zaehler = 0;
         $languageArray[$zaehler]['text'] = $this->_translator->getMessage('CONTEXT_LANGUAGE_USER');
         $languageArray[$zaehler]['value'] = 'user';
         $zaehler++;
         $languageArray[$zaehler]['text'] = '-------';
         $languageArray[$zaehler]['value'] = 'disabled';
         $zaehler++;
         $tmpArray = $this->_environment->getAvailableLanguageArray();
         foreach ($tmpArray as $item) {
             switch (mb_strtoupper($item, 'UTF-8')) {
                 case 'DE':
                     $languageArray[$zaehler]['text'] = $this->_translator->getMessage('DE');
                     break;
                 case 'EN':
                     $languageArray[$zaehler]['text'] = $this->_translator->getMessage('EN');
                     break;
                 default:
                     // $languageArray[$zaehler]['text']= $this->_translator->getMessage('COMMON_MESSAGETAG_ERROR'.' cs_configuration_preferenes_form(533) ');
                     break;
             }
             $languageArray[$zaehler]['value'] = $item;
             $zaehler++;
         }
         $message = $this->_translator->getMessage('CONTEXT_LANGUAGE_DESC2');
         #if ($this->_environment->getCurrentModule() == CS_PROJECT_TYPE) {
         #   $message = $this->_translator->getMessage('CONTEXT_LANGUAGE_DESC');
         #}
         $this->_form->addSelect('language', $languageArray, '', $this->_translator->getMessage('CONTEXT_LANGUAGE'), $message, 0, false, true, false, '', '', '', '', '13', true);
     }
     if (!$this->_environment->inPrivateRoom() or $current_module == 'myroom') {
         // radio group for displaying member-check option
         if (empty($this->_iid) or $this->_iid == 'NEW' and !$this->_environment->inServer() or $this->_type == CS_PROJECT_TYPE and $this->_environment->inCommunityRoom() or $this->_type == CS_SERVER_TYPE or $this->_environment->inPortal() or $this->_environment->inServer()) {
             $this->_form->addHidden('member_check', '');
         } else {
             $use_javascript = false;
             $session_item = $this->_environment->getSessionItem();
             if ($session_item->issetValue('javascript')) {
                 if ($session_item->getValue('javascript') == "1") {
                     $use_javascript = true;
                 }
             }
             $radio_values = array();
             $radio_values[0]['text'] = $this->_translator->getMessage('PREFERENCES_CHECK_NEW_MEMBERS_NEVER');
             $radio_values[0]['value'] = 'never';
             if ($use_javascript) {
                 $radio_values[0]['extention'] = 'onclick="disable_code()"';
             }
             #if ($this->_type != CS_PORTAL_TYPE) {
             #   $radio_values[1]['text'] = $this->_translator->getMessage('PREFERENCES_CHECK_NEW_MEMBERS_SOMETIMES_ROOM');
             #} else {
             #   $radio_values[1]['text'] = $this->_translator->getMessage('PREFERENCES_CHECK_NEW_MEMBERS_SOMETIMES_PORTAL');
             #}
             #$radio_values[1]['value'] = 'sometimes';
             #$radio_values[1]['extention'] = 'onclick="disable_code()"';
             $radio_values[2]['text'] = $this->_translator->getMessage('PREFERENCES_CHECK_NEW_MEMBERS_ALWAYS');
             $radio_values[2]['value'] = 'always';
             if ($use_javascript) {
                 $radio_values[2]['extention'] = 'onclick="disable_code()"';
             }
             $radio_values[3]['text'] = $this->_translator->getMessage('PREFERENCES_CHECK_NEW_MEMBERS_WITH_CODE');
             $radio_values[3]['value'] = 'withcode';
             if ($use_javascript) {
                 $radio_values[3]['extention'] = 'onclick="enable_code()"';
             }
             $this->_form->addRadioGroup('member_check', $this->_translator->getMessage('PREFERENCES_CHECK_NEW_MEMBERS'), $this->_translator->getMessage('PREFERENCES_CHECK_NEW_MEMBERS_DESC'), $radio_values, '', true, false);
             unset($radio_values);
             $this->_form->combine();
             $code_disabled = false;
             if ($use_javascript) {
                 $code_disabled = $this->_disable_code;
             }
             $this->_form->addTextfield('code', $this->_translator->getMessage('PREFERENCES_CHECK_NEW_MEMBERS_WITH_CODE_VALUE'), '', '', '', 57, '', '', '', '', '', '', '', $code_disabled);
         }
         // open for guests option
         if (empty($this->_iid) or $this->_iid == 'NEW' or $this->_type != CS_COMMUNITY_TYPE) {
             // do nothing
         } else {
             $radio_values = array();
             $radio_values[0]['text'] = $this->_translator->getMessage('COMMON_ON');
             $radio_values[0]['value'] = 'open';
             $radio_values[1]['text'] = $this->_translator->getMessage('COMMON_OFF');
             $radio_values[1]['value'] = 'closed';
             $this->_form->addRadioGroup('open_for_guests', $this->_translator->getMessage('PREFERENCES_OPEN_FOR_GUESTS'), $this->_translator->getMessage('PREFERENCES_OPEN_FOR_GUESTS_DESC'), $radio_values, '', true, true);
             unset($radio_values);
             $radio_values = array();
             $radio_values[0]['text'] = $this->_translator->getMessage('COMMON_ASSIGMENT_ON');
             $radio_values[0]['value'] = 'open';
             $radio_values[1]['text'] = $this->_translator->getMessage('COMMON_ASSIGMENT_OFF');
             $radio_values[1]['value'] = 'closed';
             $this->_form->addRadioGroup('room_assignment', $this->_translator->getMessage('PREFERENCES_ROOM_ASSIGMENT'), $this->_translator->getMessage('PREFERENCES_ASSIGMENT_OPEN_FOR_GUESTS_DESC'), $radio_values, '', true, false);
             unset($radio_values);
         }
         // show time (clock pulses in community room)
         if ($this->_type == CS_COMMUNITY_TYPE and !empty($this->_iid) and $this->_iid != 'NEW') {
             $current_context = $this->_environment->getCurrentContextItem();
             if ($current_context->isPortal()) {
                 $portal_item = $current_context;
             } else {
                 $portal_item = $current_context->getContextItem();
             }
             if ($portal_item->showTime()) {
                 $radio_values = array();
                 $radio_values[0]['text'] = $this->_translator->getMessage('COMMON_YES');
                 $radio_values[0]['value'] = '1';
                 $radio_values[1]['text'] = $this->_translator->getMessage('COMMON_NO');
                 $radio_values[1]['value'] = '-1';
                 $this->_form->addRadioGroup('show_time', $this->_translator->getMessage('CONFIGURATION_TIME_FORM_ELEMENT_CHOICE_TITLE'), $this->_translator->getMessage('CONFIGURATION_TIME_FORM_ELEMENT_CHOICE_COMMUNITY_DESC'), $radio_values, '', true, true);
                 unset($radio_values);
             }
         }
         // time
         if (isset($this->_with_time_array2) and $this->_with_time_array2) {
             $this->translatorChangeToPortal();
             $form_element_title = $this->_translator->getMessage('COMMON_TIME_NAME');
             $this->_form->addCheckboxGroup('time2', $this->_time_array2, '', $form_element_title, '', '', true, 2);
             $this->translatorChangeToCurrentContext();
         }
         // community room in project room
         if (!empty($this->_community_room_array)) {
             $portal_item = $this->_environment->getCurrentPortalItem();
             $project_room_link_status = $portal_item->getProjectRoomLinkStatus();
             if ($project_room_link_status == 'optional') {
                 if (!empty($this->_shown_community_room_array)) {
                     $this->_form->addCheckBoxGroup('communityroomlist', $this->_shown_community_room_array, '', $this->_translator->getMessage('PREFERENCES_COMMUNITY_ROOMS'), '', false, false);
                     $this->_form->combine();
                 }
                 if (count($this->_community_room_array) > 2) {
                     $this->_form->addSelect('communityrooms', $this->_community_room_array, '', $this->_translator->getMessage('PREFERENCES_COMMUNITY_ROOMS'), '', 1, false, false, false, '', '', '', '', 13);
                     $this->_form->combine('horizontal');
                     $this->_form->addButton('option', $this->_translator->getMessage('PREFERENCES_ADD_COMMUNITY_ROOMS_BUTTON'), '', '', 180);
                 }
             } else {
                 if (!empty($this->_shown_community_room_array)) {
                     $this->_form->addCheckBoxGroup('communityroomlist', $this->_shown_community_room_array, '', $this->_translator->getMessage('PREFERENCES_COMMUNITY_ROOMS'), '', false, false);
                     $this->_form->combine();
                 }
                 if (count($this->_community_room_array) > 2) {
                     $this->_form->addSelect('communityrooms', $this->_community_room_array, '', $this->_translator->getMessage('PREFERENCES_COMMUNITY_ROOMS'), '', 1, false, true, false, '', '', '', '', 13);
                     $this->_form->combine('horizontal');
                     $this->_form->addButton('option', $this->_translator->getMessage('PREFERENCES_ADD_COMMUNITY_ROOMS_BUTTON'), '', '', 180);
                 }
             }
         }
         // server: default sender email address
         if ($this->_type == CS_SERVER_TYPE and $this->_environment->inServer()) {
             $this->_form->addTextField('server_default_sender_address', '', $this->_translator->getMessage('SERVER_DEFAULT_SENDER_ADDRESS'), $this->_translator->getMessage('SERVER_DEFAULT_SENDER_ADDRESS_DESC'), 50, 30, true);
             if (!empty($this->_portal_option_array)) {
                 $this->_form->addSelect('server_portal_option', $this->_portal_option_array, '', $this->_translator->getMessage('PREFERENCES_PORTAL_DEFAULT'), '', 1, false, false, false, '', '', '', '', 13);
             }
         }
         if ($this->_type == CS_PORTAL_TYPE) {
             $languageArray = array();
             $tmpArray = $this->_environment->getAvailableLanguageArray();
             $zaehler = 0;
             foreach ($tmpArray as $item) {
                 switch (mb_strtoupper($item, 'UTF-8')) {
                     case 'DE':
                         $languageArray[$zaehler]['text'] = $this->_translator->getMessage('DE');
                         break;
                     case 'EN':
                         $languageArray[$zaehler]['text'] = $this->_translator->getMessage('EN');
                         break;
                     case 'RU':
                         $languageArray[$zaehler]['text'] = $this->_translator->getMessage('RU');
                         break;
                     default:
                         break;
                 }
                 $languageArray[$zaehler]['value'] = $item;
                 $zaehler++;
             }
             $this->_form->addSelect('description_text', $languageArray, '', $this->_translator->getMessage('CONFIGURATION_CHOOSE_LANGUAGE'), '', '', '', '', true, $this->_translator->getMessage('COMMON_LANGUAGE_CHOOSE_BUTTON'), 'option', '', '', '13', true);
             $this->_form->combine();
             foreach ($this->_languages as $language) {
                 if ($language == $this->_description_text) {
                     $this->_form->addTextField('wellcome1_' . $language, '', $this->_translator->getMessage('COMMON_DESCRIPTION'), '', 255, 35);
                     $this->_form->combine('horizontal');
                     $this->_form->addCheckbox('wellcome1_' . $language . '_reset', '1', '', '', mb_strtolower($this->_translator->getMessage('COMMON_RESET'), 'UTF-8') . '?');
                     $this->_form->combine();
                     $this->_form->addTextField('wellcome2_' . $language, '', $this->_translator->getMessage('COMMON_DESCRIPTION'), '', 255, 35);
                     $this->_form->combine('horizontal');
                     $this->_form->addCheckbox('wellcome2_' . $language . '_reset', '1', '', '', mb_strtolower($this->_translator->getMessage('COMMON_RESET'), 'UTF-8') . '?');
                     $this->_form->combine();
                 } else {
                     $this->_form->addHidden('wellcome1_' . $language, '');
                     $this->_form->addHidden('wellcome2_' . $language, '');
                 }
             }
             // description (text-area)
             foreach ($this->_languages as $language) {
                 if ($language == $this->_description_text) {
                     if (isset($this->_item)) {
                         $html_status = $this->_item->getHtmlTextAreaStatus();
                     } elseif ($this->_environment->inCommunityRoom()) {
                         $context = $this->_environment->getCurrentContextItem();
                         $html_status = $context->getHtmlTextAreaStatus();
                     } else {
                         $portal = $this->_environment->getCurrentPortalItem();
                         if (isset($portal)) {
                             $html_status = $portal->getHtmlTextAreaStatus();
                         } else {
                             $html_status = 0;
                         }
                     }
                     if ($html_status == '1') {
                         $html_status = '2';
                     }
                     $this->_form->addTextArea('description_' . $language, '', '', '', '48', '15', 'virtual', false, false, true, $html_status);
                 } else {
                     $this->_form->addHidden('description_' . $language, '');
                 }
             }
         } else {
             if (isset($this->_item)) {
                 $html_status = $this->_item->getHtmlTextAreaStatus();
             } elseif ($this->_environment->inCommunityRoom()) {
                 $context = $this->_environment->getCurrentContextItem();
                 $html_status = $context->getHtmlTextAreaStatus();
             } else {
                 $portal = $this->_environment->getCurrentPortalItem();
                 if (isset($portal)) {
                     $html_status = $portal->getHtmlTextAreaStatus();
                 } else {
                     $html_status = 0;
                 }
             }
             if ($html_status == '1') {
                 $html_status = '2';
             }
             $this->_form->addTextArea('description', '', $this->_translator->getMessage('CONFIGURATION_ROOM_DESCRIPTION'), '', '48', '15', 'virtual', false, false, true, $html_status);
         }
         // portal/server: URL
         if ($this->_environment->inServer() or $this->_environment->inPortal() and $this->_type == CS_PORTAL_TYPE) {
             $this->_form->addTextField('url', '', $this->_translator->getMessage('CONFIGURATION_ROOM_URL'), '', 255, 35, false, '', '', '', 'left', 'http(s)://', '', false, '/commsy.php');
         }
         // rubric connections
         if ($this->_environment->getCurrentModule() == CS_PROJECT_TYPE or $this->_environment->getCurrentModule() == CS_MYROOM_TYPE) {
             $this->_setFormElementsForConnectedRubrics();
             $this->_form->addHidden('public', '');
         }
     }
     // buttons
     if (!empty($this->_iid) and $this->_iid != 'NEW' and $this->_type != CS_SERVER_TYPE) {
         // Projektraum
         if ($this->_environment->inProjectRoom()) {
             $this->_form->addButtonBar('option', $this->_translator->getMessage('PREFERENCES_SAVE_BUTTON'), '', $this->_translator->getMessage('ROOM_DELETE_BUTTON'));
             // aus Gemeinschaftsraum
         } elseif ($this->_environment->inCommunityRoom()) {
             // Projektraum aus Gemeinschaftsraum heraus
             if ($this->_environment->getCurrentModule() == CS_PROJECT_TYPE) {
                 $this->_form->addButtonBar('option', $this->_translator->getMessage('PREFERENCES_SAVE_BUTTON'), $this->_translator->getMessage('COMMON_CANCEL_BUTTON'), '');
                 // im Gemeinschaftsraum
             } else {
                 $this->_form->addButtonBar('option', $this->_translator->getMessage('PREFERENCES_SAVE_BUTTON'), '', $this->_translator->getMessage('ROOM_DELETE_BUTTON'));
             }
             //aus Privatraum
         } elseif ($this->_environment->inPrivateRoom()) {
             if ($this->_environment->getCurrentModule() != CS_MYROOM_TYPE) {
                 $this->_form->addButtonBar('option', $this->_translator->getMessage('PREFERENCES_SAVE_BUTTON'), '', '');
             } else {
                 $this->_form->addButtonBar('option', $this->_translator->getMessage('PREFERENCES_SAVE_BUTTON'), $this->_translator->getMessage('COMMON_CANCEL_BUTTON'));
             }
         } else {
             $this->_form->addButtonBar('option', $this->_translator->getMessage('PREFERENCES_SAVE_BUTTON'), $this->_translator->getMessage('COMMON_CANCEL_BUTTON'), $this->_translator->getMessage('PORTAL_DELETE_BUTTON'));
         }
     } elseif ($this->_type == CS_SERVER_TYPE) {
         $this->_form->addButtonBar('option', $this->_translator->getMessage('PREFERENCES_SAVE_BUTTON'));
     } else {
         $this->_form->addButtonBar('option', $this->_translator->getMessage('PREFERENCES_SAVE_BUTTON'), $this->_translator->getMessage('COMMON_CANCEL_BUTTON'));
     }
 }
コード例 #9
0
ファイル: cs_item.php プロジェクト: a2call/commsy
 public function getItemUrl()
 {
     $type = $this->getType();
     $fct = 'detail';
     $params = array();
     if ($type == CS_FILE_TYPE) {
         $mod = type2Module(CS_MATERIAL_TYPE);
         $fct = 'getfile';
         $params['iid'] = $this->getFileID();
     } elseif ($type == CS_LABEL_TYPE) {
         $mod = type2Module($this->getLabelType());
         $params['iid'] = $this->getItemID();
     } else {
         $mod = type2Module($type);
         $params['iid'] = $this->getItemID();
     }
     $session_item = $this->_environment->getSessionItem();
     if (isset($session_item) and $session_item->issetValue('cookie') and $session_item->issetValue('cookie') != 1) {
         $params['SID'] = $session_item->getSessionID();
     }
     global $c_commsy_domain;
     global $c_commsy_url_path;
     $retour = $c_commsy_domain . $c_commsy_url_path . '/' . _curl(false, $this->getContextID(), $mod, $fct, $params);
     return $retour;
 }
コード例 #10
0
ファイル: cs_index_view.php プロジェクト: a2call/commsy
 /** get list view as HTML
  * this method returns the list view in HTML-Code
  *
  * @return string list view as HMTL
  */
 function asHTML()
 {
     $html = LF . '<!-- BEGIN OF LIST VIEW -->' . LF;
     $html .= $this->addJavaScriptForSearch();
     $html .= $this->_getIndexPageHeaderAsHTML();
     /*****************************/
     /*******BEGIN RIGHT BOXES*****/
     /*****************************/
     if (!$this->_clipboard_mode and !(isset($_GET['mode']) and $_GET['mode'] == 'print')) {
         $html .= '<div id="right_boxes_area">' . LF;
         $html .= '<div style="width:250px;">' . LF;
         $html .= '<form style="padding:0px; margin:0px;" action="' . curl($this->_environment->getCurrentContextID(), $this->_module, $this->_function, '') . '" method="get" name="indexform">' . 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 id="commsy_panels">' . LF;
         $html .= '<div class="commsy_no_panel" style="margin-bottom:1px;">' . LF;
         $tempMessage = '';
         switch (mb_strtoupper($this->_environment->getCurrentModule(), 'UTF-8')) {
             case 'ANNOUNCEMENT':
                 $tempMessage = $this->_translator->getMessage('ANNOUNCEMENT_INDEX');
                 break;
             case 'DATE':
                 $tempMessage = $this->_translator->getMessage('DATE_INDEX');
                 break;
             case 'DISCUSSION':
                 $tempMessage = $this->_translator->getMessage('DISCUSSION_INDEX');
                 break;
             case 'INSTITUTION':
                 $tempMessage = $this->_translator->getMessage('INSTITUTION_INDEX');
                 break;
             case 'GROUP':
                 $tempMessage = $this->_translator->getMessage('GROUP_INDEX');
                 break;
             case 'MATERIAL':
                 $tempMessage = $this->_translator->getMessage('MATERIAL_INDEX');
                 break;
             case 'MYROOM':
                 $tempMessage = $this->_translator->getMessage('MYROOM_INDEX');
                 break;
             case 'PROJECT':
                 $tempMessage = $this->_translator->getMessage('PROJECT_INDEX');
                 break;
             case 'TODO':
                 $tempMessage = $this->_translator->getMessage('TODO_INDEX');
                 break;
             case 'TOPIC':
                 $tempMessage = $this->_translator->getMessage('TOPIC_INDEX');
                 break;
             case 'USER':
                 $tempMessage = $this->_translator->getMessage('USER_INDEX');
                 break;
             default:
                 $tempMessage = $this->_translator->getMessage('COMMON_MESSAGETAG_ERROR' . ' cs_index_view(' . __LINE__ . ') ');
                 break;
         }
         $html .= $this->_getListInfosAsHTML($tempMessage);
         $context_item = $this->_environment->getCurrentContextItem();
         /*********Expert Search*******/
         $html_text1 = $this->_getAdditionalRestrictionBoxAsHTML('14.5');
         $html_text2 = $this->_getAdditionalFormFieldsAsHTML();
         if (!strstr($list_box_conf, 'search_nodisplay') and ($this->_environment->getCurrentModule() == CS_DATE_TYPE or $this->_environment->getCurrentModule() == CS_ANNOUNCEMENT_TYPE or $this->_environment->getCurrentModule() == CS_DISCUSSION_TYPE or $this->_environment->getCurrentModule() == CS_USER_TYPE or $this->_environment->getCurrentModule() == CS_MATERIAL_TYPE or $this->_environment->getCurrentModule() == CS_TODO_TYPE) and ($html_text1 != '' or $html_text2 != '')) {
             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['selstatus']) and $parameter_array['selstatus'] != '0' or $this->_environment->getCurrentModule() == CS_TODO_TYPE) or isset($parameter_array['selgroup']) and $parameter_array['selgroup'] != '0' or isset($parameter_array['selrubric']) and !empty($parameter_array['selrubric']) or isset($parameter_array['selrestriction']) and !empty($parameter_array['selrestriction']) or isset($parameter_array['seluser']) and !empty($parameter_array['seluser']) 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();
         }
         /**************Buzzwords***************/
         if ($this->showBuzzwords()) {
             if ($first_box) {
                 $first_box = false;
                 $additional_text = '';
             } else {
                 $additional_text = ',';
             }
             $title_string .= $additional_text . '"' . $this->_translator->getMessage('COMMON_BUZZWORD_BOX') . '"';
             $desc_string .= $additional_text . '""';
             if (isset($this->_available_buzzwords)) {
                 $size_string .= $additional_text . '"' . $this->_available_buzzwords->getCount() . '"';
             } else {
                 $size_string .= $additional_text . '"10"';
             }
             $parameter_array = $this->_environment->getCurrentParameterArray();
             if (isset($parameter_array['selbuzzword']) and !empty($parameter_array['selbuzzword']) or $current_context->isBuzzwordShowExpanded()) {
                 $config_text .= $additional_text . 'true';
             } else {
                 $config_text .= $additional_text . 'false';
             }
             $html .= '<div class="commsy_panel" style="margin-bottom:1px;">' . LF;
             $html .= $this->getBuzzwordBoxAsHTML();
             $html .= '</div>' . LF;
         }
         /*********************Tags******************/
         if ($this->showTags()) {
             if ($first_box) {
                 $first_box = false;
                 $additional_text = '';
             } else {
                 $additional_text = ',';
             }
             $title_string .= $additional_text . '"' . $this->_translator->getMessage('COMMON_TAG_BOX') . '"';
             $desc_string .= $additional_text . '""';
             $tag_manager = $this->_environment->getTagManager();
             $tag_manager->setContextLimit($this->_environment->getCurrentContextID());
             $tag_manager->select();
             $size = $tag_manager->getCountAll();
             unset($tag_manager);
             if (!empty($size)) {
                 $size_string .= $additional_text . '"' . $size . '"';
             } else {
                 $size_string .= $additional_text . '"10"';
             }
             $parameter_array = $this->_environment->getCurrentParameterArray();
             if (isset($parameter_array['seltag']) and !empty($parameter_array['seltag']) or $current_context->isTagsShowExpanded()) {
                 $config_text .= $additional_text . 'true';
             } else {
                 $config_text .= $additional_text . 'false';
             }
             $html .= '<div class="commsy_panel" style="margin-bottom:1px;">' . LF;
             $html .= $this->getTagBoxAsHTML();
             $html .= '</div>' . LF;
         }
         /**************sorting for flash***************/
         if (!empty($this->_display_mode) and $this->_display_mode == 'flash') {
             if ($first_box) {
                 $first_box = false;
                 $additional_text = '';
             } else {
                 $additional_text = ',';
             }
             $title_string .= $additional_text . '"' . $this->_translator->getMessage('COMMON_SORTING_BOX') . '"';
             $desc_string .= $additional_text . '""';
             $size_string .= $additional_text . '"10"';
             $config_text .= $additional_text . 'true';
             $html .= '<div class="commsy_panel" style="margin-bottom:1px;">' . LF;
             $html .= $this->getSortingBoxAsHTML();
             $html .= '</div>' . LF;
         }
         $html .= '</div>' . LF;
         /*****************Usage Information*************/
         $user = $this->_environment->getCurrentUserItem();
         $room = $this->_environment->getCurrentContextItem();
         $act_rubric = $this->_environment->getCurrentModule();
         $info_text = $room->getUsageInfoTextForRubric($act_rubric);
         if (!strstr($info_text, $this->_translator->getMessage('COMMON_MESSAGETAG_ERROR')) and !strstr($info_text, $this->_translator->getMessage('USAGE_INFO_COMING_SOON')) and !empty($info_text)) {
             $rubric_info_array = $room->getUsageInfoArray();
             if (!is_array($rubric_info_array)) {
                 $rubric_info_array = array();
             }
             // kann man dies noch über die oberfläche schalten ??? (2009.07.24 ij)
             #if ( !strstr($list_box_conf,'usage_nodisplay') ){
             if ($first_box) {
                 $first_box = false;
                 $additional_text = '';
             } else {
                 $additional_text = ',';
             }
             $html .= '<div style="margin-bottom:1px;">' . LF;
             $html .= '<div style="position:relative; top:12px;">' . LF;
             if ($this->_environment->getCurrentBrowser() == 'MSIE' && mb_substr($this->_environment->getCurrentBrowserVersion(), 0, 1) == '6') {
                 $html .= '<img src="images/commsyicons_msie6/usage_info_3.gif"/>';
             } else {
                 $html .= '<img src="images/commsyicons/usage_info_3.png"/>';
             }
             $html .= '</div>' . LF;
             $html .= '<div class="right_box_title" style="font-weight:bold;">' . $this->_text_as_html_short($room->getUsageInfoHeaderForRubric($act_rubric)) . '</div>';
             $html .= '<div class="usage_info">' . LF;
             $info_text = $room->getUsageInfoTextForRubric($act_rubric);
             $html .= $this->_text_as_html_long($this->_cleanDataFromTextArea($info_text)) . BRLF;
             $html .= '</div>' . LF;
             $html .= '</div>' . LF;
             #} // end if
         }
         $html .= '</form>' . LF;
         $html .= '</div>' . LF;
         $html .= '<script type="text/javascript">' . LF;
         $html .= 'jQuery(document).ready(function() {initCommSyPanels(Array(' . $title_string . '),Array(' . $desc_string . '),Array(' . $config_text . '), Array(),Array(' . $size_string . '),Array(),null,null)});' . LF;
         $html .= '</script>' . LF;
     } elseif (!(isset($_GET['mode']) and $_GET['mode'] == 'print')) {
         $html .= '<div style="float:right; width:27%; padding-top:5px; padding-left:5px; vertical-align:top; text-align:left;">' . LF;
         $html .= '<div style="width:250px;">' . LF;
         $html .= '<div style="margin-bottom:1px;">' . LF;
         $html .= $this->_getRubricClipboardInfoAsHTML($this->_environment->getCurrentModule());
         $html .= '</div>' . LF;
         $html .= '</div>' . LF;
     } else {
         #       $html .= $this->_getIndexPageHeaderAsHTML();
     }
     $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;
     }
     if (!empty($this->_display_mode) and $this->_display_mode == 'flash' and $this->_environment->getCurrentModule() == type2Module(CS_MATERIAL_TYPE)) {
         $current_context_item = $this->_environment->getCurrentContextItem();
         $color_array = $current_context_item->getColorArray();
         unset($current_context_item);
         $params = array();
         $params = $this->_environment->getCurrentParameterArray();
         $params['output'] = 'XML';
         $params['SID'] = $this->_environment->getSessionID();
         $data_url = utf8_encode(rawurlencode(_curl(false, $this->_environment->getCurrentContextID(), $this->_environment->getCurrentModule(), $this->_environment->getCurrentFunction(), $params)));
         unset($params);
         #$height = '100%';
         $height = '450px';
         #$bgcolor = $color_array['content_background'];
         $bgcolor = '#ffffff';
         unset($color_array);
         $html .= '<div id ="docuverser" class="index_flash" style="height: ' . $height . '; background-color: ' . $bgcolor . '; border: none;">' . LF;
         $html .= '<noscript>' . LF;
         $html .= '    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' . LF;
         $html .= '            id="study_log" width="100%" height="' . $height . '"' . LF;
         $html .= '            codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">' . LF;
         $html .= '            <param name="movie" value="flash/study_log.swf" />' . LF;
         $html .= '            <param name="quality" value="high" />' . LF;
         $html .= '            <param name="FlashVars" value="applicationType=commsy&amp;commsyXml=' . $data_url . '" />' . LF;
         $html .= '            <param name="wmode" value="transparent" />' . LF;
         $html .= '            <param name="bgcolor" value="' . $bgcolor . '" />' . LF;
         $html .= '            <param name="allowScriptAccess" value="sameDomain" />' . LF;
         $html .= '            <embed src="study_log.swf" quality="high" bgcolor="' . $bgcolor . '"' . LF;
         $html .= '                width="100%" height="' . $height . '" name="study_log" align="middle"' . LF;
         $html .= '                play="true"' . LF;
         $html .= '                FlashVars="applicationType=commsy&amp;commsyXml=' . $data_url . '"' . LF;
         $html .= '                wmode="transparent"' . LF;
         $html .= '                loop="false"' . LF;
         $html .= '                quality="high"' . LF;
         $html .= '                allowScriptAccess="sameDomain"' . LF;
         $html .= '                type="application/x-shockwave-flash"' . LF;
         $html .= '                pluginspage="http://www.adobe.com/go/getflashplayer">' . LF;
         $html .= '            </embed>' . LF;
         $html .= '    </object>' . LF;
         $html .= '</noscript>' . LF;
         $html .= '</div>' . LF;
         $html .= $this->getDokuverserJavascriptAsHTML();
     } else {
         $params = $this->_environment->getCurrentParameterArray();
         unset($params['mode']);
         unset($params['download']);
         $html .= '<form style="padding:0px; margin:0px;" action="';
         $html .= curl($this->_environment->getCurrentContextID(), $this->_environment->getCurrentModule(), $this->_environment->getCurrentFunction(), $params) . '" method="post">' . LF;
         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;
         $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 .= '</form>' . LF;
     }
     $html .= '</div>' . LF;
     $html .= '<div style="clear:both;">' . LF;
     $html .= '</div>' . LF;
     $html .= '<!-- END OF PLAIN LIST VIEW -->' . LF . LF;
     return $html;
 }
コード例 #11
0
ファイル: cs_topic_form.php プロジェクト: a2call/commsy
 /** init data for form, INTERNAL
  * this methods init the data for the form, for example topics
  *
  * @author CommSy Development Group
  */
 function _initForm()
 {
     // public
     if (isset($this->_item)) {
         $creator_item = $this->_item->getCreatorItem();
         $fullname = $creator_item->getFullname();
     } elseif (!empty($this->_form_post['iid']) and mb_strtolower($this->_form_post['iid'], 'UTF-8') != 'new') {
         $manager = $this->_environment->getManager(CS_TOPIC_TYPE);
         $item = $manager->getItem($this->_form_post['iid']);
         $creator_item = $item->getCreatorItem();
         $fullname = $creator_item->getFullname();
     } else {
         $current_user = $this->_environment->getCurrentUser();
         $fullname = $current_user->getFullname();
     }
     $public_array = array();
     $temp_array['text'] = $this->_translator->getMessage('RUBRIC_PUBLIC_YES');
     $temp_array['value'] = 1;
     $public_array[] = $temp_array;
     $temp_array['text'] = $this->_translator->getMessage('RUBRIC_PUBLIC_NO', $fullname);
     $temp_array['value'] = 0;
     $public_array[] = $temp_array;
     $this->_public_array = $public_array;
     if (!empty($this->_item)) {
         $this->_headline = $this->_translator->getMessage('TOPIC_EDIT');
     } elseif (!empty($this->_form_post)) {
         if (!empty($this->_form_post['iid'])) {
             $this->_headline = $this->_translator->getMessage('TOPIC_EDIT');
         } else {
             $this->_headline = $this->_translator->getMessage('TOPIC_ENTER_NEW');
             $new = '';
             $context_item = $this->_environment->getCurrentContextItem();
             $rubric_array = $context_item->_getRubricArray(CS_TOPIC_TYPE);
             if (isset($rubric_array[mb_strtoupper($this->_environment->getSelectedLanguage(), 'UTF-8')]['GENUS'])) {
                 $genus = $rubric_array[mb_strtoupper($this->_environment->getSelectedLanguage(), 'UTF-8')]['GENUS'];
             } else {
                 $genus = $rubric_array['EN']['GENUS'];
             }
             if ($genus == 'M') {
                 $new = $this->_translator->getMessage('COMMON_NEW_M_BIG') . ' ';
             } elseif ($genus == 'F') {
                 $new = $this->_translator->getMessage('COMMON_NEW_F_BIG') . ' ';
             } else {
                 $new = $this->_translator->getMessage('COMMON_NEW_N_BIG') . ' ';
             }
             $this->_headline = $new . $this->_headline;
         }
     } else {
         $this->_headline = $this->_translator->getMessage('TOPIC_ENTER_NEW');
         $new = '';
         $context_item = $this->_environment->getCurrentContextItem();
         $rubric_array = $context_item->_getRubricArray(CS_TOPIC_TYPE);
         if (isset($rubric_array[mb_strtoupper($this->_environment->getSelectedLanguage(), 'UTF-8')]['GENUS'])) {
             $genus = $rubric_array[mb_strtoupper($this->_environment->getSelectedLanguage(), 'UTF-8')]['GENUS'];
         } else {
             $genus = $rubric_array['EN']['GENUS'];
         }
         if ($genus == 'M') {
             $new = $this->_translator->getMessage('COMMON_NEW_M_BIG') . ' ';
         } elseif ($genus == 'F') {
             $new = $this->_translator->getMessage('COMMON_NEW_F_BIG') . ' ';
         } else {
             $new = $this->_translator->getMessage('COMMON_NEW_N_BIG') . ' ';
         }
         $this->_headline = $new . $this->_headline;
     }
     $this->setHeadline($this->_headline);
     // files
     $file_array = array();
     if (!empty($this->_session_file_array)) {
         foreach ($this->_session_file_array as $file) {
             $temp_array['text'] = $file['name'];
             $temp_array['value'] = $file['file_id'];
             $file_array[] = $temp_array;
         }
     } elseif (isset($this->_item)) {
         $file_list = $this->_item->getFileList();
         if ($file_list->getCount() > 0) {
             $file_item = $file_list->getFirst();
             while ($file_item) {
                 $temp_array['text'] = $file_item->getDisplayname();
                 $temp_array['value'] = $file_item->getFileID();
                 $file_array[] = $temp_array;
                 $file_item = $file_list->getNext();
             }
         }
     }
     $this->_file_array = $file_array;
     // PATH
     if ($this->_environment->getCurrentContextItem()->withPath()) {
         if (isset($this->_item) or isset($item) or $this->_path_reset_items) {
             $link_manager = $this->_environment->getLinkItemManager();
             $link_manager->setContextLimit($this->_environment->getCurrentContextID());
             if (isset($this->_item)) {
                 $link_manager->setLinkedItemLimit($this->_item);
                 $topic_item = $this->_item;
             } elseif (isset($item)) {
                 $link_manager->setLinkedItemLimit($item);
                 $topic_item = $item;
             } else {
                 $topic_manager = $this->_environment->getManager(CS_TOPIC_TYPE);
                 $topic_item = $topic_manager->getNewItem();
             }
             $link_manager->sortbySortingPlace();
             $link_manager->select();
             $link_item_list = $link_manager->get();
             if (!$link_item_list->isEmpty()) {
                 $counter = 1;
                 $link_item = $link_item_list->getFirst();
                 while ($link_item) {
                     $this->_link_item_place_array[$counter] = $link_item->getItemID();
                     if ($link_item->getSortingPlace()) {
                         $this->_link_item_check_array[] = $link_item->getItemID();
                     }
                     $linked_item = $link_item->getLinkedItem($topic_item);
                     $temp_array = array();
                     $item_type = $linked_item->getItemType();
                     if ($item_type == 'date') {
                         $item_type .= 's';
                     }
                     $temp_item_type = mb_strtoupper($item_type, 'UTF-8');
                     switch ($temp_item_type) {
                         case 'ANNOUNCEMENT':
                             $temp_array['text'] = $this->_translator->getMessage('COMMON_ANNOUNCEMENT');
                             break;
                         case 'DATES':
                             $temp_array['text'] = $this->_translator->getMessage('COMMON_DATES');
                             break;
                         case 'INSTITUTION':
                             $temp_array['text'] = $this->_translator->getMessage('COMMON_INSTITUTION');
                             break;
                         case 'DISCUSSION':
                             $temp_array['text'] = $this->_translator->getMessage('COMMON_DISCUSSION');
                             break;
                         case 'USER':
                             $temp_array['text'] = $this->_translator->getMessage('COMMON_USER');
                             break;
                         case 'GROUP':
                             $temp_array['text'] = $this->_translator->getMessage('COMMON_GROUP');
                             break;
                         case 'MATERIAL':
                             $temp_array['text'] = $this->_translator->getMessage('COMMON_MATERIAL');
                             break;
                         case 'PROJECT':
                             $temp_array['text'] = $this->_translator->getMessage('COMMON_PROJECT');
                             break;
                         case 'TODO':
                             $temp_array['text'] = $this->_translator->getMessage('COMMON_TODO');
                             break;
                         case 'TOPIC':
                             $temp_array['text'] = $this->_translator->getMessage('COMMON_TOPIC');
                             break;
                         default:
                             $temp_array['text'] = $this->_translator->getMessage('COMMON_MESSAGETAG_ERROR' . ' cs_topc_form(' . __LINE__ . ') ');
                             break;
                     }
                     $temp_array['text'] .= ': ' . $linked_item->getTitle();
                     $link_item_sort_array[] = $link_item->getItemID();
                     $temp_array['value'] = $link_item->getItemID();
                     $this->_link_item_array[] = $temp_array;
                     $link_item = $link_item_list->getNext();
                     $counter++;
                 }
             }
             if (isset($this->_form_post['place_array']) and !empty($this->_form_post['place_array'])) {
                 $temp_array = array();
                 $place_array_inv = array_flip($this->_form_post['place_array']);
                 foreach ($this->_link_item_array as $item) {
                     $temp_array[$place_array_inv[$item['value']] - 1] = $item;
                 }
                 ksort($temp_array);
                 $this->_link_item_array = $temp_array;
             }
             if ($this->_path_reset_items) {
                 $session = $this->_environment->getSessionItem();
                 if ($session->issetValue('cid' . $this->_environment->getCurrentContextID() . '_linked_items_index_selected_ids')) {
                     $entry_array = $session->getValue('cid' . $this->_environment->getCurrentContextID() . '_linked_items_index_selected_ids');
                     $entry_link_array = array();
                     $link_manager = $this->_environment->getLinkItemManager();
                     foreach ($entry_array as $entry_id) {
                         $link_item = $link_manager->getItemByFirstAndSecondID($topic_item->getItemID(), $entry_id);
                         if (!empty($link_item)) {
                             $entry_link_array[$entry_id] = $link_item->getItemID();
                         }
                         unset($link_item);
                     }
                     unset($link_manager);
                     $temp_link_item_array = array();
                     $temp_link_value_array = array();
                     foreach ($this->_link_item_array as $link_item) {
                         if (in_array($link_item['value'], $entry_link_array)) {
                             $temp_link_item_array[] = $link_item;
                             $temp_link_value_array[] = $link_item['value'];
                         }
                     }
                     foreach ($entry_array as $value) {
                         if (empty($entry_link_array[$value])) {
                             $item_manager = $this->_environment->getItemManager();
                             $item_type = $item_manager->getItemType($value);
                             $manager = $this->_environment->getManager(type2Module($item_type));
                             $item = $manager->getItem($value);
                             $temp_item = array();
                             $temp_item['text'] = $item->getTitle();
                             $temp_item['value'] = $item->getItemID();
                             $this->_path_new_id_array[] = $item->getItemID();
                             $temp_link_item_array[] = $temp_item;
                             unset($temp_item);
                             unset($item);
                             unset($manager);
                             unset($item_manager);
                         }
                     }
                 }
                 unset($session);
                 $this->_link_item_array = $temp_link_item_array;
             }
             if (isset($this->_link_item_array) and !empty($this->_link_item_array)) {
                 $this->_path_button_disable = false;
             }
         }
     }
 }