Closed (fixed)
Project:
Modal Frame Contrib Package
Version:
6.x-1.0
Component:
New module
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
1 Oct 2010 at 06:25 UTC
Updated:
4 Oct 2010 at 18:50 UTC
I am creating a new module that is modeled off the Modal Fame Blocks contrib module. I want to change the function that was included with the blocks module so that the parent script of my new module is loaded on the parent page, and the child script is loaded on the child page. Below is the function that I am using as the model:
function modalframe_blocks_init() {
if (!empty($_COOKIE['has_js'])) {
if (preg_match('`^admin/build/block(?:/(?:list(?:/(?:[_a-z0-9]+)?)?)?)?$`', $_GET['q'])) {
modalframe_blocks_add_js('parent');
}
elseif (preg_match('`^admin/build/block/(?:configure/|delete/|add).*$`', $_GET['q'])) {
modalframe_blocks_add_js('child');
}
}
}
My modified function is below in a new module called modalframe_whoareyou2. I want the parent script to load on every page except the page ../content/who-are-you . The script is not working though.
function modalframe_whoareyou2_init() {
if (!empty($_COOKIE['has_js'])) {
if (preg_match('`^content/.*$`', $_GET['q'])) {
modalframe_whoareyou2_add_js('parent');
}
elseif (preg_match('`^content/who-are-you.*$`', $_GET['q'])) {
modalframe_whoareyou2_add_js('child');
}
}
}
Any thoughts on what is wrong with my script would be greatly appreciated. Been spending days on this and just getting my head around building modules and PHP...
Comments
Comment #1
burnbright commentedFor anyone who is interested, I ended up going about it this way:
Did the trick...