function bulk_photo_nodes_is_bpn_add_page in Bulk File Nodes 7
Determines if a given node type's add form should be displayed as a BPN form.
Return value
bool TRUE if the current node add form is used by bpn, FALSE otherwise.
2 calls to bulk_photo_nodes_is_bpn_add_page()
- BulkPhotoNodesTestCase::testContentTypesSave in tests/
bulk_photo_nodes.test - Tests basic functionality of bulk_photo_nodes.module.
- bulk_photo_nodes_page in ./
bulk_photo_nodes.module - Page callback: Displays the first step of the bulk photo node upload form.
File
- ./
bulk_photo_nodes.module, line 268 - hooks and helper functions for bulk photo node.
Code
function bulk_photo_nodes_is_bpn_add_page($node_type) {
$query = drupal_get_query_parameters();
if (!is_array($query) || !array_key_exists('override', $query)) {
$bpn_var = variable_get('bulk_photo_node_types');
$has_bpn_field = !empty($bpn_var) && isset($bpn_var[$node_type]) && $bpn_var[$node_type] !== 'none';
$is_overridden = isset($bpn_var[$node_type . '_override']) && $bpn_var[$node_type . '_override'] != 1;
if ($has_bpn_field && !$is_overridden) {
return TRUE;
}
}
return FALSE;
}