示例#1
0
    function adminPageContent()
    {
        $pco = new PCOAccess();
        ?>
<div class="wrap">
			<div id="icon-options-general" class="icon32"><br></div>
			<h2>Planning Center Online Connection</h2>
			<form method="post" action="options.php">
				<?php 
        settings_fields('pco-connection-group');
        // This prints out all hidden setting fields
        do_settings_sections('pco-connection-admin');
        // prints out form options
        ?>
				<?php 
        submit_button();
        ?>
			</form>
			<div style="background-color: #EEE; padding: 10px;">
				<?php 
        if ($pco->okay()) {
            echo '<h3>Connection Status: <span style="color: #090">Connected!</span></h3>';
            $o = $pco->api->getOrganization();
            echo '<p>';
            echo 'Organization: ' . $o->name . "<br />\n";
            echo 'Account Owner: ' . $o->owner_name . "\n";
            echo '</p>';
            echo '<a class="button" href="?page=pco_connect&amp;pco-action=logout">Log out</a>';
        } else {
            echo '<h3>Connection Status: <span style="color: #900">Disconnected</span></h3>';
            if ($pco->hasCredentials()) {
                echo '<p>Press the button below to authenticate with the above key and secret:</p>';
                echo '<a class="button" href="?page=pco_connect&amp;pco-action=auth">Authenticate</a>';
            } else {
                echo '<p>Please enter a consumer key and secret to authenticate.</p>';
            }
        }
        ?>
			</div>
		</div>
		<?php 
    }