Skip to content
Snippets Groups Projects
Commit 1e3675ce authored by Ghislain Loas's avatar Ghislain Loas
Browse files

dev #21988 rt fix usageConstraints helper comments

parent ada8b983
Branches
Tags
4 merge requests!780Master,!767Master,!764Dev#21988 consultation pnb,!753Dev#21988 consultation pnb
......@@ -518,7 +518,7 @@ class Admin_AlbumController extends ZendAfi_Controller_Action {
* @return Zend_Form
*/
protected function _albumForm($album) {
$form = ZendAfi_Form_Album::newWith($album);
$form = ZendAfi_Form_Album::newWithAlbum($album);
$form->addAttribs(['data-backurl' => $this->view->url(['action' => 'index',
'cat_id' => $album->getCatId()])]);
return $form;
......
......@@ -31,7 +31,8 @@ class ZendAfi_Form_Album extends ZendAfi_Form {
'status',
'frbr_multi'];
public static function newWith($album) {
public static function newWithAlbum($album) {
$form = new self();
$form
......
......@@ -26,27 +26,33 @@ class ZendAfi_View_Helper_Album_UsageConstraints extends Zend_View_Helper_HtmlEl
$_content;
public function album_UsageConstraints($constraints){
if (!$constraints) return '';
if (!$constraints)
return '';
$this->_content = '';
$constraints->acceptVisitor($this);
return '<dl>'.$this->_content.'</dl>';
return $this->_tag('dl', $this->_content);
}
public function visitUsageConstraint($constraint) {
$this->_constraint_content = '';
$this->_constraint_type = '';
$constraint->acceptVisitor($this);
$this->_content .= '</dl></dd>';
$this->_content .= $this->getDtDd($this->_constraint_type,
$this->getListedConstraints());
}
public function visitUsageType($id) {
$this->_content .= '<dt>'.$this->getUsageTypeLabel($id).'</dt><dd><dl>';
$this->_constraint_type = $this->getUsageTypeLabel($id);
}
public function visitUsageData($name, $value) {
$this->_content .= '<dt>'.$this->getDataLabel($name).'</dt><dd>'.$value.'</dd>';
$this->_constraint_content .= $this->getDtDd($this->getDataLabel($name), $value);
}
......@@ -74,6 +80,21 @@ class ZendAfi_View_Helper_Album_UsageConstraints extends Zend_View_Helper_HtmlEl
return $this->_data_labels[$id];
}
protected function getListedConstraints() {
return $this->_tag('dl', $this->_constraint_content);
}
protected function getDtDd($term, $data) {
return $this->_tag('dt', $term) . $this->_tag('dd', $data);
}
protected function _tag() {
return call_user_func_array([$this->view, 'tag'], func_get_args());
}
}
?>
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment