ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilShopGUI Class Reference

Class ilShopGUI. More...

+ Inheritance diagram for ilShopGUI:
+ Collaboration diagram for ilShopGUI:

Public Member Functions

 __construct ($_post= '')
 executeCommand ()
 clearFilter ()
 getPageHTML ()
 forwardToPageObject ()
 setFilter ()
 showShopExplorer ()
 performSearch ($oResult=null)
 resetFilter ()
 showSpecialContent ()
 showShopContent ($oResult)
 showContainerContent ()
 showGeneralFilter ($a_count_result=0)
 showTopicsFilter ($a_count_result=0)
 setTopicId ($a_topic_id)
 getTopicId ()
 setString ($a_str)
 getString ()
 setType ($a_type)
 getType ()
 setSortDirection ($a_sort_direction)
 getSortDirection ()
 setSortField ($a_field)
 getSortField ()
 setSortingTypeTopics ($a_field)
 getSortingTypeTopics ()
 setSortingDirectionTopics ($a_sort_direction)
 getSortingDirectionTopics ()
- Public Member Functions inherited from ilShopBaseGUI
 __construct ()

Data Fields

const SHOP_PAGE_EDITOR_PAGE_ID = 99999999
 $genSet = null
 $cur_ref_id = null

Protected Member Functions

 prepareOutput ()
- Protected Member Functions inherited from ilShopBaseGUI
 addPager ($result, $a_session_key)
 buildSubTabs ()
 setSection ($a_section)
 getSection ()
 setSubSection ($a_sub_section)
 getSubSection ()
 showButton ($a_cmd, $a_text, $a_target= '')
 initTableGUI ()
 setTableGUIBasicData ($tbl, $result_set, $a_default_order_column= '')

Private Attributes

 $sort_type_topics = ''
 $sort_direction_topics = ''
 $sort_field = ''
 $sort_direction = ''
 $string = ''
 $type = ''
 $topic_id = 0

Additional Inherited Members

- Protected Attributes inherited from ilShopBaseGUI
 $ctrl = null
 $lng = null
 $tpl = null
 $oGeneralSettings = null
 $section = 0
 $sub_section = 0

Detailed Description

Constructor & Destructor Documentation

ilShopGUI::__construct (   $_post = '')

Definition at line 34 of file class.ilShopGUI.php.

References $_GET, $_POST, $_SESSION, $ilCtrl, ilShopBaseGUI\__construct(), ilPaymentSettings\_getInstance(), setSortDirection(), setSortField(), setSortingDirectionTopics(), setSortingTypeTopics(), setString(), setTopicId(), and setType().

{
global $ilCtrl;
$this->cur_ref_id = (int)$_GET['ref_id'];
$this->cmd = $ilCtrl->getCmd();
// set filter settings
$this->setType($_SESSION['shop_content']['type']);
$this->setString($_SESSION['shop_content']['text']);
$this->setTopicId($_POST['filter_topic_id']);
// set sorting
$this->setSortingTypeTopics($_SESSION['shop_content']['order_topics_sorting_type']);
$this->setSortingDirectionTopics($_SESSION['shop_content']['shop_topics_sorting_direction']);
# $this->setSortField($_SESSION['shop_content']['shop_order_field']);
$this->setSortField($_POST['order_field']);
$this->setSortDirection($_SESSION['shop_content']['shop_order_direction']);
}

+ Here is the call graph for this function:

Member Function Documentation

ilShopGUI::clearFilter ( )

Definition at line 132 of file class.ilShopGUI.php.

References setString(), setTopicId(), and setType().

Referenced by executeCommand().

