[ Index ]

PHP Cross Reference of MyBB

title

Body

[close]

/install/resources/ -> output.php (source)

   1  <?php
   2  /**
   3   * MyBB 1.6
   4   * Copyright 2010 MyBB Group, All Rights Reserved
   5   *
   6   * Website: http://mybb.com
   7   * License: http://mybb.com/about/license
   8   *
   9   * $Id$
  10   */
  11  
  12  class installerOutput {
  13      
  14      public $doneheader;
  15      public $openedform;
  16      public $script = "index.php";
  17      public $steps = array();
  18      public $title = "MyBB Installation Wizard";
  19  
  20  	function print_header($title="Welcome", $image="welcome", $form=1, $error=0)
  21      {
  22          global $mybb, $lang;
  23          
  24          if($lang->title)
  25          {
  26              $this->title = $lang->title;
  27          }
  28  
  29          @header("Content-type: text/html; charset=utf-8");
  30  
  31          $this->doneheader = 1;
  32          if($image == "dbconfig")
  33          {
  34              $dbconfig_add = "<script type=\"text/javascript\">document.write('<style type=\"text/css\">.db_type { display: none; }</style>');</script>";
  35          }
  36          echo <<<END
  37  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  38  <html xmlns="http://www.w3.org/1999/xhtml">
  39  <head>
  40      <title>$this->title &gt; $title</title>
  41      <link rel="stylesheet" href="stylesheet.css" type="text/css" />
  42      <script type="text/javascript" src="../jscripts/prototype.js"></script>
  43      <script type="text/javascript" src="../jscripts/general.js"></script>
  44      {$dbconfig_add}
  45  </head>
  46  <body>
  47  END;
  48          if($form)
  49          {
  50              echo "\n    <form method=\"post\" action=\"".$this->script."\">\n";
  51              $this->openedform = 1;
  52          }
  53          
  54          echo <<<END
  55          <div id="container">
  56          <div id="logo">
  57              <h1><span class="invisible">MyBB</span></h1>
  58          </div>
  59          <div id="inner_container">
  60          <div id="header">$this->title</div>
  61  END;
  62          if(empty($this->steps))
  63          {
  64              $this->steps = array();
  65          }
  66          if(is_array($this->steps))
  67          {
  68          echo "\n        <div id=\"progress\">";
  69                  echo "\n            <ul>\n";
  70                  foreach($this->steps as $action => $step)
  71                  {
  72                      if($action == $mybb->input['action'])
  73                      {
  74                          echo "                <li class=\"active\"><strong>$step</strong></li>\n";
  75                      }
  76                      else
  77                      {
  78                          echo "                <li>$step</li>\n";
  79                      }
  80                  }
  81                  echo "            </ul>";
  82          echo "\n        </div>";
  83          echo "\n        <div id=\"content\">\n";
  84          }
  85          else
  86          {
  87          echo "\n        <div id=\"progress_error\"></div>";
  88          echo "\n        <div id=\"content_error\">\n";
  89          }
  90          if($title != "")
  91          {
  92          echo <<<END
  93              <h2 class="$image">$title</h2>\n
  94  END;
  95          }
  96      }
  97  
  98  	function print_contents($contents)
  99      {
 100          echo $contents;
 101      }
 102  
 103  	function print_error($message)
 104      {
 105          global $lang;
 106          if(!$this->doneheader)
 107          {
 108              $this->print_header($lang->error, "", 0, 1);
 109          }
 110          echo "            <div class=\"error\">\n                ";
 111          echo "<h3>".$lang->error."</h3>";
 112          $this->print_contents($message);
 113          echo "\n            </div>";
 114          $this->print_footer();
 115      }
 116  
 117  
 118  	function print_footer($nextact="")
 119      {
 120          global $lang, $footer_extra;
 121          if($nextact && $this->openedform)
 122          {
 123              echo "\n            <input type=\"hidden\" name=\"action\" value=\"$nextact\" />";
 124              echo "\n                <div id=\"next_button\"><input type=\"submit\" class=\"submit_button\" value=\"".$lang->next." &raquo;\" /></div><br style=\"clear: both;\" />\n";
 125              $formend = "</form>";
 126          }
 127          else
 128          {
 129              $formend = "";
 130          }
 131  
 132          echo <<<END
 133          </div>
 134          <div id="footer">
 135  END;
 136  
 137          $copyyear = date('Y');
 138          echo <<<END
 139              <div id="copyright">
 140                  MyBB &copy; 2002-$copyyear MyBB Group
 141              </div>
 142          </div>
 143          </div>
 144          </div>
 145          $formend
 146          $footer_extra
 147  </body>
 148  </html>
 149  END;
 150          exit;
 151      }
 152  }
 153  ?>


Generated: Tue Oct 8 19:19:50 2013 Cross-referenced by PHPXref 0.7.1