class ContentProfilePageViewProfile in Content Profile 6
ContentProfilePageViewProfile displays a content profile.
Hierarchy
- class \ContentProfilePageViewProfile extends \PageroutePageView
Expanded class hierarchy of ContentProfilePageViewProfile
File
- ./
content_profile.pageroute.inc, line 82
View source
class ContentProfilePageViewProfile extends PageroutePageView {
/*
* Returns the page display for the configured node
*/
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),
),
);
}
}
public function getAdminForm($page, &$form) {
$form['options']['content-type'] = array(
'#type' => 'select',
'#title' => t('Profile content type'),
'#options' => content_profile_get_types('names'),
'#required' => TRUE,
'#default_value' => $page->options['content-type'],
'#weight' => 2,
'#description' => t('You can only use content types marked as \'content profile\''),
);
}
public static function help() {
return t('The lonely node display page can be used to view this lonely node. This might be useful for displaying the lonely node aftercreation or update. There will be a (themeable) message if there is no node that can be displayed.');
}
public static function info() {
return array(
'name' => t('Content profile display'),
);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ContentProfilePageViewProfile:: |
public | function | ||
ContentProfilePageViewProfile:: |
public | function | ||
ContentProfilePageViewProfile:: |
public static | function | ||
ContentProfilePageViewProfile:: |
public static | function |