Class: TDiary::TDiaryShowComment

Inherits:
TDiaryAdmin show all
Defined in:
lib/tdiary/admin.rb

Overview

class TDiaryShowComment

change visible mode of comments

Constant Summary

Constants inherited from TDiaryBase

TDiary::TDiaryBase::DIRTY_COMMENT, TDiary::TDiaryBase::DIRTY_DIARY, TDiary::TDiaryBase::DIRTY_NONE, TDiary::TDiaryBase::DIRTY_REFERER

Instance Attribute Summary

Attributes inherited from TDiaryBase

#cgi, #conf, #cookies, #date, #diaries, #ignore_parser_cache, #rhtml

Instance Method Summary collapse

Methods inherited from TDiaryAuthorOnlyBase

#csrf_protection_get_is_okay

Methods inherited from TDiaryBase

#[], #calendar, #last_modified

Methods included from ViewHelper

#base_url, #bot?

Constructor Details

#initialize(cgi, rhtml, conf) ⇒ TDiaryShowComment

Returns a new instance of TDiaryShowComment.



194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# File 'lib/tdiary/admin.rb', line 194

def initialize( cgi, rhtml, conf )
	super

	@io.transaction( @date ) do |diaries|
		@diaries = diaries
		dirty = DIRTY_NONE
		@diary = self[@date]
		if @diary then
			idx = 0
			@diary.each_comment do |com|
				com.show = @cgi.params[(idx += 1).to_s][0] == 'true' ? true : false;
			end
			self << @diary
			@io.clear_cache( /(latest|#{@date.strftime( '%Y%m' )})/ )
			dirty = DIRTY_COMMENT
		end
		dirty
	end
end

Instance Method Details

#eval_rhtml(prefix = '') ⇒ Object



214
215
216
217
218
# File 'lib/tdiary/admin.rb', line 214

def eval_rhtml( prefix = '' )
	load_plugins
	@plugin.instance_eval { update_proc }
	super
end