comparison noderef_view.module @ 6:e3f85c9247b7

Put the links in a right sidebar. This is probably highly controversial and should at least be controlled by a pref, but its "needed" by the customer.
author Franck Deroche <franck@defr.org>
date Mon, 26 Jan 2009 15:09:55 +0100
parents 4fc2f22efcdf
children b942365b70eb
comparison
equal deleted inserted replaced
5:4fc2f22efcdf 6:e3f85c9247b7
66 $fields = content_fields(); 66 $fields = content_fields();
67 $alter = _noderef_view_walk_form($form, $fields); 67 $alter = _noderef_view_walk_form($form, $fields);
68 if ($alter) { 68 if ($alter) {
69 // We've changed the form, add the JS-behavior and Views CSS 69 // We've changed the form, add the JS-behavior and Views CSS
70 // (the latter to deal with exposed filters in the popup) 70 // (the latter to deal with exposed filters in the popup)
71 $path = drupal_get_path('module', 'noderef_view');
72 drupal_add_js($path .'/noderef_view.js');
73 drupal_add_css($path .'/noderef_view.css');
71 drupal_add_css(drupal_get_path('module', 'views') .'/css/views.css'); 74 drupal_add_css(drupal_get_path('module', 'views') .'/css/views.css');
72 drupal_add_js(drupal_get_path('module', 'noderef_view') .'/noderef_view.js');
73 } 75 }
74 } 76 }
75 elseif ($form_id == 'views_exposed_form' && isset($_GET['destination'])) { 77 elseif ($form_id == 'views_exposed_form' && isset($_GET['destination'])) {
76 // Views "Exposed Filter" forms doesn't preserve destination by default. 78 // Views "Exposed Filter" forms doesn't preserve destination by default.
77 $form['destination'] = array( 79 $form['destination'] = array(
120 return FALSE; 122 return FALSE;
121 } 123 }
122 124
123 function noderef_view_add_link($form_element) { 125 function noderef_view_add_link($form_element) {
124 $form_element['#prefix'] = "<div class='noderef-view-wrapper'>" . $form_element['#prefix']; 126 $form_element['#prefix'] = "<div class='noderef-view-wrapper'>" . $form_element['#prefix'];
125 $form_element['#suffix'] .= $form_element['#links'] . '<span class="clear"></span></div>'; 127 $form_element['#suffix'] .= $form_element['#noderef_view_link'] . '<span class="clear-block"></span></div>';
126 return $form_element; 128 return $form_element;
127 } 129 }
128 130
129 /** 131 /**
130 * Création d'un lien vers une éventuelle vue associé au champ. 132 * Création d'un lien vers une éventuelle vue associé au champ.