Changeset 11678 for extensions/Copyrights/batch_global.php
- Timestamp:
- Jul 9, 2011, 4:43:05 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Copyrights/batch_global.php
r11439 r11678 21 21 22 22 // Assign the template for batch management 23 $template->set_filename(' batch_global', dirname(__FILE__).'/batch_global.tpl');23 $template->set_filename('CR_batch_global', dirname(__FILE__).'/batch_global.tpl'); 24 24 25 25 // Fetch all the copyrights and assign them to the template … … 39 39 40 40 // Add info on the "choose action" dropdown in the batch manager 41 42 41 $template->append('element_set_global_plugins_actions', array( 42 'ID' => 'copyrights', // ID of the batch manager action 43 43 'NAME' => l10n('Edit copyright'), // Description of the batch manager action 44 'CONTENT' => $template->parse('batch_global', true)45 44 'CONTENT' => $template->parse('CR_batch_global', true) 45 ) 46 46 ); 47 47 } 48 48 49 // * Deze functie wordt een keer aangeroepen, nadat de gebruiker submit. 50 // * Fietst met een foreach loop over de geselecteerde fotos 51 // * Rammelt alle toevoegingen in 1x met mass_updates naar de db. 49 // Process the submit action 52 50 function copyrights_batch_global_submit($action, $collection) 53 51 { … … 57 55 $crID = pwg_db_real_escape_string($_POST['copyrightID']); 58 56 59 if (count($collection) > 0) { 60 $query = sprintf( 57 // Delete any previously assigned copyrights 58 if (count($collection) > 0) { 59 $query = sprintf( 61 60 'DELETE 62 61 FROM %s … … 67 66 } 68 67 68 // Add the copyrights from the submit form to an array 69 69 $edits = array(); 70 70 foreach ($collection as $image_id) … … 79 79 } 80 80 81 // Insert the array into the database 81 82 mass_inserts( 82 COPYRIGHTS_MEDIA, // Table name83 array_keys($edits[0]), // Columns84 $edits // Data83 COPYRIGHTS_MEDIA, // Table name 84 array_keys($edits[0]), // Columns 85 $edits // Data 85 86 ); 86 87 }
Note: See TracChangeset
for help on using the changeset viewer.