/[drupal]/contributions/modules/ubrowser/ubrowser.module
ViewVC logotype

Diff of /contributions/modules/ubrowser/ubrowser.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.4, Mon Feb 11 18:26:51 2008 UTC revision 1.4.2.1, Sat Oct 11 16:20:31 2008 UTC
# Line 231  function ubrowser_tree_form($options, $s Line 231  function ubrowser_tree_form($options, $s
231    $form['tid'] = array(    $form['tid'] = array(
232      '#type' => 'select',      '#type' => 'select',
233      '#title' => t('Select a !category', array('!category' => $category)),      '#title' => t('Select a !category', array('!category' => $category)),
234      '#size' => 10,      '#size' => 10,
235      '#options' => $options,      '#options' => $options,
236      '#attributes' => array('onchange' => "load_node_select(this.value, '". base_path() ."');"),      '#attributes' => array('onchange' => "load_node_select(this.value, '". base_path() ."');"),
237    );    );
238    
239    /**    /**
240     * Save the settings array as hidden input fields in the uBrowser form.     * Save the settings array as hidden input fields in the uBrowser form.
# Line 297  function ubrowser_nodes($tid, $nids) { Line 297  function ubrowser_nodes($tid, $nids) {
297    }    }
298    else {    else {
299      $result = _ubrowser_select_nodes(array($tid), $filter);      $result = _ubrowser_select_nodes(array($tid), $filter);
300      $options = array(0 => t('!Category contains !count !nodes!punctuation',      $options = array(0 => t('!Category contains !count !nodes!punctuation',
301                              array('!Category' => ucfirst($category),                              array('!Category' => ucfirst($category),
302                                    '!count' => db_num_rows($result),                                    '!count' => db_num_rows($result),
303                                    '!nodes' => ((db_num_rows($result) == 1) ? $nodesg : $nodepl),                                    '!nodes' => ((db_num_rows($result) == 1) ? $nodesg : $nodepl),
# Line 395  function ubrowser_nodesearch() { Line 395  function ubrowser_nodesearch() {
395          $options[$node->nid] = '('. $node->nid .') '. $node->title;          $options[$node->nid] = '('. $node->nid .') '. $node->title;
396        }        }
397      }      }
398    }    }
399    else {    else {
400      $options = array(0 => t('Search yielded !count results:', array('!count' => $j)));      $options = array(0 => t('Search yielded !count results:', array('!count' => $j)));
401      foreach($results as $result) {      foreach($results as $result) {
# Line 921  function ubrowser_builder($settings) { Line 921  function ubrowser_builder($settings) {
921    $form['ubb-build'] = array(    $form['ubb-build'] = array(
922      '#type' => 'submit',      '#type' => 'submit',
923      '#value' => isset($settings['display']) ? $settings['display'] : t('Display uBrowser'),      '#value' => isset($settings['display']) ? $settings['display'] : t('Display uBrowser'),
924      '#attributes' => array('onclick' => "return build_ubrowser('". base_path()      '#attributes' => array('onclick' => "return build_ubrowser('". base_path()
925                                         ."', '$code_id');"),                                         ."', '$code_id');"),
926    );    );
927    
# Line 948  function theme_ubrowser_builder($form) { Line 948  function theme_ubrowser_builder($form) {
948   * Rewrite of taxonomy_select_nodes() to return every matching node, not just   * Rewrite of taxonomy_select_nodes() to return every matching node, not just
949   * a subset for paged display. Includes ability to filter by node type.   * a subset for paged display. Includes ability to filter by node type.
950   */   */
951  function _ubrowser_select_nodes($tids = array(), $filter = NULL, $operator = 'or', $depth = 0, $pager = TRUE, $order = 'n.sticky DESC, n.created DESC') {  function _ubrowser_select_nodes($tids = array(), $filter = NULL, $operator = 'or', $depth = 0, $pager = TRUE, $order = 'n.sticky DESC, n.title ASC') {
952    if (count($tids) > 0) {    if (count($tids) > 0) {
953      if ($filter != NULL) {      if ($filter != NULL) {
954        if (strpos($filter, ',') > 0) {        if (strpos($filter, ',') > 0) {
# Line 992  function _ubrowser_select_nodes($tids = Line 992  function _ubrowser_select_nodes($tids =
992      $result = db_query($sql);      $result = db_query($sql);
993    }    }
994    
995    return $result;    return $result;
996  }  }
997    
998  /**  /**

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.4.2.1

  ViewVC Help
Powered by ViewVC 1.1.2