bodyid = $bodyid; switch ($template) { case 'popUp': $this->template = 'Popup'; break; case 'New': $this->template = 'New'; break; default: $this->template = 'Default'; } $this->description =''; $this->keywords = ''; $this->Config = Core_Config::getInstance(); } function addCss($name) { $this->css[] = $name; } function addJs($name) { $this->js[] = $name; } public function load($template,$array=array(),$clean=0) { $L = Core_language::getInstance(); if(!$this->page) $this->page = Tools_Http::Request('page'); $template_path = ''; $template_path= TEMPLATEPATH.'/'.$template.'.html.php'; ob_start(); if(file_exists($template_path)) { include($template_path); } else include(TEMPLATEPATH.'404.html.php'); $data = ob_get_clean(); if($clean) $data = trim(preg_replace('/\s\s+/', ' ', $data)); return $data; } public function OutputHtml($array=array()) { $css=''; if (!empty($this->css)) { foreach ($this->css as $item){ $css .= ''; } } $Config = Core_Config::getInstance(); $L = Core_Language::getInstance(); $js=''; if (!empty($this->js)) { foreach ($this->js as $item){ $js .= ''; } } if(isset($this->title) && $this->title) $title = $this->title.' - '.$this->Config->Get('DEFAULT_PAGE_TITLE'); else $title= $this->Config->Get('DEFAULT_PAGE_TITLE'); if(isset($this->description) && $this->description) $description= $this->description; else $description= ''; if(isset($this->keywords) && $this->keywords) $keywords= $this->keywords; else $keywords= ''; $head_str = file_get_contents(APPDIR.'templates/htmlDef.php'); $head_str = str_replace('',$css,$head_str); $head_str = str_replace('',$js,$head_str); $head_str = str_replace('',''.$title.'', $head_str); $head_str = str_replace('','', $head_str); $head_str = str_replace('','', $head_str); $data = ''; if(isset($array['fb']) && !empty($array['fb'])) { //print_r($array); //echo $array['fb']['descr']; $descr = mb_substr(strip_tags($array['fb']['description']),0,200,'UTF-8'); $data .=''."\n"; $data .=''."\n"; $data .=''."\n"; $data .=''."\n"; $data .=''."\n"; $data .=''."\n"; $data .=' '."\n"; } $head_str = str_replace('<>',$data,$head_str); echo $head_str; } public function OutputHead($array=array()) { include APPDIR.'templates/html'.$this->template.'Head.php'; } public function OutputFoot($array=array()) { include APPDIR.'templates/html'.$this->template.'Foot.php'; } public static function goodsAction($items ) { ob_start(); $products = new Products(); $L = Core_Language::getInstance(); $labelsList = []; //$deliveries = Products_Delivery::getInstance()->getList(1); ?> 0 ? $price_array_2['price'] : $price_array['price']; $second_price = $price_array_2['price']>0 ? $price_array['price'] : $price_array_2['price']; $actual_price_arr = explode('.',$actual_price); $link = $products -> getLink($item['id'],$item['good_name']); if(isset($item['search_title']) && $item['search_title']) $title= $item['search_title']; else { if($category_title) $title= htmlspecialchars($item['good_name']).' :: '.$category_title; else $title= htmlspecialchars($item['good_name']); } $labels = new Products_Labels; $labelsList = $labels->getList(); ob_start(); ?>
href="" title=""><?=$title?> 0) { ?>
-%
Str('product_number')?>
Str('rate_this_product');?>:
Str('your_rate');?>:
*/ ?> Str('rating');?> Str('rating_count');?>
getList($item['id']); $deliveries = Products_Delivery::getInstance()->getList(1); if(!empty($documents)) { ?>
Str('Documenti')?>
Str('till_action_end')?> 0 Str('days_short')?> 0 Str('hours_short')?> 0 Str('min_short')?> 0

StrT('goods','title', $item['id'], $item['title'])?>

0) { ?>
Str('save_money_text')?> EUR Str('monthly')?> , Str('buyoff')?>

Str('with_client_card')?> Str('order_client_card')?>
.
0) { ?>
Str('purchase_for_company')?> ? Str('get_a_discount')?>
Str('free_shipping')?>
0 && !$item['action']) { ?>
Str('without_client_card')?> : Str('without_pvn')?> : */?>
Str('delivery_options')?>:
Str('free')?>, Str('delivery_direction_4')?> 0) { ?> Str('available_at_once')?>
Str('free')?>, Str('delivery_direction_2')?> 0) { ?> Str('available_at_once')?>
0) { ?>
bez maksas
Str('free')?>
0) { ?>
bez maksas
Str('free')?>
Str('more_info')?>
getList(); ob_start(); ?> getThumbnail($item['id'],'t'); $bigpic = $products->getThumbnail($item['id'],''); $link = $products -> getLink($item['id']); $title= htmlspecialchars($item['title']); $votes = $products->calc_votes($item['id']); $ip_vote = $products->get_ip_vote($item['id']); $html .= '
'.$item['descr'].'

'; if(!$ip_vote) $html .=''; if($votes) $html .= ''.$votes." ".$L->Str('votes'); else $html .= $L->Str('no_votes'); $html .='

'; return $html; } public static function videoBox(array $item, $open=false) { $html=''; $products = new Video(); $L = Core_Language::getInstance(); $link = $products -> getLink($item['id']); $title= htmlspecialchars($item['title']); $html .= '
'.$item['embed2'].'
'; return $html; } public static function partnersBoxDefault(array $items, $open=false) { $html=''; $products = new Partners(); $L = Core_Language::getInstance(); if (!empty($items)) { //print_r($items); $html .= '
'; foreach ($items as $item) { $thumb = $products->getThumbnail($item['id'],'t'); $bigpic = $products->getThumbnail($item['id'],''); $link = $products -> getLink($item['id']); $title= htmlspecialchars($item['title']); $link = $products -> getLink($item['id']); $html .= ' '; } $html .= '
'; } return $html; } public static function partnersBoxDefault2(array $items, $open=false) { $html=''; $products = new Partners(); $L = Core_Language::getInstance(); if (!empty($items)) { //print_r($items); $html .= '
'; foreach ($items as $item) { $thumb = $products->getThumbnail($item['id'],'t'); $bigpic = $products->getThumbnail($item['id'],''); $link = $products -> getLink($item['id']); $title= htmlspecialchars($item['title']); $link = $products -> getLink($item['id']); $html .= ' '; } $html .= '
'; } return $html; } public static function videoBoxDefault(array $items, $open=false) { $html=''; $products = new Video(); $L = Core_Language::getInstance(); if (!empty($items)) { //print_r($items); $html .= '
'; foreach ($items as $item) { // $thumb = $products->getThumbnail($item['id'],'t'); // $bigpic = $products->getThumbnail($item['id'],''); // $link = $products -> getLink($item['id']); $title= htmlspecialchars($item['title']); $link = $products -> getLink($item['id']); if($item['embed']) $html .= ' '; } $html .= '
'; } return $html; } public static function projectsBoxDefault(array $all_items,$open=false,$show_description=true,$show_attaches = false) { $html=''; if($open) $items[] = $all_items; else $items = $all_items; $products = new Projects(); $L = Core_Language::getInstance(); if (!empty($items)) { $html .= '
'; $vid = new Projects_Video(); foreach ($items as $item) { $all_vids = $vid->getVideos($item['id']); $images = $products -> getImages($item['id']); $photos =''; if (!empty($images) && count($images)>1) { $photos .= ''; $videos =''; $vids = array(); foreach ($all_vids as $video) { if(!$open && !$video['isthumb']) continue; $vids[]=$video; } if (!empty($vids)) { $videos .= '
'; $i=0; foreach ($vids as $video) { $videos .= $video['embed2'].'
'; } $videos .= '
'; } $title= htmlspecialchars($item['title']); $link = $products -> getLink($item['id']); $short_description = strip_tags($L->StrT('projects','descr', $item['id'], '')); $item['short_desc'] = strlen($short_description)>520 ? mb_substr(strip_tags($short_description),0,520,'UTF8').'...' : $short_description; $thumb_small = ''; $thumb_large = ''; $html .= '
'; if(!$open) $html .= ''.$L->StrT('projects','title', $item['id'], $item['title']).''; else $html .= $L->StrT('projects','title', $item['id'], $item['title']); $html .= '
'; $html .= '
'.$item['human_date'].'
'; $html .= '
'; if($show_description) { if(!$open) $html .= '
'.$thumb_small.$item['short_desc'].'
'; else $html .= '
'.$thumb_large. $L->StrT('projects','descr', $item['id'], '').'
'; } if(!empty($vids)) { $html .= '
'; $html .= ''.$videos.''; $html .= ''.$photos.''; $html .='
'; $html .='
'; } else { $html .= ''.$photos.''; } if(!$open) $html .=''; $html .='
'; } $html .= '
'; } return $html; } public static function projectShortBoxDefault(array $all_items,$gallery=false,$thumb=true,$go_link='') { $html=''; $items = $all_items; $products = new Projects(); $L = Core_Language::getInstance(); if (!empty($items)) { $all_link = '/projects/'.$go_link; $html .= '
'; foreach ($items as $item) { if($gallery) { $images = $products -> getImages($item['id']); $photos =''; if (!empty($images) && count($images)>1) { $photos .= ''; } $title= htmlspecialchars($item['title']); $link = $products -> getLink($item['id']); $short_description = strip_tags($L->StrT('projects','descr', $item['id'], $item['descr'])); $item['short_desc'] = strlen($short_description)>520 ? mb_substr(strip_tags($short_description),0,520,'UTF8').'...' : $short_description; $thumb_small = ''; $html .= '
'; $html .= '
'; $html .= ''.$L->StrT('projects','title', $item['id'], $item['title']).''; $html .= '
'; if($thumb) $html .= ''; $html .=''; $html .= '
'.$item['short_desc'].'
'; $html .= '
'; //$html .= '
'.$item['human_date'].'
'; $html .= '
'; if($gallery) { $html .= ''.$photos.''; } $html .= '
'; $html .= '
'; } //$html .=''; $html .= '
'; } return $html; } public static function blogShortBoxDefault(array $all_items,$gallery=false,$thumb=true,$go_link='') { $html=''; $items = $all_items; $products = new Projects(); $L = Core_Language::getInstance(); if (!empty($items)) { $link_base = '/blog/'; $html .= '
'; foreach ($items as $item) { $title= htmlspecialchars($item['title']); $html .= '
'; $html .= '
'; $html .= ''.$item['title'].''; $html .= '
'; if($thumb) $html .= ''; $html .=''; $html .= '
'.$item['short_desc'].'
'; $html .= '
'; //$html .= '
'.$item['human_date'].'
'; $html .= '
'; $html .=''; $html .= '
'; $html .= '
'; } $html .= '
'; } return $html; } public static function blogBoxDefault($item) { $html=''; $L = Core_Language::getInstance(); if (!empty($item)) { $html .= '
'; $title= htmlspecialchars($item['title']); $html .= '
'; $html .= '
'; $html .= '
'.$item['title'].'
'; $html .= '
'; if($item['image']) $html .= ''; $html .=''; $html .= '
'.$item['text'].'
'; $html .= '
'; //$html .= '
'.$item['human_date'].'
'; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; } return $html; } public static function reviewsBoxDefault(array $items) { $html=''; $products = new Reviews(); $L = Core_Language::getInstance(); if (!empty($items)) { //$all_link = '/reviews/'.$go_link; $html .= '
'; foreach ($items as $item) { $title= htmlspecialchars($item['title']); //$short_description = strip_tags($L->StrT('content','descr', $item['id'], $item['descr'])); //$item['short_desc'] = strlen($short_description)>520 ? mb_substr(strip_tags($short_description),0,520,'UTF8').'...' : $short_description; $thumb_small = ''; $html .= '
'; $html .= '
'; $html .= '
'; //if($thumb) $html .= ''; $html .=''; $html .= ''.$item['title'].''; $html .= $item['descr']; $html .= ''; //$html .= '
'.$item['human_date'].'
'; $html .= '
'; $html .= '
'; $html .= '
'; } // $html .=''; $html .= '
'; } return $html; } static function show_work_galleries($galleries,$type=1) { global $L; $Gallery = new WorksGallery(); //$DB = Core_Database::getInstance(); ob_start(); ?>
getImages($gall['id'], 1); if (!empty($images)) { $count = count($images); $thumb = $images[0]['picture_2']; } else { if($gall['icon']) $thumb = $dest = '/images/worksgallery/'.$gall['icon']; else $thumb=''; } $style= 'width:140px'; if($thumb && file_exists($_SERVER['DOCUMENT_ROOT'].$thumb)) { $size = getimagesize($_SERVER['DOCUMENT_ROOT'].$thumb); if($size[0]>$size[1]) { $style='width:140px'; } if($size[0]<$size[1] || $size[0]==$size[1] ) { $style='height:120px'; } } $link = '?'.Tools_Http::replaceUrl($_GET, 'gid', $gall['id']); $data=explode(' ',$gall['created']); if(!$type) $link .=$gall['type']=='gallery' ? '&gallery' : ''; if ($thumb) { ?>