Render base tabs
@author Máximo Sojo maxsojo13@gmail.com <maxtoan at atechnologies>
@param  \Atechnologies\ToolsBundle\Model\Core\Tab\Tab
@param  array
@return [type]
326007
public function renderTabs(\Tecnoready\Common\Model\Tab\Tab $tab,array $parameters = []) 
    {
        $parameters["tab"] = $tab;
        return $this->container->get('templating')->render($this->config["tabs"]["template"], 
            $parameters
        );
    }
827183
public function renderNested(array $items, $level = 0)
    {
        $out = '';
        foreach ($items as $item) {
            $out .= $this->_renderItem($item, $level);
        }
        return $out;
    }
868373
public function render(array $parameters = []): string
    {
        return $this->twig->render('@ezdesign/component/script.html.twig', [
            'src' => $this->src,
            'type' => $this->type,
            'async' => $this->async,
            'defer' => $this->defer,
            'crossorigin' => $this->crossorigin,
            'integrity' => $this->integrity,
        ] + $parameters);
    }
1241579
function render(Axis $columns, StaticAttributesMap $tableColAttributes) {

    if ($this->rows->isEmpty() || !$columns->getCount()) {
      return '';
    }

    $container = new BuildContainer(
      $this->rows->takeSnapshot(),
      $columns);

    /** @var BuildContainerBase $container */
    $container->CellContents = $this->cellContents;
    $container->CellClasses = $this->cellClasses;
    $container->CellTagNames = $this->cellTagNames;
    $container->OpenEndCells = $this->openEndCells;
    $container->RowAttributes = clone $this->rowAttributes->staticCopy();
    $container->RowStripings = $this->rowStripings;
    $container->TableColAttributes = $tableColAttributes;
    $container->SectionColAttributes = $this->colAttributes->staticCopy();

    /** @var BuildContainer $container */
    $innerHtml = $container->InnerHtml;

    return '  ' . $this->renderTag($this->tagName, "\n" . $innerHtml . '  ') . "\n";
  }
438159
public function getTabs(array $items, array $attrs = []): string
    {
        $attrs = HtmlAttrs::build(array_replace_recursive([
            'role' => 'tablist',
            'class' => 'nav nav-tabs',
        ], $attrs));

        return vsprintf('<ul %s>%s</ul>', [
            $attrs,
            implode('', array_map([$this, 'getTab'], $items)),
        ]);
    }
1207141
public function outputPHP($v, $tabs=0, $line=false) {
		$r = '';

		if($line)
			$r .= "\n".str_repeat("\t", $tabs);

		if(is_array($v)) {
			$r .= '[';
			if($v === array_values($v)) {
				foreach($v as $_v)
					$r .= $this->outputPHP($_v, $tabs+1, true).",";
			}
			else {
				foreach($v as $_k=>$_v)
					$r .= $this->outputPHP($_k, $tabs+1, true).' => '.$this->outputPHP($_v, $tabs+1).",";
			}
			$r .= "\n".str_repeat("\t", $tabs).']';

			return $r;
		}
		else
			return $r.var_export($v, true);
	}
578930
public function setsTabs($tabs)
    {
        if (is_array($tabs)) {
            $tabs = new ArrayCollection($tabs);
        }
        if (!$tabs instanceof ArrayCollection) {
            throw new \UnexpectedValueException("Expected array or instance of " . ArrayCollection::class);
        }

        $this->tabs = $tabs;

        return $this;
    }
603386
protected function render(array $colours)
    {
        $separator = '+';

        foreach ($this->columnLengthMax as $columnLength) {
            $separator .= str_repeat('-', $columnLength + 2) . '+';
        }

        $output = $separator;

        foreach ($this->rows as $row) {
            $output .= PHP_EOL . '|';

            foreach ($this->columnLengthMax as $key => $null) {
                $cellContent = isset($row[$key]) ? $row[$key] : '';

                $output .= ' ' . str_pad($cellContent, $this->columnLengthMax[$key]) . ' |';
            }
        }

        // flush rows
        $this->rows = [];

        // Create the coloured string
        return "\n\033[{$colours[0]}m\033[{$colours[1]}m" . $output . PHP_EOL . $separator . PHP_EOL . "\033[0m\n";
    }
458632
public function renderAsArray($data = false, $parent = 0)
    {
        $args = $this->setParameters(func_get_args());
        $tree = collect([]);

        $args['data']->each(function ($item) use (&$tree, $args) {

            $currentData = collect([]);

            if (intval($item[$this->parent]) == intval($args['parent'])) {
                // fill the array with the body fields
                foreach ($this->config['body'] as $field) {
                    $currentData->put($field, isset($item[$field]) ? $item[$field] : null);
                }

                // Get the child node name
                $child = $this->config['childNode'];

                $currentData->put($child, []);
                $currentData->put($this->parent, $item[$this->parent]);

                // Get the primary key name
                $item_id = $item[$this->config['primary_key']];
                // check the child element
                if ($this->hasChild($this->parent, $item_id, $args['data'])) {
                    // function call again for child elements
                    $currentData->put($child, $this->renderAsArray($args['data'], $item_id));
                }

                // current data push to global array
                $tree->push($currentData->toArray());
            }

        });

        return $tree->toArray();
    }
