Pimcore\Helper\Mail::getDebugInformationCssStyle PHP Method

getDebugInformationCssStyle() public static method

Return the basic css styles for the html debug information
public static getDebugInformationCssStyle ( ) : string
return string
    public static function getDebugInformationCssStyle()
    {
        $style = <<<'CSS'
<style type="text/css">
.pimcore_debug_information{
    width:100%;
    background-color:#f8f8f8;
    font-size:12px;
    font-family: Arial, sans-serif;
    border-spacing:0px;
    border-collapse:collapse
}
.pimcore_debug_information td, .pimcore_debug_information th{
    padding: 5px 10px;
    vertical-align:top;
    border: 1px solid #ccc;

}
.pimcore_debug_information th{
    text-align:center;
    font-weight:bold;
}
.pimcore_label_column{
    width:80px;
}

</style>
CSS;
        return $style;
    }

Usage Example

Beispiel #1
0
 /**
  * @throws \Exception
  * @throws \Zend_Mail_Exception
  */
 protected function checkDebugMode()
 {
     if (\Pimcore::inDebugMode()) {
         if (empty(self::$debugEmailAddresses)) {
             throw new \Exception('No valid debug email address given in "Settings" -> "System" -> "Email Settings"');
         }
         if ($this->preventDebugInformationAppending != true) {
             //adding the debug information to the html email
             $html = $this->getBodyHtml();
             if ($html instanceof \Zend_Mime_Part) {
                 $rawHtml = $html->getRawContent();
                 $debugInformation = MailHelper::getDebugInformation('html', $this);
                 $debugInformationStyling = MailHelper::getDebugInformationCssStyle();
                 $rawHtml = preg_replace("!(</\\s*body\\s*>)!is", "{$debugInformation}\\1", $rawHtml);
                 $rawHtml = preg_replace("!(<\\s*head\\s*>)!is", "\\1{$debugInformationStyling}", $rawHtml);
                 $this->setBodyHtml($rawHtml);
             }
             $text = $this->getBodyText();
             if ($text instanceof \Zend_Mime_Part) {
                 $rawText = $text->getRawContent();
                 $debugInformation = MailHelper::getDebugInformation('text', $this);
                 $rawText .= $debugInformation;
                 $this->setBodyText($rawText);
             }
             //setting debug subject
             $subject = $this->getSubject();
             $this->clearSubject();
             $this->setSubject('Debug email: ' . $subject);
         }
         $this->clearRecipients();
         $this->addTo(self::$debugEmailAddresses);
     }
 }