Created
September 20, 2013 19:52
-
-
Save allgood2386/6642906 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function taoti_javascript_menu() { | |
$items['slider/%/news-embed'] = array( | |
'page callback' => 'taoti_javascript_get_news_view_embed', | |
'delivery callback' => 'taoti_javascript_get_embed_wrapper', | |
'page arguments' => array(1), | |
'access callback' => TRUE, | |
); | |
$items['slider/%/topic-embed'] = array( | |
'page callback' => 'taoti_javascript_get_topic_desc_view_embed', | |
'delivery callback' => 'taoti_javascript_get_embed_wrapper', | |
'page arguments' => array(1), | |
'access callback' => TRUE, | |
); | |
return $items; | |
} | |
function taoti_javascript_get_news_view_embed($termID) { | |
return views_embed_view('news', 'latest_news_slider', $termID); | |
} | |
function taoti_javascript_get_topic_desc_view_embed($termID){ | |
return views_embed_view('taxonomy_slideshows', 'taxonomy_slider_description', $termID); | |
} | |
function taoti_javascript_get_embed_wrapper ($page_callback_result) { | |
drupal_add_http_header('Content-Type', 'text/html; charset=utf-8'); | |
global $language; | |
drupal_add_http_header('Content-Language', $language->language); | |
print $page_callback_result; | |
drupal_page_footer(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment