';
if( AKEEBA_JVERSION == '16' ) {
$html .= ''.JText::_('STATS_LABEL_START').' | '.$startTime->format(JText::_('DATE_FORMAT_LC4'), true).' |
';
} else {
$html .= ''.JText::_('STATS_LABEL_START').' | '.$startTime->toFormat(JText::_('DATE_FORMAT_LC4')).' |
';
}
$html .= ''.JText::_('STATS_LABEL_DESCRIPTION').' | '.$record['description'].' |
';
$html .= ''.JText::_('STATS_LABEL_STATUS').' | '.$status.' |
';
$html .= ''.JText::_('STATS_LABEL_ORIGIN').' | '.$origin.' |
';
$html .= ''.JText::_('STATS_LABEL_TYPE').' | '.$type.' |
';
$html .= '
';
return $html;
}
/**
* Delete the stats record whose ID is set in the model
* @param int $id Backup record whose files we have to delete
* @return bool True on success
*/
public function delete($id)
{
$db =& $this->getDBO();
if( (!is_numeric($id)) || ($id <= 0) )
{
$this->setError(JText::_('STATS_ERROR_INVALIDID'));
return false;
}
// Try to delete files
$this->deleteFile($id);
if(!AEPlatform::delete_statistics($id))
{
$this->setError($db->getError());
return false;
}
return true;
}
/**
* Delete the backup file of the stats record whose ID is set in the model
* @param int $id Backup record whose files we have to delete
* @return bool True on success
*/
public function deleteFile($id)
{
$db =& $this->getDBO();
if( (!is_numeric($id)) || ($id <= 0) )
{
$this->setError(JText::_('STATS_ERROR_INVALIDID'));
return false;
}
$stat = AEPlatform::get_statistics($id);
$allFiles = AEUtilStatistics::get_all_filenames($stat, false);
$registry =& AEFactory::getConfiguration();
$status = true;
jimport('joomla.filesystem.file');
foreach($allFiles as $filename)
{
$new_status = JFile::delete($filename);
$status = $status ? $new_status : false;
}
return $status;
}
/**
* Get a pagination object
*
* @access public
* @return JPagination
*
*/
public function &getPagination($filters = null)
{
if( empty($this->_pagination) )
{
// Import the pagination library
jimport('joomla.html.pagination');
// Prepare pagination values
$total = AEPlatform::get_statistics_count($filters);
$limitstart = $this->getState('limitstart');
$limit = $this->getState('limit');
// Create the pagination object
$this->_pagination = new JPagination($total, $limitstart, $limit);
}
return $this->_pagination;
}
}