Render a dialog button

@param array   $config An optional array with configuration options
@return  string  Html
193632
public function dialog($config = array())
    {
        $html  = $this->createHelper('behavior')->modal();
        $html .= $this->command($config);

        return $html;
    }
644000
protected function buildCss(array $config)
    {
        $output = array();
        $output['bootstrap_css'] = array(
            'inputs' => array(
                $this->normalizePath(implode(DIRECTORY_SEPARATOR, array(
                    $config['bootswatch']['path'],
                    $config['bootswatch']['theme'],
                    'bootstrap.css'
                )))
            ),
            'filters' => array('cssrewrite'),
        );
        if ($config['font_awesome']) {
            $output['font_awesome_css'] = array(
                'inputs' => array(
                    $this->normalizePath(implode(DIRECTORY_SEPARATOR, array(
                        $config['bootswatch']['path'],
                        'bower_components/font-awesome/css/font-awesome.css'
                    )))
                ),
                'filters' => array('cssrewrite'),
            );
        }
        return $output;
    }
357055
public function javascript($config = array())
    {
        return $this->getTemplate()->helper('behavior.bootstrap', array(
            'debug' => JFactory::getApplication()->getCfg('debug'),
            'css' => false,
            'javascript' => true
        ));
    }
883139
public function formatConfig(array $config)
    {
        if (!isset($config['redirectUrl'])) {
//            dd($config);
            $config['redirectUrl'] = $this->formatUrl(value($config['redirect']));;
        }

        if (!isset($config['callbackUrl'])) {
            $config['callbackUrl'] = $this->formatUrl(value($config['callback']));
        }

        return $config;
    }
563283
protected function appendCommandsToConfig(array &$config)
    {
        collect($this->entityCommandHandlers)
            ->merge(collect($this->instanceCommandHandlers))
            ->each(function($handler, $commandName) use(&$config) {
                $formFields = $handler->form();
                $formLayout = $formFields ? $handler->formLayout() : null;
                $hasFormInitialData = $formFields
                    ? is_method_implemented_in_concrete_class($handler, 'initialData')
                    : false;

                $config["commands"][$handler->type()][$handler->groupIndex()][] = [
                    "key" => $commandName,
                    "label" => $handler->label(),
                    "description" => $handler->description(),
                    "type" => $handler->type(),
                    "confirmation" => $handler->confirmationText() ?: null,
                    "form" => $formFields ? [
                        "fields" => $formFields,
                        "layout" => $formLayout
                    ] : null,
                    "fetch_initial_data" => $hasFormInitialData,
                    "authorization" => $handler->getGlobalAuthorization()
                ];
            });
    }
344052
public function renderWidget( $config = [] ) {

		$widgetHtml = $this->render( $this->template, [
			'login' => $this->login,
			'loginDisabled' => $this->loginDisabled,
			'loginMessage' => $this->loginMessage,
			'forgotPassword' => $this->forgotPassword,
			'registerDisabled' => $this->registerDisabled,
			'registerMessage' => $this->registerMessage,
			'register' => $this->register,
			'label' => $this->label,
			'fieldIcon' => $this->fieldIcon,
			'optionalFields' => $this->optionalFields,
			'actions' => $this->actions,
			'widget' => $this
		]);

		if( $this->wrap ) {

			return Html::tag( $this->wrapper, $widgetHtml, $this->options );
		}

		return $widgetHtml;
	}
445690
public function renderWidget( $config = [] ) {

		// Limit
		$limit = Yii::$app->request->getQueryParam( $this->limitParam );

		if( isset( $limit ) && in_array( $limit, $this->limits ) ) {

			$this->limit = $limit;
		}

		if( isset( $this->dataProvider ) ) {

			$this->dataProvider->pagination->pageSize = $this->limit;
		}

		// Layout
		$user		= Yii::$app->user->getIdentity();
		$uLayout	= $user->getDataConfigMeta( CoreGlobal::DATA_GRID_LAYOUT );
		$layout		= Yii::$app->request->getQueryParam( 'layout' );

		$gridLayout	= isset( $user ) && isset( $uLayout ) ? $uLayout : $this->layout;
		$gridLayout	= isset( $layout ) && in_array( $layout, [ 'data', 'table', 'list', 'card' ] ) ? $layout : $gridLayout;

		$gridLayout = $this->grid && $gridLayout == 'data' ? 'data' : $gridLayout;
		$gridLayout = $this->table && $gridLayout == 'table' ? 'table' : $gridLayout;
		$gridLayout = $this->list && $gridLayout == 'list' ? 'list' : $gridLayout;
		$gridLayout = $this->card && $gridLayout == 'card' ? 'card' : $gridLayout;

		$this->layout = $gridLayout;

		// Views
		$this->actionView = CodeGenUtil::isAbsolutePath( $this->actionView ) ? $this->actionView : "$this->template/$this->actionView";

		$sortHtml		= $this->sort ? $this->renderSort( $config ) : null;

		$searchHtml		= $this->search ? $this->renderSearch( $config ) : null;

		$filtersHtml	= $this->filter ? $this->renderFilters( $config ) : null;

		$bulkHtml		= $this->bulk ? $this->renderBulk( $config ) : null;

		$reportHtml		= $this->report ? $this->renderReport( $config ) : null;

		$headHtml		= $this->head ? $this->renderHead( $config, [ 'sortHtml' => $sortHtml, 'searchHtml' => $searchHtml, 'filtersHtml' => $filtersHtml, 'bulkHtml' => $bulkHtml ] ) : null;

		$optionsHtml	= $this->option ? $this->renderOptions( $config, [ 'sortHtml' => $sortHtml, 'searchHtml' => $searchHtml, 'filtersHtml' => $filtersHtml, 'bulkHtml' => $bulkHtml ] ) : null;

		$headerHtml		= $this->header ? $this->renderHeader( $config ) : null;

		$dataHtml		= $this->grid && $this->layout == 'data' ? $this->renderData( $config ) : null;
		$dataHtml		= $this->table && $this->layout == 'table' ? $this->renderData( $config ) : $dataHtml;

		$listHtml		= $this->list && $this->layout == 'list' ? $this->renderList( $config ) : null;

		$cardHtml		= $this->card && $this->layout == 'card' ? $this->renderCards( $config ) : null;

		$footerHtml		= $this->footer ? $this->renderFooter( $config ) : null;

		$gridView		= CodeGenUtil::isAbsolutePath( $this->gridView ) ? $this->gridView : "$this->template/$this->gridView";

		$widgetHtml = $this->render( $gridView, [
			'widget' => $this,
			'sortHtml' => $sortHtml, 'searchHtml' => $searchHtml, 'filtersHtml' => $filtersHtml,
			'bulkHtml' => $bulkHtml, 'reportHtml' => $reportHtml, 'headHtml' => $headHtml, 'optionsHtml' => $optionsHtml,
			'headerHtml' => $headerHtml, 'footerHtml' => $footerHtml,
			'dataHtml' => $dataHtml, 'listHtml' => $listHtml, 'cardHtml' => $cardHtml
		]);

		if( $this->wrap ) {

			return Html::tag( $this->wrapper, $widgetHtml, $this->options );
		}

        return $widgetHtml;
	}
672162
public function formfield_custom($config)
    {
        $config = new AnConfig($config);

        $config->append(array(
          'class' => 'input-block-level'
        ));

        return $this->_render('formfield_custom', $config);
    }
289934
public function actionAll( $config = [] ) {

		$modelClass = $this->modelService->getModelClass();

		$dataProvider = $this->modelService->getPage();

		return $this->render( 'all', [
			'dataProvider' => $dataProvider,
			'statusMap' => $modelClass::$statusMap
		]);
	}
734991
protected function parseConfig(array $config)
    {
        $config = $this->setHost($config);
        $config = $this->setPort($config);
        $config = $this->setProtocol($config);
        $config = $this->setServiceId($config);
        $config = $this->setTNS($config);
        $config = $this->setCharset($config);

        return $config;
    }
