Generate DataTable's table html.

@param array $attributes
@param bool $drawFooter
@param bool $drawSearch
@return \Illuminate\Support\HtmlString
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);
    }
220605
public function renderHtml(Autocomplete $autocomplete, array $attributes = [])
    {
        $autocomplete->addInputAttributes($attributes);

        return $this->placeAutocompleteHelper->renderHtml($autocomplete);
    }
174801
private function getTd($dataValue, $attributes = [])
    {
        $attr = [];
        foreach ($attributes as $name => $value) {
            if ($value != '') {
                $attr[] = $name.'="'.$value.'"';
            }
        }

        $attr = implode(' ', $attr);

        return '<td '.$attr.'>'.$dataValue.'</td>';
    }
1062956
public function attributes( $attributes, $merge_global = false ) {
		if ( $merge_global && count( $this->global_attributes ) > 0 ) {
			$attributes = $attributes + $this->global_attributes;
		}

		return Utils::build_html_attributes( $attributes );
	}
879495
protected function generateHtmlString(...$attributesList): HtmlString
    {
        $attributesArray = $this->buildAttributesArray(...$attributesList);
        $html = $this->buildHtmlString($attributesArray);

        return new HtmlString($html);
    }
1011936
public static function renderTable(
        array $head = [], 
        array $body = [], 
        array $attributes = []
    ) : string 
    {
        $strHead = "";
        $strBody = "";
        
        foreach ($head as $thRow) {
            $strHead .= self::renderTableHeaderRow($thRow);
        }
        if ($strHead != "") {
            $strHead = self::thead($strHead);
        }
        
        foreach ($body as $tr) {
            $strBody .= self::renderTableRow($tr);
        }
        if ($strBody != "") {
            $strBody = self::tbody($strBody);
        }
        
        return self::tag("table", $strHead.$strBody, $attributes);
    }
1305918
public function generateGridViewField($attribute, $fk, $tableSchema = null)
    {
        if (is_null($tableSchema)) {
            $tableSchema = $this->getTableSchema();
        }

        if (in_array($attribute, $this->hiddenColumns)) {
            return "['attribute' => '$attribute', 'visible' => false],\n";
        }
        if ($tableSchema === false || !isset($tableSchema->columns[$attribute])) {
            if (preg_match('/^(password|pass|passwd|passcode)$/i', $attribute)) {
                return "";
            } else {
                return "'$attribute',\n";
            }
        }
        $column = $tableSchema->columns[$attribute];
        $format = $this->generateColumnFormat($column);
        $baseClass = StringHelper::basename($this->modelClass);

        if (array_key_exists($attribute, $fk)) {
            $rel = $fk[$attribute];
            if ($rel[self::REL_CLASS] == $baseClass) {
                return "";
            }
            $labelCol = $this->getNameAttributeFK($rel[3]);
//            $modelRel = $rel[2] ? lcfirst(Inflector::pluralize($rel[1])) : lcfirst($rel[1]);
            $output = "[
                'attribute' => '$rel[7].$labelCol',
                'label' => " . $this->generateString(ucwords(Inflector::humanize($rel[5]))) . "
            ],\n";
            return $output;
        } else {
            return "'$attribute" . ($format === 'text' ? "" : ":" . $format) . "',\n";
        }
    }
841832
public static function setFooters(array $data, array $attributes = array()) {
        foreach ($data as $footer) {
            self::addFooter($footer, $attributes);
        }
    }
647021
public function datagridAttributes(array $attributes)
    {
        $result = '';

        foreach ($attributes as $attributeName => $attributeValue) {
            $result .= ' '.$attributeName.'="'.$attributeValue.'"';
        }

        return $result;
    }
