mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-30 04:23:11 +03:00
Converted image-manager to be component/HTML based
Instead of vue based.
This commit is contained in:
@ -185,7 +185,7 @@ class ImageRepo
|
||||
* Load thumbnails onto an image object.
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function loadThumbs(Image $image)
|
||||
public function loadThumbs(Image $image)
|
||||
{
|
||||
$image->thumbs = [
|
||||
'gallery' => $this->getThumbnail($image, 150, 150, false),
|
||||
@ -219,4 +219,20 @@ class ImageRepo
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the user visible pages using the given image.
|
||||
*/
|
||||
public function getPagesUsingImage(Image $image): array
|
||||
{
|
||||
$pages = Page::visible()
|
||||
->where('html', 'like', '%' . $image->url . '%')
|
||||
->get(['id', 'name', 'slug', 'book_id']);
|
||||
|
||||
foreach ($pages as $page) {
|
||||
$page->url = $page->getUrl();
|
||||
}
|
||||
|
||||
return $pages->all();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user