ILIAS  Release_5_0_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 ()
 executeCommand ()
 showFilters ()
 clearFilter ()
 getPageHTML ()
 forwardToPageObject ()
 setFilter ()
 showShopExplorer ()
 performSearch ($oResult=null)
 resetFilter ()
 showSpecialContent ()
 showTopicsContent ($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 ()

Data Fields

const SHOP_PAGE_EDITOR_PAGE_ID = 99999999
 $settings = null
 $cur_ref_id = null

Protected Member Functions

 prepareOutput ()
- Protected Member Functions inherited from ilShopBaseGUI
 addPager ($result)

Protected Attributes

 $ilShopSearchResult = null
- Protected Attributes inherited from ilShopBaseGUI
 $ctrl = null
 $lng = null
 $tpl = null
 $settings = null

Private Attributes

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

Detailed Description

Constructor & Destructor Documentation

ilShopGUI::__construct ( )

Reimplemented from ilShopBaseGUI.

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

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

{
global $ilCtrl;
if(isset($_POST['cmd']) && $_POST['cmd'] == 'setFilter')
{
$this->cmd = 'setFilter';
}
else
{
$this->cmd = $ilCtrl->getCmd();
}
$this->cur_ref_id = (int)$_GET['ref_id'];
$this->settings = ilPaymentSettings::_getInstance();
// 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($_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 171 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 72 of file class.ilShopGUI.php.

References $_GET, $cmd, $ret, ilObject\_lookupObjId(), ilObject\_lookupType(), clearFilter(), forwardToPageObject(), prepareOutput(), ilShopSearchResult\setFilterMode(), ilShopSearchResult\SHOW_CONTAINER_CONTENT, and ilShopSearchResult\SHOW_SPECIAL_CONTENT.

{
$next_class = $this->ctrl->getNextClass($this);
if(isset($_GET['ref_id']))
{
$this->cmd = 'showTree';
}
switch($next_class)
{
case 'ilshoppagegui':
$this->prepareOutput();
if($ret != '')
{
$this->tpl->setContent($ret);
}
break;
default:
switch($this->cmd)
{
case 'firstpage':
$this->clearFilter();
if($this->settings->get('use_shop_specials') == true)
{
//@todo ... continue
$cmd = 'showSpecialContent';
}
else
{
$cmd = 'performSearch';
}
break;
case 'showTree':
$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))
{
//@todo ... continue
$cmd = 'showContainerContent';
}
else
{
$cmd = 'performSearch';
}
break;
case 'resetFilter':
$cmd = 'resetFilter';
break;
case 'setFilter':
$cmd = 'setFilter';
break;
default:
$cmd = 'performSearch';
break;
}
$this->prepareOutput();
$this->$cmd();
break;
}
return true;
}

+ Here is the call graph for this function:

ilShopGUI::forwardToPageObject ( )

Definition at line 201 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 180 of file class.ilShopGUI.php.

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

Referenced by showContainerContent(), showSpecialContent(), showTopicsContent(), 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 810 of file class.ilShopGUI.php.

References $sort_direction.

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

{
}

+ Here is the caller graph for this function:

ilShopGUI::getSortField ( )

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

References $sort_field.

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

{
}

+ Here is the caller graph for this function:

ilShopGUI::getSortingDirectionTopics ( )

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

References $sort_direction_topics.

Referenced by performSearch().

+ Here is the caller graph for this function:

ilShopGUI::getSortingTypeTopics ( )

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

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

Referenced by performSearch().

