# This patch file was generated by NetBeans IDE
# Following Index: paths are relative to: /Applications/XAMPP/htdocs/limesurvey_yii/application/helpers
# This patch can be applied using context Tools: Patch action on respective folder.
# It uses platform neutral UTF-8 encoding and \n newlines.
# Above lines and this line are ignored by the patching process.
Index: export_helper.php
--- export_helper.php Base (BASE)
+++ export_helper.php Locally Modified (Based On LOCAL)
@@ -1913,9 +1913,10 @@
 
     Yii::import('application.libraries.Date_Time_Converter', true);
 
+    $aExportedTokens = array();
+
     foreach($bresult->readAll() as $brow)
     {
-
         if (trim($brow['validfrom']!=''))
         {
             $datetimeobj = new Date_Time_Converter($brow['validfrom'] , "Y-m-d H:i:s");
@@ -1947,11 +1948,18 @@
         }
         $tokenoutput = substr($tokenoutput,0,-1); // remove last comma
         $tokenoutput .= "\n";
+
+        $aExportedTokens[] = $brow['tid'];
     }
     echo $tokenoutput;
-    exit;
+
+    if (Yii::app()->request->getPost('tokendeleteexported') && !empty($aExportedTokens))
+    {
+        Tokens_dynamic::model($iSurveyID)->deleteByPk($aExportedTokens);
 }
 
+    exit;
+}
 function CPDBExport($data,$filename)
 {
 
