You are here

function simpleads_simpleads_order_info in SimpleAds 7

Implements hook_simpleads_order_info().

File

./simpleads.module, line 605

Code

function simpleads_simpleads_order_info() {
  $delta = array();
  $delta['random'] = t('Random');
  $delta['order_created_desc'] = t('Order by created date DESC');
  $delta['order_modified_desc'] = t('Order by modifed date DESC');
  $delta['order_title_asc'] = t('Order by node title ASC');

  // Nodequeue module integration
  if (module_exists('nodequeue')) {
    $qids = nodequeue_get_qids('simpleads');
    foreach ($qids as $row) {
      $nq = db_select('nodequeue_queue', 'nq')
        ->fields('nq', array(
        'qid',
        'name',
        'title',
      ))
        ->condition('nq.qid', $row->qid)
        ->execute()
        ->fetchObject();
      $delta['nqueue_' . $nq->qid] = t('Nodequeue: @name', array(
        '@name' => $nq->title,
      ));
    }
  }
  return $delta;
}