Gidday All,

Im modifying this package. What it does is produce the html for our 
presentation templates of our content management system.

I have to keep track of the number of forms on my page so I can create 
unique names for them, to do that I have initiated a variable FRM_CNT.

One of my more experienced colleagues said I should do this in the 
constructor. As below.

The modification I have to make is to add a sub that produces the HTML for 
a drop down box, one of the first tasks of this sub is to generate the 
form name

sub getDropDownHTML {
  my ($self,$lstr) = @_;
  my $outHTML = "";
  my $formName = 'form'.$self->?
  return($outHTML);
}

How do I reference the FRM_CNT variable of the package, am I on the right 
track ?

Any help appreciated.
Thank You
Colin

package aphrweb::htmlHelper;
use strict;

#----------------------------------------------------------------------------------------
# This package builds HTML used:
#  - in 'old' workflow (new workflow (cwf) is done in cwfHelper)
#  - in TPLs (converts DCR fields to HTML)
#----------------------------------------------------------------------------------------

# globals
my %w3styles = ();
my $needStyles = 1;
my $tabCnt = 0;

#----------------------------------------------------------------------------------------
# Constructor.
#----------------------------------------------------------------------------------------
sub new
{
  my ($proto, $sysData) = @_;
  my $class = ref($proto) || $proto;

  my $object = {};
  bless $object, $class;

  $object->{"SYS_DATA"}  = $sysData;
  $object->{"W3_STYLES"} = "";

  $object->{"ASSET_URI"}    = "/hr/global/yourcareer";
  $object->{"ASSET_FOLDER"} = "globalassets";
  $object->{"HTML_BR"}      = "global";
  ++$object->{"FRM_CNT"};

  my $debug = $sysData->{"debug"};
  $debug->cp3Debug("htmlHelper::new","src='".$sysData->{"SRC"}."'");

  return $object;
}

Reply via email to