@param string $topElementStyle

@throws \Kerox\Messenger\Exception\MessengerException

@return \Kerox\Messenger\Model\Message\Attachment\Template\ListTemplate
14724
public function setTopElementStyle(string $topElementStyle): self
    {
        $this->isValidTopElementStyle($topElementStyle);

        $this->topElementStyle = $topElementStyle;

        return $this;
    }
934196
public function setTemplate($template)
    {
        $layout = $this->getViewModel();
        $layout->setTemplate((string) $template);

        return $this;
    }
1174705
public function getTemplates($force = false)
    {
        if ($this->nb_messaging_template_list === null) {
            $this->nb_messaging_template_list = new CNabuMessagingTemplateList();
        }

        if ($this->nb_messaging_template_list->isEmpty() || $force) {
            $this->nb_messaging_template_list->clear();
            $this->nb_messaging_template_list->merge(CNabuMessagingTemplate::getAllMessagingTemplates($this));
            $this->nb_messaging_template_list->iterate(function($key, CNabuMessagingTemplate $nb_template) {
                $nb_template->setMessaging($this);
                return true;
            });
        }

        return $this->nb_messaging_template_list;
    }
160185
public function attach(Element\NamedElement $element)
    {
        if (!$this->getByName($element->getName(), false)) {
            $this->attach($element);
        } else {
            throw new Exception\AttachException();
        }

        return $this;
    }
1320510
public function getMetaBox(string $title): NodeElement
    {
        $metaboxes = $this->findAll('css', '.postbox');
        if ($metaboxes) {
            foreach ($metaboxes as $metabox) {
                if ($metabox->find('css', 'h2')->getText() === $title) {
                    return $metabox;
                }
            }
        }

        throw new ExpectationException(
            sprintf(
                '[W400] Metabox "%s" not found on the screen.',
                $title
            ),
            $this->getDriver()
        );
    }
823169
public function setStyle($cssStyle) {
		if (!PhalconUtils::startsWith($cssStyle, "panel"))
			$cssStyle="panel".$cssStyle;
		return $this->addToPropertyCtrl("class", $cssStyle, CssRef::Styles("panel"));
	}
388310
static function laraform($title, $name=null) {
        $el = new ElementButtonTwbs($name, ['value' => $title]);
        $el->addClass('btn');
        return $el;
    }
1209112
public static function stylesToProc($files = array())
    {
        if (!class_exists('XsltProcessor')) {
            throw new BadMethodCallException('XSL extension is missing. Can not create XsltProcessor.');
        }

        $dom = self::stylesToDOM($files);
        $proc = new XsltProcessor();
        $proc->importStylesheet($dom);

        return $proc;
    }
700871
public function setListItemElement(string $element): Breadcrumbs
    {
        $this->validateElement('allowedListItemElement', $element);

        $this->setOption('listItemElement', $element);

        return $this;
    }
902977
public function elementsOverviewAction ($elementType)
    {
        try
        {
            $elementReferences = array_map(
                function (Element $element)
                {
                    return $element->getReference();
                },
                $this->elementTypesModel->getListedElements($elementType)
            );

            return $this->twig->render("@core/elements_overview_page.twig", [
                "elementReferences" => $elementReferences
            ]);
        }
        catch (\InvalidArgumentException $e)
        {
            throw new NotFoundHttpException("Unknown element type '{$elementType}'.", $e);
        }
    }
644035
protected function getFormElements($type = 'list', $element)
    {
        $form = array();
        $template = $this->getTemplate("{$type}-block");
        $attributes = $this->getModelAttributes($this->tableInfo);

        foreach($attributes as $name)
        {
            $form[] = $this->renderElement($template, $element, $name);
        }

        return implode(PHP_EOL . PHP_EOL, $form);
    }
300730
public function withTemplates(array $templates = []): Translator
    {
        $templates = array_merge($this->templates, $templates);

        return new Translator($this->labels, $templates);
    }
875258
static function laraform($href, $text=null) {
        $el = new ElementButtonLinkTwbs(
            null, null, [
                'tagName' => 'a'
            ]
        );
        return $el->setContent($text)
            ->addClass('btn')
            ->setHref($href);
    }
62987
public function getTwigTemplate($content = array(), $template = null, $directory = null)
        {
            if ($template && $directory) {
                $loader = new Twig_Loader_Filesystem($directory);
            } else {
                $loader   = new Twig_Loader_Filesystem(__DIR__ . "/../../views");
                $template = 'email.twig';
            }
            $twig = new Twig_Environment($loader);

            return $twig->render($template, array(
                'email_title' => $this->email_title,
                'body_color'  => $this->body_color,
                'table_color' => $this->table_color,
                'content'     => $content
            ));
        }
619408
public function addTOC($styleFont = null, $styleTOC = null) {
		$toc = new PHPWord_TOC($styleFont, $styleTOC);
		$this->_elementCollection[] = $toc;
		return $toc;
	}
971766
public function listTemplates( $templateType = null ){
        $queryParams = is_null( $templateType ) ? [] : [ 'type' => $templateType ];
        return $this->httpGet( self::PATH_TEMPLATE_LIST, $queryParams );
    }
943507
public function addEx(\Psc\Exception $e) {
    if (isset($e->errorMessage)) {
      $msg = $e->errorMessage;
    } else {
      $msg = $e->getMessage();
    }
    
    if (isset($e->errorStatus)) {
      $errorStatus = $e->errorStatus;
    } else {
      $errorStatus = self::ERROR;
    }
    
    $devInfo = NULL;
    if (PSC::getProject()->isDevelopment()) {
      $devInfo = \Psc\Exception::getExceptionText($e, 'html');
    }
    
    return $this->add($msg, $errorStatus, $devInfo);
  }