Modal container for theme code form
@return ViewModel
2699
public function toolModalCodeContainerAction()
    {
        $id = $this->params()->fromRoute('id', $this->params()->fromQuery('id', ''));

        $melisKey = $this->getMelisKey();

        $view = new ViewModel();
        $view->setTerminal(false);
        $view->melisKey = $melisKey;
        $view->id = $id;

        return $view;
    }
642103
public function renderPlatformContentActionEditAction()
    {
        $melisKey = $this->params()->fromRoute('melisKey', '');
    
        $view = new ViewModel();
        $view->melisKey = $melisKey;
    
        return $view;
    }
1175259
public function indexAction(){
		$configForm = $this->getForm();
		$configForm->setData($this->getConfig());
		
		$view = new ViewModel(array('title' => $this->getEditTitle(), 'configForm' => $configForm));
		$view->setTemplate('xelax-site-config/site-config/index.phtml');
		return $view;
	}
531845
public function renderPlatformModalContentAction()
    {
        $pids_id = $this->params()->fromQuery('id');

        // Get Cms Platform ID form from  App Tool
        $melisMelisCoreConfig = $this->serviceLocator->get('MelisCoreConfig');
        $genericPlatformForm = $melisMelisCoreConfig->getFormMergedAndOrdered('meliscms/tools/meliscms_platform_tool/forms/meliscms_tool_platform_generic_form', 'meliscms_tool_platform_generic_form');

        // Factoring Calendar event and pass to view
        $factory = new \Zend\Form\Factory();
        $formElements = $this->serviceLocator->get('FormElementManager');
        $factory->setFormElementManager($formElements);
        $propertyForm = $factory->createForm($genericPlatformForm);

        $view = new ViewModel();
        $melisEngineTablePlatformIds = $this->getServiceLocator()->get('MelisEngineTablePlatformIds');
        $availablePlatform = $melisEngineTablePlatformIds->getAvailablePlatforms()->toArray();
        // Check if Cms Platform Id is Set
        if (!empty($pids_id)) {
            // Get Platform ID Details
            $platformIdsData = $melisEngineTablePlatformIds->getEntryById($pids_id);
            $platformIdsData = $platformIdsData->current();

            $platformTable = $this->getServiceLocator()->get('MelisCoreTablePlatform');
            $platformData = $platformTable->getEntryById($pids_id);
            $platformData = $platformData->current();

            // Assign Platform name to Element Name of the Form from the App Tool
            $platformIdsData->pids_name_input = $platformData->plf_name;

            // Removing Select input
            $propertyForm->remove('pids_name_select');
            // Binding datas to the Form
            $propertyForm->bind($platformIdsData);

            // Set variable to View
            $view->pids_id = $pids_id;
            $view->tabTitle = 'tr_meliscms_tool_platform_ids_btn_edit';
        } else {
            // Removing Id input and Platform input
            $propertyForm->remove('pids_id');
            $propertyForm->remove('pids_name_input');
            // Set variable to View
            $view->tabTitle = 'tr_meliscms_tool_platform_ids_btn_add';
        }

        $view->setVariable('meliscms_tool_platform_generic_form', $propertyForm);
        $view->setVariable('available_platform', $availablePlatform);
        $view->melisKey = $this->params()->fromRoute('melisKey', '');

        return $view;
    }
1211641
function() {
      var t = this;

      // Show if loaded
      if (aboutTemplate) {
       return t.showDialog('#nm-pv-about');
      }

      UI.loadTemplate('', 'About', function(error, template) {
        if (error) {return;}

        t.$el.append(template.apply(t));
        t.$('.modal a').attr({target: '_blank'});
        t.$('.colorPicker').miniColors({opacity: true});
        t.showDialog('#nm-pv-about');
      });
    }
584710
public function showAction()
    {
        $id = (int) $this->params()->fromRoute('id', null);

        $service = $this->getService();
        $entity  = $service->getById($id);

        $view = new ViewModel(array(
            'entity'  => $entity,
            'options' => $this->getOptions(),
        ));

        if ($this->getOptions()->getDisplayDiagrammInDetailView()) {
            $diagramm = $this->getService()->createUseCaseDiagrammFor($entity);
            $view->setVariable('diagramm', $diagramm);
        }

        return $view;
    }
1054025
protected function createComponentEditForm(): Form
	{
		$form = $this->formFactory->create();
		$form->addProtection();

		$form->addText('username', 'cms.user.username')
			->setDefaultValue($this->currentUser->username)
			->setRequired();
		$form->addText('firstName', 'cms.user.firstName')
			->setDefaultValue($this->currentUser->firstName);
		$form->addText('surname', 'cms.user.surname')
			->setDefaultValue($this->currentUser->surname);
		$form->addText('email', 'cms.user.email')
			->setDefaultValue($this->currentUser->email)
			->setRequired()
			->addRule(Form::EMAIL);
		$form->addPhone('phone', 'cms.user.phone')
			->setDefaultValue($this->currentUser->phone);

		$language = $form->addSelectUntranslated('language', 'cms.user.language', $this->localeService->allowed, 'form.none');
		if (!empty($this->currentUser->language)) {
			$locale = $this->localeService->get($this->currentUser->language);
			if ($locale) {
				$language->setDefaultValue($locale->id);
			}
		}

		$roles = $form->addMultiSelectUntranslated('roles', 'cms.permissions.roles', $this->orm->aclRoles->fetchPairs($this->user->isAllowed('dockbar.settings.permissions.superadmin', 'view')))
			->setRequired();
		try {
			$roles->setDefaultValue($this->currentUser->roles->getRawValue());
		} catch (InvalidArgumentException $ex) {

		}

		$form->addSubmit('save', 'form.save');
		$form->addLink('back', 'form.back', $this->getBacklink());

		$form->onSuccess[] = [$this, 'editFormSucceeded'];

		return $form;
	}
1245410
protected function createComponentSettingsForm(): Form
	{
		$form = $this->formFactory->create();

		$form->addImageUpload('logo', 'webManager.web.settings.logo', 'webManager.web.settings.deleteLogo')
			->setNamespace('front')
			->setPreview('300x100');
		$form->addText('title', 'webManager.web.settings.pagesTitle');
		$form->addTextArea('keywords', 'webManager.web.settings.keywords');
		$form->addTextArea('description', 'webManager.web.settings.description');

		$form->addSubmit('save', 'form.save');

		$form->onSuccess[] = [$this, 'settingsFormSucceeded'];

		return $form;
	}
