Changeset 11488


Ignore:
Timestamp:
Jun 22, 2011, 8:08:29 PM (13 years ago)
Author:
J.Commelin
Message:

Small code cleanups

Location:
extensions/Copyrights
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/Copyrights/batch_single.php

    r11439 r11488  
    11<?php
    22
    3 /*
    4 Try to be able to change something in the batch manager single mode (unit mode)
    5 */
    6 
    7 
    8 
    9 // Add a prefilter - whatever a prefilter may be - loc begin admin, because of this: http://piwigo.org/forum/viewtopic.php?id=17468
    10 add_event_handler('loc_begin_admin', 'set_prefilter_batch_single', 55 );
     3// Add a prefilter
     4add_event_handler('loc_begin_element_set_unit', 'set_prefilter_batch_single', 55 );
    115
    126// Change the variables used by the function that changes the template
     
    159function set_prefilter_batch_single()
    1610{
    17         //mail("matheiusb@gmail.com", "Content of $content", $content);
    1811        global $template;
    1912        $template->set_prefilter('batch_manager_unit', 'copyrights_batch_single');
     
    2215function copyrights_batch_single($content, &$smarty)
    2316{
    24         //mail("matheiusb@gmail.com", "Content of $content", $content);
    25         //$content = $content.'<div>DWO TEST</div>';
    26         return $content;
     17  $search = '#<tr id="datecreate">#';
     18
     19  $replacement = '
     20    <tr id="Copyrights_name">
     21    <tr id="datecreate">';
     22
     23    return preg_replace($search, $replacement, $content);
    2724}
    2825
  • extensions/Copyrights/main.inc.php

    r11423 r11488  
    7474 * +-----------------------------------------------------------------------+ */
    7575
    76  
    77  // Global mode
     76// With the batchmanager, copyrights can be assigned to photos. There are two
     77// modes: Global mode, for mass assignment; Unit mode, for one by one
     78// assignment to the photos.
     79
     80// Global mode
    7881include_once(dirname(__FILE__).'/batch_global.php');
    7982
    80 // Single mode - TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST
    81 // should become a include_once !!!
    82 include(dirname(__FILE__).'/batch_single.php');
     83// Unit mode
     84include_once(dirname(__FILE__).'/batch_single.php');
    8385
    8486?>
Note: See TracChangeset for help on using the changeset viewer.