initial edit page work

This commit is contained in:
Doug Bell 2010-04-30 10:29:40 -05:00
parent 3ae21d6349
commit ad96c88a36
9 changed files with 259 additions and 368 deletions

View file

@ -125,7 +125,14 @@ sub toHtml {
my ( $self ) = @_;
my $html = $self->getHeader;
$html .= join "", map { $_->toHtml } @{$self->objects};
for my $obj ( @{ $self->objects } ) {
if ( $obj->isa('WebGUI::Form::Control') ) {
$html .= $obj->toHtmlWithWrapper;
}
else {
$html .= $obj->toHtml;
}
}
$html .= $self->getFooter;
return $html;

View file

@ -56,8 +56,8 @@ sub addField {
# Load the class
# Try to load the WebGUI Field first in case we conveniently overlap with a common name
# (like Readonly)
if ( $INC{'WebGUI/Form/'.$file} || try { require 'WebGUI/Form/' . $file } ) {
$type = 'WebGUI::Form::' . $type;
if ( $INC{'WebGUI/Form/'. ucfirst $file} || try { require 'WebGUI/Form/' . ucfirst $file } ) {
$type = 'WebGUI::Form::' . ucfirst $type;
}
elsif ( !$INC{$file} && !try { require $file; } ) {
confess sprintf "Could not load form control class %s", $type;

View file

@ -93,7 +93,15 @@ Render the objects in this tab
sub toHtml {
my ( $self ) = @_;
my $html = join "", map { $_->toHtml } @{$self->objects};
my $html;
for my $obj ( @{ $self->objects } ) {
if ( $obj->isa('WebGUI::Form::Control') ) {
$html .= $obj->toHtmlWithWrapper;
}
else {
$html .= $obj->toHtml;
}
}
return $html;
}

View file

@ -62,10 +62,17 @@ sub addTab {
sub toHtml {
my ( $self ) = @_;
my ( $style, $url ) = $self->session->quick(qw( style url ));
$style->setLink( $url->extras("yui/build/tabview/assets/skins/sam/tabview.css"), { rel => "stylesheet", type => "text/css" } );
$style->setScript( $url->extras("yui/build/yahoo-dom-event/yahoo-dom-event.js") );
$style->setScript( $url->extras("yui/build/element/element-min.js") );
$style->setScript( $url->extras("yui/build/tabview/tabview-min.js") );
my $html = sprintf( '<div id="%s" class="yui-navset">', $self->name )
. '<ul class="yui-nav">'
;
for ( my $i = 0; $i < @{$self->tabs}; $i++ ) {
my $tab = $self->tabs->[$i];
$html .= sprintf '<li><a href="#tab%i"><em>%s</em></a></li>', $i, $tab->label;
@ -83,7 +90,9 @@ sub toHtml {
$html .= '</div>'
. '</div>'
. q{<script type="text/javascript">}
. sprintf( q{var tabView = new YAHOO.widget.TabView('%s');}, $self->name )
. sprintf( q'YAHOO.util.Event.onContentReady( "%s", function () {', $self->name )
. sprintf( q'new YAHOO.widget.TabView("%s");', $self->name )
. q' } );'
. q{</script>}
;