MT::App::CMS::cms_pre_save.$type

This callback is invoked prior to a user saving an object via the Movable Type application. This callback is most often used by developers to save the state of the form/screen used to submit the entry. For example, the size of the WYSIWYG editor is "sticky," meaning Movable Type will remember the size of the WYSIWYG editor between screens. This is accomplished through this callback. When a user submits the Edit Entry form, the callback retrieves from the form input parameters the size of the textarea and saves it for later retrieval.

Input Parameters

  • $cb - a reference to the current MT::Callback object handling this event.
  • $app - a reference to the MT::App::CMS object processing this request.
  • $obj - a reference to the MT::Object being saved.
  • $original - a reference to the original MT::Object prior to it being modified.

Return Value

None.

Example Handler

sub handler {
    my ($cb, $app, $obj, $original) = @_;
    my $height = $app->param('text_editor_size');
    # do something
}
This page was last updated on 2008-10-01, 17:03. [Edit]

Leave a note

Have a question? Please use the MT Forums. Notes submitted on documentation should pertain to tips & hints regarding documentation. Your note may be removed once its contents have been integrated into the body of the page.