Framework and sym-links
I have been developing some reusable modules, but my admin pages could be shared as well. The only difference between the two is the connection script and the template.
When I create in domain2.com a link to domain1.com/modules_shared
ln -s /var/www/html/domain1.com/modules_shared modules_shared
It works fine, but if I use the same code for the admin directory:
ln -s /var/www/html/domain1.com/admin admin
It pulls the template file from domain1.com. This has to do with the framework code.
It appears to me that if you change the following code:
if("" == ""){
$WA_admin_1_Content_Empty = "";
$WA_admin_1_Content = new WA_Include(__FILE__);
$WA_admin_1_Template = new WA_Include("../Templates{$WA_admin_1_Content_Empty}/admin.dwt.php");
require($WA_admin_1_Template->BaseName);
$WA_admin_1_Template->Initialize(true);
}
to
if("" == ""){
$WA_admin_1_Content_Empty = "";
$WA_admin_1_Content = new WA_Include(__FILE__);
$WA_admin_1_Template = new WA_Include($_SERVER['DOCUMENT_ROOT']."/Templates{$WA_admin_1_Content_Empty}/admin.dwt.php");
require($WA_admin_1_Template->BaseName);
$WA_admin_1_Template->Initialize(true);
}
Of course, you would want to account for people building their site in a subdirectory who are not trying to do something like this, but in that case, you can generate the code to be:
if("" == ""){
$WA_admin_1_Content_Empty = "";
$WA_admin_1_Content = new WA_Include(__FILE__);
$WA_admin_1_Template = new WA_Include($_SERVER['DOCUMENT_ROOT']."/subdir/Templates{$WA_admin_1_Content_Empty}/admin.dwt.php");
require($WA_admin_1_Template->BaseName);
$WA_admin_1_Template->Initialize(true);
}
or if that is not practical, offer a check box for document or root relative link to the theme.
Thanx
Steven