Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEPT-1813: Improve platform feature #1894

Merged
merged 8 commits into from
Mar 27, 2018
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ function multisite_block_carousel_contents($delta) {
switch ($item['type']) {
case 'image':
$thumb = image_style_url('landscape', $item['uri']);
$return .= '<a href="' . $path . '">';
$return .= '<a href="' . check_plain($path) . '">';
$return .= '<img src="' . $thumb . '" alt="' . check_plain($item['filename']) . '" />';
$return .= '<p class="carousel-caption">' . (isset($item['field_picture_description'][LANGUAGE_NONE][0]['safe_value']) ? filter_xss($item['field_picture_description'][LANGUAGE_NONE][0]['safe_value']) : check_plain($item['filename'])) . '</p>';
$return .= '</a>';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -586,15 +586,17 @@ function nexteuropa_multilingual_preprocess_field(&$variables) {

// Translate label.
if (!empty($variables['label'])) {
$variables['label'] = i18n_field_translate_property($instance, 'label', $lang);
// Use "check_plain" function to secure the label value like the "field"
// module does.
$variables['label'] = check_plain(i18n_field_translate_property($instance, 'label', $lang));
}
// Translate field value (for select list field).
if ($field['type'] == 'list_text' && $translated_value = i18n_field_translate_allowed_values($field, $lang)) {
foreach ($variables['items'] as $key => $item) {
// Get key of the value.
$key_value = $element['#items'][$key]['value'];
// Get translated field value.
$variables['items'][$key]['#markup'] = $translated_value[$key_value];
$variables['items'][$key]['#markup'] = field_filter_xss($translated_value[$key_value]);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ function survey_core_node_view($node, $view_mode, $langcode) {
*/
function survey_core_menu() {
$items = array();
$items['survey_analysis/%'] = array(
$items['survey_analysis/%node'] = array(
'title' => 'Analysis',
'page callback' => 'survey_analysis',
'page arguments' => array(1),
'access callback' => TRUE,
'access callback' => 'webform_results_access',
'access arguments' => array(1),
'weight' => 5,
);

Expand All @@ -42,9 +43,18 @@ function survey_core_menu() {

/**
* Display analysis results of a webform.
*
* @param mixed $node
* The nid or the object of the node to which the webform is attached.
*
* @return string
* The survey analysis page to display.
*/
function survey_analysis($nid) {
$node = node_load($nid);
function survey_analysis($node) {
if (!is_object($node)) {
$node = node_load($node);
}

$sids = array();
$components = $node->webform['components'];
$data = array();
Expand Down
2 changes: 1 addition & 1 deletion resources/multisite_drupal_standard.make
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,7 @@ libraries[respond][download][url] = https://raw.githubusercontent.com/scottjehl/
projects[ec_resp][type] = theme
projects[ec_resp][download][type] = git
projects[ec_resp][download][url] = https://github.com/ec-europa/ec_resp.git
projects[ec_resp][download][tag] = 2.3.5
projects[ec_resp][download][tag] = 2.3.6

projects[atomium][type] = theme
projects[atomium][version] = 2.7
Expand Down