comparison noderef_view.module @ 15:bf2615aab48c tip

Make the module Coder-clean
author Franck Deroche <franck@defr.org>
date Tue, 31 Mar 2009 17:31:55 +0200
parents e060ad73e358
children
comparison
equal deleted inserted replaced
14:e060ad73e358 15:bf2615aab48c
42 function noderef_view_select($node, $context) { 42 function noderef_view_select($node, $context) {
43 static $count = 0; 43 static $count = 0;
44 if ($count == 0 && is_array($_COOKIE['noderef'])) { 44 if ($count == 0 && is_array($_COOKIE['noderef'])) {
45 // Reset the cookies 45 // Reset the cookies
46 $before = time() - 300; 46 $before = time() - 300;
47 foreach($_COOKIE['noderef'] as $id => $val) { 47 foreach ($_COOKIE['noderef'] as $id => $val) {
48 setcookie('noderef['. $id .']', 0, $before, '/'); 48 setcookie('noderef['. $id .']', 0, $before, '/');
49 } 49 }
50 } 50 }
51 $count++; 51 $count++;
52 $five = time() + 300; 52 $five = time() + 300;
90 * @return 90 * @return
91 * TRUE si un élement a été modifié, FALSE sinon 91 * TRUE si un élement a été modifié, FALSE sinon
92 */ 92 */
93 function _noderef_view_walk_form(&$form, $fields, $items) { 93 function _noderef_view_walk_form(&$form, $fields, $items) {
94 $alter = FALSE; 94 $alter = FALSE;
95 foreach($items as $key => $item) { 95 foreach ($items as $key => $item) {
96 if (is_array($item)) { 96 if (is_array($item)) {
97 if (isset($fields[$key])) { 97 if (isset($fields[$key])) {
98 $alter |= noderef_view_alter_item($form, $key, $fields[$key]); 98 $alter |= noderef_view_alter_item($form, $key, $fields[$key]);
99 } 99 }
100 else { 100 else {
136 // Try to find a path for this view, looking at the displays 136 // Try to find a path for this view, looking at the displays
137 if (!is_array($view->display)) { 137 if (!is_array($view->display)) {
138 return ''; 138 return '';
139 } 139 }
140 $path = ''; 140 $path = '';
141 foreach($view->display as $display) { 141 foreach ($view->display as $display) {
142 if (is_array($display->display_options) 142 if (is_array($display->display_options)
143 && isset($display->display_options['path'])) { 143 && isset($display->display_options['path'])) {
144 $path = $display->display_options['path']; 144 $path = $display->display_options['path'];
145 break; 145 break;
146 } 146 }