-
Notifications
You must be signed in to change notification settings - Fork 113
/
attribute-body-default.html
107 lines (100 loc) · 4.92 KB
/
attribute-body-default.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?php
/**
* @copyright Copyright (c) Metaways Infosystems GmbH, 2013
* @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
*/
$enc = $this->encoder();
/** client/html/common/content/baseurl
* Path to the content directory or content base URL to a server
*
* This option must point to the base path or URL of the used content (images,
* downloadable files, etc.).
*
* If you use an absolute URL prefer the https protocol to avoid issues with mixed
* content. Browsers avoid to load files via http if the page was retrieved via
* https.
*
* @param string Relative path or absolute URL
* @since 2014.03
* @see client/html/common/content/baseurl
*/
$contentUrl = $this->config( 'client/html/common/content/baseurl' );
/** client/html/catalog/filter/default/button
* Displays the "Search" button in the catalog filter if Javascript is disabled
*
* Usually the "Search" button is shown in the catalog filter if the browser
* doesn't support Javascript or the user has disabled Javascript for the site.
* If you are using parts of the catalog filter to e.g. render a menu, the
* button shouldn't be displayed at all. This can be explicitely set via this
* configuration option.
*
* @param boolean A value of "1" to enable the button, "0" to disable it
* @since 2014.03
* @category User
* @category Developer
*/
$button = $this->config( 'client/html/catalog/filter/default/button', true );
$listTarget = $this->config( 'client/html/catalog/list/url/target' );
$listController = $this->config( 'client/html/catalog/list/url/controller', 'catalog' );
$listAction = $this->config( 'client/html/catalog/list/url/action', 'list' );
$listConfig = $this->config( 'client/html/catalog/list/url/config', array() );
$attrMap = $this->get( 'attributeMap', array() );
$attrIds = $this->param( 'f_attrid', array() );
$params = $this->param(); unset( $params['target'] );
?>
<section class="catalog-filter-attribute">
<?php if( !empty( $attrMap ) ) : ?>
<h2><?php echo $enc->html( $this->translate( 'client/html', 'Attributes' ), $enc::TRUST ); ?></h2>
<?php if( !empty( $attrIds ) ) : ?>
<div class="attribute-selected">
<span class="selected-intro"><?php echo $enc->html( $this->translate( 'client/html', 'Your choice' ), $enc::TRUST ); ?></span>
<ul class="attr-list">
<?php foreach( $attrMap as $attrType => $attributes ) : ?>
<?php foreach( $attributes as $id => $attribute ) : ?>
<?php if( isset( $attrIds[$id] ) ) : ?>
<?php $current = $params; if( is_array( $current['f_attrid'] ) ) { unset( $current['f_attrid'][$id] ); } ?>
<li class="attr-item"><a class="attr-name" href="<?php echo $enc->attr( $this->url( $listTarget, $listController, $listAction, $current, array(), $listConfig ) ); ?>"><?php echo $enc->html( $attribute->getName(), $enc::TRUST ); ?></a></li>
<?php endif; ?>
<?php endforeach; ?>
<?php endforeach; ?>
</ul>
<?php if( count( $attrIds ) > 1 ) : ?>
<?php $current = $params; if( isset( $current['f_attrid'] ) ) { unset( $current['f_attrid'] ); } ?>
<a class="selected-all" href="<?php echo $enc->attr( $this->url( $listTarget, $listController, $listAction, $current, array(), $listConfig ) ); ?>"><?php echo $enc->html( $this->translate( 'client/html', 'clear all' ), $enc::TRUST ); ?></a>
<?php endif; ?>
</div>
<?php endif; ?>
<div class="attribute-lists"><!--
<?php foreach( $attrMap as $attrType => $attributes ) : ?>
<?php if( !empty( $attributes ) ) : ?>
--><fieldset class="attr-<?php echo $enc->attr( $attrType, $enc::TAINT, '-' ); ?>">
<legend><?php echo $enc->html( $this->translate( 'client/html/code', $attrType ), $enc::TRUST ); ?></legend>
<ul class="attr-list"><!--
<?php foreach( $attributes as $id => $attribute ) : ?>
--><li class="attr-item" data-id="<?php echo $enc->attr( $id ); ?>">
<input class="attr-item" id="attr-<?php echo $enc->attr( $id ); ?>" name="<?php echo $enc->attr( $this->formparam( array( 'f_attrid', $id ) ) ); ?>" type="checkbox" value="<?php echo $enc->attr( $attribute->getName( 'url' ) ); ?>" <?php echo ( isset( $attrIds[$id] ) ? 'checked="checked"' : '' ); ?> />
<label class="attr-name" for="attr-<?php echo $enc->attr( $id ); ?>"><!--
--><div class="media-list"><!--
<?php foreach( $attribute->getListItems( 'media', 'icon' ) as $listItem ) : ?>
<?php if( ( $item = $listItem->getRefItem() ) !== null ) : ?>
<?php echo '-->' . $this->media( $item, $contentUrl, array( 'class' => 'media-item' ) ) . '<!--'; ?>
<?php endif; ?>
<?php endforeach; ?>
--></div>
<span><?php echo $enc->html( $attribute->getName(), $enc::TRUST ); ?></span><!--
--></label>
</li><!--
<?php endforeach; ?>
--></ul>
</fieldset><!--
<?php endif; ?>
<?php endforeach; ?>
--></div>
<?php endif; ?>
<?php echo $this->attributeBody; ?>
<?php if( $button ) : ?>
<noscript>
<button class="filter standardbutton btn-action" type="submit"><?php echo $enc->html( $this->translate( 'client/html', 'Show' ), $enc::TRUST ); ?></button>
</noscript>
<?php endif; ?>
</section>