<?php

include_once(dirname(__FILE__).'/../../Base/Module.php');

class ClientView extends View
{
  var $ItemListFormClass = array(
    'Title' => 'Verze klienta',
    'Table' => 'Client',
    'DefaultOrderColumn' => 'BuildNumber',
    'DefaultOrderDirection' => 1,
    'Items' => array(
      'Version' => array('Type' => 'String', 'Caption' => 'Verze', 'Default' => ''),
      'BuildNumber' => array('Type' => 'Integer', 'Caption' => 'Číslo sestavení', 'Default' => ''),
      'ReleaseDate' => array('Type' => 'Date', 'Caption' => 'Datum vydání', 'Default' => ''),
      'Title' => array('Type' => 'String', 'Caption' => 'Titulek', 'Default' => ''),
    ),
  );
  
  function ShowListOnRow($Row)
  {
    $Row['Version'] = '<a href="http://www.wowwiki.com/Patch_'.$Row['Version'].'">'.$Row['Version'].'</a>';
    return($Row);
  }
  
  function ItemList()
  {
    $Output = '<h4>Verze herního klienta</h4>';
    $Table = new Table($this->ItemListFormClass, $this->System);
    $Table->OnRow = array($this, 'ShowListOnRow');
    $Table->LoadValuesFromDatabase($this->Database);
    $Output .= $Table->Show();
    return($Output);
  } 
}
