mysite_get_layout($uid = NULL, $name = NULL, $reset = FALSE)
mysite.module, line 3542
Get the data associated with a layout file
$uid The $user->uid of the owner of the MySite page
$name The name of the MySite layout to load.
$reset A boolean flag for resetting the static variable.
$layout An array of data defined in mysite_layout_hook().
function mysite_get_layout($uid = NULL, $name = NULL, $reset = FALSE) {
static $layout = array();
$key = $uid .'-'. $name;
if (!isset($layout[$key]) || $reset) {
if (is_numeric($uid)) {
$sql = 'SELECT layout FROM {mysite} WHERE uid = %d';
$data = db_result(db_query($sql, $uid));
mysite_load_includes('layouts', $data);
$layout[$key] = module_invoke('mysite_layout', $data);
}
elseif (is_string($name)) {
mysite_load_includes('layouts', $name);
$layout[$key] = module_invoke('mysite_layout', $name);
}
}
return $layout[$key];
}