Ignore:
Timestamp:
May 21, 2011, 2:02:37 PM (13 years ago)
Author:
J.Commelin
Message:

Added the 'Description' field to Copyrights

Location:
extensions/Copyrights
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • extensions/Copyrights/TODO

    r10936 r10973  
    1 - Implement single mode Batch Manage
     1- Implement single mode Batch Manager
    22  Probably use prefilters combined with loc_begin_element_set_unit
    3 - Add Icon and Description fields to copyrights
     3- Add Icon field to copyrights
    44- Show the copyright when image is displayed
  • extensions/Copyrights/admin.php

    r10931 r10973  
    3838$CRname = '';
    3939$CRurl = '';
     40$CRdesc = '';
    4041$CRvisible = 0;
    4142
     
    4546    $name = pwg_db_real_escape_string($_REQUEST['name']);
    4647    $url = pwg_db_real_escape_string($_REQUEST['url']);
     48    $desc = pwg_db_real_escape_string($_REQUEST['desc']);
    4749    $visible = (isset($_REQUEST['visible']) ? 1 : 0);
    4850    $query = sprintf(
    4951      'INSERT INTO %s
    50       (`name`,`url`,`visible`) VALUES
    51       ("%s","%s",%d)
     52      (`name`,`url`,`des`,`visible`) VALUES
     53      ("%s","%s","%s",%d)
    5254      ;',
    53       COPYRIGHTS_ADMIN, $name, $url, $visible);
     55      COPYRIGHTS_ADMIN, $name, $url, $desc, $visible);
    5456    pwg_query($query);
    5557  }
     
    6870    $CRname = $row['name'];
    6971    $CRurl = $row['url'];
     72    $CRdesc = $row['desc'];
    7073    $CRvisible = $row['visible'];
    7174  }
     
    7578    $name = pwg_db_real_escape_string($_REQUEST['name']);
    7679    $url = pwg_db_real_escape_string($_REQUEST['url']);
     80    $desc= pwg_db_real_escape_string($_REQUEST['desc']);
    7781    $visible = (isset($_REQUEST['visible']) ? 1 : 0);
    7882    $query = sprintf(
    7983      'UPDATE %s
    80       SET `name`="%s", `url`="%s", `visible`=%d
     84      SET `name`="%s", `url`="%s", `desc`="%s", `visible`=%d
    8185      WHERE `cr_id`=%d
    8286      ;',
    83       COPYRIGHTS_ADMIN, $name, $url, $visible, $id);
     87      COPYRIGHTS_ADMIN, $name, $url, $desc, $visible, $id);
    8488    pwg_query($query);
    8589  }
     
    119123      'name'    => $row['name'],
    120124      'url'     => $row['url'],
     125      'desc'    => $row['desc'],
    121126      'visible' => $row['visible']
    122127    )
     
    133138$template->assign('CRname', $CRname);
    134139$template->assign('CRurl', $CRurl);
     140$template->assign('CRdesc', $CRdesc);
    135141$template->assign('CRvisible', $CRvisible);
    136142
  • extensions/Copyrights/admin.tpl

    r10874 r10973  
    1717          <td>{'URL'|@translate}</td>
    1818          <td><input type='text' name='url'  id='url'  value='{$CRurl}' /></td>
     19        </tr>
     20        <tr>
     21          <td>{'Description'|@translate}</td>
     22          <td><textarea name='desc' id='desc'>{$CRdesc}</textarea></td>
    1923        </tr>
    2024        <tr>
     
    4145        <th>{'Name'|@translate}</th>
    4246        <th>{'URL'|@translate}</th>
     47        <th>{'Description'|@translate}</th>
    4348        <th>{'Visible'|@translate}</th>
    4449        <th>{'Actions'|@translate}</th>
     
    5055        <td>{$CR.name}</td>
    5156        <td><a href="{$CR.url}">{$CR.url}</a></td>
     57        <td>{$CR.desc}</td>
    5258        <td>{if $CR.visible != 0}{'Yes'|@translate}
    5359          {else}{'No'|@translate}{/if}
  • extensions/Copyrights/maintain.inc.php

    r10931 r10973  
    2929      name varchar(255) UNIQUE NOT NULL,
    3030      url varchar(255) NOT NULL,
     31      desc text DEFAULT NULL,
    3132      visible bool DEFAULT 0,
    3233      PRIMARY KEY (cr_id)
     
    7980      'name' => 'Creative Commons (BY)',
    8081      'url' => 'http://creativecommons.org/licenses/by/3.0/',
     82      'desc' => '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.',
    8187      'visible' => 1
    8288    ),
     
    8490      'name' => 'Creative Commons (BY-SA)',
    8591      'url' => 'http://creativecommons.org/licenses/by-sa/3.0/',
     92      'desc' => '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.',
    86101      'visible' => 1
    87102    ),
     
    89104      'name' => 'Creative Commons (BY-ND)',
    90105      'url' => 'http://creativecommons.org/licenses/by-nd/3.0/',
     106      'desc' => '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.',
    91109      'visible' => 1
    92110    ),
     
    94112      'name' => 'Creative Commons (BY-NC)',
    95113      'url' => 'http://creativecommons.org/licenses/by-nc/3.0/',
     114      'desc' => '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.',
    96118      'visible' => 1
    97119    ),
     
    99121      'name' => 'Creative Commons (BY-NC-SA)',
    100122      'url' => 'http://creativecommons.org/licenses/by-nc-sa/3.0/',
     123      'desc' => '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.',
    101126      'visible' => 1
    102127    ),
     
    104129      'name' => 'Creative Commons (BY-NC-ND)',
    105130      'url' => 'http://creativecommons.org/licenses/by-nc-nd/3.0/',
     131      'desc' => '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.',
    106135      'visible' => 1
    107136    )
     
    110139  mass_inserts(
    111140    $prefixeTable.'copyrights_admin',
    112     array(
    113       'name',
    114       'url',
    115       'visible'
    116     ),
     141    array_keys($inserts[0]),
    117142    $inserts
    118143  );
Note: See TracChangeset for help on using the changeset viewer.