You are here

function nodeorder_vocabulary_can_be_ordered in Node Order 7

Same name and namespace in other branches
  1. 5 nodeorder.module \nodeorder_vocabulary_can_be_ordered()
  2. 6 nodeorder.module \nodeorder_vocabulary_can_be_ordered()

Returns TRUE if the vocabulary is orderable.

3 calls to nodeorder_vocabulary_can_be_ordered()
nodeorder_node_view in ./nodeorder.module
Implements hook_node_view().
nodeorder_taxonomy_order_access in ./nodeorder.module
Custom access function which determines whether or not the user is allowed to reorder nodes and if the vocabulary is orderable.
nodeorder_term_can_be_ordered in ./nodeorder.module
Returns TRUE if the term is in an orderable vocabulary.

File

./nodeorder.module, line 688
Nodeorder module.

Code

function nodeorder_vocabulary_can_be_ordered($vid, $reset = FALSE) {
  $vocabularies =& drupal_static(__FUNCTION__);
  if ($reset || !isset($vocabularies)) {
    $vocabularies = db_select('taxonomy_vocabulary', 'v')
      ->fields('v', array(
      'vid',
    ))
      ->condition('v.module', 'nodeorder')
      ->execute()
      ->fetchAllKeyed(0, 0);
  }
  return !empty($vocabularies[$vid]);
}