Answers the image alignment class for the specified viewport and value.

@param string $viewport
@param string $value

@return string
435372
public function getImageAlignmentClass($viewport, $value)
    {
        if ($value) {
            
            $class = [$this->getStyle('image')];
            
            $class[] = $this->getStyle('viewport', $viewport);
            
            $class[] = $this->getStyle('align', $value);
            
            return implode('-', array_filter($class));
            
        }
    }
431950
protected function matchValue($value)
    {
        $format = pathinfo($value, PATHINFO_EXTENSION);
        if ($format !== '') {
            $value = substr($value, 0, strlen($value) - strlen($format) - 1);
        }
        $segments = Arrays::trimExplode('/', $value);

        $currentModuleBase = $this->settings['modules'];
        if ($segments === [] || !isset($currentModuleBase[$segments[0]])) {
            return self::MATCHRESULT_NOSUCHMODULE;
        }

        $modulePath = [];
        $level = 0;
        $moduleConfiguration = null;
        $moduleController = null;
        $moduleAction = 'index';
        foreach ($segments as $segment) {
            if (isset($currentModuleBase[$segment])) {
                $modulePath[] = $segment;
                $moduleConfiguration = $currentModuleBase[$segment];

                if (isset($moduleConfiguration['controller'])) {
                    $moduleController = $moduleConfiguration['controller'];
                } else {
                    $moduleController = null;
                }

                if (isset($moduleConfiguration['submodules'])) {
                    $currentModuleBase = $moduleConfiguration['submodules'];
                } else {
                    $currentModuleBase = [];
                }
            } else {
                if ($level === count($segments) - 1) {
                    $moduleMethods = array_change_key_case(array_flip(get_class_methods($moduleController)), CASE_LOWER);
                    if (array_key_exists($segment . 'action', $moduleMethods)) {
                        $moduleAction = $segment;
                        break;
                    }
                }
                return self::MATCHRESULT_NOSUCHMODULE;
            }
            $level++;
        }

        if ($moduleController === null) {
            return self::MATCHRESULT_NOCONTROLLER;
        }

        $this->value = [
            'module' => implode('/', $modulePath),
            'controller' => $moduleController,
            'action' => $moduleAction
        ];

        if ($format !== '') {
            $this->value['format'] = $format;
        }

        return self::MATCHRESULT_FOUND;
    }
546848
public static function compile_string($value, $view = null)
	{
		foreach (static::$compilers as $compiler)
		{
			$method = "compile_{$compiler}";

			$value = static::$method($value, $view);
		}

		return $value;
	}
556319
public function allEqualTo($value)
    {
        foreach ($this->getViewports() as $viewport) {
            
            if ($this->getField($viewport) != $value) {
                return false;
            }
            
        }
        
        return true;
    }
230206
public function getViewportLabel($viewport)
    {
        if (isset($this->labels[$viewport])) {
            return $this->labels[$viewport];
        }
        
        return DBViewports::singleton()->getViewportLabel($viewport);
    }
879500
protected function normaliseViewport($prefix, array $valid, $value)
    {
        $value = $this->convertToArray($value);

        foreach ($value as $i => $viewport) {
            if (!\in_array($viewport, $valid)) {
                throw new InvalidConfigurationException(sprintf('The "%s" %s viewport option does not exist. Known options are: "%s"', $viewport, $prefix, implode('", "', $valid)));
            }

            $value[$i] = sprintf('%s-%s', $prefix, $viewport);
        }

        return $value;
    }
1356302
protected function getDisplayValue($value)
    {
        if (is_numeric($value)) {
            $value = $value * 100;
            $value = parent::getDisplayValue($value);
            $value = $value . '%';
        } else {
            $value = parent::getDisplayValue($value);
        }

        return $value;
    }
137063
protected function buildViewportField($viewport)
    {
        if ($this->useTextInput) {
            
            $field = TextField::create(
                $this->getViewportName($viewport),
                $this->getViewportLabel($viewport)
            );
            
        } else {
            
            $field = DropdownField::create(
                $this->getViewportName($viewport),
                $this->getViewportLabel($viewport),
                $this->getSource()
            );
            
        }
        
        return $field;
    }
