Provides complete form rendering.

@param string|null $mode 'begin', 'errors', 'ownerrors', 'body', 'end' or empty to render all
@phpcsSuppress SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint
778642
public function render(Form $form, $mode = null): string
	{
		$usedPrimary = false;

		$form->getElementPrototype()->setNovalidate(true);

		foreach ($form->getControls() as $control) {

			if ($control instanceof Controls\BaseControl
				&& !($control instanceof Controls\Checkbox)
				&& !($control instanceof Controls\CheckboxList)
				&& !($control instanceof Controls\RadioList)) {
				$control->getLabelPrototype()->addClass('col-form-label col col-sm-3');
			}

			switch (true) {
				case $control instanceof Controls\Button:
					/** @var string|null $class */
					$class = $control->getControlPrototype()->getAttribute('class');
					if ($class === null || mb_strpos($class, 'btn') === false) {
						$control->getControlPrototype()->addClass($usedPrimary === false ? 'btn btn-primary' : 'btn btn-secondary');
						$usedPrimary = true;
					}
					break;

				case $control instanceof Controls\TextBase:
				case $control instanceof Controls\SelectBox:
				case $control instanceof Controls\MultiSelectBox:
					$control->getControlPrototype()->addClass('form-control');
					break;

				case $control instanceof Controls\Checkbox:
				case $control instanceof Controls\CheckboxList:
				case $control instanceof Controls\RadioList:
					$control->getSeparatorPrototype()->setName('div')->addClass('form-check');
					$control->getControlPrototype()->addClass('form-check-input');
					$control->getLabelPrototype()->addClass('form-check-label');
					break;
			}
		}

		return parent::render($form, $mode);
	}
725362
public function render($controller = null)
    {
        // If we have parent module connection and have no view set
        if (isset($this->parent) && $this->view_path == false /*&& !method_exists($this, $controller)*/) {
            // Merge current and parent module view data
            $this->parent->view_data = array_merge($this->parent->view_data, $this->view_data);
            // Set internal view context data pointer
            $this->parent->data = &$this->parent->view_data[$this->parent->view_context];
            // Call parent render
            $this->parent->render($controller);
        } else { // Call default module behaviour
            parent::render($controller);
        }
    }
779326
public function renderToolStyleModalFormHandlerAction()
    {
        $data = array();

        $styleId = (int) $this->params()->fromQuery('styleId', '');

        $melisKey = $this->params()->fromRoute('melisKey', '');
        // declare the Tool service that we will be using to completely create our tool.
        $melisTool = $this->getServiceLocator()->get('MelisCoreTool');
        $melisCoreConfig = $this->serviceLocator->get('MelisCoreConfig');
        $appConfigForm = $melisCoreConfig->getFormMergedAndOrdered('meliscms/tools/meliscms_tool_styles/forms/meliscms_tool_styles_form','meliscms_tool_styles_form');
        $factory = new \Zend\Form\Factory();
        $formElements = $this->serviceLocator->get('FormElementManager');
        $factory->setFormElementManager($formElements);
        $form = $factory->createForm($appConfigForm);

        // set title
        $title    = $melisTool->getTranslation('tr_meliscore_tool_styles_new');

        if(!empty($styleId)){

            $tableStyle = $this->getServiceLocator()->get('MelisEngineTableStyle');
            $details = $tableStyle->getEntryById($styleId)->current();

            $data = (array)$details;
            $title = $melisTool->getTranslation('tr_meliscore_tool_styles_edit');

        }else{
            $form->get('style_id')->setAttribute('class', 'hidden');
            $form->get('style_id')->setOptions(array('label_attributes' => array('class'  => 'hidden')));
        }

        $form->setData($data);

        $view = new ViewModel();
        $view->melisKey = $melisKey;
        $view->form = $form;
        $view->title = $title;
        $view->styleId = $styleId;
        return $view;
    }
798037
private function render(): string
    {
        switch ($this->mode) {
            case 'button':
                $html = '<button class="btn' . $this->classes() . '" type="submit" ' .
                    (($this->disabled === true) ? 'disabled ' : null) .
                    '>' . $this->view->escapeHtml($this->label) . '</button>';
                break;

            case 'input':
                $html = '<input class="btn' . $this->classes() . '" type="' .
                    $this->input_type . '" value="' .
                    $this->view->escapeHtml($this->label) . '" ' .
                    (($this->disabled === true) ? ' disabled ' : null) . '/>';
                break;

            default:
                $html = '<a href="' . (($this->link !== null) ? $this->view->escapeUrl($this->link) : '#') .
                    '" class="btn' . $this->classes() .
                    (($this->disabled === true) ? ' disabled' : null) .
                    '" role="button">' . $this->view->escapeHtml($this->label) . '</a>';
                break;
        }

        return $html;
    }