{
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 790 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 780 of file class.ilShopGUI.php.

References $topic_id.

Referenced by performSearch().

{
}

+ Here is the caller graph for this function:

ilShopGUI::getType ( )

Definition at line 800 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 349 of file class.ilShopGUI.php.

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

Referenced by resetFilter(), and setFilter().

{
if(!is_object($oResult))
{
if((bool)$this->settings->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->settings->get('topics_sorting_type'));
ilShopTopics::_getInstance()->setSortingDirection(strtoupper($this->settings->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->addPager($res);
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 863 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 443 of file class.ilShopGUI.php.

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

{
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:

ilShopGUI::setFilter ( )

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

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

{
$_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 805 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 815 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 853 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 825 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 785 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 775 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 795 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 595 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(), and showFilters().

{
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()));
if(!$presentation_results)
{
$this->tpl->setVariable('RESULTS', $this->lng->txt('payment_shop_not_objects_found'));
}
else
{
$html = $search_result_presentation->showSpecials();
$this->tpl->setVariable('RESULTS', $html);
}
$this->showFilters();
}

+ Here is the call graph for this function:

ilShopGUI::showFilters ( )

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

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

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

{
$show_general_filter = $this->settings->get('show_general_filter');
$show_topics_filter = $this->settings->get('show_topics_filter');
$topics_enabled = $this->settings->get('enable_topics');
$show_shop_explorer = $this->settings->get('show_shop_explorer');
if($show_general_filter)
{
$g_filter_html = $this->showGeneralFilter();
$this->tpl->setCurrentBlock('show_general_filter');
$this->tpl->setVariable('FORM', $g_filter_html);
$this->tpl->parseCurrentBlock();
}
if($show_topics_filter && $topics_enabled)
{
$this->showTopicsFilter();
}
if($show_shop_explorer)
{
$this->showShopExplorer();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilShopGUI::showGeneralFilter (   $a_count_result = 0)

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

Referenced by showFilters().

{
include_once 'Services/Payment/classes/class.ilShopFilterGUI.php';
$filterGUI = new ilShopFilterGUI($this, 'setCmd');
$filterGUI->initFilter();
if($this->cmd == 'setFilter')
{
$filterGUI->writeFilterToSession();
}
else
{
$filterGUI->resetFilter();
}
return $filterGUI->getHtml();
}

+ Here is the caller graph for this function:

ilShopGUI::showShopExplorer ( )

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

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

Referenced by showFilters().

{
global $ilCtrl, $tree, $lng, $tpl;
$ilCtrl->setParameter($this, "active_node", $_GET["active_node"]);
$tpl->addCss('Services/Payment/css/shop_explorer.css');
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;
}
$ilCtrl->setParameter($this, "repexpand", $_GET["repexpand"]);
$tpl->setLeftContent($output);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilShopGUI::showSpecialContent ( )

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

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

{
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';
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[(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->showSpecials();
$this->tpl->setVariable('RESULTS', $html);
$this->showFilters();
}

+ Here is the call graph for this function:

ilShopGUI::showTopicsContent (   $oResult)

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

References $_SESSION, $ilUser, $result, $type, ilPaymentObject\_getTopicsObjects(), ilObject\_lookupDescription(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilObject\_lookupType(), getPageHTML(), getSortDirection(), getSortField(), ilUtil\sendInfo(), and showFilters().

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',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);
$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();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilShopGUI::showTopicsFilter (   $a_count_result = 0)

Definition at line 691 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 showFilters().

{
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->settings->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->settings->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');
}
}
}
}

+ 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 33 of file class.ilShopGUI.php.

ilShopGUI::$ilShopSearchResult = null
protected

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

ilShopGUI::$settings = null

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

ilShopGUI::$sort_direction = ''
private

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

Referenced by getSortDirection().

ilShopGUI::$sort_direction_topics = ''
private

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

Referenced by getSortingDirectionTopics().

ilShopGUI::$sort_field = ''
private

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

Referenced by getSortField().

ilShopGUI::$sort_type_topics = ''
private

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

Referenced by getSortingTypeTopics().

ilShopGUI::$string = ''
private

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

Referenced by getString().

ilShopGUI::$topic_id = 0
private

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

Referenced by getTopicId().

ilShopGUI::$type = ''
private
const ilShopGUI::SHOP_PAGE_EDITOR_PAGE_ID = 99999999

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


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