1251211
public function renderTreeToolsAction(): ViewModel
    {
        $melisKey = $this->params()->fromRoute('melisKey', '');

        /** @var \MelisCore\Service\MelisCoreConfigService $melisAppConfig */
        $melisAppConfig = $this->getServiceLocator()->get('MelisCoreConfig');
        $melisKeys = $melisAppConfig->getMelisKeys();

        // Get the order list for ordering tools
        $appconfigpath = $melisKeys[$melisKey];

        $appsConfig = $melisAppConfig->getItem($appconfigpath);


        $orderInterface = $melisAppConfig->getOrderInterfaceConfig($melisKey);
        $tools = [];

        /** @var \MelisCore\Service\MelisCoreAuthService $melisCoreAuth */
        $melisCoreAuth = $this->getServiceLocator()->get('MelisCoreAuth');

        /** @var \MelisCore\Service\MelisCoreRightsService $melisCoreRights */
        $melisCoreRights = $this->getServiceLocator()->get('MelisCoreRights');
        $xmlRights = $melisCoreAuth->getAuthRights();

        // Merge config if melisKey is "Others"
        if ($melisKey == 'melisothers_toolstree_section') {
            $appsConfig['interface'] = ArrayUtils::merge($appsConfig['interface'], $this->moveToolsToOthersCategory());
        }

        if (isset($appsConfig['interface']) && !empty($appsConfig['interface'])) {
            // Show sections first

            foreach ($appsConfig['interface'] as $key => $toolSectionName) {
                $isNavChild = false;

                if ($melisCoreRights->canAccess($key)) {

                    $tools[$key] = [
                        'toolsection_id' => $toolSectionName['conf']['id'] ?? $key,
                        'toolsection_name' => $toolSectionName['conf']['name'] ?? $key,
                        'toolsection_meliskey' => $toolSectionName['conf']['melisKey'] ?? $key,
                        'toolsection_icon' => $toolSectionName['conf']['icon'] ?? 'fa-cube',
                        'toolsection_forward' => $toolSectionName['forward'] ?? [],
                        'toolsection_children' => [],
                        'toolsection_is_tool' => isset($toolSectionName['forward']) && !empty($toolSectionName['forward']) ? true : false,
                    ];

                    // Second level, tools
                    if (isset($toolSectionName['interface'])) {
                        foreach ($toolSectionName['interface'] as $keyTool => $toolName) {
                            $isToolNavChild = false;

                            $icon = (!empty($toolName['conf']['icon'])) ? $toolName['conf']['icon'] : 'fa-cube';

                            if ($icon) {
                                $isNavChild = true;
                            }

                            if ($melisCoreRights->canAccess($keyTool)) {
                                $tools[$key]['toolsection_children'][$keyTool] = [
                                    'tool_id' => $toolName['conf']['id'] ?? $keyTool,
                                    'tool_name' => $toolName['conf']['name'] ?? "<strike>$keyTool</strike>",
                                    'tool_icon' => $icon,
                                    'tool_forward' => isset($toolName['forward']) ? $toolName['forward'] : [],
                                    'tool_melisKey' => $toolName['conf']['melisKey'] ?? $keyTool,
                                    'toolsection_is_tool' => isset($toolName['forward']) && !empty($toolName['forward']) ? true : false
                                ];
                            }

                            // add third level for tool others
                            if ($melisKey == 'melisothers_toolstree_section') {
                                if (isset($toolName['interface'])) {

                                    // third level, child tools
                                    foreach ($toolName['interface'] as $childKeyTool => $childToolname) {
                                        $icon = (!empty($childToolname['conf']['icon'])) ? $childToolname['conf']['icon'] : 'fa-cube';

                                        if ($icon) {
                                            $isToolNavChild = true;
                                        }

                                        if ($melisCoreRights->canAccess($childKeyTool)) {
                                            $tools[$key]['toolsection_children'][$keyTool]['toolsection_children'][$childKeyTool] = [
                                                'tool_id' => $childToolname['conf']['id'] ?? $keyTool,
                                                'tool_name' => $childToolname['conf']['name'] ?? "<strike>$childKeyTool</strike>",
                                                'tool_icon' => $icon,
                                                'tool_forward' => isset($childToolname['forward']) ? $childToolname['forward'] : [],
                                                'tool_melisKey' => $childToolname['conf']['melisKey'] ?? $keyTool,
                                                'toolsection_is_tool' => isset($childToolname['forward']) && !empty($childToolname['forward']) ? true : false
                                            ];
                                        }

                                    }

                                }

                            }
                            $tools[$key]['toolsection_children'][$keyTool]['toolsection_has_nav_child'] = $isToolNavChild;
                        }
                    }
                }


                $tools[$key]['toolsection_has_nav_child'] = $isNavChild;
            }
        } else {
            // for parent tool
            if (isset($appsConfig['conf']['is_parent_tool']) && $appsConfig['conf']['is_parent_tool']) {
                if ($melisCoreRights->canAccess($melisKey)) {
                    $tools[$melisKey] = $appsConfig;
                }
            }
        }

        $sections = $tools;

        // Reordering sections
        $toolsOrdered = [];
        foreach ($orderInterface as $orderKeySection => $sectionTools) {
            if (!empty($sections[$orderKeySection])) {
                if (empty($toolsOrdered[$orderKeySection])) {
                    $toolsOrdered[$orderKeySection] = [];
                }
                $toolsOrdered[$orderKeySection] = $tools[$orderKeySection];
                unset($toolsOrdered[$orderKeySection]['toolsection_children']);
                unset($sections[$orderKeySection]);
            }
        }
        foreach ($sections as $keyInterfaceSection => $childinterface) {
            if (empty($toolsOrdered[$keyInterfaceSection])) {
                $toolsOrdered[$keyInterfaceSection] = [];
            }
            $toolsOrdered[$keyInterfaceSection] = $tools[$keyInterfaceSection];
            unset($toolsOrdered[$keyInterfaceSection]['toolsection_children']);
        }

        // Reordering tools inside sections
        foreach ($toolsOrdered as $keySection => $toolsSection) {
            $sectionOrderInterface = [];
            if (!empty($orderInterface[$keySection])) {
                $sectionOrderInterface = $orderInterface[$keySection];
            }
            $toolsSectionOrdered = [];

            foreach ($sectionOrderInterface as $orderKey) {
                if (!empty($tools[$keySection]['toolsection_children'][$orderKey])) {
                    $toolsOrdered[$keySection]['toolsection_children'][$orderKey] = $tools[$keySection]['toolsection_children'][$orderKey];
                    unset($tools[$keySection]['toolsection_children'][$orderKey]);
                }
            }

            if (isset($tools[$keySection]['toolsection_children'])) {
                foreach ($tools[$keySection]['toolsection_children'] as $keyInterface => $childinterface) {
                    $toolsOrdered[$keySection]['toolsection_children'][$keyInterface] = $childinterface;
                }
            }
        }

        $view = new ViewModel();

        $view->tools = $toolsOrdered;
        $view->melisKey = $melisKey;
        return $view;
    }
