function views_json_simple_views_argument in Views Datasource 5
argument hook that will display the Simple JSON data document or display export icons.
2 calls to views_json_simple_views_argument()
- views_json_simple_views_handler in ./
views_json.module - handler for our own Simple JSON argument handler
- views_json_views_post_view in ./
views_json.module - post view to display the render icons
File
- ./
views_json.module, line 76 - views_json.module - provides Views plugin for rendering node content as JSON.
Code
function views_json_simple_views_argument($op, &$view, $arg) {
if ($op == 'argument' && $arg == 'json_simple') {
$view->page_type = 'views_' . $arg;
}
else {
if ($op == 'post_view' && $view->build_type != 'block') {
$args = views_post_view_make_args($view, $arg, $arg);
$url = views_get_url($view, $args);
$title = views_get_title($view, 'page', $args);
$links = array();
if ($arg == 'json_simple') {
if ($image = theme('image', drupal_get_path('module', 'views_json') . '/json32x32.png', t('Exhibit JSON'), t('Show @title as MIT Simile/Exhibit JSON', array(
'@title' => $title,
)))) {
$links[] = l($image, $url, array(
'class' => 'json-icon',
), $url_filter, NULL, FALSE, TRUE);
return implode(' ', $links);
}
}
}
}
}