Conjunto de cambios 59029b2 en sipes para modules_contrib/views/modules/user/views_plugin_argument_default_user.inc
- Fecha y hora:
- 26/05/2016 14:17:08 (hace 8 años)
- Branches:
- stable, version-3.0
- Children:
- 32a0eb4
- Parents:
- b907fa2
- Fichero:
-
- 1 editado
Leyenda
- No modificado
- Añadido
- Eliminado
-
modules_contrib/views/modules/user/views_plugin_argument_default_user.inc
r177a560 r59029b2 9 9 */ 10 10 class views_plugin_argument_default_user extends views_plugin_argument_default { 11 var $option_name = 'default_argument_user'; 11 function option_definition() { 12 $options = parent::option_definition(); 13 $options['user'] = array('default' => '', 'bool' => TRUE, 'translatable' => FALSE); 12 14 13 function argument_form(&$form, &$form_state) { 14 $form[$this->option_name] = array( 15 return $options; 16 } 17 18 function options_form(&$form, &$form_state) { 19 $form['user'] = array( 15 20 '#type' => 'checkbox', 16 21 '#title' => t('Also look for a node and use the node author'), 17 '#default_value' => !empty($this->argument->options[$this->option_name]), 18 '#process' => array('views_process_dependency'), 19 '#dependency' => array( 20 'radio:options[default_action]' => array('default'), 21 'radio:options[default_argument_type]' => array($this->id) 22 ), 23 '#dependency_count' => 2, 22 '#default_value' => $this->options['user'], 24 23 ); 24 } 25 26 function convert_options(&$options) { 27 if (!isset($options['user']) && isset($this->argument->options['default_argument_user'])) { 28 $options['user'] = $this->argument->options['default_argument_user']; 29 } 25 30 } 26 31 … … 40 45 } 41 46 42 if (!empty($this-> argument->options[$this->option_name])) {47 if (!empty($this->options['user'])) { 43 48 foreach (range(1, 3) as $i) { 44 49 $node = menu_get_object('node', $i); … … 53 58 } 54 59 55 if (!empty($this-> argument->options[$this->option_name])) {60 if (!empty($this->options['user'])) { 56 61 if (arg(0) == 'node' && is_numeric(arg(1))) { 57 62 $node = node_load(arg(1)); … … 70 75 } 71 76 } 72
Nota: Vea TracChangeset
para ayuda en el uso del visor de conjuntos de cambios.