| 1 |
As long as the UI module is not completed, User Display API can be configured
|
| 2 |
by adding user display style definitions and classes to <code>settings.php</code>.
|
| 3 |
|
| 4 |
<strong>Structure and concept for user display styles:</strong>
|
| 5 |
<pre>
|
| 6 |
$conf = array(
|
| 7 |
'user_display_styles' => array(
|
| 8 |
1 => array(
|
| 9 |
'name' => 'Picture only (medium)',
|
| 10 |
'elements' => array(
|
| 11 |
array('user_display_imagecache', array('user_medium')),
|
| 12 |
array('user_display_onlinestatus'),
|
| 13 |
array('user_display_links'),
|
| 14 |
),
|
| 15 |
),
|
| 16 |
),
|
| 17 |
);
|
| 18 |
</pre>
|
| 19 |
<ul>
|
| 20 |
<li>User display styles are needed on almost every page, thus using variables.</li>
|
| 21 |
<li>Styles must have ids to assign classes to them, thus the first assoc array.</li>
|
| 22 |
<li>Names for styles are cosmetical and solely used in the UI module.</li>
|
| 23 |
<li>Style elements can be ordered / re-arranged through the UI module, to render
|
| 24 |
a user's name in front of a user's image aso.</li>
|
| 25 |
<li>First array value of an element is the name of a function to invoke. Second
|
| 26 |
array value optionally contains an array of additional function arguments.
|
| 27 |
In above example, this is the ImageCache preset to use for the display style.</li>
|
| 28 |
<li>The first two arguments to each element function are always <code>$account</code> and <code>$style</code>.</li>
|
| 29 |
</ul>
|
| 30 |
|
| 31 |
<strong>Structure and concept for user display styles:</strong>
|
| 32 |
<pre>
|
| 33 |
$conf = array(
|
| 34 |
'user_display_classes' => array(
|
| 35 |
'node_story_teaser_submitted' => 1,
|
| 36 |
'user_block_online' => 1,
|
| 37 |
),
|
| 38 |
);
|
| 39 |
</pre>
|
| 40 |
<ul>
|
| 41 |
<li>This variable contains only those user display classes that have been assigned
|
| 42 |
to user display styles.</li>
|
| 43 |
<li>The value of each class references a user display style id.</li>
|
| 44 |
</ul>
|