add donate and footer and pretty things up

This commit is contained in:
John Bintz 2009-09-23 19:22:59 -04:00
parent 0a3d94837a
commit 180646a3ca
4 changed files with 49 additions and 12 deletions

View File

@ -548,6 +548,8 @@ class WhatDidTheySayAdmin {
if ($plugin_page == "manage-wdts") { if ($plugin_page == "manage-wdts") {
$this->read_language_file(); $this->read_language_file();
wp_enqueue_style('wdts-admin', plugin_dir_url(dirname(__FILE__)) . 'css/wdts-admin.css'); wp_enqueue_style('wdts-admin', plugin_dir_url(dirname(__FILE__)) . 'css/wdts-admin.css');
$this->plugin_data = get_plugin_data($this->_parent_file);
} }
wp_enqueue_script('scriptaculous-effects'); wp_enqueue_script('scriptaculous-effects');

View File

@ -6,6 +6,8 @@
'misc-options' => __('Misc. Options', 'what-did-they-say'), 'misc-options' => __('Misc. Options', 'what-did-they-say'),
'shortcodes-info' => __('Shortcodes Info', 'what-did-they-say') 'shortcodes-info' => __('Shortcodes Info', 'what-did-they-say')
); );
extract($this->plugin_data);
?> ?>
<div class="wrap"> <div class="wrap">
<h2><?php _e('What Did They Say?!?', 'what-did-they-say') ?></h2> <h2><?php _e('What Did They Say?!?', 'what-did-they-say') ?></h2>
@ -21,6 +23,19 @@
</div> </div>
<?php } ?> <?php } ?>
</div> </div>
<div id="wdts-footer">
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="donate">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="8429526">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
<p>
<a href="<?php echo $PluginURI ?>"><?php _e('What Did They Say?!?', 'what-did-they-say') ?></a> Version <?php echo $Version ?> is &copy; 2009 <?php echo $Author ?>.
</p>
</div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">

View File

@ -38,3 +38,18 @@
#wdts-container dd { #wdts-container dd {
margin-left: 4em margin-left: 4em
} }
#wdts-footer {
height: 3em;
overflow: hidden
}
#wdts-footer p {
margin: 0;
line-height: 3em
}
#wdts-footer form {
float: right;
display: inline
}

View File

@ -27,6 +27,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
foreach (glob(dirname(__FILE__) . '/classes/*.php') as $file) { require_once($file); } foreach (glob(dirname(__FILE__) . '/classes/*.php') as $file) { require_once($file); }
$what_did_they_say_admin = new WhatDidTheySayAdmin(&$what_did_they_say); $what_did_they_say_admin = new WhatDidTheySayAdmin(&$what_did_they_say);
$what_did_they_say_admin->_parent_file = __FILE__;
add_action('init', array(&$what_did_they_say_admin, 'init')); add_action('init', array(&$what_did_they_say_admin, 'init'));
@ -43,9 +44,11 @@ add_action('init', array(&$what_did_they_say_admin, 'init'));
* @return string|false The transcript in the requested language for the specified post, or false if no transcript found. * @return string|false The transcript in the requested language for the specified post, or false if no transcript found.
*/ */
function get_the_media_transcript($language = null) { function get_the_media_transcript($language = null) {
global $post, $what_did_they_say; global $post;
if (is_null($language)) { $language = $what_did_they_say->get_default_language(); } if (!empty($post)) {
$language_options = new WDTSLanguageOptions();
if (is_null($language)) { $language = $language_options->get_default_language(); }
$transcript = false; $transcript = false;
$approved_transcripts = new WDTSApprovedTranscript($post->ID); $approved_transcripts = new WDTSApprovedTranscript($post->ID);
@ -55,6 +58,8 @@ function get_the_media_transcript($language = null) {
if (isset($transcripts[$language])) { $transcript = $transcripts[$language]; } if (isset($transcripts[$language])) { $transcript = $transcripts[$language]; }
} }
return $transcript; return $transcript;
}
return '';
} }
/** /**