Changeset 11678 for extensions/Copyrights/batch_single.php
- Timestamp:
- Jul 9, 2011, 4:43:05 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Copyrights/batch_single.php
r11635 r11678 1 1 <?php 2 2 3 // Add aprefilter3 // Add event handlers for the prefilter 4 4 add_event_handler('loc_end_element_set_unit', 'CR_set_prefilter_batch_single', 55 ); 5 5 add_event_handler('loc_begin_element_set_unit', 'CR_batch_single_submit', 50 ); … … 8 8 add_event_handler('loc_end_element_set_unit', 'CR_add_batch_single_vars_to_template'); 9 9 10 // Add a prefilter to the template 10 11 function CR_set_prefilter_batch_single() 11 12 { … … 14 15 } 15 16 17 // Insert the copyright selector to the template 16 18 function CR_batch_single($content, &$smarty) 17 19 { 18 $search = "#<td><strong>{'Creation date'#"; // Not ideal, but ok for now :)20 $search = "#<td><strong>{'Creation date'#"; 19 21 20 22 // We use the <tr> from the Creation date, and give them a new <tr> … … 31 33 <td><strong>{\'Creation date\''; 32 34 33 return preg_replace($search, $replacement, $content); 34 35 // Dit is een interresant testje - deze functie word dus een aantal keren (3) aangeroepen, 36 // en pas de laatste keer is bevat $content meer dan een aantal enters... 37 // return $content.'<div id="dwo_test" style="display: none;">'.$content.'</div>'; 35 return preg_replace($search, $replacement, $content); 38 36 } 39 37 38 // Assign the variables to the Smarty template 40 39 function CR_add_batch_single_vars_to_template() 41 40 { … … 70 69 while ($row = pwg_db_fetch_assoc($result)) { 71 70 $CRcopyrights[$row['media_id']] = $row['cr_id']; 72 } 71 } 72 73 // Assign the copyrights to the template 73 74 $template->assign('CRcopyrights', $CRcopyrights); 74 75 } 75 76 77 // Catch the submit and update the copyrights tables 76 78 function CR_batch_single_submit() 77 79 { … … 81 83 $collection = explode(',', $_POST['element_ids']); 82 84 83 // Delete all existing id's of which the Copyright is going to be set85 // Delete all existing id's of which the copyright is going to be set 84 86 if (count($collection) > 0) { 85 87 $query = sprintf( … … 90 92 COPYRIGHTS_MEDIA, implode(',', $collection)); 91 93 pwg_query($query); 92 } 93 // Add all Copyrights to an array 94 } 95 96 // Add all copyrights to an array 94 97 $edits = array(); 95 98 foreach ($collection as $image_id) { … … 105 108 ) 106 109 ); 107 } 108 // Add the array to the database 110 } 111 112 // Insert the array to the database 109 113 mass_inserts( 110 114 COPYRIGHTS_MEDIA, // Table name
Note: See TracChangeset
for help on using the changeset viewer.