Sophie

Sophie

distrib > Mageia > 7 > i586 > by-pkgid > 4e237fd705495e1e21ef20696443e053 > files > 1098

bugzilla-5.0.4-3.mga7.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <title>
Bugzilla::User::Setting</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <link rel="stylesheet" title="style" type="text/css" href="../.././../../../../style.css" media="all" >

</head>
  <body id="pod">
<p class="backlinktop"><b><a name="___top" href="../../index.html" accesskey="1" title="All Documents">&lt;&lt;</a></b></p>
<h1>Bugzilla::User::Setting</h1>
<div class='indexgroup'>
<ul   class='indexList indexList1'>
  <li class='indexItem indexItem1'><a href='#NAME'>NAME</a>
  <li class='indexItem indexItem1'><a href='#SYNOPSIS'>SYNOPSIS</a>
  <li class='indexItem indexItem1'><a href='#DESCRIPTION'>DESCRIPTION</a>
  <li class='indexItem indexItem1'><a href='#CLASS_FUNCTIONS'>CLASS FUNCTIONS</a>
  <li class='indexItem indexItem1'><a href='#METHODS'>METHODS</a>
</ul>
</div>

<h1><a class='u' href='#___top' title='click to go to top of document'
name="NAME"
>NAME</a></h1>

<p>Bugzilla::User::Setting - Object for a user preference setting</p>

<h1><a class='u' href='#___top' title='click to go to top of document'
name="SYNOPSIS"
>SYNOPSIS</a></h1>

<p>Setting.pm creates a setting object,
which is a hash containing the user preference information for a single preference for a single user.
These are usually accessed through the &#34;settings&#34; object of a user,
and not directly.</p>

<h1><a class='u' href='#___top' title='click to go to top of document'
name="DESCRIPTION"
>DESCRIPTION</a></h1>

<p>use Bugzilla::User::Setting; my $settings;</p>

<p>$settings-&#62;{$setting_name} = new Bugzilla::User::Setting( $setting_name,
$user_id);</p>

<p>OR</p>

<p>$settings-&#62;{$setting_name} = new Bugzilla::User::Setting( $setting_name,
$user_id,
$is_enabled,
$default_value,
$value,
$is_default);</p>

<h1><a class='u' href='#___top' title='click to go to top of document'
name="CLASS_FUNCTIONS"
>CLASS FUNCTIONS</a></h1>

<dl>
<dt><a name="add_setting($name,_\@values,_$default_value,_$subclass,_$force_check)"
><code  class="code">add_setting($name,
\@values,
$default_value,
$subclass,
$force_check)</code></a></dt>

<dd>
<p>Description: Checks for the existence of a setting,
and adds it to the database if it does not yet exist.</p>

<p>Params: <code  class="code">$name</code> - string - the name of the new setting <code  class="code">$values</code> - arrayref - contains the new choices for the new Setting.
<code  class="code">$default_value</code> - string - the site default <code  class="code">$subclass</code> - string - name of the module returning the list of valid values.
This means legal values are not stored in the DB.
<code  class="code">$force_check</code> - boolean - when true,
the existing setting and all its values are deleted and replaced by new data.</p>

<p>Returns: a pointer to a hash of settings</p>

<dt><a name="get_all_settings($user_id)"
><code  class="code">get_all_settings($user_id)</code></a></dt>

<dd>
<p>Description: Provides the user&#39;s choices for each setting in the system; if the user has made no choice,
uses the site default instead.
Params: <code  class="code">$user_id</code> - integer - the user id.
Returns: a pointer to a hash of settings</p>

<dt><a name="get_defaults($user_id)"
><code  class="code">get_defaults($user_id)</code></a></dt>

<dd>
<p>Description: When a user is not logged in,
they must use the site defaults for every settings; this subroutine provides them.
Params: <code  class="code">$user_id</code> (optional) - integer - the user id.
Note that this optional parameter is mainly for internal use only.
Returns: A pointer to a hash of settings.
If $user_id was passed,
set the user_id value for each setting.</p>

<dt><a name="set_default($setting_name,_$default_value,_$is_enabled)"
><code  class="code">set_default($setting_name,
$default_value,
$is_enabled)</code></a></dt>

<dd>
<p>Description: Sets the global default for a given setting.
Also sets whether users are allowed to choose their own value for this setting,
or if they must use the global default.
Params: <code  class="code">$setting_name</code> - string - the name of the setting <code  class="code">$default_value</code> - string - the new default value for this setting <code  class="code">$is_enabled</code> - boolean - if false,
all users must use the global default Returns: nothing</p>

<dt><a name="clear_settings_cache($user_id)"
><code  class="code">clear_settings_cache($user_id)</code></a></dt>

<dd>
<p>Description: Clears cached settings data for the specified user.
Must be called after updating any user&#39;s setting.
Params: <code  class="code">$user_id</code> - integer - the user id.
Returns: nothing</p>
</dd>
</dl>

<h1><a class='u' href='#___top' title='click to go to top of document'
name="METHODS"
>METHODS</a></h1>

<dl>
<dt><a name="legal_values($setting_name)"
><code  class="code">legal_values($setting_name)</code></a></dt>

<dd>
<p>Description: Returns all legal values for this setting Params: none Returns: A reference to an array containing all legal values</p>

<dt><a name="validate_value"
><code  class="code">validate_value</code></a></dt>

<dd>
<p>Description: Determines whether a value is valid for the setting by checking against the list of legal values.
Untaints the parameter if the value is indeed valid,
and throws a setting_value_invalid code error if not.
Params: An lvalue containing a candidate for a setting value Returns: nothing</p>

<dt><a name="reset_to_default"
><code  class="code">reset_to_default</code></a></dt>

<dd>
<p>Description: If a user chooses to use the global default for a given setting,
their saved entry is removed from the database via this subroutine.
Params: none Returns: nothing</p>

<dt><a name="set($value)"
><code  class="code">set($value)</code></a></dt>

<dd>
<p>Description: If a user chooses to use their own value rather than the global value for a given setting,
OR changes their value for a given setting,
this subroutine is called to insert or update the database as appropriate.
Params: <code  class="code">$value</code> - string - the new value for this setting for this user.
Returns: nothing</p>
</dd>
</dl>
<p class="backlinkbottom"><b><a name="___bottom" href="../../index.html" title="All Documents">&lt;&lt;</a></b></p>

<!-- end doc -->

</body></html>