Ok, well you know when you were a kid and the teacher wrote on your report card, Doesn't fallow written instructions well!, you can add that to this here.
So this is the error you get when you write the code like I did, so I will give an example that might help people like me:
So lets take super_orders_customers_dhtml.php, and go from the original code to the admin profiles code
Original code:
PHP Code:
<?php
$za_contents[] = array('text' => BOX_CUSTOMERS_SUPER_ORDERS, 'link' => zen_href_link(FILENAME_SUPER_ORDERS, '', 'NONSSL'));
$za_contents[] = array('text' => BOX_CUSTOMERS_SUPER_BATCH_STATUS, 'link' => zen_href_link(FILENAME_SUPER_BATCH_STATUS, '', 'NONSSL'));
$za_contents[] = array('text' => BOX_CUSTOMERS_SUPER_BATCH_FORMS, 'link' => zen_href_link(FILENAME_SUPER_BATCH_FORMS, '', 'NONSSL'));
?>
Modified code:
PHP Code:
<?php
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
$options = array( array('box' => BOX_CUSTOMERS_SUPER_ORDERS, 'page' => FILENAME_SUPER_ORDERS),
array('box' => BOX_CUSTOMERS_SUPER_BATCH_STATUS, 'page' => FILENAME_SUPER_BATCH_STATUS),
array('box' => BOX_CUSTOMERS_SUPER_BATCH_FORMS, 'page' => FILENAME_SUPER_BATCH_FORMS),
);
foreach ($options as $key => $value)
if (page_allowed($value['page'])=='true')
$za_contents[] = array('text' => $value['box'], 'link' => zen_href_link($value['page'], '', 'NONSSL'));
?>
I really hope that helps some people out there, I guess we learn from our mistakes, lets just say I am learning a lot!
Bookmarks