Answers an array of options for image alignment fields.

@return array
434918
public function getImageAlignmentOptions()
    {
        return [
            self::ALIGN_LEFT   => _t(__CLASS__ . '.LEFT', 'Left'),
            self::ALIGN_CENTER => _t(__CLASS__ . '.CENTER', 'Center'),
            self::ALIGN_RIGHT  => _t(__CLASS__ . '.RIGHT', 'Right')
        ];
    }
24319
public function getOptions()
	{
		$opts = array();

		$first = array();
		$second = array();
		
        if ( $this->axisRenderer ) {
		    $first['renderer'] = '#' . $this->axisRenderer . '#';
        }
        
		if( isset( $this->options['ticks'] ) ) {
			$first['ticks'] = $this->options['ticks'];
		}
		
		$second['min'] = isset( $this->options['min'] ) ? $this->options['min'] : 0;

		if( isset( $this->options['horizontal'] ) && $this->options['horizontal'] ) {
			$opts['xaxis'] = $second;
			$opts['yaxis'] = $first;
		} else {
			$opts['xaxis'] = $first;
			$opts['yaxis'] = $second;
		}

		$opts = array( 'axes' => $opts );

		if( isset( $this->options['stackSeries'] ) ) {
			$opts['stackSeries'] = $this->options['stackSeries'];
		}

		if( isset( $this->options['seriesColors'] ) ) {
			$opts['seriesColors'] = $this->options['seriesColors'];
		}

		return $opts;
	}
537107
public function enaImageFiles()
    {
        $properties = $this->getProperties();
        $extString  = (!empty($properties['acceptedFiles'])) ? $properties['acceptedFiles'] : '';
        $imagExts   = $this->getImageExtensionConstant();
        foreach ($imagExts as $imagExt) {
            if (in_array($imagExt, $extString) === false) {
                $extString[] = $imagExt;
            }
        }
        $properties                     = $this->getProperties();
        $properties['acceptedFiles']    = $extString;
        $this->setProperties($properties);
        return $this;
    }
1306336
public function getManipulators()
    {
        return [
            new Orientation(),
            new Crop(),
            new Size($this->getMaxImageSize()),
            new Brightness(),
            new Contrast(),
            new Gamma(),
            new Sharpen(),
            new Filter(),
            new Flip(),
            new Blur(),
            new Pixelate(),
            new Watermark($this->getWatermarks(), $this->getWatermarksPathPrefix()),
            new Background(),
            new Border(),
            new Encode(),
        ];
    }
1328881
public static function getAcceptImageMimeTypes()
    {
        $imageAllowFiles = Yii::$app->getSettings()->get('imageAllowFiles','attachment');
        $extensions = explode(',', $imageAllowFiles);
        array_walk($extensions, function (&$value) {
            $value = 'image/' . $value;
        });
        return $extensions;
    }
317380
private function _allowedStyles(): array
    {
        $styles = [];
        $plugins = array_flip($this->_getRedactorConfig()['plugins'] ?? []);
        if (isset($plugins['alignment'])) {
            $styles['text-align'] = true;
        }
        if (isset($plugins['fontcolor'])) {
            $styles['color'] = true;
        }
        if (isset($plugins['fontfamily'])) {
            $styles['font-family'] = true;
        }
        if (isset($plugins['fontsize'])) {
            $styles['font-size'] = true;
        }
        return $styles;
    }
1049007
public function toOptionArray()
    {
        return [
            ['label' => __('Auto'), 'value' => self::AUTO_DISPLAYED],
            ['label' => __('Always hidden'), 'value' => self::ALWAYS_HIDDEN],
            ['label' => __('Always displayed'), 'value' => self::ALWAYS_DISPLAYED],
        ];
    }
1044192
public function getDimensions()
    {
        $imageDimension = getimagesize($this->image);

        $width  = $imageDimension[0];
        $height = $imageDimension[1];

        foreach($this->effect as $effect)
        {
            if($effect instanceof PictureEffect)
            {
                $modified = $effect->getNewDimensions($width, $height);

                $width  = $modified['w'];
                $height = $modified['h'];
            }
        }

        return array(

            'w' => $width,
            'h' => $height,
        );
    }
