Re: How do I set up forced_prefs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Tomas,

thank you very much for replying.

>> Though as I understand, forced_prefs plugin has to be configured by
>> editing config.php. The sample contains just options for time settings,
>> how do I set all other settings?
>> That is my prior question. By reading Tomas' post, even more questions
>> arose:
>>
>>> Forced prefs plugin is most useful with option widgets. Widgets are
>>> standard SquirrelMail 1.2.0+ options. Admin sets options in
>>
>> Where are the widgets and how do I use them for what?
>
> SquirrelMail plugins can use different methods to add options to option
> page. Forced Prefs plugin can always add settings, but it has to use
> different ways to control display of these options to end user.
>
>
> * 1st method. optpage_loadhook_* hooks
> Plugin sets information about used preferences. SquirrelMail displays them
> with standard option generation code. Code uses SquirrelMail Option class
> functions. Plugins don't care about display of their options to end user.
> This is what I call widgets.

Slightly offtopic here, sorry:
I always thought of a "widget" as nice a little graphical Desktop/Opera
ornament, showing the latest weather forecast or something. Quoted from
Wikipedia, a widget can be "a component of a graphical user interface
that the user interacts with" too. Different, too? But discussing about
a definition is circumstantial, I just want to understand.

> Forced Prefs plugin can control display of these options to end user. If
> option is listed in $fp_forced_settings, it will be hidden from end user.
> Controls are simple. If you want to add setting, you set it in
> $fp_added_settings. If you want to set default value and hide setting from
> end user, set it in $fp_forced_settings.

That is what I'd need. I do not use many plugins here - the system
shall be quick, easy and simple, because it's to be used by kids.
So I am going to hide many options.
What are $fp_forced_settings and $fp_added_settings---ok found them,
those arrays in config.php...

> * 2nd method. options_*_inside hooks
> Plugin creates html code with appropriate form fields. Forced prefs plugin
> don't control html output of other plugins. You can only disable plugin
> hooks with $fp_disabled_hooks option. name of hook function can be found
> by checking plugins setup.php file. For example
>
> plugins/fortune/setup.php
> ...
> function squirrelmail_plugin_init_fortune() {
> ...
> $squirrelmail_plugin_hooks['options_display_inside']['fortune'] =
> 'fortune_options';
> ...
>
> 'fortune_options' is hooked function. It can be added to
> $fp_disabled_hooks array.
>
> $fp_disabled_hooks = array('fortune_options','abook_take_options');
>
>
> * 3rd method. optpage_register_block hook
> Plugin sets information about own option block. If it is not
> advanced_settings plugin, forced_prefs plugin can't control settings
> displayed to end user. You can only remove option block with
> $fp_disabled_hooks or $fp_removed_optpage_urls settings.
>
>
> 4th method. options_link_and_description hook
> Plugin creates html box with option block. forced_prefs plugin can't
> control settings displayed to end user. You can only remove option block
> with $fp_disabled_hooks.
>
>
>
> If you want to add settings, use $fp_added_settings and don't worry about
> other things. If you want to enforce settings, use $fp_forced_settings and
> start worrying only when settings in $fp_forced_settings are not hidden
>> from end user.
>
>>> $fp_added_settings or fp_forced_settings and settings are applied to end
>>> user preferences. Both arrays use option names from .pref files for
>>> array keys and .pref values for key values.
>>
>> Are the $..... things some sort of variables that I can set somewhere?
>> Sorry, I don't understand that.
>
> http://www.squirrelmail.org/docs/admin/admin-5.html#ss5.5

Please correct me if I'm wrong:

To find out the exact options to enter in $fp_forced_settings and
$fp_added_settings in forced_prefs/config.php, I have to follow this
instruction, and then insert the parameters into the arrays, paying
maximum attention to the syntax.

Well okay, I hope I'll tackle that.

> default_pref and .pref files store lines in 'option_name=option_value'
> format.
>
> Same settings can be converted to forced prefs format.
>
> If you have
> ---
> hour_format=1
> show_num=20
> option_name=option_value
> ---
>
> It can be added to forced_prefs in forced_prefs plugin configuration as
> ---
> $fp_added_settings = array(
>    'hour_format'   => '1',
>    'show_num'      => '20',
>    'option_name'   => 'option_value'
> );
> ---
> or
> ---
> $fp_added_settings['hour_format'] = '1';
> $fp_added_settings['show_num'] = '20';
> $fp_added_settings['option_name'] = 'option_value';
> ---
>

Thanks again. I'll get on it tomorrow. I am curious.

Yours, Gregor



PS: What should happen if I open "setup.php" from a browser? Nothing
correct? I tried because I was hoping I overlooked something obvious,
like an included configuration tool. ;-)


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
--
squirrelmail-users mailing list
Posting Guidelines: http://www.squirrelmail.org/wiki/MailingListPostingGuidelines
List Address: squirrelmail-users@xxxxxxxxxxxxxxxxxxxxx
List Archives: http://news.gmane.org/thread.php?group=gmane.mail.squirrelmail.user
List Archives:  http://sourceforge.net/mailarchive/forum.php?forum_id=2995
List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-users

[Index of Archives]     [Video For Linux]     [Yosemite News]     [Yosemite Photos]     [gtk]     [KDE]     [Cyrus SASL]     [Gimp on Windows]     [Steve's Art]     [Webcams]

  Powered by Linux