/[drupal]/contributions/modules/weblinks/weblinks.taxonomy.inc
ViewVC logotype

Diff of /contributions/modules/weblinks/weblinks.taxonomy.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.3.2.1, Wed Jul 30 18:36:01 2008 UTC revision 1.3.2.2, Fri Aug 1 02:59:22 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: weblinks.taxonomy.inc,v 1.3 2008/07/29 02:22:45 rmiddle Exp $  // $Id: weblinks.taxonomy.inc,v 1.3.2.1 2008/07/30 18:36:01 nancyw Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 45  function weblinks_form_container($form_s Line 45  function weblinks_form_container($form_s
45    $form['vid'] = array('#type' => 'hidden', '#value' => $vocid);    $form['vid'] = array('#type' => 'hidden', '#value' => $vocid);
46    $form['submit'] = array('#type' => 'submit', '#value' => t('Save'));    $form['submit'] = array('#type' => 'submit', '#value' => t('Save'));
47    if ($tid) {    if ($tid) {
48      $form['delete'] = array('#type' => 'submit', '#value' => t('Delete'));      $form['delete'] = array('#type' => 'submit', '#value' => t('Delete'),     '#submit' => array('weblinks_form_container_submit_delete'));
49      $form['tid'] = array('#type' => 'hidden', '#value' => $tid);      $form['tid'] = array('#type' => 'hidden', '#value' => $tid);
50    }    }
51    return $form;    return $form;
# Line 57  function weblinks_form_container($form_s Line 57  function weblinks_form_container($form_s
57  function weblinks_form_container_submit($form, &$form_state) {  function weblinks_form_container_submit($form, &$form_state) {
58    $container = TRUE;    $container = TRUE;
59    $type = t('weblinks container');    $type = t('weblinks container');
60    if ($form_state['values']['delete'] == 'Delete') {    $status = taxonomy_save_term($form_state['values']);
     $status = taxonomy_del_term($form_state['values']['tid']);  
   }  
   else {  
     $status = taxonomy_save_term($form_state['values']);  
   }  
61    switch ($status) {    switch ($status) {
62      case SAVED_NEW:      case SAVED_NEW:
63        $containers = variable_get('weblinks_containers', array());        $containers = variable_get('weblinks_containers', array());
# Line 73  function weblinks_form_container_submit( Line 68  function weblinks_form_container_submit(
68      case SAVED_UPDATED:      case SAVED_UPDATED:
69        drupal_set_message(t('The %type %term has been updated.', array('%term' => $form_state['values']['name'], '%type' => $type)));        drupal_set_message(t('The %type %term has been updated.', array('%term' => $form_state['values']['name'], '%type' => $type)));
70        break;        break;
71      }
72      $form_state['redirect'] = 'admin/content/weblinks';
73      return;
74    }
75    
76    /**
77     * Process forum form and container form submissions.
78     */
79    function weblinks_form_container_submit_delete($form, &$form_state) {
80      $container = TRUE;
81      $type = t('weblinks container');
82      $status = taxonomy_del_term($form_state['values']['tid']);
83      switch ($status) {
84      case SAVED_DELETED:      case SAVED_DELETED:
85        drupal_set_message(t('The %type %term has been deleted.', array('%term' => $form_state['values']['name'], '%type' => $type)));        drupal_set_message(t('The %type %term has been deleted.', array('%term' => $form_state['values']['name'], '%type' => $type)));
86        break;        break;

Legend:
Removed from v.1.3.2.1  
changed lines
  Added in v.1.3.2.2

  ViewVC Help
Powered by ViewVC 1.1.2