Révision c304a780
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/ctools/views_content/plugins/content_types/views_panes.inc | ||
---|---|---|
179 | 179 |
$args[] = (isset($conf['arguments'][$id]) && $conf['arguments'][$id] !== '') ? ctools_context_keyword_substitute($conf['arguments'][$id], array(), $contexts) : NULL; |
180 | 180 |
break; |
181 | 181 |
|
182 |
case 'wildcard': |
|
182 |
case 'wildcard':
|
|
183 | 183 |
// Put in the wildcard. |
184 |
$args[] = isset($arguments[$id]['wildcard']) ? $arguments[$id]['wildcard'] : '*'; |
|
185 |
break; |
|
186 |
|
|
187 |
case 'none': |
|
188 |
default: |
|
189 |
// Put in NULL. |
|
190 |
// views.module knows what to do with NULL (or missing) arguments
|
|
191 |
$args[] = NULL; |
|
192 |
break; |
|
184 |
$args[] = isset($arguments[$id]['wildcard']) ? $arguments[$id]['wildcard'] : '*';
|
|
185 |
break;
|
|
186 |
|
|
187 |
case 'none':
|
|
188 |
default:
|
|
189 |
// Put in NULL.
|
|
190 |
// views.module knows what to do with NULL (or missing) arguments.
|
|
191 |
$args[] = NULL;
|
|
192 |
break;
|
|
193 | 193 |
} |
194 | 194 |
} |
195 | 195 |
|
196 |
// remove any trailing NULL arguments as these are non-args:
|
|
196 |
// Remove any trailing NULL arguments as these are non-args:
|
|
197 | 197 |
while (count($args) && end($args) === NULL) { |
198 | 198 |
array_pop($args); |
199 | 199 |
} |
... | ... | |
208 | 208 |
if ($allow['path_override'] && !empty($conf['path'])) { |
209 | 209 |
$view->override_path = $conf['path']; |
210 | 210 |
} |
211 |
else if ($path = $view->display_handler->get_option('inherit_panels_path')) {
|
|
211 |
elseif ($path = $view->display_handler->get_option('inherit_panels_path')) { |
|
212 | 212 |
if (drupal_is_front_page()) { |
213 | 213 |
$view->override_path = ''; |
214 | 214 |
} |
... | ... | |
219 | 219 |
|
220 | 220 |
$block = new stdClass(); |
221 | 221 |
$block->module = 'views'; |
222 |
$block->delta = $view->name . '-' . $display;
|
|
222 |
$block->delta = $view->name . '-' . $display; |
|
223 | 223 |
|
224 | 224 |
if (($allow['link_to_view'] && !empty($conf['link_to_view'])) || |
225 | 225 |
(!$allow['link_to_view'] && $view->display_handler->get_option('link_to_view'))) { |
226 | 226 |
$block->title_link = $view->get_url(); |
227 | 227 |
} |
228 | 228 |
|
229 |
// more link
|
|
229 |
// More link.
|
|
230 | 230 |
if ($allow['more_link']) { |
231 | 231 |
if (empty($conf['more_link'])) { |
232 | 232 |
$view->display_handler->set_option('use_more', FALSE); |
233 | 233 |
} |
234 | 234 |
else { |
235 | 235 |
$view->display_handler->set_option('use_more', TRUE); |
236 |
// make sure the view runs the count query so we know whether or not the
|
|
236 |
// Make sure the view runs the count query so we know whether or not the
|
|
237 | 237 |
// more link applies. |
238 | 238 |
$view->get_total_rows = TRUE; |
239 | 239 |
} |
... | ... | |
386 | 386 |
); |
387 | 387 |
} |
388 | 388 |
} |
389 |
if ($allow['link_to_view'] ) {
|
|
389 |
if ($allow['link_to_view']) { |
|
390 | 390 |
$form['link_to_view'] = array( |
391 | 391 |
'#type' => 'checkbox', |
392 | 392 |
'#default_value' => isset($conf['link_to_view']) ? $conf['link_to_view'] : $view->display_handler->get_option('link_to_view'), |
... | ... | |
437 | 437 |
$form['use_pager'] = array( |
438 | 438 |
'#type' => 'checkbox', |
439 | 439 |
'#title' => t('Use pager'), |
440 |
'#default_value' => $conf['use_pager'],
|
|
440 |
'#default_value' => $conf['use_pager'], |
|
441 | 441 |
'#id' => 'use-pager-checkbox', |
442 | 442 |
'#prefix' => '<div class="container-inline">', |
443 | 443 |
); |
... | ... | |
558 | 558 |
$form['exposed']['sort_order'] = $exposed_form['sort_order']; |
559 | 559 |
} |
560 | 560 |
|
561 |
// Add the view object to the form to allow additional customization |
|
561 |
// Add the view object to the form to allow additional customization.
|
|
562 | 562 |
$form_state['view'] = $view; |
563 | 563 |
|
564 | 564 |
return $form; |
... | ... | |
570 | 570 |
function views_content_views_panes_content_type_edit_form_submit(&$form, &$form_state) { |
571 | 571 |
// Copy everything from our defaults. |
572 | 572 |
$keys = array('link_to_view', 'more_link', 'feed_icons', 'use_pager', |
573 |
'pager_id', 'items_per_page', 'offset', 'path_override', 'path', 'arguments', 'fields_override', 'exposed'); |
|
573 |
'pager_id', 'items_per_page', 'offset', 'path_override', 'path', 'arguments', 'fields_override', 'exposed', |
|
574 |
); |
|
574 | 575 |
|
575 | 576 |
foreach ($keys as $key) { |
576 | 577 |
if (isset($form_state['values'][$key])) { |
... | ... | |
579 | 580 |
} |
580 | 581 |
} |
581 | 582 |
|
582 |
|
|
583 | 583 |
/** |
584 | 584 |
* Returns the administrative title for a type. |
585 | 585 |
*/ |
... | ... | |
614 | 614 |
$view->set_display($display_name); |
615 | 615 |
views_content_views_panes_add_defaults($conf, $view); |
616 | 616 |
|
617 |
// Add arguments first |
|
617 |
// Add arguments first.
|
|
618 | 618 |
if (!empty($conf['arguments'])) { |
619 | 619 |
$keys = array_keys($conf['arguments']); |
620 | 620 |
$values = array_values($conf['arguments']); |
621 | 621 |
$argument_input = $view->display_handler->get_option('argument_input'); |
622 | 622 |
|
623 | 623 |
foreach ($conf['arguments'] as $key => $value) { |
624 |
if (!empty($value)){ |
|
624 |
if (!empty($value)) {
|
|
625 | 625 |
$label = $argument_input[$key]['label']; |
626 | 626 |
$info[] = $label . ': ' . $value; |
627 | 627 |
} |
628 | 628 |
} |
629 | 629 |
} |
630 | 630 |
|
631 |
$block = new stdClass; |
|
631 |
$block = new stdClass();
|
|
632 | 632 |
if ($info) { |
633 | 633 |
$block->title = array_shift($info); |
634 | 634 |
|
Formats disponibles : Unified diff
Weekly update of contrib modules