File indexing completed on 2024-12-29 05:24:39

0001 <?php
0002 /**
0003  *  ocs-webserver
0004  *
0005  *  Copyright 2016 by pling GmbH.
0006  *
0007  *    This file is part of ocs-webserver.
0008  *
0009  *    This program is free software: you can redistribute it and/or modify
0010  *    it under the terms of the GNU Affero General Public License as
0011  *    published by the Free Software Foundation, either version 3 of the
0012  *    License, or (at your option) any later version.
0013  *
0014  *    This program is distributed in the hope that it will be useful,
0015  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
0016  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0017  *    GNU Affero General Public License for more details.
0018  *
0019  *    You should have received a copy of the GNU Affero General Public License
0020  *    along with this program.  If not, see <http://www.gnu.org/licenses/>.
0021  **/
0022 
0023 $helperBaseUrl = new Default_View_Helper_BaseUrl();
0024 $helperServerUrl = new Zend_View_Helper_ServerUrl();
0025 $helperBuildProductUrl = new Default_View_Helper_BuildProductUrl();
0026 $helperTruncate = new Default_View_Helper_Truncate();
0027 $helperImage = new Default_View_Helper_Image();
0028 $helperGetAuthUser = new Default_View_Helper_GetAuthUser();
0029 $helperAddDefaultScheme = new Default_View_Helper_AddDefaultScheme();
0030 
0031 
0032 $this->doctype(Zend_View_Helper_Doctype::XHTML1_RDFA);
0033 $this->headMeta()->appendProperty('og:type', 'website');
0034 $this->headMeta()->appendProperty('og:site_name', 'ocs');
0035 $this->headMeta()->appendProperty('og:title', $this->product->title);
0036 $this->headMeta()->appendProperty('og:url', $helperServerUrl->serverUrl() . $helperBaseUrl->baseUrl() . $helperBuildProductUrl->buildProductUrl($this->product->project_id));
0037 $this->headMeta()->appendProperty('og:description', $helperTruncate->truncate($this->product->description, 200, '...', false, true));
0038 $this->headMeta()->appendProperty('og:image', $helperImage->Image($this->product->image_small, array('width' => 200, 'height' => 200)));
0039 
0040 
0041 $titleImage = $helperImage->Image($this->product->image_big, array('width' => 1170, 'height' => 300));
0042 $styleAttr = ' style="background-image: url(' . $titleImage . ');"';
0043 if (strpos($titleImage, 'default.png') !== false) {
0044     $styleAttr = '';
0045 }
0046 $cssClassAuthCodeTested = $this->product->project_validated ? 'checked' : 'unchecked';
0047 
0048 $this->inlineScript()->appendScript(
0049     '    $(document).ready(function(){
0050             ProductPage.setup();
0051             ProductPage.setupPlingButton();
0052         });
0053     ');