[horde] Modifying files -- best practice?

Jan Schneider jan at horde.org
Wed Aug 27 06:54:01 UTC 2014


Zitat von Michael M Slusarz <slusarz at horde.org>:

> Quoting Tim Streit <ledoktre at meanie.us>:
>
>> I'm just going through and doing some themeing, and I'm wondering  
>> what is best practice to customize some files.
>>
>> -Themes -- no prob.  Create a new theme.
>> -Templates -- ??   For example, most files are using PNG files, I'd  
>> rather use SVG - personal preference.  I can modify some files to  
>> use this, but I assume next update will undo my work.
>
> Templates (i.e. the View in MVC) are, in general, are a difficult  
> thing to abstract. You are correct that you need to make sure to  
> make backup copies of your templates when/if you upgrade.

That being said, you can use the 'templates' setting in  
registry.local.php to point to a different folder, symlink unchanged  
templates to there, and replace the ones you modify with real files.
Obviously you need to keep a close look at template changes that you  
might have to apply to your versions after updates. But at least your  
changes aren't overwritten on updates.

Changing all the code to use SVG instead of PNG sounds like a bad idea  
though, just for personal preference.

>> -/imp/lib/Flag/Imap# vim Deleted.php  -  this is an example of  
>> something small-- I want to change the color of an email marked as  
>> deleted.
>
> You are correct - this is the only place to change this.  Probably  
> need to abstract this better in the future with something like a CSS  
> class name ... although part of me says the reason I did it this way  
> is because it was not easy to do this via CSS.  (Not looking at the  
> code at the moment, so can't provide more insight than that.)

But you can override this in the prefs, so you add some  
imp/config/prefs.d/ file to your theme pack.

> For the record - if doing many changes in Horde, it is probably  
> easier to use git instead of installing via packages.  Git will  
> typically handle most merges/updates without conflict, so it  
> provides a way of using the base files without having to make copies.
>
>> I know on config files, we insert '.local' into the name and put  
>> the changes there, and it works.  Is this the same for ALL php files?
>
> No.  This is not a general PHP thing - it is a Horde config file thing.
>
> michael
>
> ___________________________________
> Michael Slusarz [slusarz at horde.org]



-- 
Jan Schneider
The Horde Project
http://www.horde.org/
https://www.facebook.com/hordeproject



More information about the horde mailing list