Commit f8df0fed authored by webchick's avatar webchick

Issue #1938932 by duellj, andypost, tim.plunkett: Remove...

Issue #1938932 by duellj, andypost, tim.plunkett: Remove taxonomy_overview_terms() and taxonomy_overview_vocabularies()  theme functions in favour of table #type.
parent 62e5dafd
......@@ -237,24 +237,24 @@ function forum_overview($form, &$form_state) {
$vocabulary = taxonomy_vocabulary_load($vid);
$form = taxonomy_overview_terms($form, $form_state, $vocabulary);
foreach (element_children($form) as $key) {
if (isset($form[$key]['#term'])) {
$term = $form[$key]['#term'];
$form[$key]['view']['#href'] = 'forum/' . $term['tid'];
unset($form[$key]['operations']['#links']['delete']);
if (in_array($form[$key]['#term']['tid'], $config->get('containers'))) {
$form[$key]['operations']['#links']['edit']['title'] = t('edit container');
$form[$key]['operations']['#links']['edit']['href'] = 'admin/structure/forum/edit/container/' . $term['tid'];
foreach (element_children($form['terms']) as $key) {
if (isset($form['terms'][$key]['#term'])) {
$term = $form['terms'][$key]['#term'];
$form['terms'][$key]['term']['#href'] = 'forum/' . $term['tid'];
unset($form['terms'][$key]['operations']['#links']['delete']);
if (in_array($form['terms'][$key]['#term']['tid'], $config->get('containers'))) {
$form['terms'][$key]['operations']['#links']['edit']['title'] = t('edit container');
$form['terms'][$key]['operations']['#links']['edit']['href'] = 'admin/structure/forum/edit/container/' . $term['tid'];
// We don't want the redirect from the link so we can redirect the
// delete action.
unset($form[$key]['operations']['#links']['edit']['query']['destination']);
unset($form['terms'][$key]['operations']['#links']['edit']['query']['destination']);
}
else {
$form[$key]['operations']['#links']['edit']['title'] = t('edit forum');
$form[$key]['operations']['#links']['edit']['href'] = 'admin/structure/forum/edit/forum/' . $term['tid'];
$form['terms'][$key]['operations']['#links']['edit']['title'] = t('edit forum');
$form['terms'][$key]['operations']['#links']['edit']['href'] = 'admin/structure/forum/edit/forum/' . $term['tid'];
// We don't want the redirect from the link so we can redirect the
// delete action.
unset($form[$key]['operations']['#links']['edit']['query']['destination']);
unset($form['terms'][$key]['operations']['#links']['edit']['query']['destination']);
}
}
}
......@@ -263,9 +263,8 @@ function forum_overview($form, &$form_state) {
unset($form['actions']['reset_alphabetical']);
// The form needs to have submit and validate handlers set explicitly.
$form['#theme'] = 'taxonomy_overview_terms';
$form['#submit'] = array('taxonomy_overview_terms_submit'); // Use the existing taxonomy overview submit handler.
$form['#empty_text'] = t('No containers or forums available. <a href="@container">Add container</a> or <a href="@forum">Add forum</a>.', array('@container' => url('admin/structure/forum/add/container'), '@forum' => url('admin/structure/forum/add/forum')));
$form['terms']['#empty'] = t('No containers or forums available. <a href="@container">Add container</a> or <a href="@forum">Add forum</a>.', array('@container' => url('admin/structure/forum/add/container'), '@forum' => url('admin/structure/forum/add/forum')));
return $form;
}
......
......@@ -374,18 +374,18 @@ function testTermReorder() {
// term3, term1 by setting weight property, make term3 a child of term2 by
// setting the parent and depth properties, and update all hidden fields.
$edit = array(
'tid:' . $term2->tid . ':0[tid]' => $term2->tid,
'tid:' . $term2->tid . ':0[parent]' => 0,
'tid:' . $term2->tid . ':0[depth]' => 0,
'tid:' . $term2->tid . ':0[weight]' => 0,
'tid:' . $term3->tid . ':0[tid]' => $term3->tid,
'tid:' . $term3->tid . ':0[parent]' => $term2->tid,
'tid:' . $term3->tid . ':0[depth]' => 1,
'tid:' . $term3->tid . ':0[weight]' => 1,
'tid:' . $term1->tid . ':0[tid]' => $term1->tid,
'tid:' . $term1->tid . ':0[parent]' => 0,
'tid:' . $term1->tid . ':0[depth]' => 0,
'tid:' . $term1->tid . ':0[weight]' => 2,
'terms[tid:' . $term2->tid . ':0][term][tid]' => $term2->tid,
'terms[tid:' . $term2->tid . ':0][term][parent]' => 0,
'terms[tid:' . $term2->tid . ':0][term][depth]' => 0,
'terms[tid:' . $term2->tid . ':0][weight]' => 0,
'terms[tid:' . $term3->tid . ':0][term][tid]' => $term3->tid,
'terms[tid:' . $term3->tid . ':0][term][parent]' => $term2->tid,
'terms[tid:' . $term3->tid . ':0][term][depth]' => 1,
'terms[tid:' . $term3->tid . ':0][weight]' => 1,
'terms[tid:' . $term1->tid . ':0][term][tid]' => $term1->tid,
'terms[tid:' . $term1->tid . ':0][term][parent]' => 0,
'terms[tid:' . $term1->tid . ':0][term][depth]' => 0,
'terms[tid:' . $term1->tid . ':0][weight]' => 2,
);
$this->drupalPost(NULL, $edit, t('Save'));
......
......@@ -90,7 +90,7 @@ function testTaxonomyAdminChangingWeights() {
foreach ($vocabularies as $key => $vocabulary) {
$weight = -$vocabulary->weight;
$vocabularies[$key]->weight = $weight;
$edit[$key . '[weight]'] = $weight;
$edit['vocabularies[' . $key . '][weight]'] = $weight;
}
// Saving the new weights via the interface.
$this->drupalPost('admin/structure/taxonomy', $edit, t('Save'));
......
This diff is collapsed.
......@@ -238,12 +238,6 @@ function taxonomy_select_nodes($tid, $pager = TRUE, $limit = FALSE, $order = arr
*/
function taxonomy_theme() {
return array(
'taxonomy_overview_vocabularies' => array(
'render element' => 'form',
),
'taxonomy_overview_terms' => array(
'render element' => 'form',
),
'taxonomy_term' => array(
'render element' => 'elements',
'template' => 'taxonomy-term',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment