Ignore:
Timestamp:
Apr 19, 2013, 3:49:00 PM (12 years ago)
Author:
plg
Message:

compatibility with Piwigo 2.5: display copyright on the picture page and on
picture edition page.

Location:
extensions/Copyrights
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/Copyrights/image.php

    r11844 r22300  
    1818{
    1919        // Add the information after the author - so before the createdate
    20         $search = '#<tr id="datecreate">#';
     20        $search = '#class="imageInfoTable">#';
    2121       
    22         $replacement = '
    23         <tr id="Copyrights_name">
    24                 <td class="label">{\'Copyright\'|@translate}</td>
    25                 <td class="value">
    26                         {if $CR_INFO_NAME}
     22        $replacement = 'class="imageInfoTable">
     23        <div id="Copyrights_name" class="imageInfo">
     24                <dt>{\'Copyright\'|@translate}</dt>
     25                <dd>
     26{if $CR_INFO_NAME}
    2727                        <a target="_blanc" href="{$CR_INFO_URL}" title="{$CR_INFO_NAME}: {$CR_INFO_DESCR}">{$CR_INFO_NAME}</a>
    28                         {else}{\'N/A\'|@translate}{/if}
    29                 </td>
    30         </tr>
    31         <tr id="datecreate">';
     28{else}
     29      {\'N/A\'|@translate}
     30{/if}
     31    </dd>
     32        </div>';
    3233
    3334        return preg_replace($search, $replacement, $content);
  • extensions/Copyrights/modify.php

    r11794 r22300  
    33// Add a prefilter
    44add_event_handler('loc_begin_admin', 'CR_set_prefilter_modify', 50 );
    5 add_event_handler('loc_begin_admin', 'CR_modify_submit', 45 );
     5add_event_handler('loc_begin_admin_page', 'CR_modify_submit', 45 );
    66
    77// Change the variables used by the function that changes the template
    8 add_event_handler('loc_begin_admin', 'CR_add_modify_vars_to_template');
     8add_event_handler('loc_begin_admin_page', 'CR_add_modify_vars_to_template');
    99
    1010function CR_set_prefilter_modify()
     
    1616function CR_modify($content, &$smarty)
    1717{
    18         $search = "#<td><strong>{'Creation date'#"; // Not ideal, but ok for now :)
     18        $search = "#<strong>{'Creation date'#"; // Not ideal, but ok for now :)
    1919
    2020        // We use the <tr> from the Creation date, and give them a new <tr>
    21         $replacement = '<td><strong>{\'Copyright\'|@translate}</strong></td>
    22                 <td>
     21        $replacement = '<strong>{\'Copyright\'|@translate}</strong>
     22                <br>
    2323                        <select id="copyrightID" name="copyrightID">
    2424                                <option value="">--</option>
    2525                                {html_options options=$CRoptions selected=$CRid}
    2626                        </select>
    27                 </td>
    28         </tr>
     27                </p>
    2928       
    30         <tr>
    31                 <td><strong>{\'Creation date\'';
     29        </p>
     30  <p>
     31                <strong>{\'Creation date\'';
    3232
    3333    return preg_replace($search, $replacement, $content);
     
    3636function CR_add_modify_vars_to_template()
    3737{
    38         // Check if we are at the modify page (the problem is that this will send the stuff to every admin page that has an ?image_id...
    39         if (isset($_GET['image_id']))
     38        if (isset($_GET['page']) and 'photo' == $_GET['page'] and isset($_GET['image_id']))
    4039        {
    4140                global $template;
     
    7978function CR_modify_submit()
    8079{
    81         // Check if we are at the modify page (the problem is that this will send the stuff to every admin page that has an ?image_id...
    82         if (isset($_GET['image_id']))
     80  if (isset($_GET['page']) and 'photo' == $_GET['page'] and isset($_GET['image_id']))
    8381        {
    8482                if (isset($_POST['submit']))
Note: See TracChangeset for help on using the changeset viewer.