You are here

public function ContentProfilePageEditProfile::getForm in Content Profile 6

File

./content_profile.pageroute.inc, line 24

Class

ContentProfilePageEditProfile
ContentProfilePageEditProfile displays a form that allows users to edit content profiles.

Code

public function getForm(&$form, &$form_state, &$args) {
  $args['hide_pageroute_buttons'] = FALSE;
  $args['default_target'] = PAGEROUTE_CURRENT;
  $page =& $form_state['page'];
  if (isset($form_state['node']) && $form_state['node']['type'] == $this->options['content-type']) {
    $node = $form_state['node'];
  }
  else {
    if (isset($page)) {
      $node = node_load(array(
        'type' => $this->options['content-type'],
        'uid' => pageroute_page_get_uid($page),
      ));
    }
  }
  if (empty($node)) {
    PageroutePageAdd::setNodeAddForm($form, $form_state, $page);
  }
  else {
    $this
      ->setNodeEditForm($form, $form_state, $page, $args, $node);
  }
  parent::unsetForm($form);
}