You are here

function smartqueue_domain_check_subqueues in Smartqueue Domain 7

Check the current queue and add the domains subqueues if they don't exist.

3 calls to smartqueue_domain_check_subqueues()
smartqueue_domain_domain_insert in ./smartqueue_domain.module
Implements hook_domain_insert().
smartqueue_domain_nodequeue_form_submit_finish in ./smartqueue_domain.module
Implements hook_nodequeue_form_submit_finish().
smartqueue_domain_nodequeue_subqueues in ./smartqueue_domain.module
Implements hook_nodequeue_subqueues().

File

./smartqueue_domain.module, line 72

Code

function smartqueue_domain_check_subqueues(&$queue) {
  $domains = domain_domains(TRUE);
  foreach ($domains as $id => $domain) {
    $ref = $queue->name . ':domain:' . $domain['machine_name'] . ':' . $domain['domain_id'];
    $subqueue = nodequeue_load_subqueues_by_reference(array(
      $queue->qid => array(
        $ref,
      ),
    ));
    if (empty($subqueue)) {
      nodequeue_add_subqueue($queue, $queue->title . ' - ' . $domain['sitename'], $ref);
    }
  }
}