$link_item->setParameter(array());
    $admin_link_list->add($link_item);
}
if ($environment->inServer()) {
    $link_item = new cs_link();
    $link_item->setTitle($translator->getMessage('PREFERENCES_OUTOFSERVICE'));
    $link_item->setDescription($translator->getMessage('PREFERENCES_OUTOFSERVICE_DESC'));
    $link_item->setIconPath('images/cs_config/SERVER_OUTOFSERVICE.gif');
    $link_item->setContextID($environment->getCurrentContextID());
    $link_item->setModule('configuration');
    $link_item->setFunction('outofservice');
    $link_item->setParameter(array());
    $admin_link_list->add($link_item);
}
if ($environment->inServer()) {
    $link_item = new cs_link();
    $link_item->setTitle($translator->getMessage('CONFIGURATION_UPDATE_LINK'));
    $link_item->setDescription($translator->getMessage('CONFIGURATION_UPDATE_DESC'));
    if ($environment->getCurrentBrowser() == 'MSIE' && mb_substr($environment->getCurrentBrowserVersion(), 0, 1) == '6') {
        $link_item->setIconPath('images/commsyicons_msie6/48x48/config/update.gif');
    } else {
        $link_item->setIconPath('images/commsyicons/48x48/config/update.png');
    }
    $link_item->setContextID($environment->getCurrentContextID());
    $link_item->setModule('configuration');
    $link_item->setFunction('update');
    $link_item->setParameter(array());
    $admin_link_list->add($link_item);
}
$admin_link_list->sortby('title');
// Materialien
if((isset($_GET['roomwide_search_type']) and in_array(CS_MATERIAL_TYPE, $_GET['roomwide_search_type'])) or !isset($_GET['roomwide_search_type'])){
	foreach($context_array as $context){
		$rubric_manager = $environment->getManager(CS_MATERIAL_TYPE);
	   $rubric_manager->setContextLimit($context);
	   if(!empty($_GET['search'])){
	      $rubric_manager->setSearchLimit($_GET['search']);
	   }
      $rubric_manager->showNoNotActivatedEntries();
	   $rubric_manager->select();
	   $item_list = $rubric_manager->get();
	   $complete_list->addList($item_list);
	}
}

$complete_list->sortby('modification_date');
$complete_list->reverse();

$count = $complete_list->getCount();

$number_of_pages = 0;
if($count % $interval == 0){
   $number_of_pages = ($count / $interval)-1;
} else {
   $number_of_pages = (($count - ($count % $interval)) / $interval);
}
if($number_of_pages == -1){
	$number_of_pages++;
}

