FeedWordPressSyndicationPage::dashboard_box PHP Method

dashboard_box() public method

* FeedWordPressSyndicationPage::display ()
public dashboard_box ( $page, $box = NULL )
    function dashboard_box($page, $box = NULL)
    {
        global $fwp_path;
        $links = FeedWordPress::syndicated_links(array("hide_invisible" => false));
        $sources = $this->sources('*');
        $visibility = 'Y';
        $hrefPrefix = $this->form_action();
        $activeHref = $hrefPrefix . '&visibility=Y';
        $inactiveHref = $hrefPrefix . '&visibility=N';
        $lastUpdate = get_option('feedwordpress_last_update_all', NULL);
        $automatic_updates = get_option('feedwordpress_automatic_updates', NULL);
        if ('init' == $automatic_updates) {
            $update_setting = 'automatically before page loads';
        } elseif ('shutdown' == $automatic_updates) {
            $update_setting = 'automatically after page loads';
        } else {
            $update_setting = 'using a cron job or manual check-ins';
        }
        // Hey ho, let's go...
        ?>
		<div style="float: left; background: #F5F5F5; padding-top: 5px; padding-right: 5px;"><a href="<?php 
        print $this->form_action();
        ?>
"><img src="<?php 
        print esc_html(plugins_url("/{$fwp_path}/feedwordpress.png"));
        ?>
" alt="" /></a></div>

		<p class="info" style="margin-bottom: 0px; border-bottom: 1px dotted black;">Managed by <a href="http://feedwordpress.radgeek.com/">FeedWordPress</a>
		<?php 
        print FEEDWORDPRESS_VERSION;
        ?>
.</p>
		<?php 
        if (FEEDWORDPRESS_BLEG) {
            ?>
		<p class="info" style="margin-top: 0px; font-style: italic; font-size: 75%; color: #666;">If you find this tool useful for your daily work, you can
		contribute to ongoing support and development with
		<a href="http://feedwordpress.radgeek.com/donate/">a modest donation</a>.</p>
		<br style="clear: left;" />
		<?php 
        }
        ?>

		<div class="feedwordpress-actions">
		<h4>Updates</h4>
		<ul class="options">
		<li><strong>Scheduled:</strong> <?php 
        print $update_setting;
        ?>
		(<a href="<?php 
        print $this->form_action('feeds-page.php');
        ?>
">change setting</a>)</li>

		<li><?php 
        if (!is_null($lastUpdate)) {
            ?>
		<strong>Last checked:</strong> <?php 
            print fwp_time_elapsed($lastUpdate);
            ?>
		<?php 
        } else {
            ?>
		<strong>Last checked:</strong> none yet
		<?php 
        }
        ?>
	</li>

		</ul>
		</div>
		
		<div class="feedwordpress-stats">
		<h4>Subscriptions</h4>
		<table>
		<tbody>
		<tr class="first">
		<td class="first b b-active"><a href="<?php 
        print esc_html($activeHref);
        ?>
"><?php 
        print count($sources['Y']);
        ?>
</a></td>
		<td class="t active"><a href="<?php 
        print esc_html($activeHref);
        ?>
">Active</a></td>
		</tr>
		
		<tr>
		<td class="b b-inactive"><a href="<?php 
        print esc_html($inactiveHref);
        ?>
"><?php 
        print count($sources['N']);
        ?>
</a></td>
		<td class="t inactive"><a href="<?php 
        print esc_html($inactiveHref);
        ?>
">Inactive</a></td>
		</tr>
		</table>
		</div>

		<div id="add-single-uri">
			<?php 
        if (count($sources['Y']) > 0) {
            ?>
			<form id="check-for-updates" action="<?php 
            print $this->form_action();
            ?>
" method="POST">
			<div class="container"><input type="submit" class="button-primary" name"update" value="<?php 
            print FWP_CHECK_FOR_UPDATES;
            ?>
" />
			<?php 
            FeedWordPressCompatibility::stamp_nonce('feedwordpress_feeds');
            ?>
			<input type="hidden" name="update_uri" value="*" /></div>
			</form>
			<?php 
        }
        ?>
		
		  <form id="syndicated-links" action="<?php 
        print $hrefPrefix;
        ?>
&amp;visibility=<?php 
        print $visibility;
        ?>
" method="post">
		  <div class="container"><?php 
        FeedWordPressCompatibility::stamp_nonce('feedwordpress_feeds');
        ?>
		  <label for="add-uri">Add:
		  <input type="text" name="lookup" id="add-uri" placeholder="Source URL"
		  value="Source URL" style="width: 55%;" /></label>
		
		  <?php 
        FeedWordPressSettingsUI::magic_input_tip_js('add-uri');
        ?>
		  <input type="hidden" name="action" value="<?php 
        print FWP_SYNDICATE_NEW;
        ?>
" />
		  <input style="vertical-align: middle;" type="image" src="<?php 
        print plugins_url('/' . $fwp_path . '/plus.png');
        ?>
" alt="<?php 
        print FWP_SYNDICATE_NEW;
        ?>
" /></div>
		  </form>
		</div> <!-- id="add-single-uri" -->
		
		<br style="clear: both;" />
		
		<?php 
    }

Usage Example

 function dashboard()
 {
     $syndicationPage = new FeedWordPressSyndicationPage(dirname(__FILE__) . '/syndication.php');
     $syndicationPage->dashboard_box($syndicationPage);
 }