323495
public function displayValue( $value )
    {
        if ( empty( $value ) )
        {
            return '';
        }

        return $this->view
                    ->htmlTag( 'img', null, array(
                        'data-js-type' => 'js.ui.toolTip',
                        'src'   => $this->view
                                        ->thumbnail( $value,
                                                     $this->getOptions() ),
                        'title' => $this->view
                                        ->htmlTag( 'img', null, array(
                                            'src'   => $value,
                                            'style' => 'max-width: 300px;'
                                                    . ' max-height: 500px;'
                                                    . ' margin-bottom: -3px;',
                                        ) ),
                    ) );
    }
799220
public function displayValue( $value )
    {
        return $this->view->numberFormat(
            (float) $value,
            NumberFormatter::DECIMAL,
            NumberFormatter::TYPE_DOUBLE
        );
    }
871794
private function getIndividualValue($value)
    {
        if (! is_object($value) || ! $this->em->getMetadataFactory()->hasMetadataFor(StaticClassNameConverter::getClass($value))) {
            return $value;
        }

        return $this->em->getUnitOfWork()->getSingleIdentifierValue($value);
    }
240346
function(viewPort) {
					if (!that.hasValue()) return 0;
					var s = that.value+'';
					if (s.match(/em$/)) return that.numValue() * this.EM(viewPort);
					if (s.match(/ex$/)) return that.numValue() * this.EM(viewPort) / 2.0;
					if (s.match(/px$/)) return that.numValue();
					if (s.match(/pt$/)) return that.numValue() * 1.25;
					if (s.match(/pc$/)) return that.numValue() * 15;
					if (s.match(/cm$/)) return that.numValue() * this.DPI(viewPort) / 2.54;
					if (s.match(/mm$/)) return that.numValue() * this.DPI(viewPort) / 25.4;
					if (s.match(/in$/)) return that.numValue() * this.DPI(viewPort);
					if (s.match(/%$/)) return that.numValue() * svg.ViewPort.ComputeSize(viewPort);
					return that.numValue();
				}
20223
protected function getType($value)
    {
        if (is_object($value)) {
            return get_class($value);
        } elseif (is_null($value)) {
            return 'null';
        } elseif (is_string($value)) {
            return 'string';
        } elseif (is_array($value)) {
            return 'array';
        } elseif (is_int($value)) {
            return 'integer';
        } elseif (is_bool($value)) {
            return 'boolean';
        } elseif (is_float($value)) {
            return 'float';
        } elseif (is_resource($value)) {
            return 'resource';
        } else {
            return 'unknown';
        }
    }
1018394
public static function determine($value): string
    {
        $type = \gettype($value);

        switch ($type) {
            case 'object':
                return \get_class($value);

            case 'integer':
                return 'int';

            case 'boolean':
                return 'bool';

            case 'NULL':
                return 'null';

            case 'double':
                return 'float';

            default:
                return $type;
        }
    }
486292
public function setImageResource($value = null)
    {
        $this->imageResource = $value;

        if (!is_null($this->imageResource)) {
            // Get width/height
            $this->width  = imagesx($this->imageResource);
            $this->height = imagesy($this->imageResource);
        }
        return $this;
    }
722973
protected function htmlOptionsResult($value = '')
    {
        $class = !empty($this->defaults['resultClass']) ? $this->defaults['resultClass'] . $value : '';
        $style = !empty($this->defaults['resultStyle']) ? $this->defaults['resultStyle'] : '';

        if (!empty($this->bootstrapDefaults['resultClass'])) {
            $class .= $this->bootstrapDefaults['resultClass'];
        }
        if (!empty($this->bootstrapDefaults['resultStyle'])) {
            $style .= $this->bootstrapDefaults['resultStyle'];
        }
        if (!empty($this->resultClass) && is_string($this->resultClass)) {
            $class .= ' ' . $this->resultClass;
        }
        if (!empty($this->resultStyle) && is_string($this->resultStyle)) {
            $style .= ' ' . $this->resultStyle;
        }

        return [
            'class' => $class ?: null,
            'style' => $style ?: null,
        ];
    }
1312172
private function getViewProvider($value): ViewProviderInterface
    {
        foreach ($this->viewProviders as $viewProvider) {
            if ($viewProvider->supports($value)) {
                return $viewProvider;
            }
        }

        throw ViewProviderException::noViewProvider(get_class($value));
    }