Closed (fixed)
Project:
Priorities
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
1 Jul 2011 at 09:27 UTC
Updated:
8 Aug 2011 at 13:01 UTC
Hi,
Here is a list of some enhancements for the main survey page built by Function priorities_get_set_priorities()
This new code is below :
function priorities_get_set_priorities($survey) {
$output = '';
if ($survey['status'] == 3) {
// For consistency and clearer information we use drupal_set_message and we leave the function here.
drupal_set_message(t('Sorry, this survey is disabled, you cannot set priorities anymore, nor see its results.') . l(t(' Back to the surveys list'), 'priorities') . '.', 'warning', FALSE);
return $output;
}
else {
// If available we add the description of the survey.
$output .= '<div id="priorities-description">' . (empty($survey['description']) ? '' : check_markup($survey['description'], FILTER_FORMAT_DEFAULT, FALSE)) . '</div>';
// Add an unordered list instead of an html list. OK this is mostly cosmetic!
$output .= '<ul>';
if ($survey['status'] < 2 && priorities_set_access($survey)) {
$output .= '<li>' . l(variable_get('priorities_set_title', t('Set priorities to answer this survey')), 'priorities/' . $survey['survey_name'] . '/set') . '</li>';
}
if (in_array($survey['status'], array(0, 2)) && priorities_get_access($survey)) {
$output .= '<li>' . l(variable_get('priorities_get_title', t('Get results for this survey')), 'priorities/' . $survey['survey_name'] . '/results') . '</li>';
}
}
// If the user can edit this survey, then we add a link here for convenience.
if (user_access('administer priorities')) {
$output .= '<li>' . l('Edit this survey', 'admin/settings/priorities/' . $survey['survey_name']) . '</li>';
}
// End of the unordered list.
$output .= '</ul>';
// For convenience we add a link to the surveys list.
$output .= l(t('Back to the surveys list'), 'priorities');
return $output;
}
Comments
Comment #1
gibus commentedOK, this has been commited in version 6.x-2.18.