{
$this->setString('');
$this->setType('');
$this->setTopicId(0);
#return $this->performSearch();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilShopGUI::executeCommand ( )

Definition at line 58 of file class.ilShopGUI.php.

References $_GET, $cmd, $ret, ilObject\_lookupObjId(), ilObject\_lookupType(), clearFilter(), forwardToPageObject(), prepareOutput(), and ilPaymentSettings\useShopSpecials().

{
$next_class = $this->ctrl->getNextClass($this);
switch($next_class)
{
case 'ilshoppagegui':
$this->prepareOutput();
if($ret != '')
{
$this->tpl->setContent($ret);
}
break;
default:
switch($this->cmd)
{
case 'firstpage':
$this->clearFilter();
if(!$this->genSet->get('show_general_filter')
&& !$this->genSet->get('show_topics_filter')
&& !$this->genSet->get('show_shop_explorer')
)
{
$cmd = 'performSearch';
}
else
{
{
$cmd = 'showSpecialContent';
}
else
{
$cmd = 'performSearch';
}
}
break;
case 'resetFilter':
$cmd = 'resetFilter';
break;
case 'setFilter':
$cmd = 'setFilter';
break;
default:
$cmd = 'performSearch';
break;
}
if($this->cmd != 'firstpage' && (isset($_GET['ref_id']) || $this->cmd == 'showTree')) #&& $_GET['ref_id'] != ROOT_FOLDER_ID )
{
$obj_type = ilObject::_lookupType(ilObject::_lookupObjId($this->cur_ref_id));
$container = array("root", "cat", 'catr', "grp", "crs", 'crsr', 'rcrs');
if(in_array($obj_type, $container))
{
$cmd = 'showContainerContent';
}
else
{
$cmd = 'performSearch';
}
}
$this->prepareOutput();
$this->$cmd();
break;
}
return true;
}

+ Here is the call graph for this function:

ilShopGUI::forwardToPageObject ( )

Definition at line 162 of file class.ilShopGUI.php.

References ilShopBaseGUI\$lng, ilPageObject\_exists(), and ilObjStyleSheet\getContentStylePath().

Referenced by executeCommand().

{
global $lng, $ilTabs;
$ilTabs->clearTargets();
$ilTabs->setBackTarget($lng->txt('back'), $this->ctrl->getLinkTarget($this), '_top');
// page object
include_once 'Services/Payment/classes/class.ilShopPage.php';
include_once 'Services/Payment/classes/class.ilShopPageGUI.php';
$lng->loadLanguageModule('content');
include_once('./Services/Style/classes/class.ilObjStyleSheet.php');
$this->tpl->setVariable('LOCATION_CONTENT_STYLESHEET', ilObjStyleSheet::getContentStylePath(0));
if(!ilShopPage::_exists('shop', self::SHOP_PAGE_EDITOR_PAGE_ID))
{
// doesn't exist -> create new one
$new_page_object = new ilShopPage();
$new_page_object->setParentId(0);
$new_page_object->setId(self::SHOP_PAGE_EDITOR_PAGE_ID);
$new_page_object->createFromXML();
}
$this->ctrl->setReturnByClass('ilshoppagegui', 'edit');
$page_gui = new ilShopPageGUI(self::SHOP_PAGE_EDITOR_PAGE_ID);
return $this->ctrl->forwardCommand($page_gui);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilShopGUI::getPageHTML ( )

Definition at line 141 of file class.ilShopGUI.php.

References ilPageObject\_exists(), and ilObjStyleSheet\getContentStylePath().

Referenced by showContainerContent(), showSpecialContent(), and showTopicsFilter().

{
// page object
include_once 'Services/Payment/classes/class.ilShopPage.php';
include_once 'Services/Payment/classes/class.ilShopPageGUI.php';
// if page does not exist, return nothing
if(!ilShopPage::_exists('shop', self::SHOP_PAGE_EDITOR_PAGE_ID))
{
return '';
}
include_once 'Services/Style/classes/class.ilObjStyleSheet.php';
$this->tpl->setVariable('LOCATION_CONTENT_STYLESHEET', ilObjStyleSheet::getContentStylePath(0));
// get page object
$page_gui = new ilShopPageGUI(self::SHOP_PAGE_EDITOR_PAGE_ID);
return $page_gui->showPage();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilShopGUI::getSortDirection ( )

Definition at line 902 of file class.ilShopGUI.php.

References $sort_direction.

Referenced by performSearch(), showContainerContent(), showGeneralFilter(), and showSpecialContent().

{
}

+ Here is the caller graph for this function:

ilShopGUI::getSortField ( )

Definition at line 912 of file class.ilShopGUI.php.

References $sort_field.

Referenced by performSearch(), showContainerContent(), showGeneralFilter(), and showSpecialContent().

{
}

+ Here is the caller graph for this function:

ilShopGUI::getSortingDirectionTopics ( )

Definition at line 950 of file class.ilShopGUI.php.

References $sort_direction_topics.

Referenced by performSearch(), and showGeneralFilter().

+ Here is the caller graph for this function:

ilShopGUI::getSortingTypeTopics ( )

Definition at line 931 of file class.ilShopGUI.php.

References $ilUser, $sort_type_topics, ilShopTopics\TOPICS_SORT_BY_TITLE, and ilShopTopics\TOPICS_SORT_MANUALLY.

Referenced by performSearch(), and showGeneralFilter().

{
global $ilUser;
if(ANONYMOUS_USER_ID == $ilUser->getId() &&
$this->sort_type_topics == ilShopTopics::TOPICS_SORT_MANUALLY
)
{
$this->sort_type_topics = ilShopTopics::TOPICS_SORT_BY_TITLE;
}
}

+ Here is the caller graph for this function:

ilShopGUI::getString ( )

Definition at line 882 of file class.ilShopGUI.php.

References $string.

Referenced by performSearch().

{
return $this->string;
}

+ Here is the caller graph for this function:

ilShopGUI::getTopicId ( )

Definition at line 872 of file class.ilShopGUI.php.

References $topic_id.

Referenced by performSearch().

{
}

+ Here is the caller graph for this function:

ilShopGUI::getType ( )

Definition at line 892 of file class.ilShopGUI.php.

References $type.

Referenced by performSearch().

{
return $this->type;
}

+ Here is the caller graph for this function:

ilShopGUI::performSearch (   $oResult = null)

Definition at line 320 of file class.ilShopGUI.php.

References $_GET, $res, ilShopTopics\_getInstance(), ilObjectSearchFactory\_getShopMetaDataSearchInstance(), ilObjectSearchFactory\_getShopObjectSearchInstance(), ilShopBaseGUI\addPager(), getSortDirection(), getSortField(), getSortingDirectionTopics(), getSortingTypeTopics(), getString(), getTopicId(), getType(), QP_COMBINATION_AND, ilUtil\sendInfo(), SHOP_CONTENT, showShopContent(), and ilUtil\stripSlashes().

Referenced by resetFilter(), and setFilter().

{
if(!is_object($oResult))
{
if((bool)$this->oGeneralSettings->get('topics_allow_custom_sorting'))
{
ilShopTopics::_getInstance()->setIdFilter((int)$this->getTopicId());
ilShopTopics::_getInstance()->enableCustomSorting(true);
ilShopTopics::_getInstance()->setSortingType((int)$this->getSortingTypeTopics());
ilShopTopics::_getInstance()->setSortingDirection(strtoupper($this->getSortingDirectionTopics()));
}
else
{
ilShopTopics::_getInstance()->setIdFilter((int)$this->getTopicId());
ilShopTopics::_getInstance()->enableCustomSorting(false);
ilShopTopics::_getInstance()->setSortingType((int)$this->oGeneralSettings->get('topics_sorting_type'));
ilShopTopics::_getInstance()->setSortingDirection(strtoupper($this->oGeneralSettings->get('topics_sorting_direction')));
}
$topics = ilShopTopics::_getInstance()->getTopics();
$oResult->setTopics($topics);
$oResult->setResultPageNumber((int)$_GET['page_number']);
}
// query parser
include_once 'Services/Search/classes/class.ilQueryParser.php';
$query_parser = new ilQueryParser(ilUtil::stripSlashes($this->getString()));
$query_parser->setMinWordLength(0);
$query_parser->setCombination(QP_COMBINATION_AND);
$query_parser->parse();
if(!$query_parser->validate())
{
ilUtil::sendInfo($query_parser->getMessage());
}
// search
$types = array('crs', 'lm', 'sahs', 'htlm', 'file', 'tst', 'exc', 'glo');
if($this->getType() == '' || $this->getType() == 'title' ||
$query_parser->getQueryString() == ''
)
{
include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
$object_search = ilObjectSearchFactory::_getShopObjectSearchInstance($query_parser);
$object_search->setFields(array('title'));
$object_search->setFilter($types);
$object_search->setCustomSearchResultObject($oResult);
$object_search->setFilterShopTopicId((int)$this->getTopicId());
$res = $object_search->performSearch();
}
else if($this->getType() == 'author')
{
include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
$meta_search->setMode('contribute');
$meta_search->setFilter($types);
$meta_search->setFilterShopTopicId((int)$this->getTopicId());
$meta_search->setCustomSearchResultObject($oResult);
$res = $meta_search->performSearch();
}
else
{
include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
$meta_search->setMode('title');
$meta_search->setFilter($types);
$meta_search->setCustomSearchResultObject($oResult);
$meta_search->setFilterShopTopicId((int)$this->getTopicId());
$res = $meta_search->performSearch();
$meta_search->setMode('keyword');
$meta_search->setFilter($types);
$meta_search->setCustomSearchResultObject($oResult);
$meta_search->setFilterShopTopicId((int)$this->getTopicId());
$res->mergeEntries($meta_search->performSearch());
}
$res->filter(ROOT_FOLDER_ID, true);
$res->save();
if(!count($res->getResults()))
{
#ilUtil::sendInfo($this->lng->txt('payment_shop_not_objects_found'));
$this->tpl->setVariable('ERROR', $this->lng->txt('payment_shop_not_objects_found'));
}
include_once 'Services/Payment/classes/class.ilShopResultPresentationGUI.php';
$search_result_presentation = new ilShopResultPresentationGUI($res);
$search_result_presentation->setSortField(strtolower(trim($this->getSortField())));
$search_result_presentation->setSortDirection(trim($this->getSortDirection()));
$this->tpl->setVariable('RESULTS', $search_result_presentation->showResults());
$this->addPager($res, 'shop_content_maxpage');
return;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilShopGUI::prepareOutput ( )
protected

Reimplemented from ilShopBaseGUI.

Definition at line 955 of file class.ilShopGUI.php.

Referenced by executeCommand().

{
global $ilTabs;
$ilTabs->setTabActive('content');
}

+ Here is the caller graph for this function:

ilShopGUI::resetFilter ( )

Definition at line 422 of file class.ilShopGUI.php.

References $_POST, $_SESSION, performSearch(), ilUtil\sendInfo(), setString(), setTopicId(), and setType().

Referenced by setFilter().

{
unset($_SESSION['content_filter']);
unset($_POST['sel_filter_type']);
unset($_POST['filter_text']);
unset($_POST['filter_topic_id']);
unset($_POST['order_field']);
unset($_POST['order_direction']);
unset($_POST['topics_sorting_type']);
unset($_POST['topics_sorting_direction']);
unset($_POST['updateView']);
unset($_POST['show_filter']);
ilUtil::sendInfo($this->lng->txt('paya_filter_reseted'));
$this->setString('');
$this->setType('');
$this->setTopicId(0);
$this->performSearch();
return;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilShopGUI::setFilter ( )

Definition at line 194 of file class.ilShopGUI.php.

References $_POST, $_SESSION, performSearch(), resetFilter(), setSortDirection(), setSortField(), setSortingDirectionTopics(), setSortingTypeTopics(), setString(), setTopicId(), and setType().

{
if(!$_POST['show_filter'] && $_POST['updateView'] == '1')
{
$this->resetFilter();
return;
}
else if($_POST['updateView'] == 1)
{
$_SESSION['content_filter']['updateView'] = $_POST['updateView'];
$_SESSION['content_filter']['show_filter'] = $_POST['show_filter'];
$_SESSION['content_filter']['sel_filter_type'] = $_POST['sel_filter_type'];
$_SESSION['content_filter']['filter_text'] = $_POST['filter_text'];
$_SESSION['content_filter']['filter_topic_id'] = $_POST['filter_topic_id'];
$_SESSION['content_filter']['order_field'] = $_POST['order_field'];
$_SESSION['content_filter']['order_direction'] = $_POST['order_direction'];
$_SESSION['content_filter']['topics_sorting_type'] = $_POST['topics_sorting_type'];
$_SESSION['content_filter']['topics_sorting_direction'] = $_POST['topics_sorting_direction'];
}
$this->setString($_POST['filter_text']);
$this->setType($_POST['sel_filter_type']);
$this->setTopicId($_POST['filter_topic_id']);
$this->setSortingTypeTopics($_POST['topics_sorting_type']);
$this->setSortingDirectionTopics($_POST['topics_sorting_direction']);
$this->setSortField($_POST['order_field']);
$this->setSortDirection('asc');
$this->performSearch();
return;
}

+ Here is the call graph for this function:

ilShopGUI::setSortDirection (   $a_sort_direction)

Definition at line 897 of file class.ilShopGUI.php.

Referenced by __construct(), and setFilter().

{
$this->sort_direction = $a_sort_direction;
}

+ Here is the caller graph for this function:

ilShopGUI::setSortField (   $a_field)

Definition at line 907 of file class.ilShopGUI.php.

Referenced by __construct(), and setFilter().

{
$this->sort_field = $a_field;
}

+ Here is the caller graph for this function:

ilShopGUI::setSortingDirectionTopics (   $a_sort_direction)

Definition at line 945 of file class.ilShopGUI.php.

References $_SESSION.

Referenced by __construct(), and setFilter().

{
$_SESSION['shop_content']['shop_topics_sorting_direction'] = $this->sort_direction_topics = $a_sort_direction;
}

+ Here is the caller graph for this function:

ilShopGUI::setSortingTypeTopics (   $a_field)

Definition at line 917 of file class.ilShopGUI.php.

References $ilUser, ilShopTopics\TOPICS_SORT_BY_TITLE, and ilShopTopics\TOPICS_SORT_MANUALLY.

Referenced by __construct(), and setFilter().

{
global $ilUser;
if(ANONYMOUS_USER_ID == $ilUser->getId() &&
)
{
}
$this->sort_type_topics = $a_field;
}

+ Here is the caller graph for this function:

ilShopGUI::setString (   $a_str)

Definition at line 877 of file class.ilShopGUI.php.

Referenced by __construct(), clearFilter(), resetFilter(), and setFilter().

{
$this->string = $a_str;
}

+ Here is the caller graph for this function:

ilShopGUI::setTopicId (   $a_topic_id)

Definition at line 867 of file class.ilShopGUI.php.

Referenced by __construct(), clearFilter(), resetFilter(), and setFilter().

{
$this->topic_id = $a_topic_id;
}

+ Here is the caller graph for this function:

ilShopGUI::setType (   $a_type)

Definition at line 887 of file class.ilShopGUI.php.

Referenced by __construct(), clearFilter(), resetFilter(), and setFilter().

{
$this->type = $a_type;
}

+ Here is the caller graph for this function:

ilShopGUI::showContainerContent ( )

Definition at line 554 of file class.ilShopGUI.php.

References $ilUser, $result, ilShopBaseGUI\$tpl, $type, ilPaymentObject\_getContainerObjects(), ilPaymentObject\_getObjectData(), ilPaymentObject\_isBuyable(), ilObject\_lookupDescription(), ilObject\_lookupObjId(), ilPaymentObject\_lookupPobjectId(), ilObject\_lookupTitle(), ilObject\_lookupType(), getPageHTML(), getSortDirection(), getSortField(), showGeneralFilter(), showShopExplorer(), and showTopicsFilter().

{
global $ilUser, $rbacreview, $ilToolbar, $tpl;
if($rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID))
{
$ilToolbar->addButton($this->lng->txt('edit_page'), $this->ctrl->getLinkTargetByClass(array('ilshoppagegui'), 'edit'));
}
include_once './Services/Payment/classes/class.ilPaymentObject.php';
$this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.shop_content.html', 'Services/Payment');
$this->tpl->setVariable('PAGE_CONTENT', $this->getPageHTML());
$is_buyable = ilPaymentObject::_isBuyable($this->cur_ref_id);
if($is_buyable)
{
$obj_id = ilObject::_lookupObjId($this->cur_ref_id);
$title = ilObject::_lookupTitle($obj_id);
$description = ilObject::_lookupDescription($obj_id);
$presentation_results[$pobjects['pt_topic_fk']][$type][] =
array(
'ref_id' => $pobjects['ref_id'],
'title' => $title,
'description' => $description,
'type' => $type,
'obj_id' => $obj_id,
'topic_id' => $pobjects['pt_topic_fk'],
'child' => $pobjects['child']
);
}
else
{
$pobjects = ilPaymentObject::_getContainerObjects($this->cur_ref_id);
if(count($pobjects) >= 1)
{
foreach($pobjects as $result)
{
$obj_id = $result['obj_id'];
$title = $result['title'];
$description = $result['description'];
$type = $result['type'];
$presentation_results[$result['pt_topic_fk']][$type][] =
array(
'ref_id' => $result['ref_id'],
'title' => $title,
'description' => $description,
'type' => $type,
'obj_id' => $obj_id,
'topic_id' => $result['pt_topic_fk'],
'child' => $result['child']
);
}
}
}
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->showSpecials();
$this->tpl->setVariable('RESULTS', $html);
$show_general_filter = $this->oGeneralSettings->get('show_general_filter');
$show_topics_filter = $this->oGeneralSettings->get('show_topics_filter');
$show_shop_explorer = $this->oGeneralSettings->get('show_shop_explorer');
if($show_general_filter)
{
$g_filter_html = $this->showGeneralFilter(count($search_result_presentation));
$this->tpl->setVariable('FORM', $g_filter_html);
}
if($show_topics_filter)
{
$this->showTopicsFilter(count($search_result_presentation));
}
if($show_shop_explorer)
{
$this->showShopExplorer();
}
}

+ Here is the call graph for this function:

ilShopGUI::showGeneralFilter (   $a_count_result = 0)

Definition at line 645 of file class.ilShopGUI.php.

References $_SESSION, $ilUser, ilShopTopics\_getInstance(), getSortDirection(), getSortField(), getSortingDirectionTopics(), getSortingTypeTopics(), ilTextInputGUI\setValue(), ilShopTopics\TOPICS_SORT_BY_CREATEDATE, ilShopTopics\TOPICS_SORT_BY_TITLE, and ilShopTopics\TOPICS_SORT_MANUALLY.

Referenced by showContainerContent(), showShopContent(), and showSpecialContent().

{
global $ilUser;
include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$filter_form = new ilPropertyFormGUI();
$filter_form->setFormAction($this->ctrl->getFormAction($this));
$filter_form->setTitle($this->lng->txt('pay_filter'));
$filter_form->setId('formular');
$filter_form->setTableWidth('100 %');
$o_hide_check = new ilCheckBoxInputGUI($this->lng->txt('show_filter'), 'show_filter');
$o_hide_check->setValue(1);
$o_hide_check->setChecked($_SESSION['content_filter']['show_filter'] ? 1 : 0);
$o_hidden = new ilHiddenInputGUI('updateView');
$o_hidden->setValue(1);
$o_hidden->setPostVar('updateView');
$o_hide_check->addSubItem($o_hidden);
$o_filter = new ilSelectInputGUI();
$filter_option = array(
'title' => $this->lng->txt('title'),
'author' => $this->lng->txt('author'),
'metadata' => $this->lng->txt('meta_data')
);
$o_filter->setTitle($this->lng->txt('search_in'));
$o_filter->setOptions($filter_option);
$o_filter->setValue($_SESSION['content_filter']['sel_filter_type']);
$o_filter->setPostVar('sel_filter_type');
$o_hide_check->addSubItem($o_filter);
$o_filter_by = new ilTextInputGUI($this->lng->txt('filter_by'));
$o_filter_by->setValue($_SESSION['content_filter']['filter_text']);
$o_filter_by->setPostVar('filter_text');
$o_hide_check->addSubItem($o_filter_by);
ilShopTopics::_getInstance()->setIdFilter(false);
$topic_option = array();
if(count(ilShopTopics::_getInstance()->getTopics()))
{
$topic_option[''] = $this->lng->txt('please_select');
foreach(ilShopTopics::_getInstance()->getTopics() as $oTopic)
{
$topic_option[$oTopic->getId()] = $oTopic->getTitle();
}
}
else
{
$topic_option[''] = $this->lng->txt('no_topics_yet');
}
$o_topic = new ilSelectInputGUI();
$o_topic->setTitle($this->lng->txt('topic'));
$o_topic->setOptions($topic_option);
$o_topic->setValue($_SESSION['content_filter']['filter_topic_id']);
$o_topic->setPostVar('filter_topic_id');
$o_hide_check->addSubItem($o_topic);
#if(count($oResult->getResults()))
if($a_count_result)
{
$objects = (bool)$this->oGeneralSettings->get('objects_allow_custom_sorting');
if($objects)
{
// sorting form
$allow_objects_option = array(
'title' => $this->lng->txt('title'),
'author' => $this->lng->txt('author'),
'price' => $this->lng->txt('price_a')
);
$o_allow_objects = new ilSelectInputGUI();
$o_allow_objects->setTitle($this->lng->txt('sort_by'));
$o_allow_objects->setOptions($allow_objects_option);
$o_allow_objects->setValue($this->getSortField());
$o_allow_objects->setPostVar('order_field'); //objects_sorting_type
$o_hide_check->addSubItem($o_allow_objects);
$direction_option = array(
'asc' => $this->lng->txt('sort_asc'),
'desc' => $this->lng->txt('sort_desc')
);
$o_object_direction = new ilSelectInputGUI();
$o_object_direction->setOptions($direction_option);
$o_object_direction->setValue($this->getSortDirection());
$o_object_direction->setPostVar('order_direction'); //objects_sorting_direction
$o_hide_check->addSubItem($o_object_direction);
}
$topics = (bool)$this->oGeneralSettings->get('topics_allow_custom_sorting');
if($topics)
{
// sorting form
$allow_topics_option = array(
ilShopTopics::TOPICS_SORT_BY_TITLE => $this->lng->txt('sort_topics_by_title'),
ilShopTopics::TOPICS_SORT_BY_CREATEDATE => $this->lng->txt('sort_topics_by_date')
);
if(ANONYMOUS_USER_ID != $ilUser->getId())
{
$allow_topics_option[ilShopTopics::TOPICS_SORT_MANUALLY] = $this->lng->txt('sort_topics_manually');
}
$o_allow_topics = new ilSelectInputGUI();
$o_allow_topics->setTitle($this->lng->txt('sort_topics_by'));
$o_allow_topics->setOptions($allow_topics_option);
$o_allow_topics->setValue($this->getSortingTypeTopics());
$o_allow_topics->setPostVar('topics_sorting_type');
$o_hide_check->addSubItem($o_allow_topics);
$direction_option = array(
'asc' => $this->lng->txt('sort_asc'),
'desc' => $this->lng->txt('sort_desc')
);
$o_topics_direction = new ilSelectInputGUI();
$o_topics_direction->setOptions($direction_option);
$o_topics_direction->setValue($this->getSortingDirectionTopics());
$o_topics_direction->setPostVar('topics_sorting_direction'); //objects_sorting_type
$o_hide_check->addSubItem($o_topics_direction);
}
}
$filter_form->addCommandButton('setFilter', $this->lng->txt('pay_update_view'));
$filter_form->addCommandButton('resetFilter', $this->lng->txt('pay_reset_filter'));
$filter_form->addItem($o_hide_check);
return $filter_form->getHTML();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilShopGUI::showShopContent (   $oResult)

Definition at line 516 of file class.ilShopGUI.php.

References $ilUser, showGeneralFilter(), showShopExplorer(), and showTopicsFilter().

Referenced by performSearch().

{
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', $this->lng->txt('payment_shop_not_objects_found'));
#$this->tpl->setVariable('ERROR',ilUtil::sendInfo($this->lng->txt('payment_shop_not_objects_found')));
}
$show_general_filter = $this->oGeneralSettings->get('show_general_filter');
$show_topics_filter = $this->oGeneralSettings->get('show_topics_filter');
$show_shop_explorer = $this->oGeneralSettings->get('show_shop_explorer');
if($show_general_filter)
{
$g_filter_html = $this->showGeneralFilter(count($oResult->getResults()));
$this->tpl->setVariable('FORM', $g_filter_html);
}
if($show_topics_filter)
{
$this->showTopicsFilter(count($oResult->getResults()));
}
if($show_shop_explorer)
{
$this->showShopExplorer();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilShopGUI::showShopExplorer ( )

Definition at line 229 of file class.ilShopGUI.php.

References $_GET, $ilCtrl, ilShopBaseGUI\$lng, $path, ilShopBaseGUI\$tpl, ilObject\_getIcon(), ilObject\_lookupObjId(), and exit.

Referenced by showContainerContent(), showShopContent(), and showSpecialContent().

{
global $ilCtrl, $tree, $lng;
$ilCtrl->setParameter($this, "active_node", $_GET["active_node"]);
$shop_explorer_tpl = new ilTemplate('tpl.shop_explorer.html', true, true, 'Services/Payment');
include_once ("./Services/Payment/classes/class.ilShopRepositoryExplorer.php");
$active_node = ($_GET["active_node"] >= 1)
? $_GET["active_node"]
: ($_GET["ref_id"] >= 1)
? $_GET["ref_id"]
: 0;
$top_node = 0;
$exp = new ilShopRepositoryExplorer("ilias.php", $top_node);
$exp->setUseStandardFrame(false);
$exp->setExpandTarget("ilias.php?baseClass=ilshopcontroller&ref_id=1&cmd=showTree");
$exp->setFrameUpdater("tree", "updater");
$exp->setTargetGet("ref_id");
if($_GET["repexpand"] == "")
{
$expanded = $tree->readRootId();
}
else
{
$expanded = $_GET["repexpand"];
}
$exp->setExpand($expanded);
if($active_node > 0)
{
$path = $tree->getPathId($active_node);
if($top_node > 0)
{
$exp->setForceOpenPath($path);
$exp->setExpand($expanded);
}
else
{
$exp->setForceOpenPath($path + array($top_node));
}
$exp->highlightNode($active_node);
}
// build html-output
if($top_node > 0)
{
$head_tpl = new ilTemplate("tpl.cont_tree_head.html", true, true,
"Services/Repository");
$path = ilObject::_getIcon(ROOT_FOLDER_ID, "tiny", "root");
$nd = $tree->getNodeData(ROOT_FOLDER_ID);
$title = $nd["title"];
if($title == "ILIAS")
{
$title = $lng->txt("repository");
}
$head_tpl->setVariable("IMG_SRC", $path);
$head_tpl->setVariable("ALT_IMG", $lng->txt("icon") . " " . $title);
$head_tpl->setVariable("LINK_TXT", $title);
$head_tpl->setVariable("LINK_HREF", "ilias.php?baseClass=ilshopcontroller&ref_id=1");
$exp->setTreeLead($head_tpl->get());
$exp->initItemCounter(1);
$exp->setOutput($tree->getParentId($top_node), 1,
ilObject::_lookupObjId($tree->getParentId($top_node)));
}
else
{
$exp->setOutput(0);
}
$output = $exp->getOutput(true);
// asynchronous output
if($ilCtrl->isAsynch())
{
echo $output;
}
$shop_explorer_tpl->setVariable("EXPLORER", $output);
$ilCtrl->setParameter($this, "repexpand", $_GET["repexpand"]);
global $tpl;
$tpl->setLeftContent($shop_explorer_tpl->get());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilShopGUI::showSpecialContent ( )

Definition at line 445 of file class.ilShopGUI.php.

References $ilUser, $result, $type, ilPaymentObject\_getSpecialObjects(), ilObject\_lookupDescription(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilObject\_lookupType(), getPageHTML(), getSortDirection(), getSortField(), showGeneralFilter(), showShopExplorer(), and showTopicsFilter().

{
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');
$this->tpl->setVariable('PAGE_CONTENT', $this->getPageHTML());
include_once './Services/Payment/classes/class.ilPaymentObject.php';
#$this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.shop_content.html', 'Services/Payment');
if(count($pobjects))
{
foreach($pobjects as $result)
{
$obj_id = ilObject::_lookupObjId($result['ref_id']);
$title = ilObject::_lookupTitle($obj_id);
$description = ilObject::_lookupDescription($obj_id);
$presentation_results[$result['pt_topic_fk']][$type][] =
array(
'ref_id' => $result['ref_id'],
'title' => $title,
'description' => $description,
'type' => $type,
'obj_id' => $obj_id,
'topic_id' => $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->showSpecials();
$this->tpl->setVariable('RESULTS', $html);
$show_general_filter = $this->oGeneralSettings->get('show_general_filter');
$show_topics_filter = $this->oGeneralSettings->get('show_topics_filter');
$show_shop_explorer = $this->oGeneralSettings->get('show_shop_explorer');
if($show_general_filter)
{
$g_filter_html = $this->showGeneralFilter(count($search_result_presentation));
$this->tpl->setVariable('FORM', $g_filter_html);
}
if($show_topics_filter)
{
$this->showTopicsFilter(count($search_result_presentation));
}
if($show_shop_explorer)
{
$this->showShopExplorer();
}
}

+ Here is the call graph for this function:

ilShopGUI::showTopicsFilter (   $a_count_result = 0)

Definition at line 779 of file class.ilShopGUI.php.

References $_POST, $ilUser, ilShopTopics\_getInstance(), getPageHTML(), ilShopTopics\TOPICS_SORT_BY_CREATEDATE, ilShopTopics\TOPICS_SORT_BY_TITLE, and ilShopTopics\TOPICS_SORT_MANUALLY.

Referenced by showContainerContent(), showShopContent(), and showSpecialContent().

{
global $ilUser;
$this->tpl->setCurrentBlock('show_topics_filter');
ilShopTopics::_getInstance()->setIdFilter(false);
if(count(ilShopTopics::_getInstance()->getTopics()))
{
$this->tpl->setVariable('PAGE_CONTENT', $this->getPageHTML());
$this->tpl->setVariable('SORTING_FORM_ACTION', $this->ctrl->getFormAction($this, 'setFilter'));
$this->tpl->setVariable('SET_FILTER_VAL', $this->lng->txt('pay_update_view'));
$this->tpl->setCurrentBlock('topics_option');
$this->tpl->setVariable('SORT_TOPICS', $this->lng->txt('topic'));
$this->tpl->setVariable('FILTER_TOPIC_ID', 'no_selection');
$this->tpl->setVariable('FILTER_TOPIC_TEXT', '------------');
if($_POST['cmd'] == 'firstpage')
$this->tpl->setVariable('FILTER_TOPIC_SELECTED', 'selected');
$this->tpl->parseCurrentBlock('topics_option');
$this->tpl->setVariable('FILTER_TOPIC_ID', 'all');
$this->tpl->setVariable('FILTER_TOPIC_TEXT', $this->lng->txt('all'));
if($_POST['filter_topic_id'] == 'all')
$this->tpl->setVariable('FILTER_TOPIC_SELECTED', 'selected');
$this->tpl->parseCurrentBlock('topics_option');
$oTopics = array();
$oTopics = ilShopTopics::_getInstance()->getTopics();
foreach($oTopics as $oTopic)
{
$this->tpl->setVariable('FILTER_TOPIC_ID', $oTopic->getId());
$this->tpl->setVariable('FILTER_TOPIC_TEXT', $oTopic->getTitle());
if($_POST['filter_topic_id'] == $oTopic->getId())
$this->tpl->setVariable('FILTER_TOPIC_SELECTED', 'selected');
$this->tpl->parseCurrentBlock('topics_option');
}
}
if($a_count_result)
{
$objects = (bool)$this->oGeneralSettings->get('objects_allow_custom_sorting');
if($objects)
{
// sorting form
$allow_objects_option = array(
'title' => $this->lng->txt('title'),
'author' => $this->lng->txt('author'),
'price' => $this->lng->txt('price_a')
);
$this->tpl->setCurrentBlock('order_field');
$this->tpl->setVariable('SORT_BY_TEXT', $this->lng->txt('sort_by'));
foreach($allow_objects_option as $key=> $value)
{
$this->tpl->setVariable('ORDER_FIELD_VALUE', $key);
$this->tpl->setVariable('ORDER_FIELD_TEXT', $value);
if($_POST['order_field'] == $key)
$this->tpl->setVariable('ORDER_FIELD_SELECTED', 'selected');
$this->tpl->parseCurrentBlock('order_field');
}
}
$topics = (bool)$this->oGeneralSettings->get('topics_allow_custom_sorting');
if($topics)
{
// sorting form
$allow_topics_option = array(
ilShopTopics::TOPICS_SORT_BY_TITLE => $this->lng->txt('sort_topics_by_title'),
ilShopTopics::TOPICS_SORT_BY_CREATEDATE => $this->lng->txt('sort_topics_by_date')
);
if(ANONYMOUS_USER_ID != $ilUser->getId())
{
$allow_topics_option[ilShopTopics::TOPICS_SORT_MANUALLY] = $this->lng->txt('sort_topics_manually');
}
// $direction_option = array(
// 'asc' => $this->lng->txt('sort_asc'),
// 'desc' => $this->lng->txt('sort_desc')
// );
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilShopGUI::$cur_ref_id = null

Definition at line 32 of file class.ilShopGUI.php.

ilShopGUI::$genSet = null

Definition at line 30 of file class.ilShopGUI.php.

ilShopGUI::$sort_direction = ''
private

Definition at line 24 of file class.ilShopGUI.php.

Referenced by getSortDirection().

ilShopGUI::$sort_direction_topics = ''
private

Definition at line 22 of file class.ilShopGUI.php.

Referenced by getSortingDirectionTopics().

ilShopGUI::$sort_field = ''
private

Definition at line 23 of file class.ilShopGUI.php.

Referenced by getSortField().

ilShopGUI::$sort_type_topics = ''
private

Definition at line 21 of file class.ilShopGUI.php.

Referenced by getSortingTypeTopics().

ilShopGUI::$string = ''
private

Definition at line 25 of file class.ilShopGUI.php.

Referenced by getString().

ilShopGUI::$topic_id = 0
private

Definition at line 27 of file class.ilShopGUI.php.

Referenced by getTopicId().

ilShopGUI::$type = ''
private

Definition at line 26 of file class.ilShopGUI.php.

Referenced by getType(), showContainerContent(), and showSpecialContent().

const ilShopGUI::SHOP_PAGE_EDITOR_PAGE_ID = 99999999

Definition at line 19 of file class.ilShopGUI.php.


The documentation for this class was generated from the following file: