Renders the event list page with filter form and datatable.

@param eventfilter_form $form Event filter form.
@param array $tabledata An array of event data to be used by the datatable.
@return string HTML to be displayed.
519815
public function render_event_list($form, $tabledata) {
        global $PAGE;

        $title = get_string('pluginname', 'report_eventlist');

        // Header.
        $html = $this->output->header();
        $html .= $this->output->heading($title);

        // Form.
        ob_start();
        $form->display();
        $html .= ob_get_contents();
        ob_end_clean();

        $PAGE->requires->yui_module('moodle-report_eventlist-eventfilter', 'Y.M.report_eventlist.EventFilter.init',
                array(array('tabledata' => $tabledata)));
        $PAGE->requires->strings_for_js(array(
            'eventname',
            'component',
            'action',
            'crud',
            'edulevel',
            'affectedtable',
            'dname',
            'legacyevent',
            'since'
            ), 'report_eventlist');
        $html .= html_writer::start_div('report-eventlist-data-table', array('id' => 'report-eventlist-table'));
        $html .= html_writer::end_div();

        $html .= $this->output->footer();
        return $html;
    }
330312
private function cleanForm($requestData, Form $form)
    {
        $allowedField = array_keys($requestData);

        /** @var FormInterface[] $formFields */
        $formFields = $form->all();
        foreach ($formFields as $formField) {
            $fieldName = $formField->getName();

            if (!in_array($fieldName, $allowedField)) {
                $form->remove($fieldName);
            }
        }
    }
446382
public function onPreSetData(FormEvent $event)
    {
        $contentInfo = null;
        $contentLanguages = [];
        $form = $event->getForm();
        $data = $event->getData();
        $location = $data->getLocation();

        if (null !== $location) {
            $contentInfo = $location->getContentInfo();
            $versionInfo = $this->contentService->loadVersionInfo($contentInfo);
            $contentLanguages = $versionInfo->languageCodes;
        }

        $this->addLanguageFields($form, $contentLanguages, $contentInfo);
    }
658837
public function onSubmit(FormEvent $event)
    {
        $form = $event->getForm();
        $data = $event->getData();

        if (null === $data) {
            $data = array();
        }

        if (!is_array($data) && !($data instanceof \Traversable && $data instanceof \ArrayAccess)) {
            throw new UnexpectedTypeException($data, 'array or (\Traversable and \ArrayAccess)');
        }

        // The data mapper only adds, but does not remove items, so do this here
        $toDelete = array();

        foreach ($data as $name => $child) {
            if (null === $child || (
                $form->get($name)->has('__to_remove') &&
                true === $form->get($name)->get('__to_remove')->getData()
            )) {
                $toDelete[] = $name;
            }
        }

        foreach ($toDelete as $name) {
            unset($data[$name]);
        }

        if ($data instanceof \Doctrine\Common\Collections\Collection) {
            $event->setData($data->getValues());
        } else {
            $event->setData($data);
        }
    }
878787
public function beforeFormDisplay ($form, $isNew)
    {
        if ($this->useTabbedForms || $form instanceof \Gems_Form_TableForm) {
            //If needed, add a row of link buttons to the bottom of the form
            if ($links = $this->createMenuLinks($isNew ? $this->menuCreateIncludeLevel : $this->menuEditIncludeLevel)) {
                $linkContainer = \MUtil_Html::create()->div(array('class' => 'element-container-labelless'));
                $linkContainer[] = $links;

                $element = $form->createElement('html', 'formLinks');
                $element->setValue($linkContainer);
                $element->setOrder(999);
                if ($form instanceof \Gems_TabForm)  {
                    $form->resetContext();
                }
                $form->addElement($element);
                $form->addDisplayGroup(array('formLinks'), 'form_buttons');
            }
        } else {
            if (\MUtil_Bootstrap::enabled() !== true) {
                $table = new \MUtil_Html_TableElement(array('class' => 'formTable'));
                $table->setAsFormLayout($form, true, true);
                $table['tbody'][0][0]->class = 'label';  // Is only one row with formLayout, so all in output fields get class.

                if ($links = $this->createMenuLinks($isNew ? $this->menuCreateIncludeLevel : $this->menuEditIncludeLevel)) {
                    $table->tf(); // Add empty cell, no label
                    $linksCell = $table->tf($links);
                }
            } elseif ($links = $this->createMenuLinks($isNew ? $this->menuCreateIncludeLevel : $this->menuEditIncludeLevel)) {
                $element = $form->createElement('html', 'menuLinks');
                $element->setValue($links);
                $element->setOrder(999);
                $form->addElement($element);
            }
        }

        return $form;
    }
