File indexing completed on 2024-12-29 05:24:43
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 $this->headTitle($_SERVER['HTTP_HOST'], 'SET'); 0023 $this->doctype(Zend_View_Helper_Doctype::XHTML1_RDFA); 0024 $this->headMeta()->appendProperty('og:url', 'www.opendesktop.org'); 0025 $this->headMeta()->appendProperty('og:type', 'website'); 0026 $this->headMeta()->appendProperty('og:title', 'opendesktop.org'); 0027 $this->headMeta()->appendProperty('og:site_name','www.opendesktop.org'); 0028 $this->headMeta()->appendProperty('og:description','A community where developers and artists share applications, themes and other content'); 0029 $this->headMeta()->appendProperty('og:image','https://www.opendesktop.org/images/system/opendesktop-logo.png'); 0030 0031 $modelInfo = new Default_Model_Info(); 0032 $helpPrintDate = new Default_View_Helper_PrintDate(); 0033 $helperImage = new Default_View_Helper_Image(); 0034 0035 if (Zend_Auth::getInstance()->hasIdentity()){ 0036 $identity = Zend_Auth::getInstance()->getStorage()->read(); 0037 $avatar = $helperImage->image($identity->profile_image_url,array('width' => 100, 'height' => 100, 'crop' => 2)); 0038 $user = array( 0039 "username" => $identity->username, 0040 "member_id" => $identity->member_id, 0041 "mail" => $identity->mail, 0042 "avatar" => $avatar, 0043 "roleName" =>$identity->roleName 0044 ); 0045 0046 $comments = $modelInfo->getLastCommentsForUsersProjects($identity->member_id); 0047 $votes = $modelInfo->getLastVotesForUsersProjects($identity->member_id); 0048 $donations = $modelInfo->getLastDonationsForUsersProjects($identity->member_id); 0049 foreach ($comments as &$p) { 0050 $p['profile_image_url'] = $this->Image($p['profile_image_url'], array('width' => 200, 'height' => 200)); 0051 $p['comment_created_at'] = $helpPrintDate->printDate($p['comment_created_at']); 0052 } 0053 foreach ($votes as &$p) { 0054 $p['profile_image_url'] = $this->Image($p['profile_image_url'], array('width' => 200, 'height' => 200)); 0055 $p['created_at'] = $helpPrintDate->printDate($p['created_at']); 0056 } 0057 $tableMembers = new Default_Model_Member(); 0058 $supporterinfo = $tableMembers->fetchSupporterDonationInfo($identity->member_id); 0059 0060 $response = array( 0061 'user' => $user, 0062 'supporterinfo' => $supporterinfo, 0063 'comments' =>$comments, 0064 'votes' => $votes, 0065 ); 0066 }else 0067 { 0068 0069 0070 $productsAppAddons = $modelInfo->getLastProductsForHostStores(5,'152,233'); 0071 $productsThemes = $modelInfo->getLastProductsForHostStores(5,'148'); 0072 $productsMultimedia = $modelInfo->getLastProductsForHostStores(5,'586'); 0073 $comments = $modelInfo->getLatestComments(5); 0074 foreach ($productsAppAddons as &$p) { 0075 $p['image_small'] = $this->Image($p['image_small'], array('width' => 200, 'height' => 200)); 0076 } 0077 foreach ($productsThemes as &$p) { 0078 $p['image_small'] = $this->Image($p['image_small'], array('width' => 200, 'height' => 200)); 0079 } 0080 foreach ($productsMultimedia as &$p) { 0081 $p['image_small'] = $this->Image($p['image_small'], array('width' => 200, 'height' => 200)); 0082 } 0083 foreach ($comments as &$p) { 0084 $p['profile_image_url'] = $this->Image($p['profile_image_url'], array('width' => 200, 'height' => 200)); 0085 $p['comment_created_at'] = $helpPrintDate->printDate($p['comment_created_at']); 0086 } 0087 0088 $config = Zend_Registry::get('config')->settings->client->default; 0089 $baseurl = $config->baseurl; 0090 $baseurlStore = $config->baseurl_store; 0091 $url_forum = $config->url_forum; 0092 $url_blog = $config->url_blog; 0093 $url_gitlab = $config->url_gitlab; 0094 $url_riot = $config->url_riot; 0095 $url_myopendesktop = $config->url_myopendesktop; 0096 $url_cloudopendesktop = $config->url_cloudopendesktop; 0097 $url_musicopendesktop = $config->url_musicopendesktop; 0098 $url_mastodon = $config->url_mastodon; 0099 $response = array( 0100 'comments' => $comments, 0101 'products' => $productsAppAddons, 0102 'productsThemes' => $productsThemes, 0103 'productsMultimedia' => $productsMultimedia, 0104 "baseUrl" => $baseurl, 0105 "baseUrlStore" => $baseurlStore, 0106 "blogUrl" => $url_blog, 0107 "forumUrl" => $url_forum, 0108 "mastodonUrl" => $url_mastodon, 0109 "gitlabUrl" => $url_gitlab, 0110 "riotUrl" => $url_riot, 0111 "url_myopendesktop" => $url_myopendesktop, 0112 "url_cloudopendesktop" => $url_cloudopendesktop, 0113 "url_musicopendesktop" => $url_musicopendesktop, 0114 "url_mastodon" => $url_mastodon, 0115 ); 0116 0117 0118 } 0119 0120 ?> 0121 0122 0123 <div class="tooltip_templates" style="display:none"> 0124 <span id="tooltip_content"> 0125 <i class="fa fa-spinner"></i> 0126 </span> 0127 </div> 0128 0129 <main class="startpage-store-new"> 0130 <div id="main-content"></div> 0131 <script type="text/javascript"> 0132 var page = "opendesktop"; 0133 var hpVersion = 2; 0134 var data = <?php echo Zend_Json::encode($response)?>; 0135 </script> 0136 <script src="/theme/react/bundle/home-main-container-bundle.js" type="text/javascript"></script> 0137 </main>