Beispiel #1
0
 /**
  * Get the style text of the control
  * @return string style text
  */
 protected function getStyle()
 {
     $cls = $this->m_cssClass ? "class='" . $this->m_cssClass . "' " : null;
     $formobj = $this->getFormObj();
     if ($this->m_Width) {
         if ($this->m_Width >= 0) {
             $style .= "width:" . $this->m_Width . ";";
         }
     } else {
         if ($formobj->m_DataObjName && $this->m_FieldName) {
             $cType = strtoupper($this->m_Type);
             if ($cType != "TEXTAREA") {
                 //  $bizobj = BizSystem::GetObjectFactory()->getObject($formobj->m_DataObjName);
                 $bizobj = BizSystem::GetObjectFactory()->createObject($formobj->m_DataObjName);
                 $length = $bizobj->getField($this->m_FieldName)->m_Length;
                 if ($length && $length > 0) {
                     $width = $length * 10;
                     if ($width > 700) {
                         $width = 700;
                     }
                     $style .= "width:" . $width . ";";
                 }
             }
         }
     }
     if ($this->m_Height && $this->m_Height >= 0) {
         $style .= "height:" . $this->m_Height . ";";
     }
     if ($this->m_Upshift) {
         $style .= "text-transform:uppercase;";
     }
     if ($this->m_Style) {
         $style .= $this->m_Style;
     }
     if (!isset($style) && !$cls) {
         return null;
     }
     if (isset($style)) {
         $style = Expression::evaluateExpression($style, $formobj);
         $style = "style='{$style}'";
     }
     if ($cls) {
         $style = $cls . " " . $style;
     }
     return $style;
 }