nukeSEO.com - PHPNuke SEO Search engine optimization, professional tools including nukeSEO, nukeSPAM, nukeFEED, nukePIE, nukeWYSIWYG and more

 

. Welcome to nukeSEO.com  ! 
.
.
.


.
nukeSEO.com: Forums


 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

edit block pop up modal window
 
 
Post new topic   Reply to topic    nukeSEO.com Forum Index -> PHP-Nuke enhancement ideas
View previous topic :: View next topic  
Author Message
GazJ
webmaster


Joined: Mar 20, 2007
Posts: 29

PostPosted: Sun Apr 10, 2011 7:58 am    Post subject: edit block pop up modal window Reply with quote

i was toying with the blocks admin and was thinking about using jquery's toggle() function to show an edit form under each block listed in the table
but then thought about using the modal script i use PiroBox and came up with this

Image

Image

Image
  
Back to top
View user's profile Send private message
nuken
webmaster


Joined: Jan 02, 2009
Posts: 26

PostPosted: Sun Apr 10, 2011 11:18 am    Post subject: Reply with quote

Very nice. Super idea and a needed option....
  
Back to top
View user's profile Send private message
Guardian
webmaster


Joined: Dec 25, 2005
Posts: 364
Location: Vsetin, Czech Republic

PostPosted: Sun Apr 10, 2011 4:39 pm    Post subject: Reply with quote

I like it too Smile
Did you test this with RN or just Nuke? I only ask because although I have played with modal boxes before, I've never used them for form processing and I'm wondering if something like that would work with RN due to the anti-csrf token it posts through the form.
  
Back to top
View user's profile Send private message
GazJ






PostPosted: Mon Apr 11, 2011 2:29 am    Post subject: Reply with quote

the modal i used for testing on standard nuke uses the old functions all i did was comment out the header.php and graphicadmin function and change the header redirect back to the form on db submission.

ill load up rn and mod the blocks admin
  
Back to top
GazJ






PostPosted: Mon Apr 11, 2011 3:23 am    Post subject: Reply with quote

i have it done in rn if anyones intrested i can post a step by step break down of the alterations only takes around 5 mins to modify things
  
Back to top
GazJ






PostPosted: Mon Apr 11, 2011 3:43 am    Post subject: Reply with quote

edit number 1 and 2 address the crsf check as we need the header included for this

open header.php
find :
Code:
themeheader();

change to
Code:
if(!defined('BLOCKEDITFRAME')){themeheader();}


open footer.php
find:
Code:
themefooter();


change to
Code:
if(!defined('BLOCKEDITFRAME')){themefooter();}


open includes/jquery/jquery.colorbox.php
before the closing tages add:

Code:
if(defined('ADMIN_FILE')){

$inlineGJS = '<script>
$(window).load(function() {
$(".modalblockedit").colorbox({width:"80%", height:"80%", iframe:true});
});
</script>'."\n";
addJSToHead($inlineGJS,'inline');
}


admin/modules/blocks.php
line 238 inline find:
Code:
'.$admin_file.'.php?op=BlocksEdit&amp;bid='.$bid[$i].'">'._EDIT.'


before
Code:
>'._EDIT.'

add
Code:
class="modalblockedit" rel="blocksedit"


line 639 before the herader.php include add
Code:
define('BLOCKEDITFRAME',true);

and comment out
Code:
GraphicAdmin();

should now look like this
Code:
   define('BLOCKEDITFRAME',true);

   include_once('header.php');
   //GraphicAdmin();


line 931 find:
Code:
Header('Location: '.$admin_file.'.php?op=BlocksAdmin');


change to:
Code:
Header('Location: '.$admin_file.'.php?op=BlocksEdit&bid='.$bid);


should be all done Smile


Image
  

Last edited by GazJ on Mon Apr 11, 2011 6:21 am; edited 1 time in total
Back to top
Guardian






PostPosted: Mon Apr 11, 2011 5:17 am    Post subject: Reply with quote

Nice! I'll try and give it a spin this week Smile
  
Back to top
GazJ






PostPosted: Mon Apr 11, 2011 5:53 am    Post subject: Reply with quote

im sure there is prettier ways to do it but this was a quick mod
  
Back to top
kguske
Site Admin
Site Admin


Joined: May 12, 2005
Posts: 876

PostPosted: Mon Apr 11, 2011 9:02 pm    Post subject: Reply with quote

Nice! Does it work with HTML blocks and your admin stats addon? (we should just let you redesign the RN admin experience!) Is the image 1 of 14 because you have 14 blocks? Wouldn't it be cool to display a link on the block so an admin could maintain it directly from the box?!

We used the silent nukeNAV block for the popups, but your approach of modifying the header to control whether or not to display the themeheader and themefooter is interesting - maybe we could create a standard defined variable for controlling this, and eliminate the silent module...

Yet another cool use for ColorBox...
_________________
  
Back to top
View user's profile Send private message Visit poster's website
GazJ






PostPosted: Tue Apr 12, 2011 4:36 am    Post subject: Reply with quote

the 1 to 14 if the number of blocks set up active and inactive and yes it works for html blocks it does everything it did before just without the theme header and footer wrapping it Smile
i used the gallery option to group the blocks so you can edit one block and quickly switch to the next.

As for the option to edit blocks from the block its self that would be straight forward enough just edit the blocks function in mainfile to output an admin icon before the content of each block and use it to open the dialog.

there is one thing i missed in this how to.
In the show block function the link needs editing there too otherwise theres an edit block link that doesnt use the modal n the header wont show for this 1

i was thinking maybe adding to the link to control it like this

Code:
'.$admin_file.'.php?op=BlocksEdit&amp;bid='.$bid[$i].'&amp;popup=1


that way you decide if its modal or not.

[code]if($popup==1){
define('BLOCKEDITFRAME',true);
}else{
define('BLOCKEDITFRAME',false);
}
  
Back to top
GazJ






PostPosted: Tue Apr 12, 2011 4:40 am    Post subject: Reply with quote

While i think on this maybe the addition of edit in place could be used for on the fly block renaming or editing of html blocks from the index or a module page with maybe a delete button to delete or deactivate them also who knows i have lots of ideas for lots of differnt things lol
  
Back to top
kguske






PostPosted: Tue Apr 12, 2011 10:40 am    Post subject: Reply with quote

There was some work done around drag and drop placement of blocks. And there was also some work done (several years ago) around module-specific or other conditions for controlling whether or not a block is displayed.

Just some food for thought...
  
Back to top
Display posts from previous:       
Post new topic   Reply to topic    nukeSEO.com Forum Index -> PHP-Nuke enhancement ideas All times are GMT - 5 Hours
 
 Page 1 of 1

 

Jump to:   
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001-2008 phpBB Group


Page Generation: 0.05 Seconds