Module: PhcdevworksCore::PhcdevworksPluginsHelper

Defined in:
app/helpers/phcdevworks_core/phcdevworks_plugins_helper.rb

Instance Method Summary collapse

Instance Method Details

#phcdevworks_accounts_admin_onlyObject

PHCDevworks - Accounts - Add Admin Only Filter



5
6
7
8
9
# File 'app/helpers/phcdevworks_core/phcdevworks_plugins_helper.rb', line 5

def phcdevworks_accounts_admin_only
	unless current_user && current_user.admin?
		redirect_to main_app.root_path, :flash => { :error => "Sorry Access Denied. Adminisistration Access Required!" }
	end
end

#phcdevworks_real_listings_allObject

PHCDevworks - RealEstate - All Listings



22
23
24
# File 'app/helpers/phcdevworks_core/phcdevworks_plugins_helper.rb', line 22

def phcdevworks_real_listings_all
	@property_real_listings_all = Phcdevworksrealestate::Property::Listing.all
end

#phcmembers_get_member_profile_infoObject

PHCDevworks - Members - Grab Member Information



17
18
19
# File 'app/helpers/phcdevworks_core/phcdevworks_plugins_helper.rb', line 17

def phcmembers_get_member_profile_info
	@members_profile_info = Phcdevworksmembers::Member::Profile.find(params[:profile_id])
end

#resolve_property_listing_layoutsObject

PHCDevworks - RealEstate - Resolve Layouts



27
28
29
30
31
32
33
34
35
36
# File 'app/helpers/phcdevworks_core/phcdevworks_plugins_helper.rb', line 27

def resolve_property_listing_layouts
	case action_name
	when "new", "create"
		"application"
	when "index"
		"phcdevworks_real_estate/property_list"
	else
		"application"
	end
end

#user_for_paper_trailObject

PHCDevworks - Accounts - Who Dunnit



12
13
14
# File 'app/helpers/phcdevworks_core/phcdevworks_plugins_helper.rb', line 12

def user_for_paper_trail
	current_user ? current_user.username : "Public user"
end