diff options
author | vipsoft <vipsoft@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2010-07-06 22:28:19 +0400 |
---|---|---|
committer | vipsoft <vipsoft@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2010-07-06 22:28:19 +0400 |
commit | fef677c41cece9cabd32444ceea6791a64d8f7bc (patch) | |
tree | d775d5bfe92944a799552a37d21b3539bfc8b00e /core/View.php | |
parent | e21c688dd9d812d4a6b5f0006efb062f4e5d15c9 (diff) |
fixes #1442 - all GPL license incompatibilities resolved
Live: Thanks to Remy Sharp, jquery.spy is now explicitly MIT licensed.
Installation: converted to use HTML_QuickForm2
Login: converted to use HTML_QuickForm2
Diffstat (limited to 'core/View.php')
-rw-r--r-- | core/View.php | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/core/View.php b/core/View.php index 443950d851..c5cd2390fa 100644 --- a/core/View.php +++ b/core/View.php @@ -162,19 +162,25 @@ class Piwik_View implements Piwik_iView /** * Add form to view * - * @param Piwik_QuickForm $form + * @param Piwik_QuickForm2 $form */ public function addForm( $form ) { - // Create the renderer object - $renderer = new HTML_QuickForm_Renderer_ArraySmarty($this->smarty, false, false); - - // build the HTML for the form - $form->accept($renderer); - - // assign array with form data - $this->smarty->assign('form_data', $renderer->toArray()); - $this->smarty->assign('element_list', $form->getElementList()); + if($form instanceof Piwik_QuickForm2) + { + HTML_QuickForm2_Renderer::register('smarty', 'HTML_QuickForm2_Renderer_Smarty'); + + // Create the renderer object + $renderer = HTML_QuickForm2_Renderer::factory('smarty'); + $renderer->setOption('group_errors', true); + + // build the HTML for the form + $form->render($renderer); + + // assign array with form data + $this->smarty->assign('form_data', $renderer->toArray()); + $this->smarty->assign('element_list', $form->getElementList()); + } } /** |