/[drupal]/contributions/modules/copyright/copyright.module
ViewVC logotype

Diff of /contributions/modules/copyright/copyright.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.13.4.25, Fri Oct 5 15:47:40 2007 UTC revision 1.13.4.26, Sat Aug 9 07:27:48 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: copyright.module,v 1.13.4.24 2007/06/18 06:28:24 robrechtj Exp $  // $Id: copyright.module,v 1.13.4.25 2007/10/05 15:47:40 robrechtj Exp $
3    
4  /** Copyright (c) 2004 Matthew Schwartz  <matt at mattschwartz dot net>  /** Copyright (c) 2004 Matthew Schwartz  <matt at mattschwartz dot net>
5      Contributors:      Contributors:
# Line 483  function theme_copyright_admin_overview( Line 483  function theme_copyright_admin_overview(
483  /**  /**
484   * Implementation of hook_nodeapi().   * Implementation of hook_nodeapi().
485   */   */
486  function copyright_nodeapi(&$node, $op, $arg = 0) {  function copyright_nodeapi(&$node, $op, $teaser = FALSE, $page = FALSE) {
487    if (variable_get('copyright-enable_'. $node->type, 0)) {    if (variable_get('copyright-enable_'. $node->type, 0)) {
488      switch ($op) {      switch ($op) {
489        case 'view':        case 'view':
# Line 492  function copyright_nodeapi(&$node, $op, Line 492  function copyright_nodeapi(&$node, $op,
492            // $node->parent set at node load time by book.module            // $node->parent set at node load time by book.module
493            $node_license = copyright_parent_node($node->parent);            $node_license = copyright_parent_node($node->parent);
494          }          }
495          if ($node_license && $node_license->cpyid != variable_get('copyright-default', 1)) {  
496            // The node has a license other than the site's default          $display_options = variable_get('copyright-display_'. $node->type, array('full', 'teaser'));
497            if ($node_license && ($node_license->cpyid != variable_get('copyright-default', 1) || in_array('default', $display_options))
498                              && (($teaser && in_array('teaser', $display_options)) || (!$teaser && in_array('full', $display_options)))) {
499            $license = copyright_get_license($node_license->cpyid);            $license = copyright_get_license($node_license->cpyid);
500            $node->content['copyright'] = array(            $node->content['copyright'] = array(
501              '#value' => theme('copyright_footer', copyright_notice($license, $node, $node_license)),              '#value' => theme('copyright_footer', copyright_notice($license, $node, $node_license)),
# Line 533  function copyright_nodeapi(&$node, $op, Line 535  function copyright_nodeapi(&$node, $op,
535  function copyright_form_alter($form_id, &$form) {  function copyright_form_alter($form_id, &$form) {
536    if ($form_id == 'node_type_form' && isset($form['identity']['type'])) {    if ($form_id == 'node_type_form' && isset($form['identity']['type'])) {
537      $type = $form['#node_type']->type;      $type = $form['#node_type']->type;
538      $form['workflow']['copyright-enable'] = array(      $form['workflow']['copyright'] = array(
539          '#type' => 'fieldset',
540          '#title' => t('Copyright settings'),
541        );
542        $form['workflow']['copyright']['copyright-enable'] = array(
543        '#type' => 'radios',        '#type' => 'radios',
544        '#title' => t('Allow copyright selection'),        '#title' => t('Allow copyright selection'),
545        '#default_value' => variable_get('copyright-enable_'. $type, 0),        '#default_value' => variable_get('copyright-enable_'. $type, 0),
546        '#options' => array(t('Disabled'), t('Enabled')),        '#options' => array(t('Disabled'), t('Enabled')),
547        '#description' => t('Enable the copyright selection for individual nodes of this content type.'),        '#description' => t('Enable the copyright selection for individual nodes of this content type.'),
548      );      );
549        $form['workflow']['copyright']['copyright-display'] = array(
550          '#type' => 'checkboxes',
551          '#title' => t('Copyright display options'),
552          '#default_value' => variable_get('copyright-display_'. $type, array('full', 'teaser')),
553          '#options' => array(
554            'full' => t('Display notice on full node display'),
555            'teaser' => t('Display notice on teaser display'),
556            'default' => t('Display notice even when equal to default site notice'),
557          ),
558        );
559    }    }
560    
561    if (isset($form['type'])) {    if (isset($form['type'])) {

Legend:
Removed from v.1.13.4.25  
changed lines
  Added in v.1.13.4.26

  ViewVC Help
Powered by ViewVC 1.1.2