creating for disabling widgets and frontend
This commit is contained in:
		
							parent
							
								
									7b40706aed
								
							
						
					
					
						commit
						79f778ad8c
					
				| 
						 | 
				
			
			@ -1,9 +1,15 @@
 | 
			
		|||
class Admin::ModuleAppsController < ApplicationController
 | 
			
		||||
  layout "admin"
 | 
			
		||||
 | 
			
		||||
def reload_frontend_pages
 | 
			
		||||
  @module_app = ModuleApp.find(params[:id])
 | 
			
		||||
  respond_to do |format|
 | 
			
		||||
    format.js  {}
 | 
			
		||||
  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
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,6 @@
 | 
			
		|||
class ObitWidgetController< ApplicationController
 | 
			
		||||
  before_filter {|c| c.front_end_available(@app_title)}
 | 
			
		||||
  layout 'production'
 | 
			
		||||
  
 | 
			
		||||
  
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,2 +1,6 @@
 | 
			
		|||
module ApplicationHelper
 | 
			
		||||
  
 | 
			
		||||
  def check_show_frontend
 | 
			
		||||
    front_end_available(NewBlog::MOUDLEAPP_TITLE)
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,5 @@
 | 
			
		|||
module NewBlogHelper
 | 
			
		||||
  def self.check_show_frontend
 | 
			
		||||
    ApplicationController.front_end_available(NewBlog::MOUDLEAPP_TITLE)
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			@ -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"
 | 
			
		||||
| 
						 | 
				
			
			@ -1,6 +1,5 @@
 | 
			
		|||
module NewBlog
 | 
			
		||||
  class Engine < Rails::Engine
 | 
			
		||||
    isolate_namespace NewBlog
 | 
			
		||||
    PrototypeR4::Application::Orbit_Apps << "NewBlog"
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Reference in New Issue