objects->getFullObject($id)) || (($obj['class_id'] != 1) && ($obj['class_id'] != 3)))){ // exit( header('location: /404.php') ); } $vars = array( "ru"=>array( "attachedPages"=>'Прикреплённые страницы', "attachedFiles"=>'Прикреплённые файлы', "attachedPhotos"=>'Прикреплённые фото' ), "en"=>array( "attachedPages"=>'Attached pages', "attachedFiles"=>'Attached files', "attachedPhotos"=>'Attached pictures' ), "kz"=>array() ); $api->header(array('page-title'=>(strip_tags(html_entity_decode($obj['Название']))))); # ВЛОЖЕННОСТЬ $mothers = array(); function getMothers($id) { global $api; global $mothers; if (is_numeric($id) && ($id != 0) && ($o = $api->objects->getObject($id, false)) && (($o['class_id'] == 1) || ($o['class_id'] == 3))) { $mothers[] = $o['id']; getMothers($o['head']); } } getMothers($obj['head']); $mothers = array_reverse($mothers); # ХЛЕБНЫЕ КРОШКИ if (sizeof($mothers) > 0) { $out = array(); foreach($mothers as $obj_id) { if (is_numeric($obj_id) && ($path_obj = $api->objects->getFullObject($obj_id, false))) $out[] = ''.$path_obj['Название'].''; } //echo '
'.join(' / ', $out).'
'; } echo '

'.$obj['Название'].'

'.$obj['Текст']; ?> '; # ВЛОЖЕННЫЕ СТРАНИЦЫ if($api->auth()) { if($pages = $api->objects->getFullObjectsListByClass($obj['id'], 3)) { //echo '

'.$vars[$api->lang]['attachedPages'].'

'; $out = array(); foreach($pages as $page) { $out[] = '
  • getLink($page['id']).' target="_blank">'.$page['Название'].'
  • '; } echo ''; } } # ВЛОЖЕННЫЕ ФАЙЛЫ if($files = $api->objects->getFullObjectsListByClass($obj['id'], 5)) { //echo '

    '.$vars[$lang]['attachedFiles'].'

    '; $out = array('
    '); foreach($files as $k=>$file) { $ico = _WWW_.'/ext/none.png'; $ext = $api->lower($api->getFileExtension($file['Ссылка'])); $dp = $ext; if ($ext == 'docx') $ext = 'doc'; if ($ext == 'xlsx') $ext = 'xls'; if (file_exists(_WWW_ABS_.'/ext/'.$ext.'.png')) $ico = _WWW_.'/ext/'.$ext.'.png'; $out[] = ' '; } $out[]=''; echo join("\n", $out); } $lang = $api->lang; $api->lang='ru'; # ФОТОГАЛЛЕРЕЯ $onepage = 20; $pages = $api->pages($api->objects->getObjectsCount($obj['id'], 4), $onepage, 5, array(), "/".$api->lang."/".$api->t($obj['id'])."/pg/#pg#.html#photos-list", $api->lang); if($photos = $api->objects->getFullObjectsListByClass($obj['id'], 4, "AND o.active='1' ORDER BY o.sort LIMIT ".$pages['start'].", $onepage")) { //echo '

    '.$vars[$lang]['attachedPhotos'].'

    '; $n=0; $out = array(); foreach($photos as $photo){ $n++; if ($n == 1) { $out[] = ''; } $out[] = '
    '; if ($n == 4) { $out[] = ''; $n = 0; } } if ($out[sizeof($out)-1] != '') $out[] = ''; echo ''.join("\n", $out).'
    '; } $api->lang = $lang; echo '
    '.$pages['html'].'
    '; # НАЗАД if (sizeof($mothers) > 0) echo ''; # ВЛОЖЕНОСТЬ if (sizeof($mothers) > 0) $api->objects->last = $mothers[0]; echo '
    '; $api->footer(); ?>