function _nodesinblock_render_status in Nodes In Block 6
Helper function to return the status.
Parameters
integer $status The current status of a node.:
boolean $return Whether to return the complete array or a string.:
Return value
string or array Complete array or Human name of render status.
2 calls to _nodesinblock_render_status()
- nodesinblock_form_alter in ./
nodesinblock.module - Implementation of hook_form_alter(). Add Nodes in block fieldset.
- nodesinblock_settings in ./
nodesinblock.admin.inc - Menu callback to configure general settings for nodes in block.
File
- ./
nodesinblock.module, line 297 - Nodes in block makes it possible to add multiple nodes in one block.
Code
function _nodesinblock_render_status($status, $return = FALSE) {
static $render_states = array();
if (empty($render_states)) {
$render_states = array(
NIB_RENDER_TEASER_WITH_LINKS => t('Teaser with links'),
NIB_RENDER_TEASER_WITHOUT_LINKS => t('Teaser without links'),
NIB_RENDER_PAGE_WITH_LINKS => t('Page with links'),
NIB_RENDER_PAGE_WITHOUT_LINKS => t('Page without links'),
);
// Node Displays support.
if (module_exists('nd')) {
$render_states = array();
if (function_exists('ds_get_build_modes')) {
$build_modes = ds_get_build_modes('nd');
foreach ($build_modes as $key => $build_mode) {
$render_states[$key] = $build_mode['title'];
}
}
else {
// For the sake of people who might use very older versions.
$build_modes = nd_get_build_modes();
foreach ($build_modes as $key => $build_mode) {
$render_states[$key] = $build_mode['build modes'][$key]['title'];
}
}
}
}
if ($return == TRUE) {
return $render_states[$status];
}
else {
return $render_states;
}
}