Class: TDiary::TDiaryPreview
- Inherits:
-
TDiaryAdmin
- Object
- TDiaryBase
- TDiaryAuthorOnlyBase
- TDiaryAdmin
- TDiary::TDiaryPreview
- Defined in:
- lib/tdiary/admin.rb
Overview
class TDiaryPreview
preview diary
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
- #eval_rhtml(prefix = '') ⇒ Object
-
#initialize(cgi, rhtm, conf) ⇒ TDiaryPreview
constructor
A new instance of TDiaryPreview.
Methods inherited from TDiaryAuthorOnlyBase
Methods inherited from TDiaryBase
#[], #calendar, #last_modified
Methods included from ViewHelper
Constructor Details
#initialize(cgi, rhtm, conf) ⇒ TDiaryPreview
Returns a new instance of TDiaryPreview.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/tdiary/admin.rb', line 71 def initialize( cgi, rhtm, conf ) super @title = @cgi.params['title'][0] @body = @cgi.params['body'][0] @title = @conf.to_native( @title ) @body = @conf.to_native( @body ) @old_date = @cgi.params['old'][0] @hide = @cgi.params['hide'][0] == 'true' ? true : false @io.transaction( @date ) do |diaries| @diaries = diaries diary = @diaries[@date.strftime( '%Y%m%d' )] @conf.style = diary.style if diary @diary = @io.diary_factory( @date, @title, @body, @conf.style ) @diary.show( ! @hide ) DIRTY_NONE end end |
Instance Method Details
#eval_rhtml(prefix = '') ⇒ Object
91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/tdiary/admin.rb', line 91 def eval_rhtml( prefix = '' ) begin @show_result = true r = do_eval_rhtml( prefix ) rescue PluginError, SyntaxError, ArgumentError @exception = $!.dup @show_result = false r = super end r end |