All pastes #914327 Raw Edit

credit due

public php v1 · immutable
·published 2008-02-22 20:19 UTC
rendered paste body
<?php/** * Credit Due plugin, allows output of theme and plugin information for Habari sites. */class CreditDue extends Plugin{	/**	 * function info	 * Returns information about this plugin	 * @return array Plugin info array	 **/	function info()	{		return array (			'name' => 'Credit Due',			'url' => 'http://habariproject.org/',			'author' => 'Habari Community',			'authorurl' => 'http://habariproject.org/',			'version' => '0.1',			'description' => 'Allows for output of information for active themes and plugins',			'license' => 'Apache License 2.0',		);	}	/**	 * function get_credits	 * retrieves information about the active theme	 */	public function show_credits {		$theme_credits= Themes::get_active();		$plugin_credits= Plugins::get_active();				echo '<h3>Theme</h3>\n';		echo '\t<ol id="theme_credits">\n';		echo '\t\t<li>' . $theme_credits['info']->name . ' version ' . $theme_credits['info']->version . ' by <a href="' . $theme_credits['info']->url . '">' . $theme_credits['info']->author . '</a></li>\n'		echo '\t</ol>\n\n'		echo '<h3>Plugins</h3>\n';		echo '\t<ol id="plugin_credits">\n';		foreach ($plugin_credits as $plugin) {			echo '\t\t<li><a href="' . $plugin['info']->url . '">' . $plugin['info']->name . '</a> version ' . $plugin['info']->version;			echo empty( $plugin['info']->authorurl ) ? ' by ' . $plugin['info']->author : ' by <a href="' . $plugin['info']->authorurl . '">' . $plugin['info']->author . '</a>'		}	}}?>