This repository has been archived by the owner on Feb 23, 2022. It is now read-only.
forked from blazingcloud/radiant-mediamaid-extension
-
Notifications
You must be signed in to change notification settings - Fork 1
/
mediamaid_extension.rb
59 lines (43 loc) · 1.54 KB
/
mediamaid_extension.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Radiant-mediamaid-extension
# @copyright (c) 2010 Blazing CLoud (http://www.blazingcloud.net)
# @license MIT License
#
class MediamaidExtension < Radiant::Extension
version "1.0"
description "MediaMaid is an asset management tool for Radiant CMS"
url "http://blazing-cloud.com"
define_routes do |map|
map.namespace :admin, :member => { :remove => :get } do |admin|
admin.resources :mediamaid
end
end
def activate
admin.page.edit.add(:form, "mediamaid_gallery", :before=> "edit_page_parts")
admin.tabs.add "Media", "/admin/mediamaid", :after => "Layouts", :visibility => [:all]
# default settings for configuration of medimaid image sizes, to change go to Settings in Admin UI
Radiant::Config['mediamaid.thumb'] ||= "100x100"
Radiant::Config['mediamaid.small'] ||= "200x200"
Radiant::Config['mediamaid.medium'] ||= "300x300"
Radiant::Config['mediamaid.large'] ||= "640x640"
Admin::PagesController.class_eval do
before_filter :set_custom_css
def set_custom_css
@stylesheets << 'admin/mediamaid'
end
# uncomment for 0.9, and remove JS tag from view
#def include_javascript
# @javascripts << "admin/mediamaid.js"
#end
end
Admin::MediamaidController.class_eval do
before_filter :set_custom_css
#before_filter :include_javascript
def set_custom_css
@stylesheets << 'admin/mediamaid'
end
#def include_javascript
# @javascripts << "admin/mediamaid.js"
#end
end
end
end