Пример #1
0
function getHeader()
{
    ob_start();
    $plgName = EzGA::getPlgName();
    $plgSlug = EzGA::getSlug();
    $plgModeName = EzGA::$pluginModes[$plgSlug];
    $isPro = EzGA::$isPro;
    $plgPrice = EzGA::$plgPrice;
    if (!empty(EzGA::$options['eztheme'])) {
        $themeCSS = "css/bootstrap-" . strtolower(EzGA::$options['eztheme']) . ".min.css";
    } else {
        $themeCSS = "css/bootstrap-cerulean.min.css";
    }
    ?>
  <!DOCTYPE html>
  <html lang="en">
    <head>
      <meta charset="utf-8">
      <title><?php 
    echo $plgName;
    ?>
</title>
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <meta name="description" content="Ads EZ Plugin for Google AdSense">
      <meta name="author" content="Manoj Thulasidas">

      <!-- The styles -->
      <link id="bs-css" href="<?php 
    echo $themeCSS;
    ?>
" rel="stylesheet">
      <link href="css/bootstrap-editable.css" rel="stylesheet">
      <link href="css/charisma-app.css" rel="stylesheet">
      <link href='css/bootstrap-tour.min.css' rel='stylesheet'>
      <link href="css/font-awesome.min.css" rel="stylesheet">
      <link href="css/fileinput.min.css" rel="stylesheet">
      <link href="css/bootstrap-colorpicker.min.css" rel="stylesheet">
      <link href="css/ez-admin.css" rel="stylesheet">
      <style type="text/css">
        .popover{width:600px;}
        <?php 
    if (empty(EzGA::$options['breadcrumbs'])) {
        ?>
          .breadcrumb {display:none;}
          <?php 
    }
    ?>
      </style>
      <!-- jQuery -->
      <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

      <!-- The HTML5 shim, for IE6-8 support of HTML5 elements -->
      <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
      <![endif]-->

      <!-- The fav icon -->
      <link rel="shortcut icon" href="img/favicon.ico">

    </head>

    <body>
      <!-- topbar starts -->
      <div class="navbar navbar-default" role="navigation">

        <div class="navbar-inner">
          <a id="index" class="navbar-brand" href="index.php"> <img alt="Ads EZ Logo" src="img/ads-ez.png" class="hidden-xs"/>
            <span><?php 
    echo $plgName;
    ?>
</span></a>
          <div class="btn-group pull-right">
            <?php 
    $standaloneURL = plugins_url('index.php', __FILE__);
    ?>
            <a id="standAloneMode" href="<?php 
    echo $standaloneURL;
    ?>
" target="_blank" data-content="Open <?php 
    echo $plgName;
    ?>
 admin apge in a new window independent of WordPress admin interface. The standalone mode still uses WP authentication, and cannot be accessed unless logged in." data-toggle="popover" data-trigger="hover" data-placement="left"  title='Standalone Admin Screen'><span class="btn btn-info"><i class="glyphicon glyphicon-resize-full"></i> Standalone Mode</span></a>
            <a id="update" href="update.php" data-content="If you would like to check for regular updates, or install a purchased module or Pro upgrade, visit the Updates page." data-toggle="popover" data-trigger="hover" data-placement="left" title='Updates Page'><span class="btn btn-info"  ><i class="fa fa-cog fa-spin"></i> Updates
                <?php 
    if (!$isPro) {
        ?>
                  &nbsp;<span class="badge red">Pro</span>
                  <?php 
    }
    ?>
              </span>
            </a>&nbsp;
          </div>
        </div>
      </div>
      <!-- topbar ends -->
      <div class="ch-container">
        <div class="row">
          <!-- left menu starts -->
          <div class="col-sm-2 col-lg-2">
            <div class="sidebar-nav">
              <div class="nav-canvas">
                <div class="nav-sm nav nav-stacked">

                </div>
                <ul class="nav nav-pills nav-stacked main-menu">
                  <li id="dashboard"><a href="index.php"><i class="glyphicon glyphicon-home"></i><span> Dashboard</span></a>
                  </li>
                  <li id='tour'><a href="tour.php"><i class="glyphicon glyphicon-road"></i><span> Tour and Help</span></a></li>
                  <?php 
    if ($isPro) {
        $optionSets = EzGA::getOptionSets();
        echo <<<EOF
                  <li class="accordion">
                    <a id='{$plgSlug}' href="#"><i class="glyphicon glyphicon-plus"></i><span> {$plgModeName}</span></a>
                    <ul class="nav nav-pills nav-stacked">
                      <li id='{$plgSlug}-admin'><a href="{$plgSlug}-admin.php"><i class="glyphicon glyphicon-check"></i><span> Settings</span></a></li>
EOF;
        foreach ($optionSets as $o) {
            if (in_array($o, EzGA::$unSettable)) {
                $verb = 'Edit ';
            } else {
                $verb = 'Switch to ';
            }
            echo <<<EOF
                  <li id="{$plgSlug}-{$o}"><a href="{$plgSlug}-admin.php?optionset={$o}"><i class="glyphicon glyphicon-export red"></i><span> {$verb} <code>{$o}</code></span></a></li>
EOF;
        }
        echo <<<EOF
                  <li id="{$plgSlug}-add"><a href="optionset.php"><i class="glyphicon glyphicon-export red"></i><span> Manage Option Sets</span></a></li>
                    </ul>
                  </li>
EOF;
        ?>
                    <li id='pro'><a href="pro.php" class="red"><i class="glyphicon glyphicon-cog"></i><span><b> Pro Features</b></span></a></li>
                    <?php 
    } else {
        echo <<<EOF
                    <li id='{$plgSlug}-admin'><a href="{$plgSlug}-admin.php"><i class="glyphicon glyphicon-check"></i><span> {$plgModeName}</span></a></li>
EOF;
        ?>
                    <li id='goPro'><a href="pro.php" class="red goPro" data-toggle="popover" data-trigger="hover" data-content="Get the Pro version of <?php 
        echo $plgModeName;
        ?>
 for <i>only</i> $<?php 
        echo $plgPrice[$plgSlug];
        ?>
. Tons of extra features. Instant download." data-placement="right" title="Upgrade to Pro" data-product="<?php 
        echo $plgSlug;
        ?>
"><i class="glyphicon glyphicon-shopping-cart"></i><span><b> Go Pro!</b></span></a></li>
                    <?php 
    }
    ?>
                  <li id="options"><a href="options.php"><i class="glyphicon glyphicon-cog"></i><span> Options</span></a></li>
                  <li id="i18n"><a href="i18n.php"><i class="glyphicon glyphicon-globe"></i><span> Languages</span></a></li>
              </div>
            </div>
          </div>
          <!--/span-->
          <!-- left menu ends -->

          <noscript>
          <div class="alert alert-block col-md-12">
            <h4 class="alert-heading">Warning!</h4>

            <p>You need to have <a href="http://en.wikipedia.org/wiki/JavaScript" target="_blank">JavaScript</a>
              enabled to use this site.</p>
          </div>
          </noscript>

          <div id="content" class="col-lg-10 col-sm-10">
            <!-- content starts -->
            <?php 
    $header = ob_get_clean();
    return $header;
}