Returns an array of image style settings keys and their corresponding field labels
@return array
180709
protected function getImageStyleFieldsSettings()
    {
        return array(
            'image_style_category' => $this->text('Category page'),
            'image_style_category_child' => $this->text('Category page (child)'),
            'image_style_product' => $this->text('Product page'),
            'image_style_page' => $this->text('Page'),
            'image_style_product_grid' => $this->text('Product catalog (grid)'),
            'image_style_product_list' => $this->text('Product catalog (list)'),
            'image_style_cart' => $this->text('Cart'),
            'image_style_option' => $this->text('Product option'),
            'image_style_collection_file' => $this->text('File collection (banners)'),
            'image_style_collection_page' => $this->text('Page collection (news/articles)'),
            'image_style_collection_product' => $this->text('Product collection (featured products)'),
        );
    }
1197274
protected function getMediaFinderSettings() : array
    {
        $sMode = $this->getSettingValue(self::TYPE_MEDIA_FINDER);
        if (!in_array($sMode, ['file', 'image'])) {
            return [];
        }

        $arResult = [
            'type' => self::TYPE_MEDIA_FINDER,
            'mode' => $sMode,
        ];

        return $arResult;
    }
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;
    }
950221
public function getSettings() : array
    {
        $cmd = new ListSettings($this->repo->getRoot());
        $res = $this->runner->run($cmd, new ListSettings\MapSettings());

        return $res->getFormattedOutput();
    }
1226657
public function getThemeCustomizableStylePresets()
    {
        $presets = [];
        $env = Environment::get();
        if ($this->isThemeCustomizable()) {
            $directory = $env->getPath(
                DIRNAME_THEMES.'/'.$this->getThemeHandle(
                ).'/'.DIRNAME_CSS.'/'.DIRNAME_STYLE_CUSTOMIZER_PRESETS,
                $this->getPackageHandle()
            );
            $urlroot = $env->getURL(
                DIRNAME_THEMES.'/'.$this->getThemeHandle().'/'.DIRNAME_CSS,
                $this->getPackageHandle()
            );
            $dh = Loader::helper('file');
            $files = $dh->getDirectoryContents($directory);
            foreach ($files as $f) {
                if (strrchr($f, '.') == static::THEME_CUSTOMIZABLE_STYLESHEET_EXTENSION) {
                    $preset = Preset::getFromFile($directory.'/'.$f, $urlroot);
                    if (is_object($preset)) {
                        $presets[] = $preset;
                    }
                }
            }
        }
        usort(
            $presets,
            function ($a, $b) {
                if ($a->isDefaultPreset()) {
                    return -1;
                } else {
                    return strcasecmp($a->getPresetDisplayName('text'), $b->getPresetDisplayName('text'));
                }
            }
        );

        return $presets;
    }
