Sunday, September 16, 2007

Plugin activation issue, improvement on publish.php

I have posted issue 408 about plugin activation/deactivation problem.    One other user has indicated experience of similar behavior on some plugins.

I did a quick mod to admin/publish.php such that I could easily get back to the entry I just edited, here it is

if ( isset( $result ) ) {
switch( $result ) {
case 'success':
echo '[p class="update"]' . _t('Your post has been saved.') . '[br /]';
if ( isset( $slug ) ) {
$post= Post::get( array( 'slug' => $slug, 'status' => Post::status( 'any' ) ) );
echo [a href="'.site::get_url('habari').'/'.$post->slug.'">Return to post[/a][/p]';

Skippy confirmed that this isn't a bad idea but at present user/classes only overrides files in system/classes but not those in admin/.

It would be ideal for user to have, after the entry is saved successfully, to have links going back to the entry or the page when it was first directed from.   Perhaps something like a hidden field.

[input type='hidden' name='redirect_to' value='$_SERVER['REQUEST_URI']' /]

Haven't tried this out but this may work.

No comments:

Post a Comment