| 1 |
<?php |
<?php |
| 2 |
// $Id: tac_lite.module,v 1.9.2.2 2008/12/08 18:40:45 yogadex Exp $ |
// $Id: tac_lite.module,v 1.9.2.3 2008/12/09 19:47:53 yogadex Exp $ |
| 3 |
/** |
/** |
| 4 |
* @file |
* @file |
| 5 |
* Control access to site content based on taxonomy, roles and users. |
* Control access to site content based on taxonomy, roles and users. |
| 263 |
if (count($vids)) { |
if (count($vids)) { |
| 264 |
for ($i = 1; $i <= variable_get('tac_lite_schemes', 1); $i++) { |
for ($i = 1; $i <= variable_get('tac_lite_schemes', 1); $i++) { |
| 265 |
$config = _tac_lite_config($i); |
$config = _tac_lite_config($i); |
| 266 |
|
$terms = isset($account->$config['realm']) ? $account->$config['realm'] : array(); |
| 267 |
if ($config['name']) { |
if ($config['name']) { |
| 268 |
$form['tac_lite'][$config['realm']] = |
$form['tac_lite'][$config['realm']] = |
| 269 |
array('#type' => 'fieldset', |
array('#type' => 'fieldset', |
| 271 |
'#description' => t('This scheme includes permissions %perms', |
'#description' => t('This scheme includes permissions %perms', |
| 272 |
array('%perms' => implode(' and ', $config['perms']))), |
array('%perms' => implode(' and ', $config['perms']))), |
| 273 |
'#tree' => TRUE, |
'#tree' => TRUE, |
| 274 |
); |
); |
| 275 |
foreach ($vids as $vid) { |
foreach ($vids as $vid) { |
| 276 |
$v = $vocabularies[$vid]; |
$v = $vocabularies[$vid]; |
| 277 |
$form['tac_lite'][$config['realm']][$vid] = |
$form['tac_lite'][$config['realm']][$vid] = |
| 278 |
_taxonomy_term_select($v->name, |
_taxonomy_term_select($v->name, |
| 279 |
null, // name no longer used in new form api |
null, // name no longer used in new form api |
| 280 |
isset($account->tac_lite) ? $account->tac_lite[$vid] : NULL, |
isset($terms[$vid]) ? $terms[$vid] : NULL, |
| 281 |
$vid, |
$vid, |
| 282 |
'', |
'', |
| 283 |
true, |
true, |