[ Index ]

PHP Cross Reference of MyBB

title

Body

[close]

/admin/styles/sharepoint/ -> style.php (source)

   1  <?php
   2  /**
   3   * This is an example style file for Admin CP styles.
   4   *
   5   * It allows you to override our existing layout generation
   6   * classes with your own to further customise the Admin CP
   7   * layout beyond CSS.
   8   *
   9   * Your class name      Should extend
  10   * ---------------      -------------
  11   * Page                 DefaultPage
  12   * SidebarItem          DefaultSidebarItem
  13   * PopupMenu            DefaultPopupMenu
  14   * Table                DefaultTable
  15   * Form                 DefaultForm
  16   * FormContainer        DefaultFormContainer
  17   *
  18   * For example, to output your own custom header:
  19   *
  20   * class Page extends DefaultPage
  21   * {
  22   *   function output_header($title)
  23   *   {
  24   *      echo "<h1>{$title}</h1>";
  25   *   }
  26   * }
  27   *
  28   */
  29  
  30  // Disallow direct access to this file for security reasons
  31  if(!defined("IN_MYBB"))
  32  {
  33      die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
  34  } 
  35  
  36  class Page extends DefaultPage
  37  {
  38  	function generate_breadcrumb()
  39      {
  40          if(!is_array($this->breadcrumb_trail))
  41          {
  42              return false;
  43          }
  44          $trail = "";
  45          foreach($this->breadcrumb_trail as $key => $crumb)
  46          {
  47              if($this->breadcrumb_trail[$key+1])
  48              {
  49                  $trail .= "<a href=\"".$crumb['url']."\">".$crumb['name']."</a>";
  50                  if($this->breadcrumb_trail[$key+2])
  51                  {
  52                      $trail .= " &raquo; ";
  53                  }
  54              }
  55              else
  56              {
  57                  $trail .= " &raquo; <span class=\"active\">".$crumb['name']."</span>";
  58              }
  59          }
  60          return $trail;
  61      }
  62  
  63  
  64  	function output_nav_tabs($tabs=array(), $active='')
  65      {
  66          global $plugins;
  67          $tabs = $plugins->run_hooks("admin_page_output_nav_tabs_start", $tabs);
  68          if(count($tabs) > 1)
  69          {
  70              $first = true;
  71              echo "<div class=\"nav_tabs\">";
  72              echo "\t<ul>\n";
  73              foreach($tabs as $id => $tab)
  74              {
  75                  if($id == $active)
  76                  {
  77                      continue;
  78                  }
  79                  $class = '';
  80                  if($tab['link_target'])
  81                  {
  82                      $target = " target=\"{$tab['link_target']}\"";
  83                  }
  84                  if($first) $class .= " first";
  85                  echo "\t\t<li class=\"{$class}\"><a href=\"{$tab['link']}\"{$target}>{$tab['title']}</a></li>\n";
  86                  $first = false;
  87                  $target = '';
  88              }
  89              echo "\t</ul>\n";
  90              echo "</div>";
  91          }
  92  
  93          if($tabs[$active])
  94          {
  95              $intro_tab = $tabs[$active];
  96              echo "<div class=\"intro\">";
  97              echo "<h2>{$intro_tab['title']}</h2>";
  98              echo "<p>{$intro_tab['description']}</p>";
  99              echo "</div>";
 100          }
 101          $arguments = array('tabs' => $tabs, 'active' => $active);
 102          $plugins->run_hooks("admin_page_output_nav_tabs_end", $arguments);
 103      }
 104  }
 105  
 106  class SidebarItem extends DefaultSidebarItem
 107  {
 108  }
 109  
 110  class PopupMenu extends DefaultPopupMenu
 111  {
 112  }
 113  
 114  class Table extends DefaultTable
 115  {
 116  }
 117  
 118  class Form extends DefaultForm
 119  {
 120  }
 121  
 122  class FormContainer extends DefaultFormContainer
 123  {
 124  }
 125  ?>


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