You are here

public function ContentProfilePageViewProfile::getForm in Content Profile 6

File

./content_profile.pageroute.inc, line 86

Class

ContentProfilePageViewProfile
ContentProfilePageViewProfile displays a content profile.

Code

public function getForm(&$form, &$form_state, &$args) {
  $page =& $form_state['page'];
  $args['hide_pageroute_buttons'] = FALSE;
  $args['default_target'] = PAGEROUTE_CURRENT;
  $node = node_load(array(
    'type' => $page->options['content-type'],
    'uid' => pageroute_page_get_uid($page),
  ));
  if ($node->nid && node_access('view', $node)) {
    if (empty($this->title)) {
      drupal_set_title(check_plain($node->title));
    }
    node_tag_new($node->nid);
    $form += array(
      'pageroute-view' => array(
        '#value' => node_view($node, FALSE, TRUE, FALSE),
      ),
    );
  }
  else {
    $type_name = node_get_types('name', $page->options['content-type']);
    $form += array(
      'pageroute-view' => array(
        '#value' => theme('content_profile_pageroute_empty', $type_name),
      ),
    );
  }
}