示例#1
0
 public function showTopicsContent($oResult)
 {
     global $ilUser, $rbacreview, $ilToolbar;
     if ($rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID)) {
         $ilToolbar->addButton($this->lng->txt('edit_page'), $this->ctrl->getLinkTargetByClass(array('ilshoppagegui'), 'edit'));
     }
     $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.shop_content.html', 'Services/Payment');
     if (!count($oResult->getResults())) {
         $this->tpl->setVariable('ERROR', ilUtil::sendInfo($this->lng->txt('payment_shop_not_objects_found')));
     }
     include_once './Services/Payment/classes/class.ilPaymentObject.php';
     $filter_topics_id = NULL;
     if ($_SESSION['content_filter']['filter_topic_id'] != NULL) {
         $filter_topics_id = (int) $_SESSION['content_filter']['filter_topic_id'];
         $pobjects = ilPaymentObject::_getTopicsObjects($filter_topics_id);
         if (count($pobjects)) {
             foreach ($pobjects as $result) {
                 $obj_id = ilObject::_lookupObjId($result['ref_id']);
                 $title = ilObject::_lookupTitle($obj_id);
                 $description = ilObject::_lookupDescription($obj_id);
                 $type = ilObject::_lookupType($obj_id);
                 $presentation_results[(int) $result['pt_topic_fk']][$type][] = array('ref_id' => $result['ref_id'], 'title' => $title, 'description' => $description, 'type' => $type, 'obj_id' => $obj_id, 'topic_id' => (int) $result['pt_topic_fk'], 'child' => $result['child']);
             }
             $this->tpl->setVariable('PAGE_CONTENT', $this->getPageHTML());
         } else {
             $this->tpl->setVariable('PAGE_CONTENT', $this->lng->txt('please_choose_category'));
         }
         include_once 'Services/Payment/classes/class.ilShopResultPresentationGUI.php';
         $search_result_presentation = new ilShopResultPresentationGUI($presentation_results);
         $search_result_presentation->setSortField(strtolower(trim($this->getSortField())));
         $search_result_presentation->setSortDirection(trim($this->getSortDirection()));
         $html = $search_result_presentation->showTopics();
     } else {
         foreach ($oResult->getResults() as $result) {
             $obj_id = ilObject::_lookupObjId($result['ref_id']);
             $title = ilObject::_lookupTitle($obj_id);
             $description = ilObject::_lookupDescription($obj_id);
             $tmp_res = array('ref_id' => $result['ref_id'], 'title' => $title, 'description' => $description, 'type' => $result['type'], 'obj_id' => $obj_id, 'topic_id' => 0, 'child' => 0);
             $presentation_results[0][$result['type']][] = $tmp_res;
         }
         include_once 'Services/Payment/classes/class.ilShopResultPresentationGUI.php';
         $search_result_presentation = new ilShopResultPresentationGUI($presentation_results);
         $search_result_presentation->setSortField(strtolower(trim($this->getSortField())));
         $search_result_presentation->setSortDirection(trim($this->getSortDirection()));
         $html = $search_result_presentation->showTopics();
     }
     $this->tpl->setVariable('RESULTS', $html);
     $this->showFilters();
 }