EnsEMBL::Web::Component::Website::Interface NewsSelectToEdit
Included librariesPackage variablesGeneral documentationMethods
Toolbar
WebCvsRaw content
Package variables
No package variables defined.
Included modules
EnsEMBL::Web::Data::NewsItem
Inherit
EnsEMBL::Web::Component
Synopsis
No synopsis!
Description
No description!
Methods
_init
No description
Code
caption
No description
Code
content
No description
Code
Methods description
None available.
Methods code
_initdescriptionprevnextTop
sub _init {
  my $self = shift;
  $self->cacheable( 0 );
  $self->ajaxable(  0 );
}
captiondescriptionprevnextTop
sub caption {
  my $self = shift;
  return '';
}
contentdescriptionprevnextTop
sub content {
  my $self = shift;
  my $object = $self->object;
  my $html = '<h1>News Stories</h1>';
  my $release_id = $object->param('release_id') || $object->species_defs->ENSEMBL_VERSION;

  my @stories = EnsEMBL::Web::Data::NewsItem->search('release_id' => $release_id);
  my @sorted = sort {
                $a->team cmp $b->team || $a->title cmp $b->title
              } @stories;

  my @values = ({'name' => '-- Select --', 'value' => ''});
  foreach my $story (@sorted) {
    next unless $story->declaration;
    push @values, {'name' => $story->team.' - '.substr($story->declaration, 0, 50), 'value' => $story->id};
  }

  my $form = EnsEMBL::Web::Form->new('select_news', '/Website/News/Edit', 'post');

  $form->add_element(
    'name' => 'id',
    'type' => 'DropDown',
    'label' => 'Declarations',
    'select' => 'select',
    'values' =>\@ values,
  );
  $form->add_element(
    'name' => 'submit',
    'type' => 'Submit',
    'value' => 'Next',
  );
  $html .= $form->render;

  return $html;
}

1;
}
General documentation
No general documentation available.