jeemod.pages.inc 761 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. function jeemod_chapter($nid){
  3. $viewmode = "chapter";
  4. $rep = array(
  5. "nid" => $nid,
  6. "viewmode" => $viewmode
  7. );
  8. if($nodeview = node_view(node_load($nid),$viewmode)){
  9. $rep = $rep+array(
  10. 'node' => drupal_render($nodeview),
  11. );
  12. drupal_json_output($rep);
  13. }
  14. }
  15. function jeemod_static(){
  16. $viewmode = "full";
  17. // get node by url
  18. $path = drupal_get_normal_path(preg_replace('/^\//', '', $_GET['href']));
  19. $nid = end(explode("/", $path));
  20. $rep = array(
  21. // "get" => $_GET,
  22. // "path" => $path,
  23. "nid" => $nid,
  24. "viewmode" => $viewmode
  25. );
  26. if($nodeview = node_view(node_load($nid),$viewmode)){
  27. $rep = $rep+array(
  28. 'node' => drupal_render($nodeview),
  29. );
  30. drupal_json_output($rep);
  31. }
  32. }