%s stgpool pools.'),$so->count_all()); $output .= '
'; $output .= '
'; $select = array(); $select[NULL] = ''; foreach ($so->find_all() as $stgpool) $select[$stgpool->STGPOOL_NAME] = $stgpool->STGPOOL_NAME; $output .= Form::open('/stgpool/detail',array('id'=>'stgpool_detail')); $output .= sprintf('%s: %s',_('Choose a storage pool to view'),Form::select('stgpool_name',$select,NULL,array('id'=>'stgpool_name'))); $output .= Form::submit('form_submit',_('Go')); $output .= Form::close(); Block::add(array( 'title'=>_('TSM Storage Pools'), 'body'=>$output, )); } public function action_detail() { $stgpool = $this->request->param('id'); if (is_null($stgpool) AND (empty($_POST['stgpool_name']) OR ! $stgpool = $_POST['stgpool_name'])) { SystemMessage::add(array( 'title'=>_('STGPOOL_NAME is required'), 'type'=>'error', 'body'=>_('The stgpool pool name is required.'), )); HTTP::redirect('stgpool'); } $so = ORM::factory('STGPOOL',$stgpool); if (! $so->loaded()) { SystemMessage::add(array( 'title'=>_('Unknown STGPOOL_NAME'), 'type'=>'error', 'body'=>sprintf(_('The stgpool pool [%s] does not exist?.'),$stgpool), )); HTTP::redirect('stgpool'); } Block::add(array( 'title'=>sprintf(_('Storage Pool Information for %s'),$so->STGPOOL_NAME), 'body'=>View::factory('stgpool/detail')->set('so',$so) )); } } ?>