18 require_once SQ_PACKAGES_PATH.
'/cms/page_templates/page_asset_listing/page_asset_listing.inc';
44 parent::__construct($assetid);
67 $assets_to_list = NULL;
68 $group_by = $this->
attr(
'group_by');
70 $logic = $this->
attr(
'all_root_nodes') ?
'AND' :
'OR';
76 $wanted_types = $this->
attr(
'types');
77 if (empty($wanted_types)) {
78 trigger_localised_error(
'CMS0019', E_USER_NOTICE);
91 $unfiltered_assets_to_list = parent::_getAssetList($group_by, $logic, $wanted_types, $root_asset_ids, $sort_info);
95 $tag_manager = $GLOBALS[
'SQ_SYSTEM']->getTagManager();
97 $related_ids = array_keys($related_assets);
98 $related_ids = array_diff($related_ids, $relator_ids);
101 $assets_to_list = Array();
102 foreach ($related_ids as $related_id) {
103 $asset_to_list = array_get_index($unfiltered_assets_to_list, $related_id);
104 if (!is_null($asset_to_list)) {
105 $assets_to_list[$related_id] = $asset_to_list;
110 if ($group_by ==
'number') {
111 $assets_to_list = parent::_getSortedAssetLists($assets_to_list, $sort_info);
114 return $assets_to_list;
127 if (!isset($this->_tmp[
'relator_asset_ids'])) {
128 $relator_ids = Array();
129 $relator_links = $GLOBALS[
'SQ_SYSTEM']->am->getLinks($this->
id, SQ_LINK_NOTICE,
'', FALSE,
'major',
'relator');
130 foreach ($relator_links as $relator_link) {
131 if (strstr($relator_link[
'minorid'],
':') !== FALSE) {
133 $relator_ids[] = $relator_link[
'minorid'];
135 $relator_ids[] = (int)$relator_link[
'minorid'];
140 $raw_dynamic_relators = $parameter_map->getParameterValue(
'relator_node');
143 if (!empty($raw_dynamic_relators)) {
147 if (!is_array($raw_dynamic_relators)) {
148 $dynamic_relators = explode(
',', $raw_dynamic_relators);
152 if (!empty($dynamic_relators)) {
153 $relator_ids = $dynamic_relators;
159 if (empty($relator_ids)) {
160 $relator_ids = Array($this->
id);
163 $this->_tmp[
'relator_ids'] = $relator_ids;
167 return $this->_tmp[
'relator_ids'];
180 $relator_ids = Array();
181 $relator_links = $GLOBALS[
'SQ_SYSTEM']->am->getLinks($this->
id, SQ_LINK_NOTICE,
'', FALSE,
'major',
'relator');
182 foreach ($relator_links as $relator_link) {
183 $relator_ids[$relator_link[
'minorid']] = $relator_link[
'minorid'];
199 if (empty($this->
id))
return Array();
200 $thesaurus_links = $GLOBALS[
'SQ_SYSTEM']->am->getLinks($this->
id, SQ_LINK_NOTICE,
'thesaurus', FALSE,
'major',
'thesaurus_filter');
202 foreach ($thesaurus_links as $link) {
203 $res[] = $link[
'minorid'];
219 return parent::_getCacheKey().
'-REL:'.join(
',', $this->
getRelators());