16063
public function display($config = array())
    {
        $config = new KObjectConfigJson($config);
        $config->append(array(
            'editor'    => null,
            'name'      => 'description',
            'value'     => '',
            'width'     => '100%',
            'height'    => '500',
            'cols'      => '75',
            'rows'      => '20',
            'buttons'   => true,
            'options'   => array()
        ));

        // Add editor styles and scripts in JDocument to page when rendering
        $this->getIdentifier('com:koowa.view.page.html')->getConfig()->append(['template_filters' => ['document']]);

        $editor  = JFactory::getEditor($config->editor);
        $options = KObjectConfig::unbox($config->options);

        $result = $editor->display($config->name, $config->value, $config->width, $config->height, $config->cols, $config->rows, KObjectConfig::unbox($config->buttons), $config->name, null, null, $options);
        
        // Some editors like CKEditor return inline JS. 
        $result = str_replace('<script', '<script data-inline', $result);

        return $result;
    }
218993
public function render($config = array())
    {
        $config = new KObjectConfigJson($config);
        $config->append(array(
            'toolbar' => null
        ));

        $html = '<ul class="k-navigation">';

        foreach ($config->toolbar->getCommands() as $command)
        {
            $command->append(array(
                'attribs' => array(
                    'href' => '#',
                    'class' => array()
                )
            ));

            if(!empty($command->href)) {
                $command->attribs['href'] = $this->getTemplate()->route($command->href);
            }

            $url = KHttpUrl::fromString($command->attribs->href);

            if (isset($url->query['view'])) {
                $command->attribs->class->append('k-navigation-'.$url->query['view']);
            }

            $attribs = clone $command->attribs;
            $attribs->class = implode(" ", KObjectConfig::unbox($attribs->class));

            $html .= '<li'.($command->active ? ' class="k-is-active"' : '').'>';
            $html .= '<a '.$this->buildAttributes($attribs).'>';
            $html .= $this->getObject('translator')->translate($command->label);
            $html .= '</a>';
            $html .= '</li>';
        }

        $html .= '</ul>';

        return $html;
    }
262777
public function renderButton()
    {
        if (!empty($this->buttonOptions) && is_array($this->buttonOptions)) {
            TbArray::defaultValue('data-toggle', 'modal', $this->buttonOptions);

            if ($this->remote !== null) {
                $this->buttonOptions['data-remote'] = CHtml::normalizeUrl($this->remote);
            }

            $selector = '#' . $this->htmlOptions['id'];
            $label = TbArray::popValue('label', $this->buttonOptions, 'button');
            $attr = isset($this->buttonOptions['data-remote']) ? 'data-target' : 'href';
            TbArray::defaultValue($attr, $selector, $this->buttonOptions);
            echo TbHtml::button($label, $this->buttonOptions);
        }
    }
1185299
public function access($config = array())
    {
        $config = new KObjectConfigJson($config);
        $config->append(array(
            'name'      => 'access',
            'attribs'   => array(),
            'deselect_value' => '',
            'deselect'  => true,
            'select2' => false,
            'prompt'    => '- '.$this->getObject('translator')->translate('Select').' -'
        ))->append(array(
            'selected'  => $config->{$config->name}
        ));

        $prompt = false;

        // without &nbsp; Joomla strips the last hyphen of the prompt
        if ($config->deselect)  {
            $prompt = array((object) array('value' => $config->deselect_value, 'text'  => $config->prompt.'&nbsp;'));
        }

        $html = JHtml::_('access.level', $config->name, $config->selected, $config->attribs->toArray(), $prompt);

        if ($config->select2)
        {
            $html .= $this->getTemplate()->helper('behavior.select2', array(
                'element' => 'select[name=\"'.$config->name.'\"]'
            ));
        }
    
        return $html;
    }
228576
public function getTemplate(array $config)
	{
		foreach ($this->templateGenerators as $type => $generator)
		{
			if (isset($config[$type]))
			{
				return $generator->getTemplate($config[$type]);
			}
		}

		return '';
	}
601441
public function renderWidget( $config = [] ) {

		$this->links = array_flip( $this->links );

		$widgetHtml = $this->render( $this->template, [ 'widget' => $this ] );

		if( $this->wrap ) {

			return Html::tag( 'div', $widgetHtml, $this->options );
		}

		return $widgetHtml;
	}
1255526
public function render($config = array())
    {
        // Load the language strings for toolbar button labels
        JFactory::getLanguage()->load('joomla', JPATH_ADMINISTRATOR);

        $html = parent::render($config);

        return $html;
    }