Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/getgrav/grav into 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mahagr committed May 26, 2017
2 parents 7f3f634 + 0ca5812 commit 5ec844d
Show file tree
Hide file tree
Showing 171 changed files with 64 additions and 34 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

1. [](#new)
* Added new unified `Utils::getPagePathFromToken()` method which is used by various plugins (Admin, Forms, Downloads, etc.)
* Added 165 new thumbnail images for use in `media.yaml`
1. [](#improved)
* Optionally remove unpublished pages from the translated languages, move into untranslated list [#1482](https://github.com/getgrav/grav/pull/1482)
* Improved reliability of `hash` file-check method
Expand Down
72 changes: 38 additions & 34 deletions system/config/media.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ types:
mime: image/jpeg
jpeg:
type: image
thumb: media/thumb-jpeg.png
thumb: media/thumb-jpg.png
mime: image/jpeg
png:
type: image
Expand All @@ -28,12 +28,10 @@ types:
type: animated
thumb: media/thumb-gif.png
mime: image/gif

svg:
type: vector
thumb: media/thumb.png
thumb: media/thumb-svg.png
mime: image/svg+xml

mp4:
type: video
thumb: media/thumb-mp4.png
Expand All @@ -55,14 +53,13 @@ types:
thumb: media/thumb-flv.png
mime: video/x-flv
webm:
type: video
thumb: media/thumb.png
type: file
thumb: media/thumb-webm.png
mime: video/webm
ogv:
type: video
thumb: media/thumb-ogg.png
mime: video/ogg

mp3:
type: audio
thumb: media/thumb-mp3.png
Expand All @@ -85,11 +82,12 @@ types:
mime: audio/wav
aiff:
type: audio
thumb: media/thumb-aif.png
mime: audio/aiff
aif:
type: audio
thumb: media/thumb-aif.png
mime: audio/aif

txt:
type: file
thumb: media/thumb-txt.png
Expand All @@ -104,66 +102,60 @@ types:
mime: application/msword
docx:
type: file
thumb: media/thumb-docx.png
mime: application/msword
xls:
type: file
thumb: media/thumb-xls.png
mime: application/vnd.ms-excel
xlt:
type: file
mime: application/vnd.ms-excel
xlm:
type: file
mime: application/vnd.ms-excel
xlsm:
type: file
mime: application/vnd.ms-excel
xld:
type: file
mime: application/vnd.ms-excel
xla:
type: file
mime: application/vnd.ms-excel
xlc:
type: file
mime: application/vnd.ms-excel
xlw:
type: file
mime: application/vnd.ms-excel
xll:
xlsx:
type: file
thumb: media/thumb-xlsx.png
mime: application/vnd.ms-excel
ppt:
type: file
thumb: media/thumb-ppt.png
mime: application/vnd.ms-powerpoint
pptx:
type: file
thumb: media/thumb-pptx.png
mime: application/vnd.ms-powerpoint
pps:
type: file
thumb: media/thumb-pps.png
mime: application/vnd.ms-powerpoint
rtf:
type: file
thumb: media/thumb-rtf.png
mime: application/rtf

bmp:
type: file
thumb: media/thumb-bmp.png
mime: image/bmp
tiff:
type: file
thumb: media/thumb-tiff.png
mime: image/tiff
mpeg:
type: file
thumb: media/thumb-mpg.png
mime: video/mpeg
mpg:
type: file
thumb: media/thumb-mpg.png
mime: video/mpeg
mpe:
type: file
thumb: media/thumb-mpe.png
mime: video/mpeg
avi:
type: file
thumb: media/thumb-avi.png
mime: video/msvideo
wmv:
type: file
thumb: media/thumb-wmv.png
mime: video/x-ms-wmv

html:
type: file
thumb: media/thumb-html.png
Expand All @@ -172,24 +164,37 @@ types:
type: file
thumb: media/thumb-html.png
mime: text/html
ics:
type: iCal
thumb: media/thumb-ics.png
mime: text/calendar
pdf:
type: file
thumb: media/thumb-pdf.png
mime: application/pdf
ai:
type: file
thumb: media/thumb-ai.png
mime: image/ai
psd:
type: file
thumb: media/thumb-psd.png
mime: image/psd
zip:
type: file
thumb: media/thumb-zip.png
mime: application/zip
7z:
type: file
thumb: media/thumb-7zip.png
thumb: media/thumb-7z.png
mime: application/x-7z-compressed
gz:
type: file
thumb: media/thumb-gz.png
mime: application/gzip
tar:
type: file
thumb: media/thumb-tar.png
mime: application/x-tar
css:
type: file
Expand All @@ -203,4 +208,3 @@ types:
type: file
thumb: media/thumb-json.png
mime: application/json

Binary file added system/images/media/thumb-3dm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added system/images/media/thumb-3ds.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added system/images/media/thumb-3g2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added system/images/media/thumb-3gp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added system/images/media/thumb-7z.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added system/images/media/thumb-aac.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added system/images/media/thumb-ai.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added system/images/media/thumb-aif.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added system/images/media/thumb-apk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added system/images/media/thumb-app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added system/images/media/thumb-asf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added system/images/media/thumb-asp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added system/images/media/thumb-aspx.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added system/images/media/thumb-asx.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added system/images/media/thumb-avi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added system/images/media/thumb-bak.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added system/images/media/thumb-bat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added system/images/media/thumb-bin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added system/images/media/thumb-bmp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added system/images/media/thumb-cab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added system/images/media/thumb-cad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added system/images/media/thumb-cdr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added system/images/media/thumb-cer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added system/images/media/thumb-cfg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added system/images/media/thumb-cfm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added system/images/media/thumb-cgi.png
Binary file added system/images/media/thumb-com.png
Binary file added system/images/media/thumb-cpl.png
Binary file added system/images/media/thumb-cpp.png
Binary file added system/images/media/thumb-crx.png
Binary file added system/images/media/thumb-csr.png
Binary file added system/images/media/thumb-css.png
Binary file added system/images/media/thumb-csv.png
Binary file added system/images/media/thumb-cue.png
Binary file added system/images/media/thumb-cur.png
Binary file added system/images/media/thumb-dat.png
Binary file added system/images/media/thumb-db.png
Binary file added system/images/media/thumb-dbf.png
Binary file added system/images/media/thumb-dds.png
Binary file added system/images/media/thumb-dem.png
Binary file added system/images/media/thumb-dll.png
Binary file added system/images/media/thumb-dmg.png
Binary file added system/images/media/thumb-dmp.png
Binary file modified system/images/media/thumb-doc.png
Binary file added system/images/media/thumb-docx.png
Binary file added system/images/media/thumb-drv.png
Binary file added system/images/media/thumb-dtd.png
Binary file added system/images/media/thumb-dwg.png
Binary file added system/images/media/thumb-dxf.png
Binary file added system/images/media/thumb-elf.png
Binary file added system/images/media/thumb-eot.png
Binary file added system/images/media/thumb-eps.png
Binary file added system/images/media/thumb-exe.png
Binary file added system/images/media/thumb-fla.png
Binary file added system/images/media/thumb-flv.png
Binary file added system/images/media/thumb-fnt.png
Binary file added system/images/media/thumb-fon.png
Binary file added system/images/media/thumb-gam.png
Binary file added system/images/media/thumb-gbr.png
Binary file added system/images/media/thumb-ged.png
Binary file modified system/images/media/thumb-gif.png
Binary file added system/images/media/thumb-gpx.png
Binary file modified system/images/media/thumb-gz.png
Binary file added system/images/media/thumb-gzip.png
Binary file added system/images/media/thumb-hqz.png
Binary file modified system/images/media/thumb-html.png
Binary file added system/images/media/thumb-icns.png
Binary file added system/images/media/thumb-ico.png
Binary file added system/images/media/thumb-ics.png
Binary file added system/images/media/thumb-iff.png
Binary file added system/images/media/thumb-indd.png
Binary file added system/images/media/thumb-iso.png
Binary file added system/images/media/thumb-jar.png
Binary file removed system/images/media/thumb-jpeg.png
Diff not rendered.
Binary file modified system/images/media/thumb-jpg.png
Binary file added system/images/media/thumb-js.png
Binary file added system/images/media/thumb-jsp.png
Binary file added system/images/media/thumb-key.png
Binary file added system/images/media/thumb-kml.png
Binary file added system/images/media/thumb-kmz.png
Binary file added system/images/media/thumb-lnk.png
Binary file added system/images/media/thumb-log.png
Binary file added system/images/media/thumb-lua.png
Binary file added system/images/media/thumb-m3u.png
Binary file added system/images/media/thumb-m4a.png
Binary file modified system/images/media/thumb-m4v.png
Binary file added system/images/media/thumb-max.png
Binary file added system/images/media/thumb-mdb.png
Binary file added system/images/media/thumb-mdf.png
Binary file added system/images/media/thumb-mid.png
Binary file added system/images/media/thumb-mim.png
Binary file modified system/images/media/thumb-mov.png
Binary file added system/images/media/thumb-mp3.png
Binary file modified system/images/media/thumb-mp4.png
Binary file added system/images/media/thumb-mpa.png
Binary file added system/images/media/thumb-mpe.png
Binary file added system/images/media/thumb-mpg.png
Binary file added system/images/media/thumb-msg.png
Binary file added system/images/media/thumb-msi.png
Binary file added system/images/media/thumb-nes.png
Binary file added system/images/media/thumb-obj.png
Binary file added system/images/media/thumb-odb.png
Binary file added system/images/media/thumb-odc.png
Binary file added system/images/media/thumb-odf.png
Binary file added system/images/media/thumb-odg.png
Binary file added system/images/media/thumb-odi.png
Binary file added system/images/media/thumb-odp.png
Binary file added system/images/media/thumb-ods.png
Binary file added system/images/media/thumb-odt.png
Binary file added system/images/media/thumb-odx.png
Binary file added system/images/media/thumb-ogg.png
Binary file added system/images/media/thumb-pct.png
Binary file added system/images/media/thumb-pdb.png
Binary file modified system/images/media/thumb-pdf.png
Binary file added system/images/media/thumb-pif.png
Binary file added system/images/media/thumb-pkg.png
Binary file added system/images/media/thumb-pl.png
Binary file modified system/images/media/thumb-png.png
Binary file added system/images/media/thumb-pps.png
Binary file added system/images/media/thumb-ppt.png
Binary file added system/images/media/thumb-pptx.png
Binary file added system/images/media/thumb-ps.png
Binary file added system/images/media/thumb-psd.png
Binary file added system/images/media/thumb-pub.png
Binary file added system/images/media/thumb-py.png
Binary file added system/images/media/thumb-ra.png
Binary file added system/images/media/thumb-rar.png
Binary file added system/images/media/thumb-raw.png
Binary file added system/images/media/thumb-rm.png
Binary file added system/images/media/thumb-rom.png
Binary file added system/images/media/thumb-rpm.png
Binary file added system/images/media/thumb-rss.png
Binary file added system/images/media/thumb-rtf.png
Binary file added system/images/media/thumb-sav.png
Binary file added system/images/media/thumb-sdf.png
Binary file added system/images/media/thumb-sql.png
Binary file added system/images/media/thumb-srt.png
Binary file added system/images/media/thumb-svg.png
Binary file modified system/images/media/thumb-swf.png
Binary file added system/images/media/thumb-sys.png
Binary file added system/images/media/thumb-tar.png
Binary file added system/images/media/thumb-tex.png
Binary file added system/images/media/thumb-tga.png
Binary file added system/images/media/thumb-thm.png
Binary file added system/images/media/thumb-tiff.png
Binary file added system/images/media/thumb-tmp.png
Binary file added system/images/media/thumb-ttf.png
Binary file modified system/images/media/thumb-txt.png
Binary file added system/images/media/thumb-uue.png
Binary file added system/images/media/thumb-vb.png
Binary file added system/images/media/thumb-vcd.png
Binary file added system/images/media/thumb-vcf.png
Binary file added system/images/media/thumb-wav.png
Binary file added system/images/media/thumb-webm.png
Binary file added system/images/media/thumb-wma.png
Binary file added system/images/media/thumb-wmv.png
Binary file added system/images/media/thumb-woff.png
Binary file added system/images/media/thumb-woff2.png
Binary file added system/images/media/thumb-wpd.png
Binary file added system/images/media/thumb-wps.png
Binary file added system/images/media/thumb-wsf.png
Binary file added system/images/media/thumb-xls.png
Binary file added system/images/media/thumb-xlsx.png
Binary file added system/images/media/thumb-xml.png
Binary file added system/images/media/thumb-yuv.png
Binary file modified system/images/media/thumb-zip.png
Binary file modified system/images/media/thumb.png
10 changes: 10 additions & 0 deletions system/src/Grav/Common/Page/Media.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,14 @@ protected function init()
$this->add($name, $medium);
}
}

/**
* Enable accessing the media path
*
* @return mixed
*/
function path()
{
return $this->path;
}
}
15 changes: 15 additions & 0 deletions system/src/Grav/Common/Page/Medium/Medium.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,21 @@ public function path($reset = true)
return $this->get('filepath');
}

/**
* Return the relative path to file
*
* @param bool $reset
* @return mixed
*/
public function relativePath($reset = true)
{
if ($reset) {
$this->reset();
}

return str_replace(GRAV_ROOT, '', $this->get('filepath'));
}

/**
* Return URL to file.
*
Expand Down

0 comments on commit 5ec844d

Please sign in to comment.