693199
public function getCMSFields()
    {
        // Obtain Field Objects (from parent):
        
        $fields = parent::getCMSFields();
        
        // Insert Image Tab:
        
        $fields->insertAfter(
            Tab::create(
                'Image',
                $this->fieldLabel('Image')
            ),
            'Main'
        );
        
        // Create Image Fields:
        
        $fields->addFieldsToTab(
            'Root.Image',
            [
                FieldSection::create(
                    'LinkImage',
                    $this->fieldLabel('LinkImage'),
                    [
                        $image = UploadField::create(
                            'LinkImage',
                            $this->fieldLabel('LinkImageFile')
                        ),
                        ViewportsField::create(
                            'LinkImageWidth',
                            $this->fieldLabel('LinkImageWidth')
                        )->setUseTextInput(true),
                        ViewportsField::create(
                            'LinkImageHeight',
                            $this->fieldLabel('LinkImageHeight')
                        )->setUseTextInput(true),
                        CheckboxField::create(
                            'InlineVector',
                            $this->fieldLabel('InlineVector')
                        )
                    ]
                )
            ]
        );
        
        // Define Image Field:
        
        $image->setAllowedExtensions(['gif', 'jpg', 'jpeg', 'png', 'svg']);
        $image->setFolderName($this->getAssetFolder());
        
        // Answer Field Objects:
        
        return $fields;
    }
1190726
protected function configuration()
    {
        $this->options = array_merge(['accept' => 'image/*'], $this->options);
        $croppedDataInput = $this->croppedDataAttribute;
        if ($this->hasModel()) {
            $croppedDataInput = Html::getInputName($this->model, $croppedDataInput);
        } else {
            $croppedDataInput = $this->croppedDataName;
        }
        $this->pluginOptions = array_merge([
            'selectors' => [
                'fileInput' => sprintf('#%s input[type="file"]', $this->id),
                'btnCrop' => sprintf('#%s .btn-crop', $this->id),
                'btnReset' => sprintf('#%s .btn-reset', $this->id),
                'btnScaleIn' => sprintf('#%s .btn-scale-in', $this->id),
                'btnScaleOut' => sprintf('#%s .btn-scale-out', $this->id),
                'croppedContainer' => sprintf('#%s .cropped-images-cropbox', $this->id),
                'croppedDataInput' => sprintf('#%s input[name="%s"]', $this->id, $croppedDataInput),
                'messageContainer' => sprintf('#%s .message-container-cropbox', $this->id),
            ],
        ], $this->pluginOptions);
    }
345248
public function getMetaImageAlignment($alignment = null)
    {
        if ($alignment) {
            return $alignment;
        }
        
        if ($alignment = $this->owner->ImageMetaAlignment) {
            return $alignment;
        }
        
        return $this->owner->getFieldFromParent('DefaultImageAlignment');
    }
1007113
public function getBannerImageSizes()
    {
        $sizes = array();
        $imageSize = $this->Database
                            ->prepare("SELECT id, name, width, height FROM tl_image_size ORDER BY pid, name")
                            ->execute(\Input::get('id'));
        while ($imageSize->next())
        {
            $sizes[$imageSize->id] = $imageSize->name;
            $sizes[$imageSize->id] .= ' (' . $imageSize->width . 'x' . $imageSize->height . ')';
        }
        return array_merge(array('image_sizes'=>$sizes), $GLOBALS['TL_CROP']);
    }
150394
public function data() : array
    {

        //Get data
        $data = get_fields($this->ID);
        $data['args'] = $this->args;

        //Do not use link
        if ($data['mod_image_link'] == "false") {
            $data['mod_image_link_url'] = "";
        }

        //Set image class
        $imgClasses = array();
        if ($data['mod_image_responsive'] === true) {
            $imgClasses[] = 'image-responsive';
        }
        $data['img_classes'] = implode(' ', $imgClasses);

        //Crop image (if non existing)
        $data['img_src'] = $this->maybeCropImage($data);

        //Add box classes
        $data['classes'] = implode(' ', apply_filters('Modularity/Module/Classes', array('box', 'box-filled'), $this->post_type, $this->args));

        return $data;
    }