$result_page = $_GET['page'];
    $link_item->setContextID($environment->getCurrentContextID());
    $link_item->setModule('configuration');
    $link_item->setFunction('language');
    $link_item->setParameter(array());
    $room_link_list->add($link_item);
}
if ($environment->inServer()) {
    $link_item = new cs_link();
    $link_item->setTitle($translator->getMessage('CONFIGURATION_BACKUP_LINK'));
    $link_item->setIconPath('images/cs_config/PORTAL_ENTER_NEW.gif');
    $link_item->setDescription($translator->getMessage('CONFIGURATION_BACKUP_LINK_DESC'));
    $link_item->setContextID($environment->getCurrentContextID());
    $link_item->setModule('configuration');
    $link_item->setFunction('backup');
    $link_item->setParameter(array());
    $room_link_list->add($link_item);
}
if ($environment->inPortal()) {
    $link_item = new cs_link();
    $link_item->setTitle($translator->getMessage('CONFIGURATION_PORTAL_UPLOAD'));
    $link_item->setDescription($translator->getMessage('CONFIGURATION_PORTAL_UPLOAD_DESC'));
    $link_item->setIconPath('images/cs_config/COMMON_ROOM_META.gif');
    $link_item->setContextID($environment->getCurrentContextID());
    $link_item->setModule('configuration');
    $link_item->setFunction('portalupload');
    $link_item->setParameter(array());
    $room_link_list->add($link_item);
    unset($link_item);
}
$room_link_list->sortby('title');
 public function actionQuery()
 {
     $return = array("items" => array());
     $start = $this->_data["options"]["start"];
     $numEntries = $this->_data["options"]["numEntries"];
     $itemManager = $this->_environment->getItemManager();
     $currentUser = $this->_environment->getCurrentUserItem();
     // collection room ids
     $room_id_array = array();
     $grouproom_list = $currentUser->getUserRelatedGroupList();
     if (isset($grouproom_list) and $grouproom_list->isNotEmpty()) {
         $grouproom_list->reverse();
         $grouproom_item = $grouproom_list->getFirst();
         while ($grouproom_item) {
             $project_room_id = $grouproom_item->getLinkedProjectItemID();
             if (in_array($project_room_id, $room_id_array)) {
                 $room_id_array_temp = array();
                 foreach ($room_id_array as $value) {
                     $room_id_array_temp[] = $value;
                     if ($value == $project_room_id) {
                         $room_id_array_temp[] = $grouproom_item->getItemID();
                     }
                 }
                 $room_id_array = $room_id_array_temp;
             }
             $grouproom_item = $grouproom_list->getNext();
         }
     }
     $project_list = $currentUser->getUserRelatedProjectList();
     if (isset($project_list) and $project_list->isNotEmpty()) {
         $project_item = $project_list->getFirst();
         while ($project_item) {
             $room_id_array[] = $project_item->getItemID();
             $project_item = $project_list->getNext();
         }
     }
     $community_list = $currentUser->getUserRelatedCommunityList();
     if (isset($community_list) and $community_list->isNotEmpty()) {
         $community_item = $community_list->getFirst();
         while ($community_item) {
             $room_id_array[] = $community_item->getItemID();
             $community_item = $community_list->getNext();
         }
     }
     $room_id_array_without_privateroom = $room_id_array;
     $itemManager->setOrderLimit(true);
     if (isset($room_id_array_without_privateroom) && !empty($room_id_array_without_privateroom)) {
         $new_entry_array = $itemManager->getAllNewPrivateRoomEntriesOfRoomList($room_id_array_without_privateroom);
         $new_entry_list = $itemManager->getPrivateRoomHomeItemList($new_entry_array);
     } else {
         $new_entry_list = new cs_list();
     }
     // sort list
     $new_entry_list->sortby("modification_date");
     $new_entry_list->reverse();
     // prepare return
     $entry = $new_entry_list->getFirst();
     $count = 0;
     while ($entry) {
         if ($count >= $start && $count < $start + $numEntries) {
             $type = $entry->getItemType();
             if ($type == CS_LABEL_TYPE) {
                 $labelManager = $this->_environment->getLabelManager();
                 $entry = $labelManager->getItem($entry->getItemID());
                 $type = $entry->getLabelType();
             } else {
                 $manager = $this->_environment->getManager($type);
                 $entry = $manager->getItem($entry->getItemID());
             }
             if (isset($entry) and !empty($entry)) {
                 // skip portfolio
                 if ($entry->getType() !== CS_PORTFOLIO_TYPE) {
                     $moddate = $entry->getModificationDate();
                     if (mb_strstr($moddate, '9999-00-00')) {
                         $mod_date = "'";
                     } else {
                         if ($entry->getCreationDate() != $entry->getModificationDate()) {
                             $mod_date = $this->_environment->getTranslationObject()->getDateInLang($entry->getModificationDate());
                         } else {
                             $mod_date = $this->_environment->getTranslationObject()->getDateInLang($entry->getCreationDate());
                         }
                     }
                     if ($type === CS_MATERIAL_TYPE) {
                         $versionId = $entry->getVersionID();
                     } else {
                         $versionId = null;
                     }
                     $return["items"][] = array("itemId" => $entry->getItemID(), "contextId" => $entry->getContextID(), "module" => Type2Module($type), "title" => $entry->getTitle(), "image" => $this->getUtils()->getLogoInformationForType($type), "fileCount" => $entry->getFileList()->getCount(), "modificationDate" => $mod_date, "creator" => $entry->getCreatorItem()->getFullName(), "versionId" => $versionId);
                 }
             }
         }
         if (isset($entry) && !empty($entry) && $entry->getType() !== CS_PORTFOLIO_TYPE) {
             $count++;
         }
         $entry = $new_entry_list->getNext();
     }
     $return["total"] = $count;
     $this->setSuccessfullDataReturn($return);
     echo $this->_return;
 }
