[horde] Include custom preferences

Michael Rubinsky mrubinsk at horde.org
Sat Jul 26 15:47:57 UTC 2008


Quoting Juan Asensio Sánchez <okelet at gmail.com>:

> Ok
>
> It was that. Thank you very much.
>
> I know this is more a question about PHP than Horde, but why?
> require_once works equal than require except that "once" does not load
> the file if it was loaded previosly.

Exactly. The prefs files are loaded in multiple places, and in  
different scopes.


  And one more question, why does
> require_once work in the rest of the modules?


It all depends on the context.  For example, you can't reload files  
that define classes.





>
> Thanks in advance.
>
> 2008/7/26 Jan Schneider <jan at horde.org>:
>> Zitat von Juan Asensio Sánchez <okelet at gmail.com>:
>>
>>> Hi
>>>
>>> I am trying to configure Horde. Now i want to set some default values
>>> for the users that are different from the default values defined in
>>> the Horde prefs.php file. I don' want to modify this file, so i
>>> created a new file called prefs_custom.php
>>> (horde/config/prefs_custom.php) with this content:
>>>
>>> ==========================================
>>>
>>> <?php
>>>
>>> // user language
>>> $_prefs['language']['value'] = 'es_ES';
>>>
>>> // user time zone
>>> $_prefs['timezone']['value'] = 'Europe/Madrid';
>>>
>>> // time format
>>> $_prefs['twentyFour']['value'] = true;
>>>
>>> // date format
>>> $_prefs['date_format']['value'] = '%A, %d %B %Y';
>>>
>>> // what day should be displayed as the first day of the week?
>>> $_prefs['first_week_day']['value'] = 1;
>>>
>>> ==========================================
>>>
>>> And at the end of prefs.php i added this line (in horde/config/prefs.php):
>>>
>>> require_once(dirname(__FILE__) . '/prefs_custom.php');
>>>
>>> The problem is that Horde does not recognise these new values. When I
>>> go to the preferences page, the values are the Horde defaults, NOT my
>>> defaults (i have even recreated the database, tried in many browsers,
>>> OSs, etc). I have done the same thing with the rest of the modules and
>>> there it works fine. The problem is only with the default general
>>> Horde prefs.
>>
>> Use "require", not "require_once".
>>
>> Jan.
>>
>> --
>> Do you need professional PHP or Horde consulting?
>> http://horde.org/consulting/
>>
>> --
>> Horde mailing list - Join the hunt: http://horde.org/bounties/#horde
>> Frequently Asked Questions: http://horde.org/faq/
>> To unsubscribe, mail: horde-unsubscribe at lists.horde.org
>>
> --
> Horde mailing list - Join the hunt: http://horde.org/bounties/#horde
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: horde-unsubscribe at lists.horde.org
>



Thanks,
mike

--
The Horde Project (www.horde.org)
mrubinsk at horde.org

"Time just hates me. That's why it made me an adult." - Josh Joplin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: PGP Digital Signature
URL: <http://lists.horde.org/archives/horde/attachments/20080726/53149d05/attachment.bin>


More information about the horde mailing list