1092016
function render($mode=null)
	{
        $pager_html = "<div class='pager'>";
        if ($mode === null)
        {
            if (in_array('first', $this->span_open))
            {
                $pager_html .= $this->first_page();
            }
            if (in_array('previous', $this->span_open))
            {
                $pager_html .= $this->pre_page();
            }
            $pager_html .= $this->nowbar();
            if (in_array('next', $this->span_open))
            {
                $pager_html .= $this->next_page();
            }
            if (in_array('last', $this->span_open))
            {
				$pager_html.=$this->last_page();
			}
            if (in_array('pagesize', $this->span_open))
            {
                $pager_html .= $this->set_pagesize();
            }
            $pager_html .= '</div>';
            return $pager_html;
        }
        $pager_html .= '</div>';
        return $pager_html;
	}
354369
protected function loadTemplate(string $mode)
    {
        if ($mode == 'create') { // create mode
            $tplPath = sprintf(MODULE_VIEWS, $this->module . '/' . $this->division);
            $tplName = $tplPath . 'edit.php';
            $this->template->load($tplName);
        }
    }
493309
public function render($controller = null)
    {
        // Switch current system active module
        $old = $this->system->active($this);

        // If specific controller action should be run
        if (isset($controller)) {
            /**
             * TODO: This would be removed in next major version, here should be
             * passed real controller method for execution.
             */
            $controller = method_exists($this, iModule::OBJ_PREFIX . $controller)
                ? iModule::OBJ_PREFIX . $controller
                : $controller;

            // Define if this is a procedural controller or OOP
            $callback = array($this, $controller);

            // If this controller action is present
            if (method_exists($this, $controller)) {
                // Get passed arguments
                $parameters = func_get_args();
                // Remove first as its a controller action name
                array_shift($parameters);
                // Perform controller action with passed parameters
                call_user_func_array($callback, $parameters);
            } else {
                throw new ControllerActionNotFound($this->id . '#' . $controller);
            }
        }

        // Output view
        echo $this->output();

        // Restore previous active module
        $this->system->active($old);
    }
1002336
public function render($context = null)
    {
        try {
            return $this->_render($context);
        } catch (InvalidArgumentException $e) {
            throw $e;
        } catch (RootException $e) {
            throw $this->_createTemplateRenderException($this->__('Could not render placeholder template'), null, $e, $this, $context);
        }
    }
1062520
public function render($html = null) {
		$separator = $this->getSeparator();
		$result    = '';
		
		foreach ($this->getElements() as $element) {
			$result .= $separator . $element->render();
		}
		
		return parent::render($result . $separator);
	}
1034283
public function setMode($mode)
    {
        $this->mode = (null === $mode ? null : (bool) $mode);
        return $this;
    }
1253896
private function renderForm()
    {
        /** @var ActiveRecord $model */
        $model = new $this->modelClass;

        echo <<<HTML
<div class="modal" id="{$this->id}-new-node-modal" tabindex="-1" role="dialog" aria-labelledby="newNodeModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
HTML;
        /** @var ActiveForm $form */
        $form = ActiveForm::begin([
            'id' => $this->id . '-new-node-form'
        ]);

        echo <<<HTML
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="newNodeModalLabel">New node</h4>
      </div>
      <div class="modal-body">
HTML;

        echo call_user_func($this->formFieldsCallable, $form, $model);

        echo <<<HTML
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="submit" class="btn btn-primary">Create node</button>
      </div>
HTML;
        $form->end();
        echo <<<HTML
    </div>
  </div>
</div>
HTML;
    }
