Ignore:
Timestamp:
07/05/11 13:01:28 (8 years ago)
Author:
Mattias
Message:

Finished batch_single.php
Added -- in batch_global.tpl
Added description in image.php
And several bugfixes anywhere

Location:
extensions/Copyrights
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • extensions/Copyrights/TODO

    r11625 r11635  
    11=== TODO === 
    2 - Implement single mode Batch Manager 
    3     Probably use prefilters combined with "loc_begin_element_set_unit" (found in event tracer) 
    4         SOURCES: "loc_begin_admin": http://piwigo.org/forum/viewtopic.php?id=17468 
    5                          "use prefilters": http://piwigo.org/forum/viewtopic.php?id=17551&p=2 
    6         - This is almost done, except that you need to refresh the batch_unit page, to see the updated copyright 
    7 - Add Icon field to copyrights 
    8 - Show the copyright when image is displayed 
    9     (It doesnt show a picture yet, but it does show the name of the copyright) 
     2-       Add Icon field to copyrights 
     3-       Show the copyright when image is displayed 
     4        It doesnt show a picture yet, but it does show the name of the copyright 
    105 
    116=== Bugs === 
    12         - If you create a new copyright with a name that's already used (fixed??) 
     7-       We don't check if the CR url has 'http://' (or is this a TODO?) 
     8-       Go to "unit mode", click "information", and you wont see the copyright... 
  • extensions/Copyrights/admin.php

    r11625 r11635  
    5252      'SELECT COUNT(*) 
    5353      FROM %s 
    54       WHERE `name` = '%s' 
     54      WHERE `name` = \'%s\' 
    5555      ;', 
    5656      COPYRIGHTS_ADMIN, $name); 
  • extensions/Copyrights/batch_global.tpl

    r11423 r11635  
    11<div id="copyrights"> 
    2   {'Copyright'|@translate} {html_options name=copyrightID options=$CRoptions} 
     2        {'Copyright'|@translate} 
     3        <select name="copyrightID"> 
     4                <option value="0">--</option> 
     5                {html_options options=$CRoptions} 
     6        </select> 
    37</div> 
  • extensions/Copyrights/batch_single.php

    r11623 r11635  
    33// Add a prefilter 
    44add_event_handler('loc_end_element_set_unit', 'CR_set_prefilter_batch_single', 55 ); 
    5 add_event_handler('loc_end_element_set_unit', 'CR_batch_single_submit', 50 ); 
     5add_event_handler('loc_begin_element_set_unit', 'CR_batch_single_submit', 50 ); 
    66 
    77// Change the variables used by the function that changes the template 
  • extensions/Copyrights/image.php

    r11621 r11635  
    3535                <td class="value"> 
    3636                        {if $CR_INFO_NAME} 
    37                         <a target="_blanc" href="{$CR_INFO_URL}" title="{$CR_INFO_NAME}">{$CR_INFO_NAME}</a> 
     37                        <a target="_blanc" href="{$CR_INFO_URL}" title="{$CR_INFO_NAME}: {$CR_INFO_DESCR}">{$CR_INFO_NAME}</a> 
    3838                        {else}{\'N/A\'|@translate}{/if} 
    3939                </td> 
     
    5757                // Get the copyright name and url (FROM cr_admin) that belongs to the current media_item (FROM cr_media) 
    5858                $query = ' 
    59                   select name, url 
     59                  select name, url, descr 
    6060                  FROM '.COPYRIGHTS_ADMIN.' NATURAL JOIN '.COPYRIGHTS_MEDIA.' 
    6161                  WHERE media_id = '.$page['image_id'].' 
     
    6464                $result = pwg_query($query); 
    6565                $row = pwg_db_fetch_row($result); 
     66                $name = ''; 
     67                $url = ''; 
     68                $descr = ''; 
    6669                if(count($row) > 0) { 
    6770                        $name = $row[0]; 
    6871                        $url = $row[1]; 
    69                 } 
    70                 else { 
    71                         $name = ''; 
    72                         $url = ''; 
     72                        $descr = $row[2]; 
    7373                } 
    7474                         
     
    7777                array   ( 
    7878                'CR_INFO_NAME' => $name, 
    79                 'CR_INFO_URL' => $url 
     79                'CR_INFO_URL' => $url, 
     80                'CR_INFO_DESCR' => $descr 
    8081                                )); 
    8182        } 
  • extensions/Copyrights/main.inc.php

    r11488 r11635  
    22/* 
    33Plugin Name: Copyrights 
    4 Version: Alpha 
     4Version: 1.0 
    55Description: Create copyrights and assign them to your photos. 
    66Plugin URI: http://piwigo.org/ext/extension_view.php?eid=537 
  • extensions/Copyrights/maintain.inc.php

    r11084 r11635  
    8080      'name' => 'Creative Commons (BY)', 
    8181      'url' => 'http://creativecommons.org/licenses/by/3.0/', 
    82       'descr' => 'This license lets others distribute, remix, tweak, and build  
    83                 upon your work, even commercially, as long as they credit you  
    84                 for the original creation. This is the most accommodating of  
    85                 licenses offered. Recommended for maximum dissemination and  
    86                 use of licensed materials.', 
     82      'descr' => 'This license lets others distribute, remix, tweak, and build ' 
     83                .'upon your work, even commercially, as long as they credit you ' 
     84                .'for the original creation. This is the most accommodating of ' 
     85                .'licenses offered. Recommended for maximum dissemination and ' 
     86                .'use of licensed materials.', 
    8787      'visible' => 1 
    8888    ), 
     
    9090      'name' => 'Creative Commons (BY-SA)', 
    9191      'url' => 'http://creativecommons.org/licenses/by-sa/3.0/', 
    92       'descr' => 'This license lets others remix, tweak, and build upon your 
    93                 work even for commercial purposes, as long as they credit you 
    94                 and license their new creations under the identical terms. This 
    95                 license is often compared to “copyleft” free and open source 
    96                 software licenses. All new works based on yours will carry the 
    97                 same license, so any derivatives will also allow commercial 
    98                 use. This is the license used by Wikipedia, and is recommended 
    99                 for materials that would benefit from incorporating content 
    100                 from Wikipedia and similarly licensed projects.', 
     92      'descr' => 'This license lets others remix, tweak, and build upon your ' 
     93                .'work even for commercial purposes, as long as they credit you ' 
     94                .'and license their new creations under the identical terms. This ' 
     95                .'license is often compared to “copyleft” free and open source ' 
     96                .'software licenses. All new works based on yours will carry the ' 
     97                .'same license, so any derivatives will also allow commercial ' 
     98                .'use. This is the license used by Wikipedia, and is recommended ' 
     99                .'for materials that would benefit from incorporating content ' 
     100                .'from Wikipedia and similarly licensed projects.', 
    101101      'visible' => 1 
    102102    ), 
     
    104104      'name' => 'Creative Commons (BY-ND)', 
    105105      'url' => 'http://creativecommons.org/licenses/by-nd/3.0/', 
    106       'descr' => 'This license allows for redistribution, commercial and  
    107                 non-commercial, as long as it is passed along unchanged and in 
    108                 whole, with credit to you.', 
     106      'descr' => 'This license allows for redistribution, commercial and ' 
     107                .'non-commercial, as long as it is passed along unchanged and in ' 
     108                .'whole, with credit to you.', 
    109109      'visible' => 1 
    110110    ), 
     
    112112      'name' => 'Creative Commons (BY-NC)', 
    113113      'url' => 'http://creativecommons.org/licenses/by-nc/3.0/', 
    114       'descr' => 'This license lets others remix, tweak, and build upon your 
    115                 work non-commercially, and although their new works must also 
    116                 acknowledge you and be non-commercial, they don’t have to 
    117                 license their derivative works on the same terms.', 
     114      'descr' => 'This license lets others remix, tweak, and build upon your ' 
     115                .'work non-commercially, and although their new works must also ' 
     116                .'acknowledge you and be non-commercial, they don’t have to ' 
     117                .'license their derivative works on the same terms.', 
    118118      'visible' => 1 
    119119    ), 
     
    121121      'name' => 'Creative Commons (BY-NC-SA)', 
    122122      'url' => 'http://creativecommons.org/licenses/by-nc-sa/3.0/', 
    123       'descr' => 'This license lets others remix, tweak, and build upon your 
    124                 work non-commercially, as long as they credit you and license 
    125                 their new creations under the identical terms.', 
     123      'descr' => 'This license lets others remix, tweak, and build upon your ' 
     124                .'work non-commercially, as long as they credit you and license ' 
     125                .'their new creations under the identical terms.', 
    126126      'visible' => 1 
    127127    ), 
     
    129129      'name' => 'Creative Commons (BY-NC-ND)', 
    130130      'url' => 'http://creativecommons.org/licenses/by-nc-nd/3.0/', 
    131       'descr' => 'This license is the most restrictive of our six main licenses, 
    132                 only allowing others to download your works and share them with 
    133                 others as long as they credit you, but they can’t change them 
    134                 in any way or use them commercially.', 
     131      'descr' => 'This license is the most restrictive of our six main licenses, ' 
     132                .'only allowing others to download your works and share them with ' 
     133                .'others as long as they credit you, but they can’t change them ' 
     134                .'in any way or use them commercially.', 
    135135      'visible' => 1 
    136136    ) 
Note: See TracChangeset for help on using the changeset viewer.