| 1 |
<?php |
<?php |
| 2 |
// $Id: tac_lite.module,v 1.9 2008/07/22 15:55:23 yogadex Exp $ |
// $Id: tac_lite.module,v 1.9.2.1 2008/12/08 18:36:42 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. |
| 255 |
), |
), |
| 256 |
); |
); |
| 257 |
break; |
break; |
| 258 |
|
|
| 259 |
case 'form': |
case 'form': |
| 260 |
if ($category == 'tac_lite') { |
$vocabularies = taxonomy_get_vocabularies(); |
| 261 |
$vids = variable_get('tac_lite_categories', null); |
if ($category == 'tac_lite') { |
| 262 |
if (count($vids)) { |
$vids = variable_get('tac_lite_categories', null); |
| 263 |
|
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 |
if ($config['name']) { |
if ($config['name']) { |
| 270 |
'#description' => t('This scheme includes permissions %perms', |
'#description' => t('This scheme includes permissions %perms', |
| 271 |
array('%perms' => implode(' and ', $config['perms']))), |
array('%perms' => implode(' and ', $config['perms']))), |
| 272 |
'#tree' => TRUE, |
'#tree' => TRUE, |
| 273 |
); |
); |
| 274 |
foreach ($vids as $vid) { |
foreach ($vids as $vid) { |
| 275 |
$v = taxonomy_get_vocabularies($vid); |
$v = $vocabularies[$vid]; |
| 276 |
$form['tac_lite'][$config['realm']][$vid] = |
$form['tac_lite'][$config['realm']][$vid] = |
| 277 |
_taxonomy_term_select($v->name, |
_taxonomy_term_select($v->name, |
| 278 |
null, // name no longer used in new form api |
null, // name no longer used in new form api |
| 279 |
$account->tac_lite[$vid], |
isset($account->tac_lite) ? $account->tac_lite[$vid] : NULL, |
| 280 |
$vid, |
$vid, |
| 281 |
'', |
'', |
| 282 |
true, |
true, |
| 289 |
'#value' => '<p>' . t('You may grant this user access based on the schemes and terms below. These permissions are in addition to <a href="!url">role based grants on scheme settings pages</a>.', |
'#value' => '<p>' . t('You may grant this user access based on the schemes and terms below. These permissions are in addition to <a href="!url">role based grants on scheme settings pages</a>.', |
| 290 |
array('!url' => url('admin/user/access/tac_lite/scheme_1'))) . "</p>\n", |
array('!url' => url('admin/user/access/tac_lite/scheme_1'))) . "</p>\n", |
| 291 |
'#weight' => -1); |
'#weight' => -1); |
| 292 |
|
|
| 293 |
return $form; |
return $form; |
| 294 |
} |
} |
| 295 |
} |
} |
| 296 |
break; |
break; |
| 297 |
case 'validate': |
case 'validate': |
| 298 |
//print_r($edit); |
//print_r($edit); |
| 299 |
//print_r($account); |
//print_r($account); |