$widget = $this->field->widget;
}
$id = $this->autoId();
- if ($id and !array_key_exists('id', $attrs)
+ if ($id and !array_key_exists('id', $attrs)
and !array_key_exists('id', $widget->attrs)) {
$attrs['id'] = $id;
}
$widget = $this->field->widget;
$id = (isset($widget->attrs['id'])) ? $widget->attrs['id'] : $this->autoId();
$_tmp = array();
+ $class_found = false;
foreach ($attrs as $attr=>$val) {
$_tmp[] = $attr.'="'.$val.'"';
+ if ($attr=='class')
+ $class_found = true;
}
+ if ( (!$class_found) && ($this->field->required==1))
+ $_tmp[] = 'class="req"';
if (count($_tmp)) {
$attrs = ' '.implode(' ', $_tmp);
} else {
$attrs = '';
- }
+ }
return new IPF_Template_SafeString(sprintf('<label for="%s"%s>%s</label>',
$widget->idForLabel($id), $attrs, $contents), true);
}
$this->removeMaskReplacement('page');
- if (($pager->getPage()-2)>$pager->getFirstPage()){
+ if (($pager->getPage()-5)>$pager->getFirstPage()){
- if (($pager->getPage()-2)>$pager->getFirstPage()){
+ if (($pager->getPage()-5)>$pager->getFirstPage()){
$options['page_number'] = $pager->getFirstPage();
$str .= $this->processPage($options);
}
- if (($pager->getPage()-3)>$pager->getFirstPage()){
+ if (($pager->getPage()-6)>$pager->getFirstPage()){
$options['page_number'] = $pager->getFirstPage()+1;
$str .= $this->processPage($options);
}
- if (($pager->getPage()-4)>$pager->getFirstPage()){
+ if (($pager->getPage()-7)>$pager->getFirstPage()){
$str .= ' ... ';
}
}