mysite_output

Definition

mysite_output($owner, $mysite, $content = array(), $pageview = TRUE)
mysite.module, line 802

Description

Return the proper content based on the request.

Parameters

$owner The $user object for the owner of this page.

$mysite Information about this MySite collection, taken from mysite_get().

$content The content elements to render for this page.

$pageview Boolean flag that indicates the data will be viewed using theme_page. If you want to access this data externally, set $pageview = FALSE.

Return value

Normally returns a themed HTML page. If accessed from an external function, may return the $content array.

Code

function mysite_output($owner, $mysite, $content = array(), $pageview = TRUE) {
  if ($pageview) {
    if (!empty($content['data'])) {
      print theme('mysite_'. $mysite->layout .'_layout', $content);
    }
    else {
      global $user;
      $output = '';
      $_mysite_menu = mysite_content_menu();
      if ($user->uid == $owner->uid) {
        drupal_set_message(t('%name, you have no content saved.', array('%name' => $owner->name)));
      }
      else {
        drupal_set_message(t('%name has no content saved.', array('%name' => $owner->name)));
      }
      $output .= theme('mysite_content_help', $owner);
      print theme('page', $output, variable_get('mysite_fullscreen', 1));
    }
    return;
  }
  else {
    return $content;
  }
}