コード例 #1
0
    function display_admin_handle_other_options($account_hash)
    {
        ?>

    <div class="wrap" style="padding-top: 50px;">

      <?php 
        $this->display_messages();
        if (sizeof($account_hash) != 0) {
            $current_account_id = isset($_POST['ga_account_id']) ? $_POST['ga_account_id'] : get_option('gad_account_id') !== false ? get_option('gad_account_id') : '';
        }
        if (!isset($current_account_id) || $current_account_id == '') {
            ?>
        <div class="updated">
          <p><b>Note:</b> You will need to select an account and <b>click "Save Changes"</b> before the analytics dashboard will work.</p>
        </div>
      <?php 
        }
        ?>

      <form action="" method="post">

        <table class="form-table">
          <tr valign="top">
            <th scope="row"><label for="ga_account_id">Available Accounts</label></th>
            <td>
              <?php 
        if (sizeof($account_hash) == 0) {
            echo '<span id="ga_account_id">No accounts available.</span>';
        } else {
            echo '<select id="ga_account_id" name="ga_account_id">';
            foreach ($account_hash as $account_id => $account_name) {
                echo '<option value="' . $account_id . '" ' . ($current_account_id == $account_id ? 'selected' : '') . '>' . $account_name . '</option>';
            }
            echo '</select>';
        }
        ?>

            </td>
          </tr>

          <?php 
        if (get_option('gad_login_pass') !== false) {
            ?>
            <tr valign="top">
              <th scope="row"><label for="ga_forget_pass">Forget Password</label></th>
              <td><input name="ga_forget_pass" type="checkbox" id="ga_forget_pass" value="ga_forget_pass" /></td>
            </tr>
          <?php 
        }
        ?>

          <tr valign="top">
            <th scope="row"><label for="ga_forget_auth">Forget Authentication</label></th>
            <td><input name="ga_forget_auth" type="checkbox" id="ga_forget_auth" value="ga_forget_auth" /></td>
          </tr>

          <tr valign="top">
            <th scope="row"><label for="ga_forget_all">Forget Everything</label></th>
            <td><input name="ga_forget_all" type="checkbox" id="ga_forget_all" value="ga_forget_all" /></td>
          </tr>

          <tr valign="top">
            <th scope="row"><label for="ga_display_level">Dashboard Level</label></th>
            <td>
              <?php 
        $ga_display_level = get_option('gad_display_level');
        ?>
              <select name="ga_display_level" id="ga_display_level">
                <option value="">None - Admin only</option>
                <option value="level_7" <?php 
        echo $ga_display_level == 'level_7' ? 'selected' : '';
        ?>
>Editor</option>
                <option value="level_2" <?php 
        echo $ga_display_level == 'level_2' ? 'selected' : '';
        ?>
>Author</option>
                <option value="level_1" <?php 
        echo $ga_display_level == 'level_1' ? 'selected' : '';
        ?>
>Contributor</option>
                <option value="level_0" <?php 
        echo $ga_display_level == 'level_0' ? 'selected' : '';
        ?>
>Subscriber</option>
              </select>
            </td>
          </tr>

          <?php 
        if (SimpleFileCache::canCache()) {
            ?>
            <tr valign="top">
              <th scope="row"><label for="ga_cache_timeout">Cache Timeout (seconds)</label></th>
              <td><input value="<?php 
            echo get_option('gad_cache_timeout') !== false ? get_option('gad_cache_timeout') : '60';
            ?>
" name="ga_cache_timeout" id="ga_cache_timeout"/></td>
            </tr>
          <?php 
        } else {
            ?>
            <tr valign="top">
              <th colspan="2"><span style="padding: 10px;" class="error">The configuration of your server will prevent response caching.</span></th>
            </tr>
          <?php 
        }
        ?>

          <tr valign="top">
            <th scope="row">&nbsp;</th>
            <td>&nbsp;</td>
          </tr>

          <tr valign="top">
            <th scope="row"><label for="ga_goal_one">Goal #1 Label</label></th>
            <td><input value="<?php 
        echo get_option('gad_goal_one');
        ?>
" name="ga_goal_one" id="ga_goal_one"/></td>
          </tr>

          <tr valign="top">
            <th scope="row"><label for="ga_goal_two">Goal #2 Label</label></th>
            <td><input value="<?php 
        echo get_option('gad_goal_two');
        ?>
" name="ga_goal_two" id="ga_goal_two"/></td>
          </tr>

          <tr valign="top">
            <th scope="row"><label for="ga_goal_three">Goal #3 Label</label></th>
            <td><input value="<?php 
        echo get_option('gad_goal_three');
        ?>
" name="ga_goal_three" id="ga_goal_three"/></td>
          </tr>

          <tr valign="top">
            <th scope="row"><label for="ga_goal_four">Goal #4 Label</label></th>
            <td><input value="<?php 
        echo get_option('gad_goal_four');
        ?>
" name="ga_goal_four" id="ga_goal_four"/></td>
          </tr>

          <tr valign="top">
            <th scope="row"><label for="ga_disable_post_stats">Disable Post Stats Display</label></th>
            <td><input name="ga_disable_post_stats" type="checkbox" id="ga_disable_post_stats" value="ga_disable_post_stats" <?php 
        echo get_option('gad_disable_post_stats') == 'true' ? 'checked' : '';
        ?>
 /></td>
          </tr>
        </table>

        <p class="submit">
          <input type="submit" name="SubmitOptions" class="button-primary" value="<?php 
        _e('Save Changes');
        ?>
" />
        </p>

      </form>

    </div>

<?php 
    }