67042
public String buildSelectStartGalleries(String htmlAttributes) {

        StringBuffer result = new StringBuffer(1024);
        HttpServletRequest request = getJsp().getRequest();
        // set the attributes for the select tag
        if (htmlAttributes != null) {
            htmlAttributes += " name=\"" + PARAM_STARTGALLERY_PREFIX;
        }
        Map<String, A_CmsAjaxGallery> galleriesTypes = OpenCms.getWorkplaceManager().getGalleries();
        if (galleriesTypes != null) {

            // sort the galleries by localized name
            Map<String, String> localizedGalleries = new TreeMap<String, String>();
            for (Iterator<String> i = galleriesTypes.keySet().iterator(); i.hasNext();) {
                String currentGalleryType = i.next();
                String localizedName = CmsWorkplaceMessages.getResourceTypeName(this, currentGalleryType);
                localizedGalleries.put(localizedName, currentGalleryType);
            }

            for (Iterator<Map.Entry<String, String>> i = localizedGalleries.entrySet().iterator(); i.hasNext();) {
                Map.Entry<String, String> entry = i.next();
                // first: retrieve the gallery type
                String currentGalleryType = entry.getValue();
                // second: retrieve the gallery type id
                int currentGalleryTypeId = 0;
                try {
                    currentGalleryTypeId = OpenCms.getResourceManager().getResourceType(currentGalleryType).getTypeId();
                } catch (CmsLoaderException e) {
                    // resource type not found, log error
                    if (LOG.isErrorEnabled()) {
                        LOG.error(e.getLocalizedMessage(), e);
                    }
                    continue;
                }
                // third: get the available galleries for this gallery type id
                List<CmsResource> availableGalleries = A_CmsAjaxGallery.getGalleries(currentGalleryTypeId, getCms());

                // forth: fill the select box
                List<String> options = new ArrayList<String>(availableGalleries.size() + 2);
                List<String> values = new ArrayList<String>(availableGalleries.size() + 2);
                options.add(key(Messages.GUI_PREF_STARTGALLERY_PRESELECT_0));
                values.add(INPUT_DEFAULT);
                options.add(key(Messages.GUI_PREF_STARTGALLERY_NONE_0));
                values.add(INPUT_NONE);

                String savedValue = computeStartGalleryPreselection(request, currentGalleryType);
                int counter = 2;
                int selectedIndex = 0;
                Iterator<CmsResource> iGalleries = availableGalleries.iterator();
                while (iGalleries.hasNext()) {
                    CmsResource res = iGalleries.next();
                    String rootPath = res.getRootPath();
                    String sitePath = getCms().getSitePath(res);
                    // select the value
                    if ((savedValue != null) && (savedValue.equals(rootPath))) {
                        selectedIndex = counter;
                    }
                    counter++;
                    // gallery title
                    String title = "";
                    try {
                        // read the gallery title
                        title = getCms().readPropertyObject(
                            sitePath,
                            CmsPropertyDefinition.PROPERTY_TITLE,
                            false).getValue("");
                    } catch (CmsException e) {
                        // error reading title property
                        if (LOG.isErrorEnabled()) {
                            LOG.error(e.getLocalizedMessage(), e);
                        }
                    }
                    options.add(title.concat(" (").concat(sitePath).concat(")"));
                    values.add(rootPath);

                }
                // select the value
                if ((savedValue != null) && savedValue.equals(INPUT_NONE)) {
                    selectedIndex = 1;
                }

                // create the table row for the current resource type
                result.append("<tr>\n\t<td style=\"white-space: nowrap;\">");

                result.append(entry.getKey());
                result.append("</td>\n\t<td>");
                result.append(buildSelect(htmlAttributes + currentGalleryType + "\"", options, values, selectedIndex));
                result.append("</td>\n</tr>\n");

            }

        }
        return result.toString();
    }
853094
private function drawArc(
    CanvasInterface $canvas, StyleInterface $style = null, $filled = false)
    {
        $color = (is_null($style)) ?
                $this->getColor()->getValue() :
                $style->apply($canvas, $this)->getValue();

        $falgs = array();
        if ($this->isRounded()) {
            $falgs[] = IMG_ARC_PIE;
        }

        if ($this->isAnglesConnected()) {
            $falgs[] = IMG_ARC_CHORD;
        }

        if ($this->isAnglesConnectedToCenter()) {
            $falgs[] = IMG_ARC_EDGED;
        }
        if ($filled === false) {
            $falgs[] = IMG_ARC_NOFILL;
        }

        if (
                false == @imagefilledarc(
                        $canvas->getHandler()
                        , $this->getCenter()->getX()
                        , $this->getCenter()->getY()
                        , $this->getDimension()->getWidth()
                        , $this->getDimension()->getHeight()
                        , $this->getStartDegree()
                        , $this->getEndDegree()
                        , $color
                        , $this->getBitflags($falgs)
                )
        ) {
            throw new DrawableException(sprintf(
                    'Failed To Draw The Arc "%s"', (string) $this
            ));
        }
    }
742319
public function setAttributes($figNamespace, array $attributes)
    {
        // We don't call the parent version, which does extraneous work of resolving conds and walks etc.,
        // whereas we just need to check existence of class attribute.
        // A feed tag is oblivious to other control directives.


        $this->dataFile = isset($attributes['file']) ? $attributes['file'] : null;

        if(null === $this->dataFile) {
            throw new RequiredAttributeException($this->getTagName(),
                $this->xmlLineNumber,
                'file');
        }

    }