794012
public function initializePanels($mode)
    {
        $sessionClass = ReporticoSession();

        $template = new ReporticoTemplateTwig($this->templateViewPath, $this->templateCachePath, $this->getTheme(), $this->disableThemeCaching);

        $dummy = "";
        $version = $this->version;

        $forward_url_params = $sessionClass::sessionRequestItem('forward_url_get_parameters', $this->forward_url_get_parameters);
        $forward_url_params_graph = $sessionClass::sessionRequestItem('forward_url_get_parameters_graph', $this->forward_url_get_parameters_graph);
        $forward_url_params_dbimage = $sessionClass::sessionRequestItem('forward_url_get_parameters_dbimage', $this->forward_url_get_parameters_dbimage);

        $template->assign('REPORTICO_VERSION', $version);
        $template->assign('REPORTICO_SITE', $this->url_site);
        $template->assign('REPORTICO_CSRF_TOKEN', $this->csrfToken);
        $template->assign('REPORTICO_AJAX_HANDLER', $this->ajaxHandler);

        // Assign user parameters to template
        if ($this->user_parameters && is_array($this->user_parameters)) {
            foreach ($this->user_parameters as $k => $v) {
                $param = preg_replace("/ /", "_", $k);
                $template->assign('USER_' . $param, $v);
            }
        }

        // Twig needs to include Javascript if AJAX enabled
        if (!defined('AJAX_ENABLED')) {
            define('AJAX_ENABLED', true);
        }

        $template->assign('AJAX_ENABLED', AJAX_ENABLED);

        // Date format for ui Datepicker
        $template->assign('AJAX_DATEPICKER_LANGUAGE', ReporticoLocale::getDatepickerLanguage(ReporticoApp::getConfig("language")));
        $template->assign('AJAX_DATEPICKER_FORMAT', ReporticoLocale::getDatepickerFormat(ReporticoApp::getConfig("prep_dateformat")));
        $template->assign('PDF_DELIVERY_MODE', $this->pdf_delivery_mode);

        $template->assign('SHOW_OPEN_LOGIN', false);
        $template->assign('DB_LOGGEDON', false);
        $template->assign('ADMIN_MENU_URL', false);
        $template->assign('CONFIGURE_MENU_URL', false);
        $template->assign('CREATE_REPORT_URL', false);
        $template->assign('SESSION_ID', $sessionClass::reporticoSessionName());

        // Set template variables
        $template->assign('SCRIPT_SELF', $this->url_path_to_calling_script);

        $template->assign('REPORTICO_AJAX_MODE', $this->reportico_ajax_mode);
        $template->assign('REPORTICO_AJAX_CALLED', $this->reportico_ajax_called);

        if ($this->url_path_to_assets) {
            $template->assign('REPORTICO_URL_DIR', $this->url_path_to_assets);
        } else {
            $template->assign('REPORTICO_URL_DIR', $this->reportico_url_path);
        }

        $template->assign('REPORTICO_AJAX_RUNNER', $this->reportico_ajax_script_url);

        $template->assign('PRINTABLE_HTML', false);
        if (ReporticoUtility::getRequestItem("printable_html")) {
            $template->assign('PRINTABLE_HTML', true);
        }

        // In frameworks we dont want to load jquery when its intalled once when the module load
        // so flag this unless specified in new_reportico_window
        $template->assign('REPORTICO_STANDALONE_WINDOW', false);
        $template->assign('REPORTICO_AJAX_PRELOADED', $this->reportico_ajax_preloaded);
        if (ReporticoUtility::getRequestItem("new_reportico_window", false)) {
            $template->assign('REPORTICO_AJAX_PRELOADED', false);
            $template->assign('REPORTICO_STANDALONE_WINDOW', true);
        }

        $template->assign('SHOW_LOGOUT', false);
        $template->assign('SHOW_LOGIN', false);
        $template->assign('SHOW_REPORT_MENU', false);
        $template->assign('SHOW_SET_ADMIN_PASSWORD', false);
        $template->assign('SHOW_OUTPUT', false);
        $template->assign('IS_ADMIN_SCREEN', false);
        $template->assign('SHOW_DESIGN_BUTTON', false);
        $template->assign('SHOW_ADMIN_BUTTON', true);
        $template->assign('PROJ_PASSWORD_ERROR', "");
        $template->assign('SHOW_PROJECT_MENU_BUTTON', true);
        if ($this->access_mode && ($this->access_mode != "DEMO" && $this->access_mode != "FULL" && $this->access_mode != "ALLPROJECTS" && $this->access_mode != "ONEPROJECT")) {
            $template->assign('SHOW_PROJECT_MENU_BUTTON', false);
        }
        $template->assign('SHOW_EXPAND', false);
        $template->assign('SHOW_CRITERIA', false);
        $template->assign('SHOW_EXPANDED', false);
        $template->assign('SHOW_MODE_MAINTAIN_BOX', false);
        $template->assign('STATUSMSG', '');
        $template->assign('ERRORMSG', false);
        $template->assign('SET_ADMIN_PASSWORD_INFO', '');
        $template->assign('SET_ADMIN_PASSWORD_ERROR', '');
        $template->assign('ADMIN_PASSWORD_ERROR', '');
        $template->assign('PASSWORD_ERROR', '');
        $template->assign('DEMO_MODE', false);
        $template->assign('DROPDOWN_MENU_ITEMS', false);

        // Dont allow admin menu buttons to show in demo mode
        if ($this->allow_maintain == "DEMO") {
            $template->assign('DEMO_MODE', true);
            $template->assign('SHOW_ADMIN_BUTTON', false);
        }

        if (!$this->admin_accessible) {
            $template->assign('SHOW_ADMIN_BUTTON', false);
        }

        // Dont show admin button
        if ($this->access_mode && ($this->access_mode != "DEMO" && $this->access_mode != "FULL" && $this->access_mode != "ALLPROJECTS")) {
            $template->assign('SHOW_ADMIN_BUTTON', false);
        }

        $partialajaxpath = ReporticoUtility::findBestLocationInIncludePath("partial.php");
        $template->assign('AJAX_PARTIAL_RUNNER', $this->reportico_url_path . $partialajaxpath);

        // Use alternative location for js/css/images if specified.
        // Set stylesheet to the reportico bootstrap if bootstrap styles in place
        $this->bootstrap_styles = $sessionClass::registerSessionParam("bootstrap_styles", $this->bootstrap_styles);

        // Force reportico modals or decide based on style?
        $this->force_reportico_mini_maintains = $sessionClass::registerSessionParam("force_reportico_mini_maintains", $this->force_reportico_mini_maintains);

        $this->url_path_to_assets = $sessionClass::registerSessionParam("url_path_to_assets", $this->url_path_to_assets);
        $this->url_path_to_templates = $sessionClass::registerSessionParam("url_path_to_templates", $this->url_path_to_templates);
        $this->jquery_preloaded = $sessionClass::registerSessionParam("jquery_preloaded", $this->jquery_preloaded);
        $this->bootstrap_preloaded = $sessionClass::registerSessionParam("bootstrap_preloaded", $this->bootstrap_preloaded);

        //Define the asset dir path
        if ($this->url_path_to_assets) {
            $asset_path = $this->url_path_to_assets;
        } else {
            $asset_path = ReporticoUtility::findBestUrlInIncludePath("assets/notes.txt");
            if ($asset_path) {
                $asset_path = dirname($asset_path);
            }

            $this->url_path_to_assets = $asset_path;
        }

        $template->assign('ASSETS_PATH', $asset_path);

        //Define the template dir where we could find specific template css js and template files
        // if not already provided
        $theme_dir = $this->url_path_to_templates;
        if ( !$this->url_path_to_templates )
            $theme_dir = ReporticoUtility::findBestUrlInIncludePath('themes');

        $template->assign('THEME_DIR', "$theme_dir/".$this->getTheme());

        /*@todo Must be in the theme and not in the code*/
        if (!$this->bootstrap_styles) {
            $csspath = $this->url_path_to_assets . "/css/reportico.css";
            if ($this->url_path_to_assets) {
                $csspath = $this->url_path_to_assets . "/css/reportico.css";
            } else {
                $csspath = $this->reportico_url_path . "/" . ReporticoUtility::findBestUrlInIncludePath("/css/reportico.css");
            }

        } else {
            if ($this->url_path_to_assets) {
                $csspath = $this->url_path_to_assets . "/css/reportico.css";
            } else {
                $csspath = $this->reportico_url_path . "/" . ReporticoUtility::findBestUrlInIncludePath("css/reportico.css");
            }

        }
        $template->assign('STYLESHEET', $csspath);
        $template->assign('STYLESHEETDIR', dirname($csspath));

        $template->assign('REPORTICO_JQUERY_PRELOADED', $this->jquery_preloaded);
        $template->assign('BOOTSTRAP_STYLES', $this->bootstrap_styles);
        $template->assign('REPORTICO_BOOTSTRAP_PRELOADED', $this->bootstrap_preloaded);
        $template->assign('BOOTSTRAP_STYLE_GO_BUTTON', $this->getBootstrapStyle('button_go'));
        $template->assign('BOOTSTRAP_STYLE_PRIMARY_BUTTON', $this->getBootstrapStyle('button_primary'));
        $template->assign('BOOTSTRAP_STYLE_RESET_BUTTON', $this->getBootstrapStyle('button_reset'));
        $template->assign('BOOTSTRAP_STYLE_ADMIN_BUTTON', $this->getBootstrapStyle('button_admin'));
        $template->assign('BOOTSTRAP_STYLE_DROPDOWN', $this->getBootstrapStyle('dropdown'));
        $template->assign('BOOTSTRAP_STYLE_CHECKBOX_BUTTON', $this->getBootstrapStyle('checkbox_button'));
        $template->assign('BOOTSTRAP_STYLE_CHECKBOX', $this->getBootstrapStyle('checkbox'));
        $template->assign('BOOTSTRAP_STYLE_TOOLBAR_BUTTON', $this->getBootstrapStyle('toolbar_button'));
        $template->assign('BOOTSTRAP_STYLE_MENU_TABLE', $this->getBootstrapStyle('menu_table'));
        $template->assign('BOOTSTRAP_STYLE_TEXTFIELD', $this->getBootstrapStyle('textfield'));
        $template->assign('BOOTSTRAP_STYLE_SMALL_BUTTON', $this->getBootstrapStyle('small_button'));

        // Set charting engine
        $template->assign('REPORTICO_CHARTING_ENGINE', $this->charting_engine_html);

        // Set on/off template elements
        foreach ($this->output_template_parameters as $k => $v) {
            $template->assign(strtoupper($k), $v);
        }
        if ($this->url_path_to_assets) {
            $jspath = $this->url_path_to_assets . "/js";
            $template->assign('JSPATH', $jspath);
        } else {
            $jspath = ReporticoUtility::findBestUrlInIncludePath("js/reportico.js");
            if ($jspath) {
                $jspath = dirname($jspath);
            }

            $template->assign('JSPATH', $this->reportico_url_path . $jspath);
        }
        $this->panels["MAIN"] = new DesignPanel($this, "MAIN");
        $this->panels["MAIN"]->setTemplate($template);
        $this->panels["BODY"] = new DesignPanel($this, "BODY");
        $this->panels["TITLE"] = new DesignPanel($this, "TITLE");
        $this->panels["TOPMENU"] = new DesignPanel($this, "TOPMENU");
        $this->panels["MENUBUTTON"] = new DesignPanel($this, "MENUBUTTON");
        $this->panels["LOGIN"] = new DesignPanel($this, "LOGIN");
        $this->panels["SET_ADMIN_PASSWORD"] = new DesignPanel($this, "SET_ADMIN_PASSWORD");
        $this->panels["LOGOUT"] = new DesignPanel($this, "LOGOUT");
        $this->panels["FORM"] = new DesignPanel($this, "FORM");
        $this->panels["MENU"] = new DesignPanel($this, "MENU");
        $this->panels["ADMIN"] = new DesignPanel($this, "ADMIN");
        $this->panels["USERINFO"] = new DesignPanel($this, "USERINFO");
        $this->panels["RUNMODE"] = new DesignPanel($this, "RUNMODE");
        $this->panels["PREPARE"] = new DesignPanel($this, "PREPARE");
        $this->panels["CRITERIA"] = new DesignPanel($this, "CRITERIA");
        $this->panels["CRITERIA_FORM"] = new DesignPanel($this, "CRITERIA_FORM");
        $this->panels["CRITERIA_EXPAND"] = new DesignPanel($this, "CRITERIA_EXPAND");
        $this->panels["MAINTAIN"] = new DesignPanel($this, "MAINTAIN");
        $this->panels["REPORT"] = new DesignPanel($this, "REPORT");
        $this->panels["DESTINATION"] = new DesignPanel($this, "DESTINATION");
        $this->panels["EXECUTE"] = new DesignPanel($this, "EXECUTE");
        $this->panels["STATUS"] = new DesignPanel($this, "STATUS");
        $this->panels["ERROR"] = new DesignPanel($this, "ERROR");

        // Identify which panels are visible by default
        $this->panels["MAIN"]->setVisibility(true);
        $this->panels["BODY"]->setVisibility(true);
        $this->panels["TITLE"]->setVisibility(true);
        $this->panels["TOPMENU"]->setVisibility(true);
        $this->panels["STATUS"]->setVisibility(true);
        $this->panels["ERROR"]->setVisibility(true);

        // Set up a default panel hierarchy
        $this->panels["MAIN"]->addPanel($this->panels["BODY"]);
        $this->panels["BODY"]->addPanel($this->panels["TITLE"]);
        $this->panels["BODY"]->addPanel($this->panels["TOPMENU"]);
        $this->panels["BODY"]->addPanel($this->panels["FORM"]);
        $this->panels["BODY"]->addPanel($this->panels["STATUS"]);
        $this->panels["BODY"]->addPanel($this->panels["ERROR"]);
        $this->panels["FORM"]->addPanel($this->panels["CRITERIA"]);
        $this->panels["FORM"]->addPanel($this->panels["MAINTAIN"]);
        $this->panels["FORM"]->addPanel($this->panels["REPORT"]);
        $this->panels["FORM"]->addPanel($this->panels["MENU"]);
        $this->panels["FORM"]->addPanel($this->panels["ADMIN"]);
        $this->panels["CRITERIA"]->addPanel($this->panels["CRITERIA_FORM"]);
        $this->panels["CRITERIA"]->addPanel($this->panels["CRITERIA_EXPAND"]);
        $this->panels["CRITERIA"]->addPanel($this->panels["DESTINATION"]);
        $this->panels["BODY"]->addPanel($this->panels["REPORT"]);
        $this->panels["TOPMENU"]->addPanel($this->panels["LOGIN"]);
        $this->panels["TOPMENU"]->addPanel($this->panels["SET_ADMIN_PASSWORD"]);
        $this->panels["TOPMENU"]->addPanel($this->panels["USERINFO"]);
        $this->panels["TOPMENU"]->addPanel($this->panels["MENUBUTTON"]);
        $this->panels["TOPMENU"]->addPanel($this->panels["RUNMODE"]);
        $this->panels["TOPMENU"]->addPanel($this->panels["LOGOUT"]);

        // Store any menu page URL, in ajax mode links go through the general ajax link, otherwise go through calling script
        $calling_script = $this->getActionUrl();
        if (preg_match("/\?/", $this->getActionUrl())) {
            $url_join_char = "&";
        } else {
            $url_join_char = "?";
        }

        $this->prepare_url = $calling_script . "{$url_join_char}execute_mode=PREPARE&reportico_session_name=" . $sessionClass::reporticoSessionName();
        $this->menu_url = $calling_script . "{$url_join_char}execute_mode=MENU&reportico_session_name=" . $sessionClass::reporticoSessionName();
        $this->admin_menu_url = $calling_script . "{$url_join_char}execute_mode=MENU&project=admin&reportico_session_name=" . $sessionClass::reporticoSessionName();
        $this->configure_project_url = $calling_script . "{$url_join_char}execute_mode=PREPARE&xmlin=configureproject.xml&reportico_session_name=" . $sessionClass::reporticoSessionName();
        $this->delete_project_url = $calling_script . "{$url_join_char}execute_mode=PREPARE&xmlin=deleteproject.xml&reportico_session_name=" . $sessionClass::reporticoSessionName();
        $this->create_report_url = $calling_script . "{$url_join_char}execute_mode=PREPARE&xmlin=&reportico_session_name=" . $sessionClass::reporticoSessionName();

        if ($forward_url_params) {
            $this->prepare_url .= "&" . $forward_url_params;
            $this->menu_url .= "&" . $forward_url_params;
            $this->admin_menu_url .= "&" . $forward_url_params;
            $this->configure_project_url .= "&" . $forward_url_params;
            $this->delete_project_url .= "&" . $forward_url_params;
            $this->create_report_url .= "&" . $forward_url_params;
        }
        // ***MENUURL ***if (array_key_exists("menu_url", $_SESSION[$sessionClass::reporticoNamespace()]))
        // ***MENUURL ***{
        // ***MENUURL ***$this->menu_url = $sessionClass::getReporticoSessionParam("menu_url");
        // ***MENUURL ***}

        // Generate dropdown menu strip in menu or prepare mode
        if (ReporticoApp::get("dropdown_menu") && !$this->dropdown_menu) {
            $this->dropdown_menu = ReporticoApp::get("dropdown_menu");
        }

        if ($this->dropdown_menu && ($mode == "MENU" || $mode == "PREPARE")) {
            $this->generateDropdownMenu($this->dropdown_menu);
            $template->assign('DROPDOWN_MENU_ITEMS', $this->dropdown_menu);
        }
        $template->assign('MENU_TITLE', ReporticoApp::get('menu_title'));

        if ($mode == "MENU") {
            // Store the URL of thi smenu so it can be referred to
            // in later screens
            // ***MENUURL ***$this->menu_url = $_SERVER["PHP_SELF"];
            // ***MENUURL ***$sessionClass::setReporticoSessionParam("menu_url",$this->menu_url);
            $this->panels["MENU"]->setVisibility(true);
            //$this->panels["FORM"]->addPanel($this->panels["MENU"]);
        }

        if ($mode == "EXECUTE") {
            $this->panels["REPORT"]->setVisibility(true);
            //$this->panels["FORM"]->addPanel($this->panels["REPORT"]);
        }

        if ($mode == "MAINTAIN") {
            $this->panels["MAINTAIN"]->setVisibility(true);
            //$this->panels["FORM"]->addPanel($this->panels["MAINTAIN"]);
        }

        if ($mode == "ADMIN") {
            $this->panels["ADMIN"]->setVisibility(true);
            $this->panels["MENU"]->setVisibility(true);
            //$this->panels["FORM"]->addPanel($this->panels["MAINTAIN"]);
        }

        if ($mode == "PREPARE") {
            $this->panels["CRITERIA"]->setVisibility(true);
            $this->panels["CRITERIA_FORM"]->setVisibility(true);
            $this->panels["CRITERIA_EXPAND"]->setVisibility(true);
            $this->panels["DESTINATION"]->setVisibility(true);
            //$this->panels["FORM"]->addPanel($this->panels["CRITERIA"]);
        }

        // Visibility of Login details depends on whether user has provided login
        // details and also whether those details are valid, so set user name
        // and password to use for connection and then attempt to connect
        $this->panels["MENUBUTTON"]->setVisibility(true);
        $this->panels["LOGIN"]->setVisibility(false);
        $this->panels["SET_ADMIN_PASSWORD"]->setVisibility(false);
        $this->panels["LOGOUT"]->setVisibility(true);
        $this->panels["USERINFO"]->setVisibility(true);
        $this->panels["RUNMODE"]->setVisibility(true);

        $template->assign('REPORTICO_BOOTSTRAP_MODAL', true);
        if (!$this->bootstrap_styles || $this->force_reportico_mini_maintains) {
            $template->assign('REPORTICO_BOOTSTRAP_MODAL', false);
        }

        // If no admin password then force user to enter one and  a language
        if (ReporticoApp::getConfig("project") == "admin" && ReporticoApp::getConfig("admin_password") == "PROMPT") {
            $template->assign('LANGUAGES', ReporticoLang::availableLanguages());
            // New Admin password submitted, attempt to set password and go to MENU option
            if (array_key_exists("submit_admin_password", $_REQUEST)) {
                $template->assign('SET_ADMIN_PASSWORD_ERROR',
                    $this->saveAdminPassword($_REQUEST["new_admin_password"], $_REQUEST["new_admin_password2"], $_REQUEST["jump_to_language"]));
            }

            $this->panels["SET_ADMIN_PASSWORD"]->setVisibility(true);
            $template->assign('SHOW_SET_ADMIN_PASSWORD', true);
            $this->panels["LOGOUT"]->setVisibility(false);
            $this->panels["MENU"]->setVisibility(false);
            $template->assign('SHOW_REPORT_MENU', false);
            if (!ReporticoApp::isSetConfig('admin_password_reset')) {
                return;
            } else {
                $template->assign('SHOW_SET_ADMIN_PASSWORD', false);
            }

        }

        $template->assign('SHOW_MINIMAINTAIN', false);
        {
            $sessionClass::setReporticoSessionParam("loggedin", true);
            if ($this->loginCheck($template)) {
                // User has supplied details ( user and password ), so assume that login box should
                // not occur ( user details
                $this->panels["MENUBUTTON"]->setVisibility(true);
                $this->panels["LOGIN"]->setVisibility(false);
                $this->panels["SET_ADMIN_PASSWORD"]->setVisibility(false);
                $this->panels["LOGOUT"]->setVisibility(true);
                $this->panels["USERINFO"]->setVisibility(true);
                $this->panels["FORM"]->setVisibility(true);

                // Show quick edit/mini maintain elements if in design or demo mode
                // unless the report is a reportico configuration report
                if ($this->login_type == "DESIGN" || $this->access_mode == "DEMO") {
                    $template->assign('SHOW_MINIMAINTAIN', true);
                }

                if ($this->login_type == "DESIGN") {
                    $this->panels["RUNMODE"]->setVisibility(true);
                } else {
                    $this->panels["RUNMODE"]->setVisibility(false);
                }

                $template->assign('SHOW_REPORT_MENU', true);

                // Only show a logout button if a password is in effect
                $project_password = ReporticoApp::getConfig("project_password");
                if ($this->login_type == "DESIGN" || $this->login_type == "ADMIN" || (ReporticoApp::isSetConfig('project_password') && ReporticoApp::getConfig('PROJECT_PASSWORD') != '')) {
                    $template->assign('SHOW_LOGOUT', true);
                }

                // Dont show logout button in ALLPROJECTS, ONE PROJECT
                if ($this->access_mode && ($this->access_mode != "DEMO" && $this->access_mode != "FULL" && $this->access_mode != "ALLPROJECTS")) {
                    $template->assign('SHOW_LOGOUT', false);
                }


                if ($mode == "PREPARE" && ($this->xmlinput == "deleteproject.xml" || $this->xmlinput == "configureproject.xml" || $this->xmlinput == "createtutorials.xml")) {

                    // Dont show database errors if displaying Configure Project prepare page as database connectivity could be wrong
                    // and user will correct it
                } else {

                if ( is_object($this->datasource) && ( get_class($this->datasource) == "stdClass" ||  $this->datasource->connect() || $mode != "MAINTAIN" ) ) {
                    // Store connection session details
                    if( get_class($this->datasource) != "stdClass" ){
                        $sessionClass::setReporticoSessionParam("database", $this->datasource->database);
                        $sessionClass::setReporticoSessionParam("hostname", $this->datasource->host_name);
                        $sessionClass::setReporticoSessionParam("driver", $this->datasource->driver);
                        $sessionClass::setReporticoSessionParam("server", $this->datasource->server);
                        $sessionClass::setReporticoSessionParam("protocol", $this->datasource->protocol);
                    }
                } else {
                    //echo "not connected okay<br>";
                    $this->panels["LOGIN"]->setVisibility(true);
                    $this->panels["SET_ADMIN_PASSWORD"]->setVisibility(false);
                    $this->panels["MENUBUTTON"]->setVisibility(false);
                    $this->panels["LOGOUT"]->setVisibility(false);
                    $this->panels["USERINFO"]->setVisibility(false);
                    $this->panels["RUNMODE"]->setVisibility(true);
                    $this->panels["FORM"]->setVisibility(false);
                    $this->panels["STATUS"]->setVisibility(true);
                    $this->panels["ERROR"]->setVisibility(true);
                }
                }
                //echo "done connecting";
            } else {

                // If not logged in then set first criteria entry to true
                // So when we do get into criteria it will work
                $sessionClass::setReporticoSessionParam("firstTimeIn", true);
                $sessionClass::setReporticoSessionParam("loggedin", false);

                $this->panels["LOGIN"]->setVisibility(true);
                $this->panels["MENUBUTTON"]->setVisibility(true);
                $this->panels["LOGOUT"]->setVisibility(false);
                $this->panels["USERINFO"]->setVisibility(false);
                $this->panels["RUNMODE"]->setVisibility(false);

                // Dont allow admin design access if access mode is set and not FULL access
                if (ReporticoApp::getConfig("project") == "admin") {
                    if ($this->access_mode && ($this->access_mode != "FULL")) {
                        $this->panels["LOGIN"]->setVisibility(false);
                    }
                }

                // We do want to show the "run project" list in admin mode if not logged in
                if (ReporticoApp::getConfig("project") == "admin") {
                    $this->panels["FORM"]->setVisibility(true);
                } else {
                    $this->panels["FORM"]->setVisibility(false);
                }

            }
        }

        // Turn off design mode if login type anything except design
        if ($this->login_type != "DESIGN" && !ReporticoUtility::getRequestItem("partialMaintain", false)) {
            $this->panels["MAINTAIN"]->setVisibility(false);
        }

    }
