function hosting_platform_view in Hosting 5
Same name and namespace in other branches
- 6.2 platform/hosting_platform.module \hosting_platform_view()
- 7.4 platform/hosting_platform.module \hosting_platform_view()
- 7.3 platform/hosting_platform.module \hosting_platform_view()
Implementation of hook_view().
File
- platform/
hosting_platform.module, line 208 - Platform node type definition
Code
function hosting_platform_view($node, $teaser = FALSE, $page = FALSE) {
$node->content['info'] = array(
'#prefix' => '<div id="hosting-platform-info">',
'#suffix' => '</div>',
);
$node->content['info']['verified'] = array(
'#type' => 'item',
'#title' => t('Verified'),
'#value' => hosting_format_interval($node->verified),
'#weight' => -10,
);
$node->content['info']['publish_path'] = array(
'#type' => 'item',
'#title' => t('Publish path'),
'#value' => filter_xss($node->publish_path),
'#weight' => -8,
);
$node->content['info']['web_server'] = array(
'#type' => 'item',
'#title' => t('Web server'),
'#value' => _hosting_node_link($node->web_server),
'#weight' => -7,
);
if ($node->release) {
$release = sprintf("%s %s", $node->release->title, $node->release->version);
$node->content['info']['release'] = array(
'#type' => 'item',
'#title' => t('Release'),
'#value' => _hosting_node_link($node->release->nid, $release),
'#weight' => -6,
);
}
if ($node->nid == HOSTING_DEFAULT_PLATFORM) {
$node->content['info']['default_platform'] = array(
'#type' => 'item',
'#description' => t('This platform is the default platform for new sites'),
);
}
$node->content['sites_view'] = array(
'#type' => 'item',
'#value' => hosting_site_list("platform", $node->nid),
'#prefix' => '<div id="hosting-site-list">',
'#suffix' => '</div>',
'#weight' => 10,
);
if ($node->nid) {
$node->content['tasks_view'] = array(
'#type' => 'item',
'#value' => hosting_task_list_embedded("rid", $node->nid),
'#prefix' => '<div id="hosting-task-list">',
'#suffix' => '</div>',
'#weight' => -6,
);
}
return $node;
}