[% currentPage = 'edit.html' currentPageTitle = 'Edit Article' id = modwheel.getParam('id') title = modwheel.getParam('title') keywords = modwheel.getParam('keywords') summary = modwheel.getParam('summary') text = modwheel.getParam('text') active = modwheel.getParam('active') parent = modwheel.getParam('parent') sort = modwheel.getParam('sort') template = modwheel.getParam('template') username = modwheel.getCurrentUser() execute = modwheel.getParam('execute') executeDeleteFile = modwheel.getParam('executeDeleteFile') deleteFileId = modwheel.getParam('deleteFileId') %] [% # ######### Fetch the article requested. %] [% this = modwheel.fetchObject(id => id, type ="'article'") %] [% error = 'No such article' UNLESS this%] [% id = this.id IF this.id %] [% # ######### Set default values %] [% DEFAULT active = 'off' %] [% DEFAULT sort = 10 %] [% DEFAULT parent = this.parent %] [% # ############ Save the object. %] [% IF execute == 'Yes' %] [% error = 'All objects must have a title.' UNLESS title %] [% UNLESS error %] [% ret = this.setObjectValues( type => 'article', name => title, keywords => keywords, description => summary, data => text, active => active, parent => parent, sort => sort, template => template owner => username, revised_by => username) %] [% ret = modwheel.saveObject(this) %] [% error = "Internal Error: Couldn't save object." UNLESS ret %] [% END %] [% END %] [% IF executeDeleteFile == 'Yes' and deleteFileId %] [% ret = modwheel.deleteRepositoryFile(deleteFileId) %] [% END %] [% INCLUDE header_start.html %] [%# INCLUDE rtef_init.html %] [% INCLUDE header_end.html %]