function hosting_site_view in Hosting 6.2
Same name and namespace in other branches
- 5 site/hosting_site.module \hosting_site_view()
- 7.4 site/hosting_site.nodeapi.inc \hosting_site_view()
- 7.3 site/hosting_site.nodeapi.inc \hosting_site_view()
Implementation of hook_view().
File
- site/
hosting_site.nodeapi.inc, line 23 - Site nodeapi implementations.
Code
function hosting_site_view(&$node, $teaser = false) {
hosting_set_breadcrumb($node);
modalframe_parent_js();
$node->content['info']['#prefix'] = '<div id="hosting-site-info" class="hosting-info-list">';
if ($node->site_status == HOSTING_SITE_ENABLED) {
$node->content['info']['link'] = array(
'#value' => _hosting_site_goto_link($node),
'#weight' => -10,
);
}
if (is_numeric($node->client)) {
$node->content['info']['client'] = array(
'#type' => 'item',
'#title' => t('Client'),
'#value' => _hosting_node_link($node->client),
'#weight' => 5,
);
}
$node->content['info']['verified'] = array(
'#type' => 'item',
'#title' => t('Verified'),
'#value' => hosting_format_interval($node->verified),
);
$node->content['info']['platform'] = array(
'#type' => 'item',
'#title' => t('Platform'),
'#value' => _hosting_node_link($node->platform),
);
if ($node->profile) {
$node->content['info']['profile'] = array(
'#type' => 'item',
'#title' => t('Install profile'),
'#value' => _hosting_node_link($node->profile),
);
}
if ($node->site_language) {
$node->content['info']['site_language'] = array(
'#type' => 'item',
'#title' => t('Language'),
'#value' => _hosting_language_name($node->site_language),
);
}
if ($node->nid) {
$node->content['info']['status'] = array(
'#type' => 'item',
'#title' => t('Status'),
'#value' => _hosting_site_status($node),
);
}
if ($node->db_server) {
$node->content['info']['db_server'] = array(
'#type' => 'item',
'#title' => t('Database server'),
'#value' => _hosting_node_link($node->db_server),
);
}
if ($node->db_name) {
$node->content['info']['db_name'] = array(
'#type' => 'item',
'#title' => t('Database name'),
'#value' => check_plain($node->db_name),
);
}
$node->content['info']['#suffix'] = '</div>';
if ($node->nid) {
$node->content['tasks_view'] = array(
'#type' => 'item',
'#value' => hosting_task_table($node),
'#prefix' => '<div id="hosting-task-list">',
'#suffix' => '</div>',
'#weight' => 10,
);
$settings['hostingTaskRefresh'] = array(
'nid' => $node->nid,
'changed' => $node->changed,
);
drupal_add_js($settings, 'setting');
drupal_add_js(drupal_get_path('module', 'hosting_task') . '/hosting_task.js');
}
return $node;
}