コード例 #1
0
function spa_panel_header()
{
    global $spAPage, $spNews, $spDevice;
    echo '<!-- Common wrapper and header -->';
    echo '<div class="wrap nosubsub">';
    echo '<div class="mainicon icon-forums"></div>';
    echo '<h2>' . spa_text('Simple:Press Administration') . '</h2>';
    echo '<div class="clearboth"></div>';
    echo '<table class="sfamenutable" style="width:100%">';
    $site = SFHOMEURL . 'index.php?sp_ahah=acknowledge&amp;sfnonce=' . wp_create_nonce('forum-ahah');
    $title = spa_text('About Simple:Press');
    echo '<tr><td style="text-align:right"><a class="button button-highlight" target="_blank" href="http://simple-press.com/documentation/codex/">' . spa_text('Simple:Press Codex') . '</a>&nbsp;&nbsp;';
    echo '<a class="button button-highlight" href="javascript:void(null)" onclick="spjDialogAjax(this, \'' . $site . '\', \'' . $title . '\', 600, 0, \'center\');">' . $title . '</a>&nbsp;&nbsp;';
    echo '<a class="button button-highlight" href="' . sp_url() . '">' . spa_text('Go To Forum') . '</a></td>';
    echo '</tr></table></div><div class="clearboth"></div>';
    # define container for th dialog box popup
    echo '<div id="dialogcontainer" style="display:none;"></div>';
    # display any warning messages and global 'cleanups'
    echo spa_check_warnings();
    # News update widget
    $spNews = spa_check_for_news();
    if (!empty($spNews)) {
        add_action('in_admin_footer', 'spa_remove_news');
        echo '<div id="spa_dashboard_news" class="postbox" style="margin: 6px 20px 0 15px; padding: 20px;">';
        spa_dashboard_news();
        echo '</div>';
    }
    do_action('sph_admin_panel_header');
}
コード例 #2
0
function spa_dashboard_setup()
{
    global $spNews, $spStatus;
    # If awaiting installation then dive out now to avoid errors
    if ($spStatus == 'Install') {
        return;
    }
    # standard forum widget
    wp_add_dashboard_widget('spa_dashboard_forum', spa_text('Forums'), 'spa_dashboard_forum');
    # News update widget
    $spNews = spa_check_for_news();
    if (!empty($spNews)) {
        wp_add_dashboard_widget('spa_dashboard_news', spa_text('Simple:Press News'), 'spa_dashboard_news');
        add_action('in_admin_footer', 'spa_remove_news');
    }
}