###############################################
# connection to other commsys
###############################################
if ($context_item->isServer()) {
    $link_item = new cs_link();
    $link_item->setTitle($translator->getMessage('CONFIGURATION_CONNECTION'));
    $link_item->setIconPath('images/cs_config/PORTAL_ENTER_NEW.gif');
    $link_item->setDescription($translator->getMessage('CONFIGURATION_CONNECTION_DESC'));
    $link_item->setContextID($environment->getCurrentContextID());
    $link_item->setModule('configuration');
    $link_item->setFunction('connection');
    $addon_link_list->add($link_item);
}
#############################################
# export import
#############################################
$context_item = $environment->getCurrentContextItem();
if ($context_item->isPortal()) {
    $link_item = new cs_link();
    $link_item->setTitle($translator->getMessage('CONFIGURATION_EXPORT_IMPORT_LINK'));
    $link_item->setIconPath('images/cs_config/CONFIGURATION_EXTRA_FORM.gif');
    $link_item->setDescription($translator->getMessage('CONFIGURATION_EXPORT_IMPORT_DESC'));
    $link_item->setContextID($environment->getCurrentContextID());
    $link_item->setModule('configuration');
    $link_item->setFunction('export_import');
    $link_item->setParameter(array('iid' => $environment->getCurrentContextID()));
    $addon_link_list->add($link_item);
}
if ($addon_link_list->getFirst()) {
    $addon_link_list->sortby('title');
}
Ejemplo n.º 6
0
 /** get list of files attached o this item
       if a list of files has been set (@see setFileList()), get it
       if an array of file-ids has been set (@see setFileIDArray()),
       get corresponding files, otherwise get files linked in material_link_file
       @return cs_list list of file items
    */
 function getFileListWithFilesFromArticles()
 {
     $file_list = new cs_list();
     // articles
     $section_list = clone $this->getAllArticles();
     if ($section_list->isNotEmpty()) {
         $section_item = $section_list->getFirst();
         while ($section_item) {
             $section_file_list = $section_item->getFileList();
             if ($section_file_list->isNotEmpty()) {
                 $file_list->addList($section_file_list);
             }
             unset($section_item);
             $section_item = $section_list->getNext();
         }
     }
     unset($section_item);
     unset($section_list);
     $file_list->sortby('filename');
     return $file_list;
 }
 public function actionQuery()
 {
     $return = array("items" => array());
     $start = $this->_data["options"]["start"];
     $numEntries = $this->_data["options"]["numEntries"];
     $query = $this->_data["query"];
     if (isset($this->_data["options"]["filter"])) {
         $filter = $this->_data["options"]["filter"];
     } else {
         $filter = array();
     }
     $currentUserItem = $this->_environment->getCurrentUserItem();
     $privateRoomItem = $currentUserItem->getOwnRoom();
     // collect data of interest
     $roomIdArray = array();
     $roomNameArray = array();
     $rubricArray = array();
     if (!empty($filter)) {
         foreach ($filter["rooms"] as $filterRoom) {
             if ($filterRoom["active"]) {
                 $roomIdArray[] = $filterRoom["id"];
                 $roomNameArray[$filterRoom["id"]] = $filterRoom["title"];
             }
         }
     } else {
         // project and group rooms
         $projectRoomList = $currentUserItem->getUserRelatedProjectList();
         $projectRoomItem = $projectRoomList->getFirst();
         while ($projectRoomItem) {
             $roomIdArray[] = $projectRoomItem->getItemID();
             $roomNameArray[$projectRoomItem->getItemID()] = $projectRoomItem->getTitle();
             $projectRoomItem = $projectRoomList->getNext();
         }
         // community rooms
         $communityRoomList = $currentUserItem->getUserRelatedCommunityList();
         $communityRoomItem = $communityRoomList->getFirst();
         while ($communityRoomItem) {
             $roomIdArray[] = $communityRoomItem->getItemID();
             $roomNameArray[$communityRoomItem->getItemID()] = $communityRoomItem->getTitle();
             $communityRoomItem = $communityRoomList->getNext();
         }
         // private room
         //$roomIdArray[] = $privateRoomItem->getItemID();
         //$roomNameArray[$privateRoomItem->getItemID()] = $privateRoomItem->getTitle();
     }
     // determe the rubrics to search in
     if (!empty($filter)) {
         foreach ($filter["rubrics"] as $filterRubric) {
             if ($filterRubric["active"] && in_array($filterRubric["type"], array(CS_DISCUSSION_TYPE, CS_DATE_TYPE, CS_TODO_TYPE))) {
                 $rubricArray[] = $filterRubric["type"];
             }
         }
     } else {
         $rubricArray[] = CS_DISCUSSION_TYPE;
         $rubricArray[] = CS_DATE_TYPE;
         $rubricArray[] = CS_TODO_TYPE;
     }
     /*
      * only three rubrics are handled in the following foreach loop
      * maybe these are the only managers that are able to handle context arrays???
      * however, setting context array limits in other managers seems not to work
      */
     // get search results from all relevant managers
     $searchResults = new cs_list();
     foreach ($rubricArray as $rubric) {
         $manager = $this->_environment->getManager($rubric);
         $manager->setContextArrayLimit($roomIdArray);
         if ($rubric == CS_DATE_TYPE) {
             $manager->setWithoutDateModeLimit();
         }
         if (!empty($query)) {
             $manager->setSearchLimit($query);
         }
         $manager->showNoNotActivatedEntries();
         $manager->select();
         $searchResults->addList($manager->get());
     }
     // redefine rubric array
     if (!empty($filter)) {
         $rubricArray = array();
         foreach ($filter["rubrics"] as $filterRubric) {
             if ($filterRubric["active"] && in_array($filterRubric["type"], array(CS_MATERIAL_TYPE, CS_ANNOUNCEMENT_TYPE, CS_TOPIC_TYPE))) {
                 $rubricArray[] = $filterRubric["type"];
             }
         }
     } else {
         $rubricArray = array(CS_MATERIAL_TYPE, CS_ANNOUNCEMENT_TYPE, CS_TOPIC_TYPE);
     }
     // materials
     foreach ($roomIdArray as $roomId) {
         foreach ($rubricArray as $rubric) {
             $rubricManager = $this->_environment->getManager($rubric);
             $rubricManager->setContextLimit($roomId);
             if (!empty($query)) {
                 $rubricManager->setSearchLimit($query);
             }
             $rubricManager->showNoNotActivatedEntries();
             $rubricManager->select();
             $searchResults->addList($rubricManager->get());
         }
     }
     // announcements
     foreach ($roomIdArray as $roomId) {
         $annoucementManager = $this->_environment->getManager(CS_ANNOUNCEMENT_TYPE);
         $annoucementManager->setContextLimit($roomId);
     }
     // sort list
     $searchResults->sortby("modification_date");
     $searchResults->reverse();
     // prepare return
     $entry = $searchResults->getFirst();
     $count = 0;
     while ($entry) {
         if ($count >= $start && $count < $start + $numEntries) {
             $type = $entry->getItemType();
             if ($type == CS_LABEL_TYPE) {
                 $labelManager = $this->_environment->getLabelManager();
                 $entry = $labelManager->getItem($entry->getItemID());
                 $type = $entry->getLabelType();
             } else {
                 $manager = $this->_environment->getManager($type);
                 $entry = $manager->getItem($entry->getItemID());
             }
             if (isset($entry) and !empty($entry)) {
                 // skip portfolio
                 if ($entry->getType() !== CS_PORTFOLIO_TYPE) {
                     $moddate = $entry->getModificationDate();
                     if ($entry->getCreationDate() != $entry->getModificationDate() && !strstr($moddate, '9999-00-00')) {
                         $mod_date = $this->_environment->getTranslationObject()->getDateInLang($entry->getModificationDate());
                     } else {
                         $mod_date = $this->_environment->getTranslationObject()->getDateInLang($entry->getCreationDate());
                     }
                     if ($type === CS_MATERIAL_TYPE) {
                         $versionId = $entry->getVersionID();
                     } else {
                         $versionId = null;
                     }
                     $return["items"][] = array("itemId" => $entry->getItemID(), "contextId" => $entry->getContextID(), "module" => Type2Module($type), "title" => $entry->getTitle(), "image" => $this->getUtils()->getLogoInformationForType($type), "fileCount" => $entry->getFileList()->getCount(), "modificationDate" => $mod_date, "creator" => $entry->getCreatorItem()->getFullName(), "versionId" => $versionId, "roomName" => $roomNameArray[$entry->getContextID()]);
                 }
             }
         }
         if (isset($entry) && !empty($entry) && $entry->getType() !== CS_PORTFOLIO_TYPE) {
             $count++;
         }
         $entry = $searchResults->getNext();
     }
     $return["total"] = $count;
     $this->setSuccessfullDataReturn($return);
     echo $this->_return;
 }
    $link_item->setIconPath('images/cs_config/CONFIGURATION_DISCUSSION_PREFERENCES.gif');
    $link_item->setContextID($environment->getCurrentContextID());
    $link_item->setModule('configuration');
    $link_item->setFunction('discussion');
    $link_item->setParameter('');
    $rubric_link_list->add($link_item);
}
if ($environment->inProjectRoom() or $environment->inCommunityRoom() or $environment->inGroupRoom()) {
    $link_item = new cs_link();
    $link_item->setTitle($translator->getMessage('PREFERENCES_PATH_CONFIGURATIONS'));
    $link_item->setDescription($translator->getMessage('PREFERENCES_PATH_CONFIGURATIONS_DESC'));
    $link_item->setIconPath('images/cs_config/CONFIGURATION_PATH.gif');
    $link_item->setContextID($environment->getCurrentContextID());
    $link_item->setModule('configuration');
    $link_item->setFunction('path');
    $link_item->setParameter('');
    $rubric_link_list->add($link_item);
}
if ($environment->inProjectroom() and $current_context->showGrouproomConfig() and $current_context->withRubric(CS_GROUP_TYPE)) {
    $link_item = new cs_link();
    $link_item->setTitle($translator->getMessage('CONFIGURATION_GROUPROOM_LINK'));
    $link_item->setIconPath('images/cs_config/PORTAL_ENTER_NEW.gif');
    $link_item->setDescription($translator->getMessage('CONFIGURATION_GROUPROOM_LINK_DESC'));
    $link_item->setContextID($environment->getCurrentContextID());
    $link_item->setModule('configuration');
    $link_item->setFunction('grouproom');
    $link_item->setParameter(array('iid' => $environment->getCurrentContextID()));
    $rubric_link_list->add($link_item);
}
$rubric_link_list->sortby('title');