Re: Theme pages

Rivanna Web Works <[email protected]> Wed, 27 Nov 2002 13:20:42 -0500
Newsgroups gmane.comp.cms.xaraya.ui
Message-ID <[email protected]>
>
>
>>>So the master template can be used for all user pages whereas the admin
>>>template can be used for all admin pages.
>>>
>>>      
>>>
>> /themes/theme_name/pages/admin.pnt
>>will be used as the Master Template for the admin side of modules?
>>    
>>
>
>Yes, as of a couple of weeks ago, you can have a seperate UI for the admin
>area.  The idea is that some templates will not translate well with the user
>template, as well as having a seperate block set for the admin (for
>documentation that we can push, listing of new modules, etc).
>
>Right now I have not made a seperate for the admin, because I am waiting on
>someone a little better at design than myself to work on it:)
>
>  
>
 
I tried 
/themes/theme_name/pages/admin.pnt
and it did not work...so I went hunting...


in includes/pnTemplate.php:

function pnTpl_renderPage($mainModuleOutput, $otherModulesOutput = NULL, 
$pageName = NULL)
{
    global $pnTpl_themeDir;

    if (empty($pageName)) {
        $pageName = 'default';
    }
    // Grab module Type Whether admin or user.
    $modType = pnVarCleanUntrusted(pnRequestGetVar('type'));
    if (empty($modType)) {
        $modType = 'user';
    }
    // Override all admin modules types to is pages/admin exist.
    // TODO --> Allow master admin template.
    if($modType == 'admin'){
        $pageName = pnVarPrepForOS($pageName);
        $sourceFileName = "$pnTpl_themeDir/admin/$pageName.pnt";
        if (!file_exists($sourceFileName)) {
            // Revert to main theme
            $pageName = pnVarPrepForOS($pageName);
            $sourceFileName = "$pnTpl_themeDir/pages/$pageName.pnt";
        }
    } else {
        $pageName = pnVarPrepForOS($pageName);
        $sourceFileName = "$pnTpl_themeDir/pages/$pageName.pnt";
    }

    $tplData = array('_bl_mainModuleOutput' => $mainModuleOutput);

    return pnTpl__executeFromFile($sourceFileName, $tplData);
}



means that

/themes/theme_name/admin/default.pnt
should be the Master Template for the admin side of modules.  
I tested this and appears to work.

Is this what is wanted?
to have 
/themes/theme_name/pages/default.pnt
for the user side

/themes/theme_name/admin/default.pnt
for the admin side?

seems to be more directories than necessary.

why not 

/themes/theme_name/pages/default.pnt
for the user side

/themes/theme_name/pages/admin.pnt
for the admin side?
if so, change

if($modType == 'admin'){
        $pageName = pnVarPrepForOS($pageName);
        $sourceFileName = "$pnTpl_themeDir/admin/$pageName.pnt";

to

if($modType == 'admin'){
        $pageName = pnVarPrepForOS($pageName);
        $sourceFileName = "$pnTpl_themeDir/pages/$modType.pnt";


rivanna