%s libraries.'),$lo->count_all());
$output .= '
';
$output .= '
';
$select = array();
$select[NULL] = '';
foreach ($lo->find_all() as $library)
$select[$library->LIBRARY_NAME] = $library->LIBRARY_NAME;
$output .= Form::open('/library/detail',array('id'=>'library_detail'));
$output .= sprintf('%s: %s',_('Choose a storage pool to view'),Form::select('library_name',$select,NULL,array('id'=>'library_name')));
$output .= Form::submit('form_submit',_('Go'));
$output .= Form::close();
Block::add(array(
'title'=>_('TSM Libraries'),
'body'=>$output,
));
}
public function action_detail($library=NULL) {
if (is_null($library) AND (empty($_POST['library_name']) OR ! $library = $_POST['library_name'])) {
SystemMessage::add(array(
'title'=>_('LIBRARY_NAME is required'),
'type'=>'error',
'body'=>_('The library pool name is required.'),
));
Request::current()->redirect('library');
}
$lo = ORM::factory('library',$library);
if (! $lo->loaded()) {
SystemMessage::add(array(
'title'=>_('Unknown LIBRARY_NAME'),
'type'=>'error',
'body'=>sprintf(_('The library pool [%s] does not exist?.'),$library),
));
Request::current()->redirect('library');
}
$slots = DB::query(Database::SHOW,'SHOW SLOTS '.$lo)->execute();
Block::add(array(
'title'=>sprintf(_('Library Information for %s'),$lo->LIBRARY_NAME),
'body'=>View::factory('library/detail')
->set('lo',$lo)
->set('slots',$slots)
));
}
}
?>