Example #1
0
 /**
  * ThinkUp admin menu entry page. This page handles the passing to every page in the admin section through the
  * 'step' get variable.
  */
 public static function index()
 {
     // div class wrap for display purposes
     echo '<div class="wrap">';
     // header
     echo '<h2 id="top">' . __('ThinkUp Plugin Options', 'thinkup-wp-plugin') . '</h2>';
     // menu buttons
     if (current_user_can(ThinkUpWordPressPlugin::settingsAccessLevel())) {
         echo '<a class="button-secondary" href="?page=' . ThinkUpWordPressPlugin::uniqueIdentifier() . '&step=settings">Settings</a>';
     }
     echo '<a class="button-secondary" href="?page=' . ThinkUpWordPressPlugin::uniqueIdentifier() . '&step=help">Help</a>';
     echo '<a class="button-secondary" href="?page=' . ThinkUpWordPressPlugin::uniqueIdentifier() . '&step=faq">FAQ</a>';
     echo '<br /><br />';
     // decide which page to load based on a 'step' GET variable
     $step = isset($_GET['step']) ? $_GET['step'] : '';
     switch ($step) {
         case 'help':
             ThinkUpAdminPages::help();
             break;
         case 'faq':
             ThinkUpAdminPages::faq();
             break;
         default:
             if (current_user_can(ThinkUpWordPressPlugin::settingsAccessLevel())) {
                 ThinkUpAdminPages::settings();
             } else {
                 ThinkUpAdminPages::help();
             }
             break;
     }
     // end <div class="wrap">
     echo '</div>';
 }
Example #2
0
 /**
  * Returns a string to be used as the name for our nonce fields.
  *
  * For more information on nonce fields:
  * http://codex.wordpress.org/Function_Reference/wp_nonce_field
  *
  * @return str md5 hash of the unique identifier to use as a nonce.
  */
 public static function nonceName()
 {
     return md5(ThinkUpWordPressPlugin::uniqueIdentifier());
 }
    public static function displayHelpFaqContents($title, $files) {
        $title = __($title, ThinkUpWordPressPlugin::uniqueIdentifier());

        ?>
<div id="poststuff" class="ui-sortable meta-box-sortable"
	style="max-width: 700px">
<div class="postbox" id="contents">
<h3><?php echo $title; ?></h3>
<div class="inside" style="line-height: 1.5"><?php
foreach ($files as $name => $contents) {
    $name = __($name, ThinkUpWordPressPlugin::uniqueIdentifier());
    echo '<a href="#'.$name.'">'.$name.'</a><br />';
}
?></div>
</div>
</div>
<?php

    }