partner.php
5.7 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
<?php
/**
* @var $this PartnersSectionController
* @var $partners Partner[]
* @var $partner Partner
* @var $contacts Contact
*/
?>
<?php $this->renderPartial('//snippets/headerGallery'); ?>
<!-- header end-->
<div class="wrapper content-wrapper">
<div class="col-wrapper">
<div class="col2 aside-no-title">
<?php
$items = array();
foreach ($partners as $item) {
$items[] = array(
'label' => $item->i18n->name,
'url' => $this->createUrl('partnersSection/partner', array('link' => $item->link)),
'active' => $item->id == $partner->id,
);
}
$sideMenu = array(
array('url' => $this->createUrl('about/index', array('node_id' => $this->root_node_id)), 'label' => Yii::t('site', 'О компании')),
);
foreach ($this->getRootNode()->nodes as $node)
if (!$node->hidden) {
$sideMenuItem = null;
switch ($node->data_type) {
case('partnersSection'):
$sideMenuItem = array(
'url' => $this->createUrl('partnersSection/partners', array('node_id' => $node->id)),
'label' => $node->i18n->label,
);
break;
case('jobsSection'):
$sideMenuItem = array(
'url' => $this->createUrl('jobsSection/jobs', array('node_id' => $node->id)),
'label' => $node->i18n->label,
);
break;
case('aboutSection'):
$sideMenu[] = array(
'url' => $this->createUrl('aboutSection/index', array('node_id' => $node->id)),
'label' => $node->i18n->label,
);
break;
}
if (!empty($sideMenuItem)) {
$sideMenuItem['active'] = $node->id == $this->node_id;
if ($sideMenuItem['active']) {
$sideMenuItem['items'] = $items;
}
$sideMenu[] = $sideMenuItem;
}
}
$this->widget('zii.widgets.CMenu', array(
'items' => $sideMenu,
'htmlOptions' => array('class' => 'sidebar-nav'),
));
?>
<?php $this->renderPartial('//about/_photoFeed', array('galleryId' => $this->getAboutRoot()->photo_gallery_id));?>
</div>
<div class="col8">
<h1><?php echo CHtml::encode($this->pageName)?></h1>
<div class="text-content">
<?php echo $partner->i18n->content1 ?>
</div>
<h2><?php echo Yii::t('site', '{name} тюнинг для автомобилей', array('{name}' => $partner->i18n->name));?></h2>
<div class="car-marque-list">
<?php foreach ($partner->brands as $brand): ?>
<a class="car-marque-item" title="<?php echo CHtml::encode($brand->i18n->name)?>">
<span class="car-marque"
style="background-image: url(<?php echo CHtml::encode($brand->imageBehavior->getFileUrl('small'))?>);">
</span>
</a>
<?php endforeach;?>
</div>
<?php echo $partner->i18n->content2 ?>
<?php if ($partner->gallery_id != null && $partner->galleryBehavior->getGalleryPhotoCount() > 0): ?>
<h2><?php echo $partner->i18n->gallery_heading?></h2>
<div class="content-wide-gallery">
<?php
foreach ($partner->galleryBehavior->getGalleryPhotos() as $photo) {
echo CHtml::link(CHtml::image($photo->getUrl('small'), $photo->i18n->name), $photo->getUrl('medium'), array(
'rel' => 'gallery',
));
}
?>
</div>
<?php endif;?>
<?php echo $partner->i18n->content3 ?>
</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);
?>