function blocks_render_blocks
Search API
4.x blocks.module | blocks_render_blocks($section, $region, $title_style = "curved") |
5.x blocks.module | blocks_render_blocks($section, $region, $title_style = "curved") |
This function will actually render the HTML for the blocks requested for a particular section and region.
2 calls to blocks_render_blocks()
- system_display_login_page in modules/
system/ system.module - Display the "login" page. This is the default page displayed to the user, at /login, if they have not logged in yet.
- system_display_main_page in modules/
system/ system.module - Display the "main" tab-page for FlightPath. Displays announcements as well as the Tools menu, and the "special administrative tools" menu.
File
- modules/
blocks/ blocks.module, line 437
Code
function blocks_render_blocks($section, $region, $title_style = "curved") {
$rtn = "";
$rtn .= "<div class='blocks-blocks'>";
$c = 0;
$res = db_query("SELECT * FROM blocks WHERE section = '?' AND region = '?'
ORDER BY weight", $section, $region);
while ($cur = db_fetch_array($res)) {
$module = $cur ["module"];
$delta = $cur ["delta"];
$block = FALSE;
if (function_exists($module . "_render_block")) {
$block = call_user_func($module . "_render_block", $delta);
}
if (!$block) {
continue;
}
$extra_class = "";
if ($c == 0) {
$extra_class = " block-first";
}
$rtn .= "<div class='block-$module-$delta $extra_class'>";
if ($block ["title"] != "") {
if ($title_style == "curved") {
$rtn .= fp_render_curved_line($block ["title"]);
}
else if ($title_stule == "square") {
$rtn .= fp_render_square_line($block ["title"]);
}
}
$rtn .= "<div class='block-body'>" . $block ["body"] . "</div>";
$rtn .= "</div>";
$c++;
}
$rtn .= "</div>";
return $rtn;
}