rs->isEmpty()) {
echo '
'.$msg_no_entry.'
';
}
else {
$pager = new pager($page,$this->rs_count,$nb_per_page,10);
if (!$search) {
$pager->base_url = $url.'&tab='.$type.'&page=%s';
}
else {
$pager->var_pager = 'page';
}
$html_block =
''.
''.
''.
'| '.$msg_th_label.' | '.
''.__('Lastest Version').' | '.
''.__('Quick description').' | '.
''.__('Actions').' | '.
'
'.
''.
'%s'.
'
';
echo '';
$blocks = explode('%s',$html_block);
echo $blocks[0];
$this->rs->index(((integer)$page - 1) * $nb_per_page);
$iter = 0;
while ($iter < $nb_per_page) {
echo $this->{$lineMethod}($url);
if ($this->rs->isEnd()) {
break;
}
else {
$this->rs->moveNext();
$iter++;
}
}
echo $blocks[1];
echo '';
}
}
/**
* Return a generic plugin row
*
* @param string url
*
* @return string
*/
private function pluginLine($url)
{
return
''."\n".
# Extension
'| '.
''.html::escapeHTML($this->rs->id).''.
" | \n".
# Version
''.
html::escapeHTML($this->rs->version).
" | \n".
# Quick description
''.
' '.html::escapeHTML($this->rs->label).' '.
''.html::escapeHTML($this->rs->desc).' '.
__('by').' '.html::escapeHTML($this->rs->author).' '.
'( '.__('More details').' )'.
" | \n".
# Action
''.
''.
" | \n".
'
'."\n";
}
/**
* Return a generic theme row
*
* @param string url
*
* @return string
*/
private function themeLine($url)
{
return
''."\n".
# Extension
'| '.
''.html::escapeHTML($this->rs->id).''.
' .') '.
" | \n".
# Version
''.
html::escapeHTML($this->rs->version).
" | \n".
# Quick description
''.
' '.html::escapeHTML($this->rs->label).' '.
''.html::escapeHTML($this->rs->desc).' '.
__('by').' '.html::escapeHTML($this->rs->author).' '.
'( '.__('More details').' )'.
" | \n".
# Action
''.
''.
" | \n".
'
'."\n";
}
}
/**
* Class daModulesUpdateList
*/
class daModulesUpdateList
{
protected $rs;
protected $nb;
/**
* Class constructor
*/
public function __construct($core,$rs,$nb)
{
$this->core = $core;
$this->rs = $rs;
$this->nb = $nb;
$this->p_link = '%s';
}
/**
* Display data table for plugins and themes update lists
*
* @param string type
* @param string url
*
* @return string
*/
public function display($type,$url)
{
$type = ($type == 'themes') ? 'themes' : 'plugins';
if ($type == 'themes') {
$msg_th_label = __('Theme');
$lineMethod = 'themeLine';
}
else {
$msg_th_label = __('Plugins');
$lineMethod = 'pluginLine';
}
$iter = 0;
$items = '';
$html_block =
'';
while ($iter < $this->rs->count()) {
$items .= $this->{$lineMethod}($url);
$this->rs->moveNext();
$iter++;
}
echo $this->nb > 0 ? sprintf($html_block,$type,$items) : '';
}
/**
* Return a update plugin row
*
* @param string url
*
* @return string
*/
private function pluginLine($url)
{
$support =
strlen($this->rs->support) > 0 ?
sprintf($this->p_link,$this->rs->support,'support modal',__('Support')) :
''.__('No support available').'';
return
''."\n".
# Extension
'| '.
form::checkbox(array('plugins_id[]'),$this->rs->id).
''.html::escapeHTML($this->rs->id).''.
" | \n".
# Version
''.
html::escapeHTML($this->rs->version).
" | \n".
# Quick description
''.
' '.html::escapeHTML($this->rs->label).' '.
''.html::escapeHTML($this->rs->desc).' '.
__('by').' '.html::escapeHTML($this->rs->author).' '.
'( '.
__('More details').' - '.$support.' )'.
" | \n".
'
'."\n";
}
/**
* Return a update theme row
*
* @param string url
*
* @return string
*/
private function themeLine($url)
{
$support =
strlen($this->rs->support) > 0 ?
sprintf($this->p_link,$this->rs->support,'support modal',__('Support')) :
''.__('No support available').'';
return
''."\n".
# Themes
'| '.
form::checkbox(array('themes_id[]'),$this->rs->id).
''.html::escapeHTML($this->rs->id).''.
' .') '.
" | \n".
# Version
''.
html::escapeHTML($this->rs->version).
" | \n".
# Quick description
''.
' '.html::escapeHTML($this->rs->label).' '.
''.html::escapeHTML($this->rs->desc).' '.
__('by').' '.html::escapeHTML($this->rs->author).' '.
'( '.
__('More details').' - '.$support.' )'.
" | \n".
'
'."\n";
}
}
?>