/** * @param integer PageID * @return string * @access private */ function _InlineMenuSetImagePage($PageID) { // Get data from header $imagePath = GetPostOrGet('imagePath'); // FIXME: load from config? $imgmax2 = 200; // Get data form config $inlinemenuFolder = $this->_Config->Get('thumbnailfolder', 'data/thumbnails/'); // resize the image if it doesn't exist $imageResizer = new ImageConverter($imagePath); //$sizes = $imageResizer->CalcSizeByMaxWidth($imgmax2); $sizes = array(); if ($imageResizer->Size[0] > $imgmax2) { $sizes = $imageResizer->CalcSizeByMaxWidth($imgmax2); } else { if ($imageResizer->Size[1] > $imgmax2) { $sizes = $imageResizer->CalcSizeByMax($imgmax2); } } $thumbnail = $imagePath; if (count($sizes) == 2) { $thumbnail = $imageResizer->SaveResizedTo($sizes[0], $sizes[1], $inlinemenuFolder, $sizes[0] . 'x' . $sizes[1] . '_'); } // if resizing was successful ... if (file_exists($thumbnail)) { // ... set it to the inlinemenu $this->_PageStructure->SetInlineMenuImage($PageID, $thumbnail, $imagePath); } // go back to the overview of the inlinemenu return $this->_InlineMenuHomePage($PageID); }
/** * @param integer PageID * @return string * @access private */ function _InlineMenuSetImagePage($PageID) { // Get data from header $imagePath = GetPostOrGet('imagePath'); // FIXME: load from config? $imgmax2 = 200; // Get data form config $inlinemenuFolder = $this->_Config->Get('thumbnailfolder', 'data/thumbnails/'); // resize the image if it doesn't exist $thumbnail = resizeImageToWidth($imagePath, $inlinemenuFolder, $imgmax2); // if resizing was successful ... if (file_exists($thumbnail)) { // ... set it to the inlinemenu $this->_PageStructure->SetInlineMenuImage($PageID, $thumbnail, $imagePath); } // go back to the overview of the inlinemenu return $this->_InlineMenuHomePage($PageID); }