View Single Post
  #11  
Old 12-07-2016, 03:36 AM
 
Triple A Racing Triple A Racing is offline
 

X-Wizard
  
Join Date: Jul 2008
Location: Manchester UK
Posts: 1,028
 

Default Re: Crisp White Skin in 5.3.* - Custom Modifications?

Quote:
Originally Posted by qualiteam
....If you want to override admin, common and so on, you add them through that decorated getSkins() method, not from getSkins() defined in your Main.php
Ahhhhh Okay. It does work perfectly so far (with the exception of the .less file(s) which is unconnected we think) and that's using the setup we described above, which is the opposite to your last post (!) but obviously, we much prefer to have less processing! So... remove the getSkins() coding from Main.php for these areas and then add it to the 'additional' file? That's what we think you're saying. We'll try it this weekend. An example has been added to the existing additional file coding, shown below for reference.

We did think about that after your initial very helpful post, but we couldn't understand how that would work, as the XC Crisp White Skin Module only uses getSkins() for the 'customer' area only... so we thought it would be limited as such... We don't have any knowledge of the logic rules involved, but we'll alter it and try it this way regardless.
PHP Code:
<?php
// classes/XLite/Module/*.*/*.*/CrispWhiteMain.php

namespace XLite\Module\*.*\*.*;

abstract class 
CrispWhiteMain extends \XLite\Module\XC\CrispWhiteSkin\Main implements \XLite\Base\IDecorator
{
    public static function 
getSkins()
    {
        
$skins parent::getSkins();
        
        
$customCustomerDirectory '*.*' LC_DS 'customer';
        if (isset(
$skins[\XLite::CUSTOMER_INTERFACE])) {
            
// The original theme registers its own directory for the "customer interface",
            // so we should combine ours with that one
            
$directories = (array) $skins[\XLite::CUSTOMER_INTERFACE];
            
$directories[] = $customCustomerDirectory;
            
$skins[\XLite::CUSTOMER_INTERFACE] = $directories;
        } else {
            
// The original theme has no directory for the "customer interface",
            // so we just add our directory to the list
            
$skins[\XLite::CUSTOMER_INTERFACE] = $customCustomerDirectory;
        }

        
Example Addition:
        
$customCustomerDirectory '*.*' LC_DS 'admin';
        
$skins[\XLite::ADMIN_INTERFACE] = $customCustomerDirectory;

        return 
$skins;
    }
}
Quote:
Originally Posted by qualiteam
...I'm waiting a reply from the XC5 dev team on this
No problem. If it's a .less file higher up that is overriding this one and others, then we can add that in, once we understand the logic rules.
__________________
Dev Store & Live Store XC Business 5.4.1.35
Server; Ubuntu 22.04.2 LTS (HWE 6.2.0.26.26 Kernel)) / Plesk Obsidian
Nginx 1.20.4 / Apache 2.4.52 (Ubuntu Backported) / MariaDB 10.11.4 / PHP 7.4.33
Reply With Quote