737136
public static function RenderAttrs (array $attributes = []) {
		$result = [];
		foreach ($attributes as $attrName => $attrValue) {
			//if (gettype($attrValue) == 'array') $stop();
			$result[] = $attrName.'="'.$attrValue.'"';
		}
		return implode(' ', $result);
	}
1203962
private function getBaseTables() {
    $base_tables = [];

    /** @var array[] $wizard_plugins */
    $wizard_plugins = $this->viewsWizardManager->getDefinitions();
    foreach ($wizard_plugins as $wizard) {
      if (!array_key_exists('base_table', $wizard)) {
        continue;
      }
      $base_tables[$wizard['base_table']] = (string) $wizard['title'];
    }

    return $base_tables;
  }
516023
public function table(array $attributes = [], $drawFooter = false, $drawSearch = false)
    {
        $this->setTableAttributes($attributes);

        $th = $this->compileTableHeaders();
        $htmlAttr = $this->html->attributes($this->tableAttributes);

        $tableHtml = '<table ' . $htmlAttr . '>';
        $searchHtml = $drawSearch ? '<tr class="search-filter">' . implode('',
                $this->compileTableSearchHeaders()) . '</tr>' : '';
        $tableHtml .= '<thead><tr>' . implode('', $th) . '</tr>' . $searchHtml . '</thead>';
        if ($drawFooter) {
            $tf = $this->compileTableFooter();
            $tableHtml .= '<tfoot><tr>' . implode('', $tf) . '</tr></tfoot>';
        }
        $tableHtml .= '</table>';

        return new HtmlString($tableHtml);
    }
624441
public static function formatArray(array $array, $braces = true)
    {
        $isMultiline = self::isArrayMultiline($array);

        $array = self::prepareArrayLines($array);

        $eol = $isMultiline ? PHP_EOL : '';

        $output = implode($array, ', ' . $eol);

        if ($isMultiline) {
            // apply base indent to array elements
            $output = self::indentLines($output, self::$tabSize);
        }

        if ($braces) {
            $output = implode(['[', $output, ']'], $eol);
        } else {
            $output = $eol . $output . $eol;
        }

        return $output;
    }
1078645
public function renderPagetabPropertiesAction()
	{
		$idPage = $this->params()->fromRoute('idPage', $this->params()->fromQuery('idPage', ''));
		$melisKey = $this->params()->fromRoute('melisKey', '');
		$pageStyle = null;
		$pathAppConfigForm = self::PagePropertiesAppConfigPath;
		 
		/**
		 * Get the config for this form
		 */
		$melisMelisCoreConfig = $this->serviceLocator->get('MelisCoreConfig');
		$pageStyleTable = $this->getServiceLocator()->get('MelisEngineTablePageStyle');
		
		$appConfigForm = $melisMelisCoreConfig->getFormMergedAndOrdered(
		    self::PagePropertiesAppConfigPath,
		    'meliscms_page_properties',
		    $idPage . '_'
		);

		/** Overriding the Page properties form by calling listener */
        $modifiedForm =  $this->getEventManager()->trigger(
            'modify_page_properties_form_config',
            $this,
            ['appConfigForm' => $appConfigForm]
        )->last();
        if (!empty($modifiedForm)) {
            $appConfigForm = $modifiedForm;
        }

		if (!empty($idPage))
		{
			// Lang not changeable after creation, config array defines the form in "new" state
			$appConfigForm = $melisMelisCoreConfig->setFormFieldDisabled($appConfigForm, 'plang_lang_id', true);
			$appConfigForm = $melisMelisCoreConfig->setFormFieldRequired($appConfigForm, 'plang_lang_id', false);
		}
		 
		/**
		 * Get the data to fill the form
		 */
		if (!empty($idPage))
		{
			$melisPage = $this->serviceLocator->get('MelisEnginePage');
			$datasPage = $melisPage->getDatasPage($idPage, 'saved');
			$datasPageTree = $datasPage->getMelisPageTree();
			$pageStyle = $pageStyleTable->getEntryByField('pstyle_page_id', $idPage)->current();
		}
		else
			$datasPageTree = null;
		 
		/**
		 * Generate the form through factory and change ElementManager to
		 * have access to our custom Melis Elements
		 * Bind with datas
		 */
		$factory = new \Zend\Form\Factory();
		$formElements = $this->serviceLocator->get('FormElementManager');
		$factory->setFormElementManager($formElements);
		$appConfigForm['attributes']['action'] .= '?idPage=' . $idPage;
		$propertyForm = $factory->createForm($appConfigForm);
		
		// service for handling Melis Multi Value Input (tags)
		if (!empty($datasPageTree)) {
		    // modify the values of the dates to render to its locale
		    $container = new Container('meliscore');
		    $locale = $container['melis-lang-locale'];
		    $melisTranslation = $this->getServiceLocator()->get('MelisCoreTranslation');
		    
		    $datasPageTree->page_creation_date = strftime($melisTranslation->getDateFormatByLocate($locale), strtotime($datasPageTree->page_creation_date));
		    $datasPageTree->page_edit_date = strftime($melisTranslation->getDateFormatByLocate($locale), strtotime($datasPageTree->page_edit_date));
            $propertyForm->bind($datasPageTree);
		}
		
		if(!empty($pageStyle)){
		    $propertyForm->setData(array('style_id' => $pageStyle->pstyle_style_id));
		}
		
		/**
		 * Send back the view and add the form config inside
		*/
		$view = new ViewModel();
		$view->setVariable('meliscms_page_properties', $propertyForm);
		$view->idPage = $idPage;
		$view->melisKey = $melisKey;
	
		return $view;
	}
