A tumblelog CMS built on AJAX, PHP and MySQL.

post_confirmation.php 752B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /*
  3. Plugin Name: PostConfirmation
  4. Description: Add a confirmation dialog when submit the Create-post button.
  5. Author: Victor Bracco
  6. Author URI: http://www.vbracco.com.ar/
  7. Version: 1.0
  8. */
  9. class post_confirmation extends plugins
  10. {
  11. public function post_confirmation()
  12. {
  13. $this->addAction('admin_includes', 'post_confirmation_script');
  14. }
  15. public function post_confirmation_script()
  16. {
  17. global $admin_includes,$isEdition;
  18. if (!$isEdition) {
  19. $admin_includes .= "
  20. <script type=\"text/javascript\">
  21. $(document).ready(function(){
  22. $('#publish').click( function(){
  23. return (confirm('".__("Do you realy want to publish this?")."'));
  24. });
  25. });
  26. </script>
  27. ";
  28. }
  29. }
  30. }