963281
protected function renderParameterTypeHint($parameter)
    {
        $typeHint = $parameter->hasType() ? (string) $parameter->getType() : '';

        $typeHint = trim($typeHint);

        if ($typeHint) {
            // If the type is not a built in types, we should add a leading slash
            // in the type hint be make the class name not confusing.
            if (
                ! in_array($typeHint, [
                    'self', 'array', 'callable', 'bool', 'float', 'int', 'string',
                    'object', 'iterable', 'void'
                ])
            ) {
                $typeHint = '\\'.$typeHint;
            }

            if ($parameter->allowsNull()) {
                $typeHint = '?'.$typeHint;
            }

            $typeHint .= ' ';
        }

        return $typeHint;
    }
654559
public function render()
    {
        $this->formActionUri = null;
        if ($this->arguments['action'] === null && $this->arguments['actionUri'] === null) {
            throw new ViewHelper\Exception('FormViewHelper requires "actionUri" or "action" argument to be specified', 1355243748);
        }
        $this->tag->addAttribute('action', $this->getFormActionUri());

        if (strtolower($this->arguments['method']) === 'get') {
            $this->tag->addAttribute('method', 'get');
        } elseif (strtolower($this->arguments['method']) === 'dialog') {
            $this->tag->addAttribute('method', 'dialog');
        } else {
            $this->tag->addAttribute('method', 'post');
        }

        $this->addFormObjectNameToViewHelperVariableContainer();
        $this->addFormObjectToViewHelperVariableContainer();
        $this->addFieldNamePrefixToViewHelperVariableContainer();
        $this->addFormFieldNamesToViewHelperVariableContainer();
        $this->addEmptyHiddenFieldNamesToViewHelperVariableContainer();
        $this->viewHelperVariableContainer->addOrUpdate(FormViewHelper::class, 'required-enctype', '');

        $formContent = $this->renderChildren();

        $requiredEnctype = $this->viewHelperVariableContainer->get(FormViewHelper::class, 'required-enctype');
        if ($requiredEnctype !== '' && $requiredEnctype !== strtolower($this->arguments['enctype'])) {
            throw new WrongEnctypeException('The form you are trying to render requires an enctype of "' . $requiredEnctype . '". Please specify the correct enctype when using file uploads.', 1522706399);
        }

        // wrap hidden field in div container in order to create XHTML valid output
        $content = chr(10) . '<div style="display: none">';
        if (strtolower($this->arguments['method']) === 'get') {
            $content .= $this->renderHiddenActionUriQueryParameters();
        }
        $content .= $this->renderHiddenIdentityField($this->arguments['object'], $this->getFormObjectName());
        $content .= $this->renderAdditionalIdentityFields();
        $content .= $this->renderHiddenReferrerFields();
        $content .= $this->renderEmptyHiddenFields();
        // Render the trusted list of all properties after everything else has been rendered
        $content .= $this->renderTrustedPropertiesField();
        $content .= $this->renderCsrfTokenField();
        $content .= '</div>' . chr(10);
        $content .= $formContent;

        $this->tag->setContent($content);

        $this->removeFieldNamePrefixFromViewHelperVariableContainer();
        $this->removeFormObjectFromViewHelperVariableContainer();
        $this->removeFormObjectNameFromViewHelperVariableContainer();
        $this->removeFormFieldNamesFromViewHelperVariableContainer();
        $this->removeEmptyHiddenFieldNamesFromViewHelperVariableContainer();

        return $this->tag->render();
    }
