view.php
8.66 KB
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<?php
/**
* @var $this TuningController
* @var $currentBrand TuningBrand
* @var $currentModel TuningModel
* @var $currentSet TuningSet
* @var $prev TuningSet[]
* @var $next TuningSet[]
* @var $contacts Contact[]
*/
?>
<?php $this->renderPartial('//snippets/headerGallery'); ?>
<div class="wrapper content-wrapper">
<div class="col-wrapper">
<div class="col2">
<p class="section-title"><?php echo Yii::t('site', 'Наши услуги');?></p>
<ul class="sidebar-nav">
<?php foreach ($this->getServices() as $item): ?>
<li><?php echo CHtml::link($item->i18n->name, array('tuning/service', 'link' => $item->link));?></li>
<?php endforeach; ?>
</ul>
<p class="section-title"><?php echo Yii::t('site', 'Марки авто');?></p>
<ul class="sidebar-nav">
<ul class="sidebar-nav">
<?php foreach ($this->getBrands() as $brand): ?>
<?php if ($brand->id == $currentBrand->id): ?>
<li class="active">
<?php echo CHtml::link($brand->i18n->name, array('tuning/brand', 'brand' => $brand->link));?>
<ul>
<?php foreach ($brand->tuningModels as $model) if (!$model->hidden): ?>
<li <?php if ($model->id == $currentModel->id) echo'class="active"' ?>>
<?php
echo CHtml::link($model->i18n->name, array(
'tuning/model',
'brand' => $model->tuningBrand->link,
'model' => $model->link)
);
?>
</li>
<?php endif; ?>
</ul>
</li>
<?php else: ?>
<li><?php echo CHtml::link($brand->i18n->name, array('tuning/brand', 'brand' => $brand->link));?></li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
</ul>
</div>
<div class="col8">
<ul class="crumbs">
<li><?php echo CHtml::link(Yii::t('site', 'Тюнинг автомобилей'), array('tuning/index'));?>→</li>
<li><?php echo CHtml::link($currentBrand->i18n->name, array(
'tuning/brand',
'brand' => $currentBrand->link,
));?>→
</li>
<li><?php echo CHtml::link($currentModel->i18n->name, array(
'tuning/model',
'brand' => $currentBrand->link,
'model' => $currentModel->link,
));?>→
</li>
</ul>
<h1><?php echo $this->pageName?></h1>
<div class="catalog-item-full">
<ul class="catalog-item-nav">
<?php
if (count($prev) > 0) echo '<li class="catalog-item-prev">', CHtml::link($prev[0]->i18n->name, array(
'tuning/view',
'brand' => $prev[0]->tuningModel->tuningBrand->link,
'model' => $prev[0]->tuningModel->link,
'set' => $prev[0]->link,
)), '</li>';
if (count($next) > 0) echo '<li class="catalog-item-next">', CHtml::link($next[0]->i18n->name, array(
'tuning/view',
'brand' => $next[0]->tuningModel->tuningBrand->link,
'model' => $next[0]->tuningModel->link,
'set' => $next[0]->link,
)), '</li>';
?>
</ul>
<div class="text-content">
<?php
$big = $currentSet->imageBehavior->getFileUrl('big');
$bigger = $currentSet->imageBehavior->getFileUrl('bigger');
if (isset($bigger))
echo CHtml::image($bigger,'', array('width' => '800'));
else
echo CHtml::image($big,'', array('width' => '632'));
?>
<?php echo $currentSet->i18n->content ?>
</div>
<?php
if (isset($currentSet->gallery_id)) {
$photos = $currentSet->galleryBehavior->getGalleryPhotos();
if (count($photos) > 0) {
?>
<div class="col10">
<div class="col8">
<h2><?php echo Yii::t('site', 'Фотогалерея');?></h2>
<div class="catalog-item-gallery">
<?php
foreach ($photos as $photo) {
echo CHtml::link(
CHtml::image($photo->getUrl('small'), $photo->i18n->name),
$photo->getUrl('medium'),
array(
'rel' => 'gallery',
'data-name' => $photo->i18n->name,
'data-description' => $photo->i18n->description,
)
);
}
?>
</div>
</div>
</div>
<?php
}
}
?>
</div>
<div class="text-content">
<h2><?php echo Yii::t('site', 'Узнать стоимость и наличие {tuning_set}',
array('{tuning_set}' => $currentSet->i18n->name))?></h2>
<p><?php echo Yii::t('site', 'Ответ на эти и другие интересующие вас вопросы вы можете получить связавшись с нами:');?>
</p>
</div>
<?php echo $this->tuningRoot->i18n->contact_info?>
<?php if (count($prev) + count($next) > 0): ?>
<h2>
<?php echo Yii::t('site', 'Другие варианты тюнинга {model}',
array('{model}' => $currentModel->i18n->name))?>:
</h2>
<div class="catalog-similar">
<?php
foreach (array_reverse($prev) as $item) {
$this->renderPartial('_similarSet', array('tuningSet' => $item));
}
$this->renderPartial('_similarSet', array('tuningSet' => $currentSet, 'htmlClass' => 'active'));
foreach ($next as $item) {
$this->renderPartial('_similarSet', array('tuningSet' => $item));
}
?>
</div>
<?php endif;?>
</div>
<div class="col2">
<p class="section-title"><?php echo Yii::t('site', 'Есть вопросы?');?></p>
<div class="text-content">
<?php echo Yii::t('site', 'Обращайтесь к вашему персональному консультанту по тюнингу!');?>
</div>
<?php $this->renderPartial('//snippets/sidebarContacts');?>
</div>
</div>
</div>
<?php
$cs = Yii::app()->clientScript;
$cs->registerCoreScript('jquery');
//$cs->registerScriptFile(Yii::app()->baseUrl . '/js/fancybox/jquery.mousewheel-3.0.4.pack.js');
$cs->registerScriptFile(Yii::app()->baseUrl . '/js/fancybox/jquery.fancybox-1.3.4.pack.js');
$cs->registerCssFile(Yii::app()->baseUrl . '/js/fancybox/jquery.fancybox-1.3.4.css');
$src = <<<JS
$("a[rel=gallery]").fancybox({
'transitionIn' : 'none',
'transitionOut' : 'none',
'titlePosition' : 'over',
'titleFormat' : function(title, currentArray, currentIndex, currentOpts) {
var name = $(currentArray[currentIndex]).data('name'), r = '';
var description = $(currentArray[currentIndex]).data('description');
name = name?name:''; description = description?description:'';
if(name.length) r+='<b>'+name+'</b> ';
if(description.length) r+=description;
if(r.length) return '<span id="fancybox-title-over">'+r+'</span>';
else return '';
}
});
JS;
$cs->registerScript('fancybox_gallery', $src);
?>