| 47 |
if (!($element['#weight'] & 1)) { //first cell |
if (!($element['#weight'] & 1)) { //first cell |
| 48 |
$element['#prefix'] = '<div class="office-hours-block">'.t($days[$day]); |
$element['#prefix'] = '<div class="office-hours-block">'.t($days[$day]); |
| 49 |
} |
} |
| 50 |
elseif ($field['addhrs']) { //we're supposed to show the 'add hours link' |
elseif ($field['addhrs']) { // second cell, we're supposed to show the 'add hours link' |
| 51 |
$link = l(t('Add more hours'),'office-hours-add',array('attributes' => array('class'=>'oh-add-more-link'))).'<div class="office-hours-block">'.t('And from'); |
$link = l(t('Add more hours'),'office-hours-add',array('attributes' => array('class'=>'oh-add-more-link'))).'<div class="office-hours-block">'.t('And from'); |
| 52 |
$element['#prefix'] = isset($element['#value'][$field_strhrs]) ? '<div class="office-hours-block">'.t('And from') : $link; |
$element['#prefix'] = isset($element['#value'][$field_strhrs]) ? '<div class="office-hours-block">'.t('And from') : $link; |
| 53 |
} |
} |
| 54 |
else { //this is the second cell and were not showing it- better to clear it. |
else { //this is the second cell and were not showing it- better clear it (in case a value was entered before). |
| 55 |
unset($element['#value'][$field_strhrs]); |
$element['#prefix'] = "<div class='oh-hide'>"; |
| 56 |
|
$element['#value'][$field_strhrs] = ''; |
| 57 |
} |
} |
| 58 |
|
|
| 59 |
$element['#suffix'] = '</div>'; |
$element['#suffix'] = '</div>'; |