Ticket #1120: #1120-27LivePlugin.diff
| File #1120-27LivePlugin.diff, 22.4 KB (added by peterb, 22 months ago) |
|---|
-
plugins/Live/API.php
### Eclipse Workspace Patch 1.0 #P trunk
33 33 } 34 34 return self::$instance; 35 35 } 36 36 37 37 const TYPE_FETCH_VISITS = 1; 38 38 const TYPE_FETCH_PAGEVIEWS = 2; 39 39 … … 70 70 /* 71 71 * @return Piwik_DataTable 72 72 */ 73 public function getLastVisitsDetails( $idSite, $limit = 1000, $minIdVisit = false )73 public function getLastVisitsDetails( $idSite, $limit = 25, $minIdVisit = false ) 74 74 { 75 75 Piwik::checkUserHasViewAccess($idSite); 76 $visitorDetails = $this->loadLastVisitorDetailsFromDatabase($idSite, $visitorId = null, $limit, $minIdVisit );76 $visitorDetails = $this->loadLastVisitorDetailsFromDatabase($idSite, $visitorId = null, $limit, $minIdVisit, true); 77 77 $dataTable = $this->getCleanedVisitorsFromDetails($visitorDetails, $idSite); 78 78 return $dataTable; 79 79 } … … 118 118 $visitorData = $this->loadLastVisitorInLastXTimeFromDatabase($idSite, $minutes, $days = 0, self::TYPE_FETCH_PAGEVIEWS); 119 119 return $visitorData; 120 120 } 121 121 122 122 /* 123 123 * @return Piwik_DataTable 124 124 */ … … 144 144 $sql = " 145 145 SELECT DISTINCT " .Piwik_Common::prefixTable('log_action').".name AS pageUrl 146 146 FROM " .Piwik_Common::prefixTable('log_link_visit_action')." 147 INNER JOIN " .Piwik_Common::prefixTable('log_action')." 147 INNER JOIN " .Piwik_Common::prefixTable('log_action')." 148 148 ON " .Piwik_Common::prefixTable('log_link_visit_action').".idaction_url = " .Piwik_Common::prefixTable('log_action').".idaction 149 149 WHERE " .Piwik_Common::prefixTable('log_link_visit_action').".idvisit = $idvisit; 150 150 "; … … 154 154 $sql = " 155 155 SELECT DISTINCT " .Piwik_Common::prefixTable('log_action').".name AS pageUrl 156 156 FROM " .Piwik_Common::prefixTable('log_link_visit_action')." 157 INNER JOIN " .Piwik_Common::prefixTable('log_action')." 157 INNER JOIN " .Piwik_Common::prefixTable('log_action')." 158 158 ON " .Piwik_Common::prefixTable('log_link_visit_action').".idaction_name = " .Piwik_Common::prefixTable('log_action').".idaction 159 159 WHERE " .Piwik_Common::prefixTable('log_link_visit_action').".idvisit = $idvisit; 160 160 "; … … 169 169 /* 170 170 * @return array 171 171 */ 172 private function loadLastVisitorDetailsFromDatabase($idSite, $visitorId = null, $limit = null, $minIdVisit = false )172 private function loadLastVisitorDetailsFromDatabase($idSite, $visitorId = null, $limit = null, $minIdVisit = false, $dateDependant = null) 173 173 { 174 174 $where = $whereBind = array(); 175 175 … … 188 188 $whereBind[] = $minIdVisit; 189 189 } 190 190 191 if(!empty($dateDependant)) { 192 $period = Piwik_Common::getRequestVar('period', false); 193 $date = Piwik_Common::getRequestVar('date', false); 194 $offset = Piwik_Common::getRequestVar('filter_offset', 0, "int"); 195 196 $limit = 25+(int)$offset; 197 } 198 199 // SQL Filter with provided period 200 if (!empty($period) && !empty($date)) { 201 202 $currentSite = new Piwik_Site($idSite); 203 $currentTimezone = $currentSite->getTimezone(); 204 $processedDate = Piwik_Date::factory($date, $currentTimezone); 205 $processedPeriod = Piwik_Period::factory($period, $processedDate); 206 207 array_push( $where, Piwik_Common::prefixTable('log_visit') . ".visit_first_action_time BETWEEN ? AND ?"); 208 array_push( $whereBind, 209 $processedPeriod->getDateStart()->toString(), 210 $processedPeriod->getDateEnd()->addDay(1)->toString()); 211 } 212 191 213 $sqlWhere = ""; 192 214 if(count($where) > 0) 193 215 { 194 216 $sqlWhere = " WHERE " . join(' AND ', $where); 195 217 } 196 218 197 $sql = "SELECT " . Piwik_Common::prefixTable('log_visit') . ".* , 219 $sql = "SELECT " . Piwik_Common::prefixTable('log_visit') . ".* , 198 220 " . Piwik_Common::prefixTable ( 'goal' ) . ".match_attribute 199 221 FROM " . Piwik_Common::prefixTable('log_visit') . " 200 LEFT JOIN ".Piwik_Common::prefixTable('log_conversion')." 222 LEFT JOIN ".Piwik_Common::prefixTable('log_conversion')." 201 223 ON " . Piwik_Common::prefixTable('log_visit') . ".idvisit = " . Piwik_Common::prefixTable('log_conversion') . ".idvisit 202 LEFT JOIN ".Piwik_Common::prefixTable('goal')." 224 LEFT JOIN ".Piwik_Common::prefixTable('goal')." 203 225 ON (" . Piwik_Common::prefixTable('goal') . ".idsite = " . Piwik_Common::prefixTable('log_visit') . ".idsite 204 226 AND " . Piwik_Common::prefixTable('goal') . ".idgoal = " . Piwik_Common::prefixTable('log_conversion') . ".idgoal) 205 227 AND " . Piwik_Common::prefixTable('goal') . ".deleted = 0 206 $sqlWhere228 $sqlWhere 207 229 ORDER BY idsite,idvisit DESC 208 230 LIMIT $limit"; 209 231 … … 235 257 236 258 if($days != 0) 237 259 { 238 $timeLimit = mktime(0, 0, 0, date("m"), date("d") - $days + 1, date("Y")); 239 $where[] = " visit_last_action_time > '".date('Y-m-d H:i:s', $timeLimit)."'"; 260 $oSite = new Piwik_Site($idSite); 261 $sTimezone = $oSite->getTimezone(); 262 263 $oDateLocalized = Piwik_Date::factory("now", $sTimezone); 264 $oDateUTC = Piwik_Date::factory("now"); 265 266 $aDate["utc"] = $oDateUTC->getTimestamp(); 267 $aDate["localized"] = $oDateLocalized->getTimestamp(); 268 269 $siDateOffsetInSeconds = $aDate["localized"] - $aDate["utc"]; 270 271 $dateWithOffsetToUTC = date('Y-m-d H:i:s', strtotime($oDateLocalized->toString("Y-m-d 00:00:00"))-($siDateOffsetInSeconds)); 272 273 $where[] = " visit_last_action_time > '".$dateWithOffsetToUTC."'"; 240 274 } 241 275 242 276 $sqlWhere = ""; … … 252 286 FROM " . Piwik_Common::prefixTable('log_visit') . " 253 287 $sqlWhere 254 288 ORDER BY idsite,idvisit DESC"; 255 }256 // Pages257 elseif($type == self::TYPE_FETCH_PAGEVIEWS)258 {289 } 290 // Pages 291 elseif($type == self::TYPE_FETCH_PAGEVIEWS) 292 { 259 293 $sql = "SELECT " . Piwik_Common::prefixTable('log_link_visit_action') . ".idaction_url 260 294 FROM " . Piwik_Common::prefixTable('log_link_visit_action') . " 261 INNER JOIN " . Piwik_Common::prefixTable('log_visit') . " 295 INNER JOIN " . Piwik_Common::prefixTable('log_visit') . " 262 296 ON " . Piwik_Common::prefixTable('log_visit') . ".idvisit = " . Piwik_Common::prefixTable('log_link_visit_action') . ".idvisit 263 $sqlWhere";264 }265 else266 {267 // no $type is set --> ERROR268 throw new Exception("type parameter is not properly set.");269 }297 $sqlWhere"; 298 } 299 else 300 { 301 // no $type is set --> ERROR 302 throw new Exception("type parameter is not properly set."); 303 } 270 304 271 305 // return $sql by fetching 272 306 return Piwik_FetchAll($sql, $whereBind); 273 307 } 274 275 308 309 276 310 /** 277 311 * Removes fields that are not meant to be displayed (md5 config hash) 278 312 * Or that the user should only access if he is super user (cookie, IP) 279 * 313 * 280 314 * @return void 281 315 */ 282 316 private function cleanVisitorDetails( &$visitorDetails ) … … 295 329 } 296 330 } 297 331 } 298 332 299 333 } -
plugins/Live/templates/index.tpl
61 61 $("#visitsTotal").load("index.php?module=Live&idSite={/literal}{$idSite}{literal}&action=ajaxTotalVisitors"); 62 62 } 63 63 64 // updates the visit table, to refresh the already presented vis otors pages64 // updates the visit table, to refresh the already presented visitors pages 65 65 function updateVisitBox() 66 66 { 67 67 $("#visitsLive").load("index.php?module=Live&idSite={/literal}{$idSite}{literal}&action=getLastVisitsStart"); … … 79 79 </script> 80 80 81 81 <style> 82 #visitsLive { 83 text-align:left; 84 font-size:90%; 82 #visitsLive { 83 text-align:left; 84 font-size:90%; 85 color:#444444; 86 } 87 #visitsLive .datetime, #visitsLive .country, #visitsLive .referer, #visitsLive .settings, #visitsLive .returning , #visitsLive .countActions{ 88 border-bottom: 1px solid #d3d1c5; 89 border-right:1px solid #d3d1c5; 90 padding:5px 5px 5px 12px; 85 91 } 86 #visitsLive .datetime, #visitsLive .country, #visitsLive .referer, #visitsLive .settings, #visitsLive .returning , #visitsLive .countActions{87 border-bottom:1px solid #C1DAD7;88 border-right:1px solid #C1DAD7;89 padding:5px 5px 5px 12px;90 }91 92 92 #visitsLive .datetime { 93 background:#D4E3ED url(plugins/CoreHome/templates/images/bg_header.jpg) repeat-x scroll 0 0; 94 border-top:1px solid #C1DAD7; 95 color:#6D929B; 96 margin:0; 97 text-align:left; 93 #visitsLive .datetime { 94 background:#E4E2D7; 95 border-top:1px solid #d3d1c5; 96 margin:0; 97 text-align:left; 98 98 } 99 99 100 #visitsLive .country { 101 color:#4F6B72; 102 background:#FFFFFF url(plugins/CoreHome/templates/images/bullet1.gif) no-repeat scroll 0 0; 100 #visitsLive .country { 101 background:#FFFFFF url(plugins/CoreHome/templates/images/bullet1.gif) no-repeat scroll 0 0; 103 102 } 104 103 105 #visitsLive .referer { 106 background:#F9FAFA none repeat scroll 0 0; 107 color:#797268; 104 #visitsLive .referer { 105 background:#F9FAFA none repeat scroll 0 0; 108 106 } 109 107 110 #visitsLive .pagesTitle { 111 display:block; 112 float:left; 113 padding-top: 3px; 108 #visitsLive .referer:hover { 109 background:#FFFFF7; 114 110 } 115 111 116 #visitsLive .countActions{117 background:#FFFFFF none repeat scroll 0 0;118 color:#4F6B72;112 #visitsLive .pagesTitle { 113 display:block; 114 float:left; 119 115 } 120 116 121 #visitsLive .settings { 122 background:#FFFFFF none repeat scroll 0 0; 123 color:#4F6B72; 124 } 117 #visitsLive .countActions { 118 background:#FFFFFF none repeat scroll 0 0; 119 } 125 120 126 #visitsLive .returning { 127 background:#F9FAFA none repeat scroll 0 0; 128 color:#797268; 129 } 121 #visitsLive .settings { 122 background:#FFFFFF none repeat scroll 0 0; 123 } 130 124 131 #visitsLive .visit { 132 } 125 #visitsLive .returning { 126 background:#F9FAFA none repeat scroll 0 0; 127 } 133 128 134 #visitsLive .alt { 135 } 129 #visitsLive .actions { 130 background:#F9FAFA none repeat scroll 0 0; 131 padding:0px 5px 0px 12px; 132 } 136 133 137 #visitsLive .actions {138 background:#F9FAFA none repeat scroll 0 0;139 color:#797268;140 padding:0px 5px 0px 12px;141 }142 143 134 </style> 144 135 {/literal} 145 136 -
plugins/Live/templates/visitorLog.tpl
1 <div class="home" id="content" style="display: block;"><a graphid="VisitsSummarygetEvolutionGraph" name="evolutionGraph"></a> 2 <h2>Besucherverlauf</h2> 3 4 <div id="{$properties.uniqueId}"> 5 6 {if isset($arrayDataTable.result) and $arrayDataTable.result == 'error'} 7 {$arrayDataTable.message} 8 {else} 9 {if count($arrayDataTable) == 0} 10 <a name="{$properties.uniqueId}"></a> 11 <div class="pk-emptyDataTable">{'CoreHome_ThereIsNoDataForThisReport'|translate}</div> 12 {else} 13 <a name="{$properties.uniqueId}"></a> 14 15 <table class="dataTable" cellspacing="0" width="100%" style="width:100%;"> 16 <thead> 17 <tr> 18 <th style="display:none"></th> 19 <th id="label" class="sortable label" style="cursor: auto;width:20%" width="20%"> 20 <div id="thDIV">{'Live_VisitorLog'|translate}<div></th> 21 <th id="label" class="sortable label" style="cursor: auto;width:20%" width="20%"> 22 <div id="thDIV">{'Source'|translate}<div></th> 23 <th id="label" class="sortable label" style="cursor: auto;width:60%" width="60%"> 24 <div id="thDIV">{'Actions_Actions'|translate}<div></th> 25 </tr> 26 </thead> 27 <tbody> 28 {php} $col = 0; {/php} 29 30 {foreach from=$arrayDataTable item=visitor} 31 <tr> 32 33 {php} 34 $col++; 35 if ($col % 2 ) 36 { 37 $label = "odd"; 38 } else { 39 $label = "even"; 40 } 41 {/php} 42 43 <td style="display:none;"></td> 44 <td class="label label{php} echo $label; {/php}" style="width:20%" width="20%"> 45 46 {$visitor.columns.serverDatePretty} - {$visitor.columns.serverTimePretty}<br/> 47 <img src="{$visitor.columns.countryFlag}" title="{$visitor.columns.country}, Provider {$visitor.columns.provider}" /> 48 <img src="{$visitor.columns.browserIcon}" title="{$visitor.columns.browser} with plugins {$visitor.columns.plugins} enabled" /> 49 <img src="{$visitor.columns.operatingSystemIcon}" title="{$visitor.columns.operatingSystem}, {$visitor.columns.resolution} ({$visitor.columns.screen})" /> 50 {if $visitor.columns.isVisitorGoalConverted}<img src="{$visitor.columns.goalIcon}" title="{$visitor.columns.goalType}" />{/if} 51 {if $visitor.columns.isVisitorReturning} <img src="plugins/Live/templates/images/returningVisitor.gif" title="Returning Visitor" />{/if} 52 <br/> 53 IP: {$visitor.columns.ip}<br/> 54 {if count($visitor.columns.pluginIcons) > 0} 55 <hr /> 56 {'UserSettings_Plugins'|translate}: {foreach from=$visitor.columns.pluginIcons item=pluginIcon} 57 <img src="{$pluginIcon.pluginIcon}" title="{$pluginIcon.pluginName|capitalize:true}" alt="{$pluginIcon.pluginName|capitalize:true}" /> 58 {/foreach} 59 {/if} 60 </td> 61 62 <td class="column{php} echo $label; {/php}" style="width:20%" width="20%"> 63 <div class="referer"> 64 {if $visitor.columns.refererType != 'directEntry'}{'Referer'|translate}: 65 {if !empty($visitor.columns.searchEngineIcon)} 66 <img src="{$visitor.columns.searchEngineIcon}" alt="{$visitor.columns.refererName}" /> 67 {/if} 68 <a href="{$visitor.columns.refererUrl}" target="_blank" style="text-decoration:underline;"> 69 {$visitor.columns.refererName} 70 71 {if !empty($visitor.columns.keywords)} 72 - "{$visitor.columns.keywords}"{/if} 73 {/if} 74 </a> 75 76 {if $visitor.columns.refererType == 'directEntry'}{'Direct_Entry'|translate}{/if} 77 </div> 78 </td> 79 <td class="column{php} echo $label; {/php}" style="width:60%" width="60%"> 80 <strong>{$visitor.columns.actionDetails|@count} {'Actions_Actions'|translate} - {$visitor.columns.visitLengthPretty}</strong> 81 <br /><br /> 82 <ol style="list-style:decimal inside none;"> 83 {foreach from=$visitor.columns.actionDetails item=action} 84 <li> 85 <a href="{$action.pageUrl}" target="_blank" style="text-decoration:underline;" title="{$action.pageUrl}"> 86 {$action.pageUrl|truncate:80:"...":true} 87 </a> 88 </li> 89 {/foreach} 90 </ol> 91 </td> 92 </tr> 93 {/foreach} 94 </tbody> 95 </table> 96 97 {/if} 98 {if $properties.show_footer} 99 {include file="CoreHome/templates/datatable_footer.tpl"} 100 {/if} 101 {include file="CoreHome/templates/datatable_js.tpl"} 102 {/if} 103 </div> 104 105 {literal} 106 <style> 107 hr { 108 background:none repeat scroll 0 0 transparent; 109 border-color:-moz-use-text-color -moz-use-text-color #EEEEEE; 110 border-style:none none solid; 111 border-width:0 0 1px; 112 color:#CCCCCC; 113 margin:0 2em 0.5em; 114 padding:0 0 0.5em; 115 } 116 117 </style> 118 {/literal} 119 </div> 120 No newline at end of file -
plugins/Live/Controller.php
30 30 public function widget($fetch = false) 31 31 { 32 32 $view = Piwik_View::factory('index'); 33 $view->idSite = Piwik_Common::getRequestVar('idSite'); 33 $view->idSite = Piwik_Common::getRequestVar('idSite'); 34 34 $view->visitorsCountHalfHour = $this->getUsersInLastXMin(30); 35 35 $view->visitorsCountToday = $this->getUsersInLastXDays(1); 36 36 $view->pisHalfhour = $this->getPageImpressionsInLastXMin(30); … … 42 42 43 43 public function getLastVisitsDetails($fetch = false) 44 44 { 45 $view = Piwik_ViewDataTable::factory( '');45 $view = Piwik_ViewDataTable::factory(); 46 46 $view->init( $this->pluginName, 47 47 __FUNCTION__, 48 'Live.getLastVisitsDetails', 49 'getPagesFromVisitId'); 50 // All colomns in DB which could be shown 51 //'ip', 'idVisit', 'countActions', 'isVisitorReturning', 'country', 'countryFlag', 'continent', 'provider', 'providerUrl', 'idSite', 52 //'serverDate', 'visitLength', 'visitLengthPretty', 'firstActionTimestamp', 'lastActionTimestamp', 'refererType', 'refererName', 53 //'keywords', 'refererUrl', 'searchEngineUrl', 'searchEngineIcon', 'operatingSystem', 'operatingSystemShortName', 'operatingSystemIcon', 54 //'browserFamily', 'browserFamilyDescription', 'browser', 'browserIcon', 'screen', 'resolution', 'screenIcon', 'plugins', 'lastActionDateTime', 55 //'serverDatePretty', 'serverTimePretty', 'actionDetails' 48 'Live.getLastVisitsDetails'); 56 49 57 $view->setColumnsToDisplay(array( 58 'idVisit', 59 'serverDatePretty', 60 'serverTimePretty', 61 'ip', 62 'countActions', 63 'visitLengthPretty', 64 'keywords', 65 'refererUrl', 66 'operatingSystemShortName', 67 'browser', 68 'screen', 69 'resolution', 70 'plugins', 71 )); 50 // All colomns in DB which could be shown 51 //'ip', 'idVisit', 'countActions', 'isVisitorReturning', 'country', 'countryFlag', 'continent', 'provider', 'providerUrl', 'idSite', 52 //'serverDate', 'visitLength', 'visitLengthPretty', 'firstActionTimestamp', 'lastActionTimestamp', 'refererType', 'refererName', 53 //'keywords', 'refererUrl', 'searchEngineUrl', 'searchEngineIcon', 'operatingSystem', 'operatingSystemShortName', 'operatingSystemIcon', 54 //'browserFamily', 'browserFamilyDescription', 'browser', 'browserIcon', 'screen', 'resolution', 'screenIcon', 'plugins', 'lastActionDateTime', 55 //'serverDatePretty', 'serverTimePretty', 'actionDetails' 72 56 73 $view->setColumnsTranslations(array(74 'idVisit' => Piwik_Translate(''),75 'serverDatePretty' => Piwik_Translate('Live_Date'),76 'serverTimePretty' => Piwik_Translate('Live_Time'),77 'ip' => 'IP',78 'countActions' => Piwik_Translate('VisitorInterest_ColumnPagesPerVisit'),79 'visitLengthPretty' => Piwik_Translate('VisitorInterest_ColumnVisitDuration'),80 'keywords' => Piwik_Translate('Referers_ColumnKeyword'),81 'refererUrl' => Piwik_Translate('Live_Referrer_URL'),82 'operatingSystemShortName' => Piwik_Translate('UserSettings_ColumnOperatingSystem'),83 'browser' => Piwik_Translate('UserSettings_ColumnBrowser'),84 'screen' => Piwik_Translate('UserSettings_ColumnTypeOfScreen'),85 'resolution' => Piwik_Translate('UserSettings_ColumnResolution'),86 'plugins' => Piwik_Translate('UserSettings_ColumnPlugin'),87 ));88 89 57 $view->disableSort(); 90 $view->setLimit(10); 91 $view->disableExcludeLowPopulation(); 58 $view->setLimit(20); 59 $view->setTemplate("Live/templates/visitorLog.tpl"); 60 //$view->disableOffsetInformation(); 92 61 $view->setSortedColumn('idVisit', 'ASC'); 93 62 $view->disableSearchBox(); 63 $view->disableOffsetInformation(); 94 64 // "Include low population" link won't be displayed under this table 95 65 $view->disableExcludeLowPopulation(); 66 $view->queueFilter('ColumnCallbackAddMetadata', array('label', 'logo', 'Piwik_getPluginsLogo')); 96 67 // disable the tag cloud, pie charts, bar chart icons 97 68 $view->disableShowAllViewsIcons(); 98 69 // disable the button "show more datas" … … 101 72 return $this->renderView($view, $fetch); 102 73 } 103 74 104 function getPagesFromVisitId( $fetch = false)105 {106 $view = Piwik_ViewDataTable::factory('');107 $view->init( $this->pluginName,108 __FUNCTION__,109 'Live.getLastVisitsForVisitor',110 'getPagesFromVisitId');111 112 return $this->renderView($view, $fetch);113 }114 115 75 public function getLastVisitsStart($fetch = false) 116 76 { 117 77 $view = Piwik_View::factory('lastVisits'); 118 $view->idSite = Piwik_Common::getRequestVar('idSite'); 119 78 $view->idSite = Piwik_Common::getRequestVar('idSite'); 79 120 80 $view->visitors = $this->getLastVisits(10); 121 81 122 82 $rendered = $view->render($fetch); … … 167 127 public function ajaxTotalVisitors($fetch = false) 168 128 { 169 129 $view = Piwik_View::factory('totalVisits'); 170 $view->idSite = Piwik_Common::getRequestVar('idSite'); 130 $view->idSite = Piwik_Common::getRequestVar('idSite'); 171 131 $view->visitorsCountHalfHour = $this->getUsersInLastXMin(30); 172 132 $view->visitorsCountToday = $this->getUsersInLastXDays(1); 173 133 $view->pisHalfhour = $this->getPageImpressionsInLastXMin(30); … … 179 139 { 180 140 return $rendered; 181 141 } 182 echo $rendered; 142 echo $rendered; 183 143 } 184 144 } -
plugins/Live/Visitor.php
71 71 'resolution' => $this->getResolution(), 72 72 'screenIcon' => $this->getScreenTypeIcon(), 73 73 'plugins' => $this->getPlugins(), 74 'pluginIcons' => $this->getPluginIcons(), 74 75 'lastActionDateTime' => $this->getDateTimeLastAction(), 75 76 'isVisitorGoalConverted' => $this->isVisitorGoalConverted(), 76 77 'goalIcon' => $this->getGoalIcon(), … … 80 81 81 82 function getServerDate() 82 83 { 83 return date('Y-m-d', strtotime($this->details['visit_last_action_time'])); 84 return date('Y-m-d', strtotime($this->details['visit_last_action_time'])); 84 85 } 85 86 86 87 function getIp() … … 150 151 function getRefererType() 151 152 { 152 153 $map = array( 153 Piwik_Common::REFERER_TYPE_SEARCH_ENGINE => 'searchEngine',154 Piwik_Common::REFERER_TYPE_WEBSITE => 'website',155 Piwik_Common::REFERER_TYPE_DIRECT_ENTRY => 'directEntry',156 Piwik_Common::REFERER_TYPE_CAMPAIGN => 'campaign',154 Piwik_Common::REFERER_TYPE_SEARCH_ENGINE => 'searchEngine', 155 Piwik_Common::REFERER_TYPE_WEBSITE => 'website', 156 Piwik_Common::REFERER_TYPE_DIRECT_ENTRY => 'directEntry', 157 Piwik_Common::REFERER_TYPE_CAMPAIGN => 'campaign', 157 158 ); 158 159 if(isset($map[$this->details['referer_type']])) 159 160 { … … 185 186 function getSearchEngineUrl() 186 187 { 187 188 if($this->getRefererType() == 'searchEngine' 188 && !empty($this->details['referer_name']))189 && !empty($this->details['referer_name'])) 189 190 { 190 191 return Piwik_getSearchEngineUrlFromName($this->details['referer_name']); 191 192 } … … 227 228 return implode(", ", $return); 228 229 } 229 230 231 function getPluginIcons() 232 { 233 $sPluginNames = $this->getPlugins(); 234 if( !empty($sPluginNames) ) 235 { 236 $aPluginNames = explode(", ", $sPluginNames); 237 $aPluginIcons = array(); 238 239 foreach($aPluginNames as $sPlugin) { 240 $aPluginIcons[] = array("pluginIcon" =>Piwik_getPluginsLogo($sPlugin), "pluginName" =>$sPlugin); 241 } 242 return $aPluginIcons; 243 } 244 return null; 245 } 246 230 247 function getOperatingSystem() 231 248 { 232 249 return Piwik_getOSLabel($this->details['config_os']); … … 310 327 if(isset($this->details['match_attribute'])){ 311 328 $goalicon = ""; 312 329 switch ($this->details['match_attribute']) { 313 case "url":314 $goalicon = "plugins/Live/templates/images/goal.png";315 break;316 case "file":317 $goalicon = "plugins/Live/templates/images/download.png";318 break;319 case "external_website":320 $goalicon = "plugins/Live/templates/images/outboundlink.png";321 break;330 case "url": 331 $goalicon = "plugins/Live/templates/images/goal.png"; 332 break; 333 case "file": 334 $goalicon = "plugins/Live/templates/images/download.png"; 335 break; 336 case "external_website": 337 $goalicon = "plugins/Live/templates/images/outboundlink.png"; 338 break; 322 339 } 323 340 return $goalicon; 324 341 }
