Révision ca0757b9
Ajouté par Assos Assos il y a plus de 9 ans
drupal7/sites/all/modules/webform/webform.module | ||
---|---|---|
151 | 151 |
'type' => MENU_LOCAL_TASK, |
152 | 152 |
); |
153 | 153 |
$items['node/%webform_menu/webform/emails/%webform_menu_email'] = array( |
154 |
'title' => 'Edit e-mail settings', |
|
155 | 154 |
'load arguments' => array(1), |
156 | 155 |
'page arguments' => array('webform_email_edit_form', 1, 4), |
157 | 156 |
'access callback' => 'node_access', |
158 | 157 |
'access arguments' => array('update', 1), |
159 | 158 |
'file' => 'includes/webform.emails.inc', |
160 |
'type' => MENU_LOCAL_TASK,
|
|
159 |
'type' => MENU_CALLBACK,
|
|
161 | 160 |
); |
162 | 161 |
$items['node/%webform_menu/webform/emails/%webform_menu_email/delete'] = array( |
163 |
'title' => 'Delete e-mail settings', |
|
164 | 162 |
'load arguments' => array(1), |
165 | 163 |
'page arguments' => array('webform_email_delete_form', 1, 4), |
166 | 164 |
'access callback' => 'node_access', |
167 | 165 |
'access arguments' => array('update', 1), |
168 |
'type' => MENU_LOCAL_TASK,
|
|
166 |
'type' => MENU_CALLBACK,
|
|
169 | 167 |
); |
170 | 168 |
|
171 | 169 |
// Node component forms. |
... | ... | |
1010 | 1008 |
// are being displayed. |
1011 | 1009 |
$node = $renderable['#node']; |
1012 | 1010 |
$is_admin = webform_results_access($node); |
1011 |
module_load_include('inc', 'webform', 'includes/webform.components'); |
|
1013 | 1012 |
if (empty($renderable['#email']) && !$is_admin) { |
1014 | 1013 |
// Find and hide the display of all hidden components. |
1015 | 1014 |
foreach ($node->webform['components'] as $cid => $component) { |
... | ... | |
2086 | 2085 |
} |
2087 | 2086 |
} |
2088 | 2087 |
|
2089 |
// Private component? |
|
2090 |
if ($component['extra']['private']) { |
|
2091 |
$show_component = webform_results_access($node); |
|
2092 |
} |
|
2093 |
|
|
2094 | 2088 |
return $show_component; |
2095 | 2089 |
} |
2096 | 2090 |
|
... | ... | |
2126 | 2120 |
*/ |
2127 | 2121 |
function _webform_client_form_add_component($node, $component, $component_value, &$parent_fieldset, &$form, $form_state, $submission, $format = 'form', $page_num = 0, $filter = TRUE) { |
2128 | 2122 |
$cid = $component['cid']; |
2123 |
$component_access = empty($component['extra']['private']) || webform_results_access($node); |
|
2129 | 2124 |
|
2130 | 2125 |
// Load with submission information if necessary. |
2131 | 2126 |
if ($format != 'form') { |
2132 | 2127 |
// This component is display only. |
2133 | 2128 |
$data = empty($submission->data[$cid]['value']) ? NULL : $submission->data[$cid]['value']; |
2134 | 2129 |
if ($display_element = webform_component_invoke($component['type'], 'display', $component, $data, $format)) { |
2130 |
// Set access based on the private property. |
|
2131 |
$element['#access'] = $component_access; |
|
2132 |
|
|
2135 | 2133 |
// Ensure the component is added as a property. |
2136 | 2134 |
$display_element['#webform_component'] = $component; |
2137 | 2135 |
|
... | ... | |
2159 | 2157 |
// Add this user-defined field to the form (with all the values that are always available). |
2160 | 2158 |
$data = isset($submission->data[$cid]['value']) ? $submission->data[$cid]['value'] : NULL; |
2161 | 2159 |
if ($element = webform_component_invoke($component['type'], 'render', $component, $data, $filter)) { |
2160 |
// Set access based on the private property. |
|
2161 |
$element['#access'] = $component_access; |
|
2162 |
|
|
2162 | 2163 |
// Ensure the component is added as a property. |
2163 | 2164 |
$element['#webform_component'] = $component; |
2164 | 2165 |
|
... | ... | |
2709 | 2710 |
} |
2710 | 2711 |
$output = '<div class="' . implode(' ', $wrapper_classes) . '" id="webform-component-' . $parents . '">' . "\n"; |
2711 | 2712 |
|
2713 |
// If #title_display is none, set it to invisible instead - none only used if |
|
2714 |
// we have no title at all to use. |
|
2715 |
if ($element['#title_display'] == 'none') { |
|
2716 |
$variables['element']['#title_display'] = 'invisible'; |
|
2717 |
$element['#title_display'] = 'invisible'; |
|
2718 |
} |
|
2712 | 2719 |
// If #title is not set, we don't display any label or required marker. |
2713 | 2720 |
if (!isset($element['#title'])) { |
2714 | 2721 |
$element['#title_display'] = 'none'; |
... | ... | |
3359 | 3366 |
if ($encode) { |
3360 | 3367 |
$name = mime_header_encode($name); |
3361 | 3368 |
} |
3369 |
$name = trim($name); |
|
3362 | 3370 |
return '"' . $name . '" <' . $address . '>'; |
3363 | 3371 |
} |
3364 | 3372 |
else { |
... | ... | |
3769 | 3777 |
function webform_email_html_capable() { |
3770 | 3778 |
// TODO: Right now we only support MIME Mail and HTML Mail. Support others |
3771 | 3779 |
// if available through a hook? |
3772 |
if (module_exists('mimemail')) { |
|
3773 |
$mail_systems = variable_get('mail_system', array('default-system' => 'DefaultMailSystem')); |
|
3774 |
$enable = (!isset($mail_systems['webform']) || $mail_systems['webform'] == 'MimeMailSystem') ? 'MimeMailSystem' : FALSE; |
|
3775 |
} |
|
3776 |
elseif (module_exists('htmlmail')) { |
|
3777 |
$mail_systems = variable_get('mail_system', array('default-system' => 'DefaultMailSystem')); |
|
3778 |
$enable = (!isset($mail_systems['webform']) || $mail_systems['webform'] == 'HTMLMailSystem') ? 'HTMLMailSystem' : FALSE; |
|
3780 |
$supported_html_modules = array( |
|
3781 |
'mimemail' => 'MimeMailSystem', |
|
3782 |
'htmlmail' => 'HTMLMailSystem', |
|
3783 |
); |
|
3784 |
foreach ($supported_html_modules as $mail_module => $mail_system_name) { |
|
3785 |
if (module_exists($mail_module)) { |
|
3786 |
$mail_systems = variable_get('mail_system', array('default-system' => 'DefaultMailSystem')); |
|
3787 |
if (isset($mail_systems['webform'])) { |
|
3788 |
$enable = strpos($mail_systems['webform'], $mail_system_name) !== FALSE ? $mail_systems['webform'] : FALSE; |
|
3789 |
} |
|
3790 |
else { |
|
3791 |
$enable = $mail_system_name; |
|
3792 |
} |
|
3793 |
} |
|
3779 | 3794 |
} |
3780 | 3795 |
if (!empty($enable)) { |
3781 | 3796 |
// We assume that if a solution exists even if it's not specified we should |
Formats disponibles : Unified diff
Weekly update of contrib modules