<commit_before><?php
namespace cmsadmin\blocks;

class ImageBlock extends \cmsadmin\base\Block
{
    public $renderPath = '@cmsadmin/views/blocks';

    public function jsonFromArray()
    {
        return [
            'vars' => [
                ['var' => 'imageId', 'label' => 'Bild', 'type' => 'zaa-image-upload'],
            ],
        ];
    }

    public function getExtraVars()
    {
        return [
            'image' => \yii::$app->luya->storage->image->get($this->getVarValue('imageId'))
        ];
    }
    
    public function getTwigFrontend()
    {
        return '<img src="{{extras.image.source}}" border="0" /> {{dump(extras)}}';
    }

    public function getTwigAdmin()
    {
        return '<p><img src="{{extras.image.source}}" border="0" height="100" /></p>';
    }

    public function getName()
    {
        return 'Bild';<commit_msg>image block: see if image source is empty (twig.js if function).<commit_after><?php
namespace cmsadmin\blocks;

class ImageBlock extends \cmsadmin\base\Block
{
    public $renderPath = '@cmsadmin/views/blocks';

    public function jsonFromArray()
    {
        return [
            'vars' => [
                ['var' => 'imageId', 'label' => 'Bild', 'type' => 'zaa-image-upload'],
            ],
        ];
    }

    public function getExtraVars()
    {
        return [
            'image' => \yii::$app->luya->storage->image->get($this->getVarValue('imageId'))
        ];
    }
    
    public function getTwigFrontend()
    {
        return '<img src="{{extras.image.source}}" border="0" /> {{dump(extras)}}';
    }

    public function getTwigAdmin()
    {
        return '<p>{% if extras.image.source %}<img src="{{extras.image.source}}" border="0" height="100" />{% else %}<strong>Es wurde noch kein Bild Hochgeladen.</strong>{% endif %}</p>';
    }

    public function getName()
    {
        return 'Bild';
{'fraction_non_alphanumeric': 0.17703349282296652, 'fraction_numerical': 0.00531632110579479, 'mean_word_length': 2.3075571177504393, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6800375', 'n_tokens_mistral': 600, 'n_tokens_neox': 583, 'n_words': 118}