44307
public function getCMSFields()
    {
        // Obtain Field Objects (from parent):
        
        $fields = parent::getCMSFields();
        
        // Define Placeholders:
        
        $placeholderDefault = _t(__CLASS__ . '.DROPDOWNDEFAULT', '(default)');
        
        // Create Style Fields:
        
        $fields->addFieldsToTab(
            'Root.Style',
            [
                FieldSection::create(
                    'ListStyle',
                    $this->fieldLabel('ListStyle'),
                    [
                        DropdownField::create(
                            'HeadingLevel',
                            $this->fieldLabel('HeadingLevel'),
                            $this->getTitleLevelOptions()
                        )->setEmptyString(' ')->setAttribute('data-placeholder', $placeholderDefault),
                        DropdownField::create(
                            'ImageAlign',
                            $this->fieldLabel('ImageAlign'),
                            $this->getImageAlignOptions()
                        )->setEmptyString(' ')->setAttribute('data-placeholder', $placeholderDefault),
                        ColorField::create(
                            'OverlayBackground',
                            $this->fieldLabel('OverlayBackground')
                        ),
                        ColorField::create(
                            'OverlayForeground',
                            $this->fieldLabel('OverlayForeground')
                        ),
                        FontIconField::create(
                            'OverlayIcon',
                            $this->fieldLabel('OverlayIcon')
                        ),
                        ColorField::create(
                            'OverlayIconColor',
                            $this->fieldLabel('OverlayIconColor')
                        ),
                        FontIconField::create(
                            'ButtonIcon',
                            $this->fieldLabel('ButtonIcon')
                        )
                    ]
                )
            ]
        );
        
        // Add List Style Fields:
        
        $fields->addFieldsToTab('Root.Style', $this->getListStyleFields());
        
        // Create Options Fields:
        
        $fields->addFieldsToTab(
            'Root.Options',
            [
                FieldSection::create(
                    'ListOptions',
                    $this->fieldLabel('ListOptions'),
                    [
                        DropdownField::create(
                            'ShowImage',
                            $this->fieldLabel('ShowImage'),
                            $this->getShowOptions()
                        ),
                        DropdownField::create(
                            'ShowHeader',
                            $this->fieldLabel('ShowHeader'),
                            $this->getShowOptions()
                        ),
                        DropdownField::create(
                            'ShowDetails',
                            $this->fieldLabel('ShowDetails'),
                            $this->getShowOptions()
                        ),
                        DropdownField::create(
                            'ShowSummary',
                            $this->fieldLabel('ShowSummary'),
                            $this->getShowOptions()
                        ),
                        DropdownField::create(
                            'ShowContent',
                            $this->fieldLabel('ShowContent'),
                            $this->getShowOptions()
                        ),
                        DropdownField::create(
                            'ShowFooter',
                            $this->fieldLabel('ShowFooter'),
                            $this->getShowOptions()
                        ),
                        TextField::create(
                            'ButtonLabel',
                            $this->fieldLabel('ButtonLabel')
                        ),
                        CheckboxField::create(
                            'ButtonLink',
                            $this->fieldLabel('ButtonLink')
                        ),
                        CheckboxField::create(
                            'LinkTitles',
                            $this->fieldLabel('LinkTitles')
                        ),
                        CheckboxField::create(
                            'HideNoDataMessage',
                            $this->fieldLabel('HideNoDataMessage')
                        )
                    ]
                ),
                FieldSection::create(
                    'ListImageOptions',
                    $this->fieldLabel('ListImageOptions'),
                    [
                        DropdownField::create(
                            'ImageLinksTo',
                            $this->fieldLabel('ImageLinksTo'),
                            $this->getImageLinksToOptions()
                        ),
                        CheckboxField::create(
                            'OverlayImages',
                            $this->fieldLabel('OverlayImages')
                        ),
                        CheckboxField::create(
                            'OverlayTitle',
                            $this->fieldLabel('OverlayTitle')
                        ),
                        CheckboxField::create(
                            'LinkImages',
                            $this->fieldLabel('LinkImages')
                        )
                    ]
                )
            ]
        );
        
        // Add List Option Fields:
        
        $fields->addFieldsToTab('Root.Options', $this->getListOptionFields());
        
        // Answer Field Objects:
        
        return $fields;
    }
581936
public function getImageTitleOptions()
    {
        return [
            self::IMAGE_TITLE_NONE => _t(__CLASS__ . '.NONE', 'None'),
            self::IMAGE_TITLE_MEDIA => _t(__CLASS__ . '.MEDIATITLE', 'Media Title'),
            self::IMAGE_TITLE_COMPONENT => _t(__CLASS__ . '.COMPONENTTITLE', 'Component Title')
        ];
    }
190029
public function getCustomStylesConfig()
    {
        $styles = [];
        
        if (($config = $this->owner->config()->custom_styles) && is_array($config)) {
            $styles = $config;
        }
        
        ksort($styles);
        
        array_walk($styles, function (&$item) {
            $item = $this->owner->cleanStyleClasses($item);
        });
        
        return $styles;
    }
1373500
protected function getSourceAttributes()
    {
        extract($this->resource->getImageGeometry());

        return [
            'width'  => $width,
            'height' => $height,
            'ratio'  => $this->ratio($width, $height),
            'size'   => $this->resource->getImageLength(),
            'type'   => sprintf('image/%s', strtolower($this->resource->getImageFormat())),
        ];
    }
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;
    }
767413
protected function getUnsettedKeys()
    {
        $unsettedKeys = [];

        foreach ($this->_originalAttributes as $key=>$value) {

            if (!array_key_exists($key, $this->_attributes)) {
                $unsettedKeys[] = $key;
                continue;
            }
        }

        return $unsettedKeys;
    }
1053641
public function layout(): array
    {
        if ($this->layout && count($this->layout)) {
            return $this->layout;
        }

        return array_keys($this->fields);
    }
1299135
public static function getAllSettings()
    {
        $settings = Settings::all();

        $settingsList = [];
        foreach($settings as $setting){
            $settingsList[$setting->settingsKey] = $setting->value;
        }

        return $settingsList;
    }
