[ PHPXref.com ] [ Generated: Sun Jul 20 21:13:29 2008 ] [ YALA 0.32 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/ -> htmloutput.inc.php (source)

   1  <?php
   2  #
   3  # HTMLOutput is a class which is supposed to contain all the ugly HTML code..
   4  # The idea is to make all the other code clean, and call functions from here to
   5  # do the ugly html output.
   6  #
   7  
   8  class HTMLOutput {
   9  
  10      var $bgcolor;
  11  
  12  	function HTMLOutput() {
  13      }
  14  
  15  	function resultsHeader($dn) {
  16  ?><!-- resultsHeader -->
  17  <TABLE CLASS="results-outer" WIDTH="98%">
  18      <TR CLASS="dnbgcolor"><TD CLASS="view-dnattr" ALIGN="center"><?php echo $dn; ?></TD></TR>
  19  <?php
  20      }
  21  
  22  	function resultsInnerHeader() {
  23  ?>    <!-- resultsInnerHeader -->
  24      <TR><TD>
  25      <TABLE CLASS="results-inner" WIDTH="100%">
  26  <?php
  27      }
  28  
  29  
  30  	function resultsInnerRow($attr, $value, $status) {
  31          if (!$attr) $attr = "&nbsp;";
  32          if (!$value) $value = "&nbsp;";
  33  ?>        <TR><TD CLASS="results-inner" WIDTH="40%"><?php echo $attr; ?></TD><TD CLASS="results-inner" WIDTH="40%"><?php echo $value; ?></TD><TD CLASS=<?php
  34          switch ($status) {
  35              case 1: echo "\"success\">OK"; break;
  36              case -1: echo "\"success\">&nbsp;"; break;
  37              default: echo "\"failed\">FAILED";
  38          }
  39  ?></TD></TR>
  40  <?php
  41      }
  42  
  43  	function resultsInnerFooter() {
  44  ?>    </TABLE>
  45      </TD></TR>
  46      <!-- resultsInnerFooter -->
  47  <?php
  48      }
  49      
  50  	function resultsTitle($text) {
  51  ?>    <TR CLASS="bgcolor1"><TD><B><?php echo $text; ?></B></TD></TR>
  52  <?php
  53      }
  54  
  55  	function resultsFooter() {
  56  ?></TABLE>
  57  <!-- resultsFooter -->
  58  <?php
  59      }
  60  
  61  
  62  
  63  
  64  
  65      function viewHeader($dn = "") {
  66  ?><!-- viewHeader -->
  67  <FORM NAME="form" METHOD="post" ACTION="<?php echo MAINFILE; ?>" <?php if (ENABLE_JAVASCRIPT) echo " onSubmit=\"javascript:return confirm('Are you sure you want to commit a \''+this.chosen_action.value+'\' operation on this entry?');\""; ?> >
  68  <?php if ($dn) echo "<INPUT TYPE=\"hidden\" NAME=\"entry\" VALUE=\"".$dn."\">\n"; ?>
  69  <INPUT TYPE="hidden" NAME="chosen_action" VALUE="none">
  70  
  71  <TABLE CLASS="view-outer" WIDTH="98%">
  72      <TR CLASS="dnbgcolor"><TD CLASS="view-dnattr" ALIGN="center"><?php echo $dn; ?></TD></TR>
  73  <?php
  74      }
  75  
  76  	function modrdnHeader($dn = "") {
  77  ?><!-- modrdnHeader -->
  78  <TABLE CLASS="view-outer" WIDTH="98%">
  79      <TR CLASS="dnbgcolor"><TD CLASS="view-dnattr" ALIGN="center"><?php echo $dn; ?></TD></TR>
  80  <?php
  81      }
  82  
  83  
  84  	function viewInnerHeader() {
  85  ?>    <!--viewInnerHeader -->
  86      <TR><TD>
  87      <TABLE CLASS="view-inner" WIDTH="100%">
  88  <?php
  89      }
  90  
  91  	function viewInnerRowDN($dn) {
  92          echo "
  93          <TR CLASS=\"bgcolor1\"><TD CLASS=\"view-dnattr\">";
  94  echo "<ACRONYM TITLE=\"Disntinguished Name\">dn</ACRONYM>&nbsp;<FONT";
  95  echo " SIZE=\"-2\">[&nbsp;<A HREF=\"".MAINFILE."?do=modrdn_form&amp;entry=";
  96  echo urlencode($dn)."\">Modify DN</A>&nbsp;]&nbsp;</FONT></TD>";
  97  echo "<TD><INPUT TYPE=\"text\" NAME=\"dn\" VALUE=\"".formatOutputStr($dn);
  98  echo "\" SIZE=\"".INPUT_TEXT_SIZE."\"></TD></TR>\n";
  99  
 100      }
 101  
 102  	function modrdnInnerRowDN($dn) {
 103          echo "
 104          <TR CLASS=\"bgcolor1\"><TD CLASS=\"view-dnattr\">";
 105  echo "<ACRONYM TITLE=\"The DN before the modifictation\">dn</ACRONYM></TD>";
 106  echo "<TD>".formatOutputStr($dn)."</TD></TR>\n";
 107  
 108      }
 109  
 110  
 111  	function modrdnInnerRow($attr, $value, $acronym) {
 112  
 113          # Very stupid color changing
 114          if (isset($this->bgcolor) && $this->bgcolor == "bgcolor2") 
 115              $this->bgcolor = "bgcolor1";
 116          else
 117              $this->bgcolor = "bgcolor2";
 118  
 119          $str = 
 120  "        <TR CLASS=\"".$this->bgcolor."\"><TD CLASS=\"attr\">";
 121          if ($acronym) $str .= "<ACRNOYM TITLE=\"".$acronym."\">";
 122          $str .= $attr;
 123          if ($acronym) $str .= "</ACRONYM>";
 124          $str .= "</TD><TD CLASS=\"value\"><INPUT TYPE=\"text\" NAME=\"";
 125          $str .= $attr."\" VALUE=\"".$value."\" SIZE=\"".INPUT_TEXT_SIZE."\">";
 126          $str .= "</TD></TR>\n";
 127  
 128          echo $str;
 129      }
 130  
 131  	function viewInnerRow($attr, $value, $bold, $acronym) {
 132  
 133          # Very stupid color changing
 134          if (isset($this->bgcolor) && $this->bgcolor == "bgcolor2") 
 135              $this->bgcolor = "bgcolor1";
 136          else
 137              $this->bgcolor = "bgcolor2";
 138  
 139          $str = 
 140  "        <TR CLASS=\"".$this->bgcolor."\"><TD CLASS=\"attr\">";
 141          if ($bold) $str .= "<B>";
 142          if ($acronym) $str .= "<ACRNOYM TITLE=\"".$acronym."\">";
 143          $str .= $attr;
 144          if ($acronym) $str .= "</ACRONYM>";
 145          if ($bold) $str .= "</B>";
 146          $str .= "</TD><TD CLASS=\"value\"><INPUT TYPE=\"text\" NAME=\"";
 147          $str .= $attr."[]\" VALUE=\"".$value."\" SIZE=\"".INPUT_TEXT_SIZE."\">";
 148          $str .= "</TD></TR>\n";
 149  
 150          echo $str;
 151      }
 152  
 153  	function viewActionBar($entryExists) {
 154  ?><!-- ACTION BAR BEGIN -->
 155  <BR><TABLE CLASS="actionbar">
 156      <TR CLASS="actionbar">
 157      <?php
 158      ### MODIFY ###
 159      if ($entryExists) {
 160          echo "
 161      <TD><INPUT TYPE=\"submit\" CLASS=\"submit\" NAME=\"submit\"";
 162          echo "VALUE=\"Modify\"";
 163          if (ENABLE_JAVASCRIPT) echo 
 164  " onClick=\"javascript:this.form.chosen_action.value='Modify';\"";
 165          echo "></TD>";
 166      }
 167  
 168      ### NEW ###
 169  
 170      echo "
 171      <TD><INPUT TYPE=\"submit\" CLASS=\"submit\" NAME=\"submit\"";
 172  echo "VALUE=\"New\"";
 173      if (ENABLE_JAVASCRIPT) echo
 174  " onClick=\"javascript:this.form.chosen_action.value='New';\"";
 175      echo "></TD>\n";
 176  
 177      ### DELETE ###
 178  
 179      if ($entryExists) {
 180          echo "
 181      <TD><INPUT TYPE=\"submit\" CLASS=\"submit\" NAME=\"submit\"";
 182          echo "VALUE=\"Delete\"";
 183          if (ENABLE_JAVASCRIPT) echo 
 184  " onClick=\"javascript:this.form.chosen_action.value='Delete';\"";
 185          echo "></TD>";
 186      }
 187  ?>
 188      </TR>
 189  </TABLE>
 190  <!-- ACTION BAR END -->
 191  <?php
 192      }
 193  
 194      function viewInnerFooter() {
 195  ?>
 196      <!-- viewInnerFooter -->
 197      </TABLE>
 198      </TD></TR>
 199  <?php
 200      }
 201      
 202  	function viewTitle($text) {
 203  ?>    <TR CLASS="bgcolor1"><TD><B><?php echo $text; ?></B></TD></TR>
 204  <?php
 205      }
 206  
 207  	function modrdnFooter() {
 208  ?>
 209  <!-- modrdnFooter -->
 210  </TABLE>
 211  <CENTER><INPUT TYPE="submit" NAME="submit" VALUE="Modrdn"></CENTER>
 212  </FORM>
 213  <CENTER><FONT SIZE="-1">TIP: Put the mouse over an unknown term in order to get help</FONT></CENTER><?php
 214      }
 215  
 216      function viewFooter($dn = "") {
 217  ?>
 218  <!-- viewFooter -->
 219  </TABLE>
 220  <?php $this->viewActionBar($dn); ?>
 221  </FORM>
 222  <?php
 223      }
 224  }


[ Powered by PHPXref - Served by Debian GNU/Linux ]