521229
public function fields(): array
    {
        return [

            Field::group([

                Input::make('name')
                    ->type('text')
                    ->max(255)
                    ->required()
                    ->title('Name Articles')
                    ->help('Article title'),

                Input::make('title')
                    ->type('text')
                    ->max(255)
                    ->required()
                    ->title('Article Title')
                    ->help('SEO title'),

            ]),

            Field::group([

                DateTimer::make('open')
                    ->title('Opening date')
                    ->help('The opening event will take place'),

                Input::make('phone')
                    ->type('text')
                    ->mask('(999) 999-9999')
                    ->title('Phone')
                    ->help('Number Phone'),

                CheckBox::make('free')
                    ->sendTrueOrFalse()
                    ->title('Free')
                    ->placeholder('Event for free')
                    ->help('Event for free'),
            ]),

            TinyMCE::make('body')
                ->required()
                ->title('Name Articles')
                ->help('Article title'),

            Map::make('place')
                ->required()
                ->title('Object on the map')
                ->help('Enter the coordinates, or use the search'),

            Cropper::make('picture')
                ->width(500)
                ->height(300),

            UTM::make('link')
                ->title('UTM link')
                ->help('Generated link'),

            SimpleMDE::make('body2')
                ->title('Name Articles')
                ->help('Article title'),

            Quill::make('body3')
                ->title('Name Articles')
                ->help('Article title'),

            Code::make('code')
                ->title('Name Articles')
                ->help('Article title'),
        ];
    }
1264876
public function defaultImages($options = []) {
		$options = $this->_cleanOptions($options + $this->_config);
		$images = [];
		foreach ($this->_defaultIcons as $defaultIcon) {
			$options['default'] = $defaultIcon;
			$images[$defaultIcon] = $this->image(null, $options);
		}
		return $images;
	}
193336
public function getAllImageFormats()
    {
        if ($this->allImageFormats === null) {
            $this->allImageFormats = [
                static::FORMAT_PNG,
                static::FORMAT_JPEG,
                static::FORMAT_GIF,
                static::FORMAT_WBMP,
                static::FORMAT_XBM,
            ];
        }

        return $this->allImageFormats;
    }
1008089
public static function getExtensionConfig(): array
    {
        $supportedMimeTypes = self::DEFAULT_SUPPORTED_MIME_TYPES;
        $desktopWidth = self::DEFAULT_DESKTOP_WIDTH;
        $tabletWidth = self::DEFAULT_TABLET_WIDTH;
        $smartphoneWidth = self::DEFAULT_SMARTPHONE_WIDTH;

        if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['responsive_images'])) {
            $supportedMimeTypes = $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['responsive_images']['supportedMimeTypes'] ?? self::DEFAULT_SUPPORTED_MIME_TYPES;
            $desktopWidth = (int)$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['responsive_images']['maxDesktopImageWidth'] ?? self::DEFAULT_DESKTOP_WIDTH;
            $tabletWidth = (int)$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['responsive_images']['maxTabletImageWidth'] ?? self::DEFAULT_TABLET_WIDTH;
            $smartphoneWidth = (int)$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['responsive_images']['maxSmartphoneImageWidth'] ?? self::DEFAULT_SMARTPHONE_WIDTH;
        } elseif (isset($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['responsive_images'])) {
            try {
                $extConfig = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['responsive_images']);

                if (!empty($extConfig['supportedMimeTypes'])) {
                    $supportedMimeTypes = $extConfig['supportedMimeTypes'];
                }

                if (isset($extConfig['maxDesktopImageWidth']) && is_numeric($extConfig['maxDesktopImageWidth'])) {
                    $desktopWidth = (int)$extConfig['maxDesktopImageWidth'];
                }

                if (isset($extConfig['maxTabletImageWidth']) && is_numeric($extConfig['maxTabletImageWidth'])) {
                    $tabletWidth = (int)$extConfig['maxTabletImageWidth'];
                }

                if (isset($extConfig['maxSmartphoneImageWidth']) && is_numeric($extConfig['maxSmartphoneImageWidth'])) {
                    $smartphoneWidth = (int)$extConfig['maxSmartphoneImageWidth'];
                }
            } catch (\Exception $e) {
            }
        }

        return [
            'supportedMimeTypes' => $supportedMimeTypes,
            'maxDesktopImageWidth' => $desktopWidth,
            'maxTabletImageWidth' => $tabletWidth,
            'maxSmartphoneImageWidth' => $smartphoneWidth,
        ];
    }