18 require_once SQ_CORE_PACKAGE_PATH.
'/designs/design_areas/menu/design_area_menu_type/design_area_menu_type.inc';
43 parent::__construct($assetid);
57 parent::printStaticInitOutput();
60 if (empty($GLOBALS[
'SQ_'.__CLASS__.__FUNCTION__.
'_RUN_'.$GLOBALS[
'DESIGN_BEING_GENERATED']->id])) {
62 // because we need to be able to get to this with the recurse fn
63 $GLOBALS[\'RECURSIVE_MENU_ASSET_LINEAGE\'] = &$ASSET_LINEAGE;
65 $GLOBALS[
'SQ_'.__CLASS__.__FUNCTION__.
'_RUN_'.$GLOBALS[
'DESIGN_BEING_GENERATED']->id] = TRUE;
79 parent::printInitOutput();
96 function '.$this->attr(
'id_name').
'_recursive_fn($level, $parentid, $'.$this->
attr(
'id_name').
'_base_url)
98 global $RECURSIVE_MENU_ASSET_LINEAGE;
101 $'.$this->
attr(
'id_name').
'_lineage_assetid = (empty($RECURSIVE_MENU_ASSET_LINEAGE[$level + 1])) ? 0 : $RECURSIVE_MENU_ASSET_LINEAGE[$level + 1][\'assetid\'];
102 $'.$this->
attr(
'id_name').
'_lineage_setting = (count($RECURSIVE_MENU_ASSET_LINEAGE) - 1 == $level + 1) ? \'current\' : \'hierarchy\';
103 $'.$this->
attr(
'id_name').
'_urls = $GLOBALS[\'SQ_SYSTEM\']->am->getAssetURL(array_keys($GLOBALS[\'MENU_DATA\'][\''.$this->
attr(
'id_name').
'\'][$parentid]), $
'.$this->attr('id_name
').'_base_url);
108 $num_kids = count($GLOBALS[\
'MENU_DATA\'][\''.$this->
attr(
'id_name').
'\'][$parentid]);
110 foreach ($GLOBALS[\
'MENU_DATA\'][\''.$this->
attr(
'id_name').
'\'][$parentid] as $
'.$this->attr('id_name
').'_row) {
112 $end = ($i == $num_kids);
114 if (((
int) $
'.$this->attr('id_name
').'_row[\
'status\'] & SQ_STATUS_LIVE) == 0) {
115 $'.$this->
attr(
'id_name').
'_obj = $GLOBALS[\'SQ_SYSTEM\']->am->getAsset($'.$this->
attr(
'id_name').
'_row[\'assetid\'], $'.$this->
attr(
'id_name').
'_row[\'type_code\']);
117 unset($'.$this->
attr(
'id_name').
'_obj);
119 $'.$this->
attr(
'id_name').
'_current_setting = ($'.$this->
attr(
'id_name').
'_lineage_assetid == $'.$this->
attr(
'id_name').
'_row[\'assetid\']) ? $'.$this->
attr(
'id_name').
'_lineage_setting : \'normal\';
120 # pre_echo("CURRENT SETTING : ".$'.$this->
attr(
'id_name').
'_current_setting);
124 if ($asset_contents = $this->
attr(
'asset_contents')) {
125 $this->_tmp[
'outputting_asset_section'] = TRUE;
126 foreach ($asset_contents as $item) {
129 unset($this->_tmp[
'outputting_asset_section']);
137 $recurse_condition =
'$'.$this->attr(
'id_name').
'_current_setting != \'normal\'';
140 if ($this->
attr(
'min_num_levels') > 0) {
141 $recurse_condition =
'$level < '.($this->attr(
'min_num_levels') + $this->
attr(
'level') - 1).
' || '.$recurse_condition;
144 if ($this->
attr(
'max_num_levels') > 0) {
145 $recurse_condition =
'$level < '.($this->attr(
'max_num_levels') + $this->
attr(
'level') - 1).
' && ('.$recurse_condition.
')';
148 if (('.$recurse_condition.
') && !empty($GLOBALS[\'MENU_DATA\'][\''.$this->
attr(
'id_name').
'\'][$
'.$this->attr('id_name
').'_row[\
'assetid\']])) {
149 '.$this->attr(
'id_name').
'_recursive_fn($level + 1, $'.$this->
attr(
'id_name').
'_row[\'assetid\'], $'.$this->
attr(
'id_name').
'_urls[$'.$this->
attr(
'id_name').
'_row[\'assetid\']]);
157 }//end '.$this->attr(
'id_name').
'_recursive_fn()
174 $ignore_permissions = $this->
attr(
'ignore_permissions') ?
' , TRUE' :
' , FALSE';
177 $'.$this->attr(
'id_name').
'_num_repeats = count($ASSET_LINEAGE) - $'.$this->
attr(
'id_name').
'_level;
180 if ($this->
attr(
'min_num_levels') > 0) {
182 if ($'.$this->attr(
'id_name').
'_num_repeats < '.((int) $this->
attr(
'min_num_levels')).
') $'.$this->
attr(
'id_name').
'_num_repeats = '.((int) $this->
attr(
'min_num_levels')).
';
185 if ($this->
attr(
'max_num_levels') > 0) {
187 if ($'.$this->attr(
'id_name').
'_num_repeats > '.((int) $this->
attr(
'max_num_levels')).
') $'.$this->
attr(
'id_name').
'_num_repeats = '.((int) $this->
attr(
'max_num_levels')).
';
193 if (is_null($parent_menu) || $parent_menu->attr(
'show_subs') ==
'on_current') {
195 $'.$this->attr(
'id_name').
'_assetids = Array();';
199 $'.$this->attr(
'id_name').
'_assetids = $'.$parent_menu->attr(
'id_name').
'_assetids;';
203 for ($'.$this->attr(
'id_name').
'_i = 0; $'.$this->
attr(
'id_name').
'_i < $'.$this->
attr(
'id_name').
'_num_repeats; $'.$this->
attr(
'id_name').
'_i++) {
209 if ($this->
attr(
'min_num_levels') > 0) {
212 if (is_null($parent_menu) || $parent_menu->attr(
'show_subs') ==
'on_current') {
213 $min_levels_extra_cond =
'$'.$this->attr(
'id_name').
'_i > 0 &&';
215 $min_levels_extra_cond =
'';
219 if ('.$min_levels_extra_cond.
' $'.$this->
attr(
'id_name').
'_i < '.((int) $this->
attr(
'min_num_levels')).
') {
220 $'.$this->
attr(
'id_name').
'_assetids_cond = $'.$this->
attr(
'id_name').
'_assetids;
222 $'.$this->
attr(
'id_name').
'_assetids_cond = Array((int) $ASSET_LINEAGE[$'.$this->
attr(
'id_name').
'_level + $'.$this->
attr(
'id_name').
'_i][\'assetid\']);
225 $majorids =
'$'.$this->attr(
'id_name').
'_assetids_cond';
227 $majorids =
'Array((int) $ASSET_LINEAGE[$'.$this->attr(
'id_name').
'_level + $'.$this->
attr(
'id_name').
'_i][\'assetid\'])';
231 unset($'.$this->attr(
'id_name').
'_assetids);
232 $'.$this->
attr(
'id_name').
'_assetids = menu_get_assets(\''.$this->
attr(
'id_name').
'\',
'.$majorids.' '.$ignore_permissions.');
238 }//end printDataCollection()
252 public function printVar($var, Array $args, $value_prefix='', $value_suffix='')
254 if ($var == 'asset_short_name
' && $this->attr('ellipsis_length
') > 0) {
255 $value_prefix = 'ellipsisize(
'.$value_prefix;
256 $value_suffix = $value_suffix.',
'.$this->attr('ellipsis_length
').' - (2 * $depth_count))
';
259 parent::printVar($var, $args, $value_prefix, $value_suffix);
272 protected function _printContentItemCode(Array $element)
274 switch (array_get_index($element, 'operation
')) {
280 $parent_menu = $this->getParentMenu();
281 // if we aren't a sub menu
282 if (is_null($parent_menu)) {
283 $parent_assetid_name =
'$ASSET_LINEAGE[$'.$this->attr(
'id_name').
'_level][\'assetid\']';
286 $'.$this->attr(
'id_name').
'_base_url = (empty($ASSET_LINEAGE[$'.$this->
attr(
'id_name').
'_level])) ? \'\' : current_protocol().\'://\'.$ASSET_LINEAGE[$'.$this->
attr(
'id_name').
'_level][\'url\'];
291 $parent_assetid_name =
'$'.$parent_menu->attr(
'id_name').
'_row[\'assetid\']';
294 $'.$this->attr(
'id_name').
'_base_url = $'.$parent_menu->attr(
'id_name').
'_urls[$'.$parent_menu->attr(
'id_name').
'_row[\'assetid\']];
300 '.$this->attr(
'id_name').
'_recursive_fn($'.$this->
attr(
'id_name').
'_level, '.$parent_assetid_name.
', $'.$this->
attr(
'id_name').
'_base_url);
311 return parent::_printContentItemCode($element);