288727
public function render(array $sitemapElements, $basepath)
    {
        $data = '<?xml version="1.0" encoding="UTF-8"?>' . PHP_EOL;
        $data .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . PHP_EOL;

        foreach ($sitemapElements as $sitemapElement) {
            $data .= '    <url>' . PHP_EOL;
            $data .= '        <loc>' . $basepath . $sitemapElement->getLocation() . '</loc>' . PHP_EOL;

            $lastModification = $sitemapElement->getLastModification();
            if (null !== $lastModification) {
                $data .= '        <lastmod>' . $lastModification . '</lastmod>' . PHP_EOL;
            }

            $changeFrequency = $sitemapElement->getChangeFrequency();
            if (null !== $changeFrequency) {
                $data .= '        <changefreq>' . $changeFrequency . '</changefreq>' . PHP_EOL;
            }

            $priority = $sitemapElement->getPriority();
            if (null !== $priority) {
                $data .= '        <priority>' . $priority . '</priority>' . PHP_EOL;
            }

            $data .= '    </url>' . PHP_EOL;
        }

        $data .= '</urlset>' . PHP_EOL;

        return $data;
    }
244147
private function renderRowArray($type = 'normal')
    {
        $data = $this->getTable()->getData();
        $headers = $this->getTable()->getHeaders();
        $render = array();

        foreach ($data as $rowData) {
            $this->setActualRow($rowData);
            $temp = array();
            foreach ($headers as $name => $options) {
                if ($type == 'assc') {
                    $temp[$name] =  $this->getTable()->getHeader($name)->getCell()->render('array');
                } else {
                    $temp[] =  $this->getTable()->getHeader($name)->getCell()->render('array');
                }
            }
            $render[] = $temp;
        }
        return $render;
    }
1010888
public void renderExtendedTab(Collection<I_CmsFormField> fields, FlowPanel tab) {

        List<CmsFieldSet> result = new ArrayList<CmsFieldSet>();

        tab.clear();

        String used = Messages.get().key(Messages.GUI_PROPERTY_BLOCK_USED_0);
        CmsFieldSet usedFieldSet = new CmsFieldSet();
        usedFieldSet.addStyleName(I_CmsInputLayoutBundle.INSTANCE.inputCss().formGradientBackground());
        usedFieldSet.setLegend(used);
        usedFieldSet.setAnimationDuration(50);

        String unused = Messages.get().key(Messages.GUI_PROPERTY_BLOCK_UNUSED_0);
        CmsFieldSet unusedFieldSet = new CmsFieldSet();
        unusedFieldSet.addStyleName(I_CmsInputLayoutBundle.INSTANCE.inputCss().formGradientBackground());
        unusedFieldSet.setOpen(false);
        unusedFieldSet.setLegend(unused);
        unusedFieldSet.setAnimationDuration(50);
        boolean reopen = false;
        final String currentMarkedProperty = m_markedProperty;
        m_markedProperty = null;
        for (I_CmsFormField field : fields) {
            if (isTop(field)) {
                usedFieldSet.addContent(createRow(field));
            } else {
                if ((currentMarkedProperty != null)
                    && field.getLayoutData().get(LD_PROPERTY).equals(currentMarkedProperty)) {
                    reopen = true;
                }
                unusedFieldSet.addContent(createRow(field));
            }
        }
        if (reopen) {
            unusedFieldSet.setOpen(true);
        }

        if (usedFieldSet.getWidgetCount() > 0) {
            result.add(usedFieldSet);
        }
        if (unusedFieldSet.getWidgetCount() > 0) {
            result.add(unusedFieldSet);
        }

        Iterator<CmsFieldSet> iter = result.iterator();
        while (iter.hasNext()) {
            CmsFieldSet fieldSet = iter.next();
            if (iter.hasNext()) {
                fieldSet.getElement().getStyle().setMarginTop(9, Unit.PX);
            } else {
                fieldSet.getElement().getStyle().setMarginTop(15, Unit.PX);
            }
            tab.add(fieldSet);
        }
        CmsDomUtil.resizeAncestor(tab.getParent());
    }