1225061
public function render()
    {
        $this->removeIDFilterIfNeeded();

        if (empty($this->filters)) {
            return '';
        }

        $script = <<<'EOT'

$("#filter-modal .submit").click(function () {
    $("#filter-modal").modal('toggle');
    $('body').removeClass('modal-open');
    $('.modal-backdrop').remove();
});

EOT;
        Admin::script($script);

        return view($this->view)->with([
            'action'  => $this->action ?: $this->urlWithoutFilters(),
            'filters' => $this->filters,
            'modalId' => $this->filterModalId,
        ]);
    }
606465
public function toolContainerAction()
    {

        $form = $this->getForm();
        $melisKey = $this->params()->fromRoute('melisKey', '');
        $view = new ViewModel();

        $view->melisKey = $this->getMelisKey();
        $view->hasAccess = $this->hasAccess($melisKey);

        $schemeData = $this->getPlatformSchemeSvc()->getCurrentScheme();

        if ($schemeData) {
            $colors = json_decode($schemeData->getColors(), true);
            if ($colors) {
                $form->setData($colors);
            }
        }

        $view->setVariable('form', $form);
        $view->schemes = $schemeData;

        return $view;
    }
737047
public function renderToolUserModalNewRightsAction()
    {
        $melisKey = $this->params()->fromRoute('melisKey', '');


        $view = new ViewModel();
        $view->melisKey = $melisKey;

        return $view;
    }
213501
public function render() {

		$output = '<div id="' . esc_attr( $this->id() ) . '" data-color="' . esc_attr( $this->base_color() ) . '" data-for="' . esc_attr( $this->id() ) . '-control" class="uix-control uix-control-' . esc_attr( $this->type ) . ' ' . esc_attr( $this->id() ) . '"></div>';
		$output .= $this->label();
		$output .= $this->input();

		$output .= $this->component_templates();

		$output .= $this->modal_template();

		return $output;
	}
91133
public function getViewModel() {
		RequestHandler::handleDelete($this->objectManager, $this->entityNamespace, $this->entityId, $this->entityFilter);
		if ($this->redirect != null) {
			return $this->getRedirect();
		}
	}
316085
public function indexAction()
    {
        // To begin the step of installation, the user must click "continue".
        if (! $this->params()->fromRoute('process')) {
            return new ViewModel();
        }

        $installation = $this->getInstallation();
        $redirect     = $this->getRedirect();
        $step         = $installation->getCurrentStep();
        $member       = $step->getCurrentMember();
        $service      = $this->getService();
        $validator    = $this->getValidator();

        foreach ($member as $item) {
            if (! $validator->isValid($item)) {
                if (! $service->process($item)) {
                    return new ViewModel([
                        'errors' => $service->getMessages()
                    ]);
                }
            }
        }
        return $this->redirect()->toUrl($redirect);
    }
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;
    }
675086
public function component_templates() {
		$output = null;
		foreach ( $this->modals as $modal ) {

			$width  = 'data-width="950"';
			$height = 'data-height="550"';

			$output .= '<script type="text/html" ' . $width . ' ' . $height . ' id="' . esc_attr( $this->id() ) . '-' . esc_attr( $modal->slug ) . '">';
			if ( isset( $modal->struct['preview'] ) ) {
				$template = uix()->add( 'control', $modal->slug, array(
					'type'     => 'template',
					'template' => $modal->struct['preview'],
				) );

				$output .= $template->render();
			} else {
				$output .= '<div>' . $modal->struct['label'] . '</div>';
			}
			$output .= '</script>';

		}

		return $output;
	}