A tumblelog CMS built on AJAX, PHP and MySQL.

post_confirmation.php 820B

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