Commit af4c7958 authored by nhck's avatar nhck
Browse files

Issue #354740 by paulrooney: Fixed how to display webfm attachment based on language.

parent 016487da
Loading
Loading
Loading
Loading
+19 −1
Original line number Diff line number Diff line
@@ -505,6 +505,12 @@ function webfm_nodeapi(&$node, $op, $teaser) {
        $files = explode(',', $_POST['attachlist']);
        array_walk($files, 'intval');//Don't trust your Inputs. Forcing all values to int.
        webfm_dbupdate_attach($node->nid, $files); 
        
        //If this field is set to syncing we keep the POST Data othrwise we drop it
        $i18nsync_nodeapi = variable_get('i18nsync_nodeapi_' . $node->type, FALSE); 
        if (!in_array('webfm_attachments_sync', $i18nsync_nodeapi)) {
          unset($_POST['attachlist']);
        }
      }
      break;

@@ -514,6 +520,18 @@ function webfm_nodeapi(&$node, $op, $teaser) {
  }
}

/**
 * 
 * Function adds the checkbox the the i18nsync-fieldlist in the form alter.
 * 
 * 
 * @param array $fields fields provided by i18n
 * @param string $type nodetype
 */
function webfm_i18nsync_fields_alter(&$fields, $type) {
  $fields['node']['#options']['webfm_attachments_sync'] = t('Web file Manger attached files');
}

/**
 * Implementation of hook_content_extra_fields().
 */