Skip to content
Snippets Groups Projects
Commit 2c005913 authored by Tim Steiner's avatar Tim Steiner
Browse files

More updating to drupal coding standards.

git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x@211 20a16fea-79d4-4915-8869-1ea9d5ebf173
parent 05b5625f
No related branches found
No related tags found
No related merge requests found
<?php
function tac_admin($form, $form_state, $rid = NULL)
{
function tac_admin($form, $form_state, $rid = NULL) {
$vocabularyObjects = taxonomy_get_vocabularies();
$vocabularies = array(-1 => '[Select One]');
foreach ($vocabularyObjects as $vocabularyObject) {
......@@ -51,18 +50,18 @@ function tac_admin($form, $form_state, $rid = NULL)
'view' => array(
'#parents' => array('edit', $rid, $term->tid, 'view'),
'#type' => 'checkbox',
'#default_value' => (isset($currentValues[$rid][$term->tid]->grant_view) ? $currentValues[$rid][$term->tid]->grant_view : 0)
'#default_value' => (isset($currentValues[$rid][$term->tid]->grant_view) ? $currentValues[$rid][$term->tid]->grant_view : 0),
),
'update' => array(
'#parents' => array('edit', $rid, $term->tid, 'update'),
'#type' => 'checkbox',
'#default_value' => (isset($currentValues[$rid][$term->tid]->grant_update) ? $currentValues[$rid][$term->tid]->grant_update : 0)
'#default_value' => (isset($currentValues[$rid][$term->tid]->grant_update) ? $currentValues[$rid][$term->tid]->grant_update : 0),
),
'delete' => array(
'#parents' => array('edit', $rid, $term->tid, 'delete'),
'#type' => 'checkbox',
'#default_value' => (isset($currentValues[$rid][$term->tid]->grant_delete) ? $currentValues[$rid][$term->tid]->grant_delete : 0)
)
'#default_value' => (isset($currentValues[$rid][$term->tid]->grant_delete) ? $currentValues[$rid][$term->tid]->grant_delete : 0),
),
);
}
$form['role' . $rid] = $subform;
......@@ -77,8 +76,7 @@ function tac_admin($form, $form_state, $rid = NULL)
return $form;
}
function theme_tac_term_list($variables)
{
function theme_tac_term_list($variables) {
$form = $variables['form'];
$headers = array('Term', 'View', 'Update', 'Delete');
......@@ -94,11 +92,14 @@ function theme_tac_term_list($variables)
);
}
return theme('table', array('header' => $headers, 'rows' => $rows, 'caption' => $form['#title']));
return theme('table', array(
'header' => $headers,
'rows' => $rows,
'caption' => $form['#title'],
));
}
function tac_admin_submit($form, &$form_state)
{
function tac_admin_submit($form, &$form_state) {
db_delete('tac_map')->execute();
$vocabulary = $form_state['values']['vocabulary'];
......@@ -106,7 +107,8 @@ function tac_admin_submit($form, &$form_state)
variable_set('tac_vocabulary', $vocabulary);
node_access_needs_rebuild(TRUE);
return;
} else if ($vocabulary <= 0) {
}
elseif ($vocabulary <= 0) {
variable_del('tac_vocabulary');
node_access_needs_rebuild(TRUE);
return;
......@@ -117,7 +119,9 @@ function tac_admin_submit($form, &$form_state)
foreach ($form_state['values']['edit'] as $rid => $terms) {
foreach ($terms as $tid => $grants) {
$insert->values(array($rid, $tid, $grants['view'], $grants['update'], $grants['delete']));
$insert->values(array(
$rid, $tid, $grants['view'], $grants['update'], $grants['delete'],
));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment