original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Returns the CSS dimensions for the uploaded image,
  uses auto where no dimension is provided.
  @param string $mode
  @return string
docstring_tokens: Returns the CSS dimensions for the uploaded image uses auto where no dimension is provided .