Skip to content

Commit

Permalink
Allow the config for the tree output to be specified when creating th…
Browse files Browse the repository at this point in the history
…e TreeControl for a form.

git-svn-id: https://svn.habariproject.org/habari/trunk/htdocs/system@5120 653ae4dd-d31e-0410-96ef-6bf7bf53c507
  • Loading branch information
ringmaster committed May 12, 2011
1 parent 33eaead commit c494fb9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion admin/formcontrols/formcontrol_tree.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php if ( !defined( 'HABARI_PATH' ) ) { die('No direct access'); } ?>
<div<?php echo ($class) ? ' class="' . $class . '"' : ''?><?php echo ($id) ? ' id="' . $id . '"' : ''?>>
<?php echo Format::term_tree( $options, $control->name ); ?>
<?php echo Format::term_tree( $options, $control->name, $control->config ); ?>
<input type="hidden" name="<?php echo $field; ?>_submitted" class="tree_submitted" value="1">
<?php $control->errors_out('<li>%s</li>', '<ul class="error">%s</ul>'); ?>
</div>
4 changes: 3 additions & 1 deletion classes/formui.php
Original file line number Diff line number Diff line change
Expand Up @@ -1759,16 +1759,18 @@ class FormControlTree extends FormControlSelect
* @param string $caption
* @param array $options
* @param string $template
* @param array $config
*/
public function __construct()
{
$args = func_get_args();
list( $name, $storage, $caption, $template ) = array_merge( $args, array_fill( 0, 5, null ) );
list( $name, $storage, $caption, $template, $config ) = array_merge( $args, array_fill( 0, 5, null ) );

$this->name = $name;
$this->storage = $storage;
$this->caption = $caption;
$this->template = $template;
$this->config = empty($config) ? array() : $config;
}

/**
Expand Down

0 comments on commit c494fb9

Please sign in to comment.