[Chameleon] Moving custom widget/skin files'

Paul Spencer pspencer at dmsolutions.ca
Tue Jan 25 08:36:06 EST 2005


Joanne,

final fix that I applied was:

/* case 1 - skin search path relative to app */
         foreach( array_reverse($this->maszSkinSearchPath) as $szPath )
         {
             //echo "searching registered skin path $szPath<BR>\n";
             if ($this->isAbsolutePath($szPath))
             {
                 $szTempPath = $this->resolvePath2( $szFilePath, $szPath );
             }
             else
             {
                 $szTempPath = $this->resolvePath2( $szFilePath, 
$_SESSION['gszAppPath'].'/'.$szPath."/" );
             }
             //echo "resolved search path to $szTempPath<BR>\n";
             clearstatcache();
             if ($szTempPath != "" && file_exists($szTempPath))
             {
                 //echo "found in registered skin: $szTempPath<BR>\n";
                 return $szTempPath;
             }
         }

This resolves the problem with finding the files, but it doesn't 
necessarily work if you are not using the button generator (i.e. if you 
are using the images as the buttons themselves) because the files also 
have to be web-accessible and the application needs to know where to 
find them.

Paul


Paul Spencer wrote:
> Joanne,
> 
> you are absolutely correct.  The way the code is written, it assumes a 
> relative path to the application.  There may be a better way to fix 
> this, I'll have to look more closely at the code, but I will file a bug 
> and a fix tomorrow...
> 
> Cheers
> 
> Paul
> 
> McGraw, Joanne wrote:
> 
>> Hello all,
>>
>>  
>>
>> I have a follow up question to the information provided in the message 
>> at:
>>
>>  
>>
>> http://lists.maptools.org/pipermail/chameleon/2004-June/000955.html
>>
>>  
>>
>> I have established a directory of /ms4w/apps/custom/widgets and 
>> /ms4w/apps/custom/skins, so that I can move our custom widgets and 
>> skins out of the chameleon sub-directory entirely. In the index.phtml 
>> for the application, I have the following two lines of code to 
>> accommodate this:
>>
>>  
>>
>> $oApp->registerSkin('/ms4w/apps/custom/skins/aafc');
>>
>> $oApp->CWCExecute(array('/ms4w/apps/custom/widgets'));
>>
>>  
>>
>> As a result, the custom/widgets are found, but the custom/skins/aafc 
>> are not. I looked at the chameleon.php findFile() function and found 
>> it does not accommodate the occurrence of the skin path being absolute 
>> as the widgets appear to do. Any info why this is the case? That is, 
>> if I just edit the foreach() loop in chameleon.php’s findFile() as 
>> below, it works and I’m wondering if changing that is bad idea.
>>
>>  
>>
>> Cheers,
>>
>> jtm
>>
>>  
>>
>>         foreach( array_reverse($this->maszSkinSearchPath) as $szPath )
>>
>>         {
>>
>>             //echo "searching registered skin path $szPath<BR>\n";
>>
>>             $szTempPath = $this->resolvePath2( $szFilePath, 
>> $_SESSION['gszAppPath'].'/'.$szPath."/" );
>>
>>             //echo "resolved search path to $szTempPath<BR>\n";
>>
>>             clearstatcache();
>>
>>             if ($szTempPath != "" && file_exists($szTempPath))
>>
>>             {
>>
>>                 //echo "found in registered skin: $szTempPath<BR>\n";
>>
>>                 return $szTempPath;
>>
>>             }
>>
>>  
>>
>>             $szTempPath = $this->resolvePath2( $szFilePath, 
>> $szPath."/" );
>>
>>             //echo "resolved search path to $szTempPath<BR>\n";
>>
>>             clearstatcache();
>>
>>             if ($szTempPath != "" && file_exists($szTempPath))
>>
>>             {
>>
>>                 //echo "found in registered skin: $szTempPath<BR>\n";
>>
>>                 return $szTempPath;
>>
>>             }
>>
>>  
>>
>>         }
>>
>>  
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Chameleon mailing list
>> Chameleon at lists.maptools.org
>> http://lists.maptools.org/mailman/listinfo/chameleon
> 
> 

-- 
+-----------------------------------------------------------------+
|Paul Spencer                           pspencer at dmsolutions.ca   |
+-----------------------------------------------------------------+
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/|
+-----------------------------------------------------------------+


More information about the Chameleon mailing list