This topic is locked
[SOLVED]

 Possibility for GreyBox in a future release?

8/20/2007 12:07:06 AM
PHPRunner General questions
F
fsteves author

EDITED FOR BETTER INSTRUCTION:
Okay, sorry for the lack of instruction.
First, you want to download the Greybox from their main site @ http://orangoo.com/labs/GreyBox/
Next, unzip the package and take the folder named 'greybox' and place it in your site root (This is the folder INSIDE of the package).
Now, at the top of your include/header.php file, include the following between your head tags:

<script type="text/javascript">

var GB_ROOT_DIR = "./greybox/";

</script>
&lt;script type="text/javascript" src="greybox/AJS.js"></script>

&lt;script type="text/javascript" src="greybox/AJS_fx.js"></script>

&lt;script type="text/javascript" src="greybox/gb_scripts.js"></script>

<link href="greybox/gb_styles.css" rel="stylesheet" type="text/css" media="all" />


Now, open up greybox/gb_script.js, and add the following to the very top or bottom, and save it:

function reloadParentOnClose(){

window.top.location.href="?return=a";

}


Now, go into PHPRunner, and open up the Visual Editor tab.

Once there, Click and Select your Add New button, and click the HTML Mode button at the top of the visual editor window to reveal the source code of your project.

Now, the following is how you invoke it:

// FOR BUTTONS

// Find the following code:

// <input class=button type=button value="{mlang_message tag="ADD_NEW"}" onclick="window.location.href='table_info_add.php'">

// Now, remove the old onclick event and replace it with the following below, making sure to match it to your project

onclick="return GB_showPage('Add Event', '../table_info_add.php',reloadParentOnClose)"

// and you will get this:

<input class=button type=button value="{mlang_message tag="ADD_NEW"} onclick="return GB_showPage('Add Event', '../table_info_add.php',reloadParentOnClose)">



Regular links are a little different, but do it generally the same way. Using Javascript you can reference the 'href' statement:

// FOR VIEW AND EDIT LINKS

// Find the following code:

// <A href="evac_events_edit.php?{$row.1editlink}">

// add the following to the end:

onclick="return GB_showPage('Edit User', this.href, reloadParentOnClose)">

// and you will get this:

<A href="evac_events_edit.php?{$row.1editlink} onclick="return GB_showPage('Edit User', this.href, reloadParentOnClose)">


There are many ways to display using Greybox, so make sure you check out the examples @ http://orangoo.com/labs/greybox/advance_usage.html
Also, for custom usage and other ways to use it, such as with POST's or Form events, check their Google Groups discussion, there is a plethora if information there. I hope to see some implementation of this in the future!

A
asimha 8/20/2007

Hello Clarity, this is very interesting, I have also been trying to implement Greybox or Slimbox without success ...
Would you care to share a little more on how you achieved this?
Many thanks

Andre

F
fsteves author 8/20/2007

I modified my original post to include better instruction, hope it helps!

A
asimha 8/20/2007

I modified my original post to include better instruction, hope it helps!


Thanks Clarity this is really very helpful, but how would you go about using it only to display picture links (i.e instead of the standard "new window") using gb_showimage?

Andre

J
Jean 8/20/2007

Thanks Clarity !
Did you find anything with Adv. Search too ? I didn't succeed.
And, closing greybox in the Add module, FF or IE7 ask both a confirmation to post again. Have you find a way to avoid this message ?

F
fsteves author 8/20/2007

And, closing greybox in the Add module, FF or IE7 ask both a confirmation to post again. Have you find a way to avoid this message ?


Not yet.

F
francesco 8/23/2007

Hi Clarity
This is one of best code hint never added in this site.

Great tutorial for great function.

Integration of graybox in PHPRunner is a MUST.
Thanks again for sharing this feature.
For admin:
According to me this post should be added in Tips Topic, it's great.

What about integration of graybox in next PHPrunner release?

F
fsteves author 8/23/2007

Also, there is a small issue with IE, the DIV expands beyond the browers window, so you will need to edit gb_styles.css and change the following:

.GB_header table {

margin: 0;

width: 100%;

border-collapse: collapse;

}


Change the 100% to 96%:

.GB_header table {

margin: 0;

width: 96%;

border-collapse: collapse;

}
F
fsteves author 8/23/2007

I modified the top part, but I did find a fix to the POSTDATA annoyance, which goes along with what PHPRunner itself does to alleviate the problem:

function reloadParentOnClose(){

window.top.location.href="?return=a";

}