Не помню откуда этот файл, но когда его не было отладка ругалась на его отсутствие.
<?php if ($field->title) { ?><label for="<?php echo $field->id; ?>"><?php echo $field->title; ?></label><?php } ?>
<?php
$content_model = cmsCore::getModel('content');
$content_model->setTablePrefix('');
$ctypes = $field->options['ctypes'];
$ctypes = $content_model->filterIn('name', $ctypes)->getContentTypes();
if($value) { $value = cmsModel
::yamlToArray($value); } else { $value = array(); }
if(isset($value['main'])) {
$main = $value['main'];
}
?>
<div id="related_content_<?php echo $field->id; ?>">
<?php echo html_radio
("{$field->name}[main]", (!isset($main)) ?
true : false, 0, array('title'=>'Без главного материала')); ?> - без главного материала
<ul>
<?php $i = 1; foreach($ctypes as $ctype) { ?>
<?php $content_model->setTablePrefix('con_'); ?>
<?php $items = $content_model->getContentItems($ctype['name']); ?>
<?php if($items) { ?>
<li<?php if($i == 1) { ?> class="active"<?php } ?>>
<?php echo $ctype['title']; ?>
<ul>
<?php $ii = 1; foreach($items as $item) { ?>
<li>
<?php echo html_checkbox
("{$field->name}['".$ctype['name']."'][]", isset($value[$ctype['name']]) ?
in_array($item['id'], $value[$ctype['name']]) : false, $item['id'], array('id'=>$ctype['name'].$item['id'])); ?> <label for="<?php echo $ctype['name'].$item['id']; ?>"><?php echo $item['title']; ?></label>
<?php echo html_radio
("{$field->name}[main]", (isset($main) && $main == $ctype['name'].'-'.$item['id']) ?
true : false, $ctype['name'].'-'.$item['id'], array('title'=>'Главный материал')); ?> </li>
<?php $ii++; } ?>
</ul>
</li>
<?php } ?>
<?php } ?>
</ul>
</div>
<script>
$('#related_content_<?php echo $field->id; ?> > ul > li > ul').click(function(event){
event.stopPropagation();
}).filter(':not(:first)').hide();
$('#related_content_<?php echo $field->id; ?> > ul > li').click(function(){
var selfClick = $(this).find('ul:first').is(':visible');
if(!selfClick) {
$(this).parent().find('> li ul:visible').slideToggle();
}
$(this).find('ul:first').stop(true, true).slideToggle();
});
</script>
<style>
#related_content_<?php echo $field->id; ?> {
}
#related_content_<?php echo $field->id; ?> li{
cursor: pointer;
background:url(accordion_bg.png) repeat-x;
font-weight:bold;
color:#015287;
border:1px solid #b2b2b2;
margin-bottom:2px;
list-style-image:none;
list-style-position:outside;
list-style-type:none;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
padding: 4px 8px;
}
#related_content_<?php echo $field->id; ?> ul{
padding:0;
margin:0;
}
#related_content_<?php echo $field->id; ?> li.active{
color:#D15600
}
#related_content_<?php echo $field->id; ?> li ul{
padding:0;
margin:10px 0 0 0;
}
#related_content_<?php echo $field->id; ?> li.active li{
text-indent:0;
}
#related_content_<?php echo $field->id; ?> li li{
font-weight: normal;
background:none;
border:0;
}
#related_content_<?php echo $field->id; ?> label{
display:inline;
}
</style>