[dw-free] Expose Image_std to core2
[commit: http://hg.dwscoalition.org/dw-free/rev/f4f60bc8f540]
http://bugs.dwscoalition.org/show_bug.cgi?id=3951
Add a new global function to core2: get_image( $key ), which returns an
Image object for a given key.
Patch by
exor674.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=3951
Add a new global function to core2: get_image( $key ), which returns an
Image object for a given key.
Patch by
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Files modified:
- bin/upgrading/s2layers/core2.s2
- cgi-bin/LJ/S2.pm
-------------------------------------------------------------------------------- diff -r 8839002a6af5 -r f4f60bc8f540 bin/upgrading/s2layers/core2.s2 --- a/bin/upgrading/s2layers/core2.s2 Wed Sep 28 20:09:48 2011 +0800 +++ b/bin/upgrading/s2layers/core2.s2 Thu Sep 29 00:21:37 2011 +0800 @@ -1073,6 +1073,9 @@ function builtin keys_alpha(string{} elements) : string[] "Return the keys of the array in alphabetically sorted order."; +function builtin get_image(string key) : Image +"Given an image key to look up, returns an Image object populated with src, width, height taken from the standard images used by S2. Image object may be null if key is not valid"; + ##[ properties ] propgroup colors = "Colors"; diff -r 8839002a6af5 -r f4f60bc8f540 cgi-bin/LJ/S2.pm --- a/cgi-bin/LJ/S2.pm Wed Sep 28 20:09:48 2011 +0800 +++ b/cgi-bin/LJ/S2.pm Thu Sep 29 00:21:37 2011 +0800 @@ -2607,6 +2607,10 @@ return $clean_classname; } +sub get_image { + return LJ::S2::Image_std( $_[1] ); +} + sub set_content_type { my ($ctx, $type) = @_; --------------------------------------------------------------------------------