Skip to content

Commit

Permalink
Dev: bad naming sqg to sgq in do_listwithcomment
Browse files Browse the repository at this point in the history
Dev: review partial list with comment
Dev: MUST use aria-labelledby on the group : see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-describedby_attribute
  • Loading branch information
Shnoulle committed Nov 18, 2016
1 parent 180cc06 commit 1183e49
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 24 deletions.
7 changes: 3 additions & 4 deletions application/helpers/qanda_helper.php
Expand Up @@ -1861,7 +1861,7 @@ function do_listwithcomment($ia)
'hint_comment' => $hint_comment,
'kpclass' => $kpclass,
'name' => $ia[1].'comment',
'sqg' => $ia[1],
'sgq' => $ia[1],
'tarows' => floor($tarows),
'has_comment_saved' => isset($_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$fname2]) && $_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$fname2],
'comment_saved' => htmlspecialchars($_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$fname2]),
Expand Down Expand Up @@ -1938,14 +1938,13 @@ function do_listwithcomment($ia)
'name' => $ia[1],
'coreClass' => $coreClass,
'id' => 'answer'.$ia[1],
'checkconditionFunction' => $checkconditionFunction.'(this.value, this.name, this.type)',
'sgq' => $ia[1],
'show_noanswer' => is_null($_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$ia[1]]),
'label_text' => $hint_comment,
'kpclass' => $kpclass,
'tarows' => $tarows,
'maxoptionsize' => $maxoptionsize,
'has_comment_saved' => isset($_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$fname2]) && $_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$fname2],
'comment_saved' => htmlspecialchars( $_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$fname2]),
'comment_saved' => htmlspecialchars($_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$fname2]),/* htmlspecialchars(null)=="" right ? */
'value' => $_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$ia[1]],
), true);

Expand Down
Expand Up @@ -15,18 +15,18 @@
* @var $has_comment_saved
* @var $comment_saved htmlspecialchars( $_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$fname2])
* @var $value $_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$ia[1]] /// SHOULD BE CALL VALUE
* @var sgq : basename for input
* @todo : control if dropdown need labelledby or if labelledby in group is OK. Think automatic system return needed ...
*/
?>

<div class="ls-answers row">
<div class="ls-answers row" role="group" aria-labelledby="ls-question-text-<?php echo $sgq; ?>">

<div class="answer-item dropdown-item col-sm-6 col-xs-12">
<select
class="select form-control"
name="<?php echo $name;?>"
id="<?php echo $id;?>"
onchange="<?php echo $checkconditionFunction;?>" >

<?php if($show_noanswer):?>
<option class="noanswer-item" value="" SELECTED>
<?php eT('Please choose...');?>
Expand All @@ -37,23 +37,22 @@ class="select form-control"
// rows/option.php
echo $sOptions;
?>

</select>
<!-- Input copy for EM : default is radio and EM use id -->
<input type="hidden" name="java<?php echo $name?>" id="java<?php echo $name?>" value="<?php echo $value;?>" disabled />
</div>

<div class="answer-item text-item col-sm-6 col-xs-12">
<label for="answer<?php echo $name ;?>comment">
<?php echo $label_text;?>:
</label>

<textarea
class="form-control textarea <?php echo $kpclass; ?>"
name="<?php echo $name;?>comment"
id="answer<?php echo $name ;?>comment"
rows="<?php echo $tarows; ?>"
cols="<?php echo $maxoptionsize; ?>"
><?php if($has_comment_saved):?><?php echo $comment_saved; ?><?php endif;?></textarea>
><?php echo $comment_saved; ?></textarea>

<input class="radio" type="hidden" name="java<?php echo $name?>" id="java<?php echo $name?>" value="<?php echo $value;?>" />
</div>
</div>
Expand Up @@ -19,15 +19,22 @@
<!-- List with comment, list style, -->

<!-- answer -->
<div class="<?php echo $coreClass; ?> row" role="group" aria-describedby="ls-question-text-<?php echo $sgq; ?>">
<div class="<?php echo $coreClass; ?> row" role="group" aria-labelledby="ls-question-text-<?php echo $sgq; ?>">
<div class="answers-list radio-list col-sm-6 col-xs-12">
<ul class="list-unstyled" role="radio-group">
<?php
// rows/row.php
echo $sRows;
?>

</ul>
<!-- EM use id , but no need to submit -->
<input
type="hidden"
name="<?php echo $java_name;?>"
id="<?php echo $java_id;?>"
value="<?php echo $java_value;?>"
disabled
/>
</div>

<div class="form-group answer-item text-item col-sm-6 col-xs-12">
Expand All @@ -39,17 +46,9 @@ class="form-control <?php echo $kpclass; ?>"
name="<?php echo $name; ?>"
id="<?php echo $id; ?>"
rows="<?php echo $tarows;?>"
><?php if($has_comment_saved):?><?php echo $comment_saved;?><?php endif;?></textarea>
><?php echo $comment_saved;?></textarea>
</div>
</div>

<!-- EM use id , but no need to submit -->
<input
class="radio"
type="hidden"
name="<?php echo $java_name;?>"
id="<?php echo $java_id;?>"
value="<?php echo $java_value;?>"
disabled
/>

<!-- end of answer -->

0 comments on commit 1183e49

Please sign in to comment.