CFDBShortcodeDataTable

The Contact Form DB CFDBShortcodeDataTable class.

Defined (1)

The class is defined in the following location(s).

/CFDBShortcodeDataTable.php  
  1. class CFDBShortcodeDataTable extends ShortCodeScriptLoader { 
  2.  
  3. public function handleShortcode($atts, $content = null) { 
  4. $atts['content'] = $content; 
  5. $atts['useDT'] = true; 
  6. require_once('CFDBShortcodeTable.php'); 
  7. $sc = new CFDBShortcodeTable(); 
  8. return $sc->handleShortcode($atts, $content); 
  9.  
  10. public function register($shortcodeName) { 
  11. parent::register($shortcodeName); 
  12.  
  13. // Unfortunately, can't put styles in the footer so we have to always add this style sheet 
  14. // There is an article about how one might go about this here: 
  15. // http://beerpla.net/2010/01/13/wordpress-plugin-development-how-to-include-css-and-javascript-conditionally-and-only-when-needed-by-the-posts/ 
  16. // But it appears to expects posts on the page and I'm concerned it will not work in all cases 
  17.  
  18. // Just enqueuing it causes problems in some pages. Need a targeted way to do this. 
  19. // wp_enqueue_style('datatables-demo', 'http://www.datatables.net/release-datatables/media/css/demo_table.css'); 
  20.  
  21. public function addScript() { 
  22. // wp_register_style('datatables-demo', 'http://www.datatables.net/release-datatables/media/css/demo_table.css'); 
  23. // wp_print_styles('datatables-demo'); 
  24.  
  25. // wp_register_script('datatables', 'http://www.datatables.net/release-datatables/media/js/jquery.dataTables.js', array('jquery'), false, true); 
  26. wp_enqueue_script('datatables', plugins_url('/', __FILE__) . 'DataTables/media/js/jquery.dataTables.min.js', array('jquery')); 
  27. do_action_ref_array('cfdb_edit_enqueue', array()); 
  28. wp_print_scripts('datatables'); 
  29.