1266872
function (form) {
        render(req, res, 'organization-select', {
          form: form,
          formActionUri: formActionUri,
          formModel: organizationSelectFormModel
        });
      }
4105
public function preSubmitData(FormEvent $event)
    {
        $form = $event->getForm();
        $data = $event->getData();

        if (null === $data || '' === $data) {
            $data = array();
        }

        foreach ($form as $name => $child) {
            if (!isset($data[$name])) {
                $form->remove($name);
            }
        }
    }
1262076
public function render(FormInterface $form)
    {
        if (method_exists($form, 'prepare')) {
            $form->prepare();
        }

        $formContent = '';

        foreach ($form as $element) {
            if ($element instanceof FieldsetInterface) {
                $formContent.= $this->getView()->bootstrapFormCollection($element);
            } else {
                $formContent.= $this->getView()->bootstrapFormRow($element);
            }
        }

        return $this->openTag($form) . $formContent . $this->closeTag();
    }
137392
public function onPreSetData(FormEvent $event)
    {
        $form = $event->getForm();
        $item = $event->getData();

        foreach ($this->fields as $field) {
            list ($name, $type, $options) = $field;
            if (null !== $item) {
                $options = array_replace($options, $this->itemHelper->getFormOptions($item, $name));
            }
            $form->add($name, $type, $options);
        }
    }
1209512
public function doNew($data, $form)
    {
        return $this->redirect(Controller::join_links($this->gridField->Link('item'), 'new'));
    }
139591
public function render(Form $form)
    {
        $this->htmlSpecialCharsFlag = ENT_NOQUOTES;
        if (defined('ENT_HTML5')) {
            $this->htmlSpecialCharsFlag |= $this->html5 ? ENT_HTML5 : ENT_HTML401;
        }
        $this->form = $form;
        $this->form->addValues();
        return $this->renderFields($this->form->getFields());
    }
1263301
public function doPrevious($data, $form)
    {
        $this->getToplevelController()->getResponse()->addHeader('X-Pjax', 'Content');
        $link = $this->getEditLink($this->getPreviousRecordID());
        return $this->redirect($link);
    }
88946
public function datatableRender(Twig_Environment $twig, AbstractDatatableView $datatable)
    {
        return $twig->render('SgDatatablesBundle:Datatable:datatable.html.twig', $this->getOptions($datatable));
    }
1295517
protected function getUpdateEvent($formData)
    {
        $contentUpdateEvent = new ContentUpdateEvent($formData['id']);

        $contentUpdateEvent
            ->setLocale($formData['locale'])
            ->setTitle($formData['title'])
            ->setChapo($formData['chapo'])
            ->setDescription($formData['description'])
            ->setPostscriptum($formData['postscriptum'])
            ->setVisible($formData['visible'])
            ->setDefaultFolder($formData['default_folder']);

        return $contentUpdateEvent;
    }
348720
private function filter_table_data($table, $data) {
		$table_fields = $this->get_columns($table);
		$result = [];

		foreach ($table_fields as $field) {
			if (array_key_exists($field, $data)) {
				$result[ $field ] = $data[$field];
			}
		}

		if (count($data) == 0) {
			return [];
		}
		return $result;
	}
555273
public static  function getTableHTML($tableData)
    {
        $html = '';
        if (empty($tableData))
            return NULL;

        $html .= '<!-- Start_Table_Responsive -->';
        $html .= '<div class="table-responsive">';
        $html .= '<table class="table no-margin">';

        $html .= '<thead>';
        $html .= '<tr>';

        foreach ($tableData["ths"] as $th) 
        {
            $html .= '<th>';
            $html .= $th;
            $html .= '</th>';
        }

        $html .= '</tr>';
        $html .= '</thead>';

        $html .= '<tbody>';
        $html .= '<tr>';

        foreach ($tableData["tbs"] as $tb) 
        {  
            foreach($tb as $t)
            {
                $html .= $t;
            }
        }

        $html .= '</tr>';
        $html .= '</tbody>';

        $html .= '</table>';
        $html .= '</div>';
        $html .= '<!-- End_Table_Responsive -->';

        return $html;   
    }
1274025
public function datatableFilterRender(Twig_Environment $twig, AbstractDatatableView $datatable, AbstractColumn $column, $loopIndex)
    {
        if ($filterProperty = $column->getFilter()->getProperty()) {
            $filterColumnId = $datatable->getColumnIdByColumnName($filterProperty);
        } else {
            $filterColumnId = $loopIndex;
        }

        return $twig->render($column->getFilter()->getTemplate(), array(
            'column' => $column,
            'filterColumnId' => $filterColumnId,
            'selectorId' => $loopIndex,
            'tableId' => $datatable->getName()
            )
        );
    }