1335338
public function RenderBegin () {
		$this->form->PreDispatch();
		$result = "<form";
		$attrs = [];
		$form = & $this->form;
		// standard attributes
		$formProperties = ['id', 'action', 'method', 'enctype', 'target'];
		foreach ($formProperties as $property) {
			$getter = 'Get'.ucfirst($property);
			$formPropertyValue = $form->$getter();
			if ($formPropertyValue !== NULL)
				$attrs[$property] = $formPropertyValue;
		}
		// css classes
		$formCssClasses = $form->GetCssClasses();
		if ($formCssClasses)
			$attrs['class'] = gettype($formCssClasses) == 'array'
				? implode(' ', (array) $formCssClasses)
				: $formCssClasses;
		// additional custom attributes completing
		foreach ($form->GetAttributes() as $key => $value) {
			if (!in_array($key, $formProperties))
				$attrs[$key] = $value;
		}
		// pseudo-boolean attributes completing
		$formAutoComplete = $form->GetAutoComplete();
		if ($formAutoComplete !== NULL) 
			$attrs['autocomplete'] = $formAutoComplete ? 'on' : 'off';
		$formNoValidate = $form->GetNoValidate();
		if ($formNoValidate === TRUE)
			$attrs['novalidate'] = 'novalidate';
		$formAcceptCharsets = $form->GetAcceptCharsets();
		if (count($formAcceptCharsets) > 0) 
			$attrs['accept-charset'] = implode(' ', $formAcceptCharsets);
		// boolean and additional attributes
		$attrsStr = self::RenderAttrs($attrs);
		if ($attrsStr) $result .= ' ' . $attrsStr;
		$result .= '>';
		$this->form->SetFormTagRenderingStatus(TRUE);
		$result .= $this->RenderCsrf();
		return $result;
	}
382905
protected function html($val, $mode = 's')
    {
        switch ($mode) {
            case 'e':
                return $this->htmlE($val);
            case 's':
                return $this->htmlS($val);
        }

        Throw new ViewException(sprintf('Mode "%s" is a not supported View::html() output mode.', $mode));
    }
138183
public function render(Zend_View_Interface $view = null)
	{
        $formTypes = array( // avaible form types of Twitter Bootstrap form (i.e. classes)
          'horizontal',
          'inline',
          'vertical',
          'search'
        );
        
        $set = false;
        
        foreach($formTypes as $type) {
            if($this->getAttrib($type)) {
                $this->addDecorator("Form", array("class" => "form-$type"));
                $set = true;
            } 
        }
        if(true !== $set) { // if neither type was set, we set the default vertical class
            $this->addDecorator("Form", array("class" => "form-vertical"));
        }

		return parent::render($view);
	}