228775
public static function get_settings_fields( array $values = array() ) {
		$fields = array(
			'hide_label'     => array(
				'id'      => 'hide_label',
				'type'    => 'select',
				'label'   => __( 'Hide Label', 'menu-icons' ),
				'default' => '',
				'choices' => array(
					array(
						'value' => '',
						'label' => __( 'No', 'menu-icons' ),
					),
					array(
						'value' => '1',
						'label' => __( 'Yes', 'menu-icons' ),
					),
				),
			),
			'position'       => array(
				'id'      => 'position',
				'type'    => 'select',
				'label'   => __( 'Position', 'menu-icons' ),
				'default' => 'before',
				'choices' => array(
					array(
						'value' => 'before',
						'label' => __( 'Before', 'menu-icons' ),
					),
					array(
						'value' => 'after',
						'label' => __( 'After', 'menu-icons' ),
					),
				),
			),
			'vertical_align' => array(
				'id'      => 'vertical_align',
				'type'    => 'select',
				'label'   => __( 'Vertical Align', 'menu-icons' ),
				'default' => 'middle',
				'choices' => array(
					array(
						'value' => 'super',
						'label' => __( 'Super', 'menu-icons' ),
					),
					array(
						'value' => 'top',
						'label' => __( 'Top', 'menu-icons' ),
					),
					array(
						'value' => 'text-top',
						'label' => __( 'Text Top', 'menu-icons' ),
					),
					array(
						'value' => 'middle',
						'label' => __( 'Middle', 'menu-icons' ),
					),
					array(
						'value' => 'baseline',
						'label' => __( 'Baseline', 'menu-icons' ),
					),
					array(
						'value' => 'text-bottom',
						'label' => __( 'Text Bottom', 'menu-icons' ),
					),
					array(
						'value' => 'bottom',
						'label' => __( 'Bottom', 'menu-icons' ),
					),
					array(
						'value' => 'sub',
						'label' => __( 'Sub', 'menu-icons' ),
					),
				),
			),
			'font_size'      => array(
				'id'          => 'font_size',
				'type'        => 'number',
				'label'       => __( 'Font Size', 'menu-icons' ),
				'default'     => '1.2',
				'description' => 'em',
				'attributes'  => array(
					'min'  => '0.1',
					'step' => '0.1',
				),
			),
			'svg_width'      => array(
				'id'          => 'svg_width',
				'type'        => 'number',
				'label'       => __( 'SVG Width', 'menu-icons' ),
				'default'     => '1',
				'description' => 'em',
				'attributes'  => array(
					'min'  => '.5',
					'step' => '.1',
				),
			),
			'image_size'     => array(
				'id'      => 'image_size',
				'type'    => 'select',
				'label'   => __( 'Image Size', 'menu-icons' ),
				'default' => 'thumbnail',
				'choices' => kucrut_get_image_sizes(),
			),
		);

		$fields = apply_filters( 'menu_icons_settings_fields', $fields );

		foreach ( $fields as &$field ) {
			if ( isset( $values[ $field['id'] ] ) ) {
				$field['value'] = $values[ $field['id'] ];
			}

			if ( ! isset( $field['value'] ) && isset( $field['default'] ) ) {
				$field['value'] = $field['default'];
			}
		}

		unset( $field );

		return $fields;
	}
390668
protected function getReflectionColumns()
    {
        $metadata = $this->getClassMetadata();
        $fields = $metadata->getFieldNames();
        $identifier = $metadata->getIdentifier();
        $identifier = isset($identifier[0]) ? $identifier[0] : null;

        $columns = array();
        foreach ($fields as $field) {
            $mapping = $metadata->getFieldMapping($field);
            if (isset($mapping['options']) && isset($mapping['options']['label'])) {
                $label = $mapping['options']['label'];
            } else {
                $label = $this->fromCamelCase($field);
            }

            if ($identifier === $field) {
                if (isset($mapping['strategy']) && 'auto' == $mapping['strategy']) {
                    continue;
                }
            }
            $columns[$field] = new GridColumn($field, $label);
        }

        return $columns;
    }
1352322
public function getAllKeyValues()
    {
        $query = $this->_table->query();

        $query->formatResults(function (ResultSet $results) {
            return $results->map(function ($row) {
                if ($row['serialized'] === true) {
                    $row['value'] = unserialize($row['value']);
                }
                return $row;
            });
        });

        $settings = [];

        foreach ($query->all() as $row) {
            $key = $row['scope'] . '__' . $row[$this->config('fields.key')];
            $value = $row[$this->config('fields.value')];
            $settings[$key] = $value;
        }

        return Hash::expand($settings, '__');
    }
1094987
public function export_for_pix() {
        $title = isset($this->attributes['title']) ? $this->attributes['title'] : '';
        if (empty($title)) {
            $title = isset($this->attributes['alt']) ? $this->attributes['alt'] : '';
        }
        return [
            'key' => $this->pix,
            'component' => $this->component,
            'title' => $title
        ];
    }