creating for disabling widgets and frontend

This commit is contained in:
Matthew Fu 2012-01-05 16:21:33 +08:00
parent 7b40706aed
commit 79f778ad8c
9 changed files with 56 additions and 9 deletions

View File

@ -1,9 +1,15 @@
class Admin::ModuleAppsController < ApplicationController
layout "admin"
def reload_frontend_pages
def index
@module_apps = ModuleApp.all.entries
end
def reload_frontend_pages
@module_app = ModuleApp.find(params[:id])
respond_to do |format|
format.js {}
end
end
end
end

View File

@ -0,0 +1,6 @@
class ObitWidgetController< ApplicationController
before_filter {|c| c.front_end_available(@app_title)}
layout 'production'
end

View File

@ -1,6 +1,10 @@
class Panel::Blog::FrontEnd::PostsController < ApplicationController
class Panel::Blog::FrontEnd::PostsController < ObitWidgetController
layout 'production'
def initialize
super
@app_title = NewBlog::MOUDLEAPP_TITLE
end
# GET /posts
# GET /posts.xml

View File

@ -1,7 +1,12 @@
class Panel::Blog::Widget::PostsController < ApplicationController
class Panel::Blog::Widget::PostsController < ObitWidgetController
layout 'production'
def initialize
super
@app_title = NewBlog::MOUDLEAPP_TITLE
end
# GET /posts
# GET /posts.xml
def index

View File

@ -1,2 +1,6 @@
module ApplicationHelper
def check_show_frontend
front_end_available(NewBlog::MOUDLEAPP_TITLE)
end
end

View File

@ -0,0 +1,5 @@
module NewBlogHelper
def self.check_show_frontend
ApplicationController.front_end_available(NewBlog::MOUDLEAPP_TITLE)
end
end

View File

@ -0,0 +1,18 @@
# module NewBlog
# class MyEngine < Rails::Engine
# # Add a load path for this specific Engine
# # config.autoload_paths << File.expand_path("../lib/some/path", __FILE__)
# put "ABC"
# PrototypeR4::Application::Orbit_Apps << "NewBlog"
#
# # initializer "my_engine.add_middleware" do |app|
# # app.middleware.use MyEngine::Middleware
# # end
# end
#
# end
module NewBlog
VERSION = "0.0.1"
MOUDLEAPP_TITLE = "NewBlog"
end
PrototypeR4::Application::Orbit_Apps << "NewBlog"

View File

@ -1,6 +1,5 @@
module NewBlog
class Engine < Rails::Engine
isolate_namespace NewBlog
PrototypeR4::Application::Orbit_Apps << "NewBlog"
end
end