<?php

include_once(dirname(__FILE__).'/../../Base/View.php');

class ClusterView extends View
{
  var $ItemListFormClass = array(
    'Title' => 'Uzly skupiny',
    'Table' => 'ClusterNode',
    'DefaultOrderColumn' => 'NetworkAddress',
    'DefaultOrderDirection' => 1,
    'Items' => array(
      'NetworkAddress' => array('Type' => 'String', 'Caption' => 'Síťová adresa', 'Default' => ''),
    ),
  );
  
  function ShowListOnRow($Row)
  {
    //$Row['Version'] = '<a href="http://www.wowwiki.com/Patch_'.$Row['Version'].'">'.$Row['Version'].'</a>';
    return($Row);
  }
  
  function ItemList()
  {
    $Output = '<h4>Uzly ve skupině</h4>';
    $Table = new Table($this->ItemListFormClass, $this->System);
    $Table->OnRow = array($this, 'ShowListOnRow');
    $Table->LoadValuesFromDatabase($this->Database);
    $Output .= $Table->Show();
    if($this->System->Modules['Permission']->Check('Cluster', 'Show'))
    {
      $Output .= '<div style="text-align: center">';
      $Output .= ' <a href="?Module=Cluster&amp;Action=Add">Přidat</a>';
      $Output .= '</div>';
    }
    return($Output);
  } 
}
