[ Index ]

PHP Cross Reference of MyBB 1.8.38

title

Body

[close]

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

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


2005 - 2021 © MyBB.de | Alle Rechte vorbehalten! | Sponsor: netcup Cross-referenced by PHPXref