Changeset 6767

Show
Ignore:
Timestamp:
09/17/08 22:21:08 (5 years ago)
Author:
p_lindheimer
Message:

don't print out submit button in guielements if no fields form fields are generated

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/2.5/amp_conf/htdocs/admin/components.class.php

    r6756 r6767  
    33// 
    44$_guielement_tabindex = 1; 
     5$_guielement_formfields = 0; 
    56 
    67class component { 
     
    354355    $tabindex = guielement::gettabindex(); 
    355356    // End of table 
    356     $htmlout .= "\t<tr>\n"; 
    357     $htmlout .= "\t\t<td colspan=\"2\">"; 
    358     $htmlout .= "<h6>"; 
    359     $htmlout .= "<input name=\"Submit\" type=\"submit\" tabindex=\"$tabindex\" value=\""._("Submit")."\">"; 
    360     $htmlout .= "</h6>"; 
    361     $htmlout .= "</td>\n"; 
    362     $htmlout .= "\t</tr>\n"; 
     357 
     358    // Don't put a submit button if there were not form fields generated 
     359    // 
     360    if (guielement::getformfields()) { 
     361      $htmlout .= "\t<tr>\n"; 
     362      $htmlout .= "\t\t<td colspan=\"2\">"; 
     363      $htmlout .= "<h6>"; 
     364      $htmlout .= "<input name=\"Submit\" type=\"submit\" tabindex=\"$tabindex\" value=\""._("Submit")."\">"; 
     365      $htmlout .= "</h6>"; 
     366      $htmlout .= "</td>\n"; 
     367      $htmlout .= "\t</tr>\n"; 
     368    } 
    363369    $htmlout .= "</table><!-- end of table $formname -->\n\n"; 
    364370 
     
    473479    $_guielement_tabindex = $new_tab; 
    474480  } 
     481  function incrementfields() { 
     482    global $_guielement_formfields; 
     483    $_guielement_formfields++; 
     484  } 
     485  function getformfields() { 
     486    global $_guielement_formfields; 
     487    return $_guielement_formfields; 
     488  } 
    475489} 
    476490 
     
    524538    // this will be the html that makes up the input element 
    525539    $this->html_input = ''; 
     540    guielement::incrementfields(); 
    526541  } 
    527542