[5120] trunk/htdocs/system: Allow the config for the tree output to be specified when creating the TreeControl for a form .

1 view
Skip to first unread message

s...@habariproject.org

unread,
May 11, 2011, 8:45:53 PM5/11/11
to habar...@googlegroups.com
Revision
5120
Author
ringmaster
Date
2011-05-12 00:45:50 +0000 (Thu, 12 May 2011)

Log Message

Allow the config for the tree output to be specified when creating the TreeControl for a form.

Modified Paths

Diff

Modified: trunk/htdocs/system/admin/formcontrols/formcontrol_tree.php (5119 => 5120)


--- trunk/htdocs/system/admin/formcontrols/formcontrol_tree.php	2011-05-10 23:15:52 UTC (rev 5119)
+++ trunk/htdocs/system/admin/formcontrols/formcontrol_tree.php	2011-05-12 00:45:50 UTC (rev 5120)
@@ -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>

Modified: trunk/htdocs/system/classes/formui.php (5119 => 5120)


--- trunk/htdocs/system/classes/formui.php	2011-05-10 23:15:52 UTC (rev 5119)
+++ trunk/htdocs/system/classes/formui.php	2011-05-12 00:45:50 UTC (rev 5120)
@@ -1759,16 +1759,18 @@
 	 * @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;
 	}
 	
 		/**
Reply all
Reply to author
Forward
0 new messages