Skip to content
Snippets Groups Projects

add support for multiple instances

Merged Hahn Axel (hahn) requested to merge add-instances-switcher into master
7 files
+ 57
3
Compare changes
  • Side-by-side
  • Inline
Files
7
@@ -217,6 +217,26 @@ class cronlogrenderer extends cronlog{
@@ -217,6 +217,26 @@ class cronlogrenderer extends cronlog{
return $this->renderCronlogs($aData);
return $this->renderCronlogs($aData);
}
}
 
/**
 
* get html code for a switcher of multiple instances
 
*
 
* @param array $aData result of $oCL->getServerLogs()
 
* @return string
 
*/
 
public function renderInstances(){
 
if(count($this->_aInstances) < 2){
 
return false;
 
}
 
$sReturn='';
 
$sServer=isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : false;
 
 
foreach($this->_aInstances as $sInstance => $sUrl){
 
$sHost=parse_url($sUrl, PHP_URL_HOST);
 
$sClass=($sServer && $sServer==$sHost) ? 'active' : '';
 
$sReturn.='<a class="'.$sClass.'" href="'.$sUrl.'" title="'.$sUrl.'">'.$sInstance.'</a> ';
 
}
 
return $sReturn;
 
}
/**
/**
* get html code for a table with history of executed cronjobs
* get html code for a table with history of executed cronjobs
*
*
Loading