protected function getCssDimensions($mode = null)
    {
        if (!$this->imageWidth && !$this->imageHeight) {
            return '';
        }

        $cssDimensions = '';

        if ($mode == 'block') {
            $cssDimensions .= $this->imageWidth
                ? 'width: '.$this->imageWidth.'px;'
                : 'width: '.$this->imageHeight.'px;';

            $cssDimensions .= ($this->imageHeight)
                ? 'max-height: '.$this->imageHeight.'px;'
                : 'height: auto;';
        }
        else {
            $cssDimensions .= $this->imageWidth
                ? 'width: '.$this->imageWidth.'px;'
                : 'width: auto;';

            $cssDimensions .= ($this->imageHeight)
                ? 'max-height: '.$this->imageHeight.'px;'
                : 'height: auto;';
        }

        return $cssDimensions;
    }
protected function getCssDimensions($mode = null)
    {
        if (!$this->imageWidth && !$this->imageHeight) {
            return '';
        }

        $cssDimensions = '';

        if ($mode == 'block') {
            $cssDimensions .= $this->imageWidth
                ? 'width: '.$this->imageWidth.'px;'
                : 'width: '.$this->imageHeight.'px;';

            $cssDimensions .= ($this->imageHeight)
                ? 'max-height: '.$this->imageHeight.'px;'
                : 'height: auto;';
        }
        else {
            $cssDimensions .= $this->imageWidth
                ? 'width: '.$this->imageWidth.'px;'
                : 'width: auto;';

            $cssDimensions .= ($this->imageHeight)
                ? 'max-height: '.$this->imageHeight.'px;'
                : 'height: auto;';
        }

        return $cssDimensions;
    }
protected function getCssDimensions ( $ mode = null ) { if ( ! $ this -> imageWidth && ! $ this -> imageHeight ) { return '' ; } $ cssDimensions = '' ; if ( $ mode == 'block' ) { $ cssDimensions .= $ this -> imageWidth ? 'width: ' . $ this -> imageWidth . 'px;' : 'width: ' . $ this -> imageHeight . 'px;' ; $ cssDimensions .= ( $ this -> imageHeight ) ? 'max-height: ' . $ this -> imageHeight . 'px;' : 'height: auto;' ; } else { $ cssDimensions .= $ this -> imageWidth ? 'width: ' . $ this -> imageWidth . 'px;' : 'width: auto;' ; $ cssDimensions .= ( $ this -> imageHeight ) ? 'max-height: ' . $ this -> imageHeight . 'px;' : 'height: auto;' ; } return $ cssDimensions ; }
Returns the CSS dimensions for the uploaded image,
uses auto where no dimension is provided.
@param string $mode
@return string
Returns the CSS dimensions for the uploaded image uses auto where no dimension is provided .