351595
protected function compileTableFooter()
    {
        $footer = [];
        foreach ($this->collection->all() as $row) {
            if (is_array($row->footer)) {
                $footerAttr = $this->html->attributes(array_only($row->footer,
                    ['class', 'id', 'title', 'width', 'style', 'data-class', 'data-hide']));
                $title = isset($row->footer['title']) ? $row->footer['title'] : '';
                $footer[] = '<th ' . $footerAttr . '>' . $title . '</th>';
            } else {
                $footer[] = '<th>' . $row->footer . '</th>';
            }
        }

        return $footer;
    }
1170852
public function css($aliasOrUrl, array $attributes = [])
    {
        $url = $this->getCssUrl($aliasOrUrl);
        if (!$this->included->isIncluded($url)) {
            $this->included->markAsIncluded($url);
            return new Tag('link', array_merge([
                'type' => 'text/css',
                'rel' => 'stylesheet',
                'href' => $url,
                'media' => 'all'
            ], $attributes));
        } else {
            return new DataView();
        }
    }
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";
  }
99493
public function buildEmbedHtml(array $attributes = [], array $parameters = [])
    {
        // <iframe width="560" height="315" src="https://www.youtube.com/embed/5qanlirrRWs" frameborder="0" allowfullscreen></iframe>
        $attributes = array_merge($this->attributes, $attributes, [
            'src' => $this->buildEmbedUrl($parameters), // required attribute
        ]);

        $attributeStrings = [''];
        foreach ($attributes as $name => $value) {
            $attributeString = (string)$name;
            if (null !== $value) {
                $attributeString .= '="'.htmlspecialchars($value).'"';
            }
            $attributeStrings[] = $attributeString;
        }

        return '<iframe'.implode(' ', $attributeStrings).'></iframe>';
    }
857334
public function generateScripts(array $attributes = null)
    {
        $init = <<<EOD
           $(document).ready(function(){
                container=$('div.%s');                                     
                form=$('#%s');
                cancelButton=form.find('button.cancel-request');
                submitButton=form.find('button:submit');
                var xhrPool = [];
                $(document).ajaxSend(function (e, jqXHR, options) {
                    xhrPool.push(jqXHR);
                });
                $(document).ajaxComplete(function (e, jqXHR, options) {
                    xhrPool = $.grep(xhrPool, function (x) {
                        return x != jqXHR
                    });
                });
                var abort = function () {
                    $.each(xhrPool, function (idx, jqXHR) {
                        jqXHR.abort();
                    });
                    cancelButton.attr('disabled','disabled').addClass('btn-disabled');
                    submitButton.removeAttr('disabled').removeClass('btn-disabled');
                };
                var processStop = function () {
                    abort();                    
                }
                $.fn.analyzeSpecAjax = function (key) {
                    $.when(
                        $.ajax({                            
                            url: "%s",
                            type: "POST",
                            data: indexes[key],
                            beforeSend: function (element) {
                                $('div.test-response').append('<hr/>'+indexes[key].message);               
                            }
                        })
                    ).then(function (data, textStatus, jqXHR) {                        
                        $('div.test-response').append(data);
                        if(indexes[key+1]!==undefined){
                            $.fn.analyzeSpecAjax(key+1);                            
                        }else{
                            processStop();                            
                        }
                    });
                };
                var indexes={};
                form.on('click', 'button:submit', function (e) {                                        
                    handler=$(this).parents('form:first');
                    
                    $.ajax({
                       url:handler.attr('action'),
                       data:handler.serialize(),
                       type:'POST',
                       dataType:'json',
                       success:function(response,element,status){
                           
                           $('div.test-response').html(''); 
                           indexes=response;       
                           cancelButton.removeAttr('disabled').removeClass('btn-disabled');
                           submitButton.attr('disabled','disabled').addClass('btn-disabled');
                           $.fn.analyzeSpecAjax(0);                           
                       },
                       error:function(eResponse){
                           obj = jQuery.parseJSON(eResponse.responseText);
                           $('div.test-response').html('');                                               
                           for(var i=0;i<obj.length;i++){                                                              
                               $('div.test-response').append(obj[i].error);               
                           }                                                      
                       }
                    });                    
                    return false;
                });
                form.on('click', '.cancel-request', function (e) {                                        
                    processStop();
                    return false;
                });
                form.find('.test-checkboxes').on('ifChecked',function(e){
                    form.find('input:checkbox').iCheck('check');
                    processStop();
                    return true;                    
                });
                
                 form.find('.test-checkboxes').on('ifUnchecked',function(e){
                    form.find('input:checkbox').iCheck('uncheck'); 
                    processStop();
                    return true;                    
                });
                
            });
EOD;
        return sprintf($init, $attributes['response-container'], $attributes['form-container'], handles('antares::tools/tester/run', ['csrf' => true]));
    }