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

Diff of /contributions/modules/pacs/pacs.module

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

revision 1.4, Tue Jun 13 22:13:36 2006 UTC revision 1.5, Mon Jun 26 23:54:29 2006 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id:$  // $Id: pacs.module,v 1.3 2006/06/12 14:11:43 peterone Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 8  Line 8 
8    
9  $_pacs_nodes = array();  $_pacs_nodes = array();
10    
11    // includes on demand
12    if (arg(0) == 'pacs') require_once 'pacs_xml.inc';
13    
14  /**  /**
15   *  pacs_debug()   *  pacs_debug()
16   */   */
# Line 384  function pacs_tree($nid) { Line 387  function pacs_tree($nid) {
387    $output .= '</fieldset>';    $output .= '</fieldset>';
388    
389    if (pacs_manage_tree_perm($nid)) {    if (pacs_manage_tree_perm($nid)) {
     /////////////////////////////////////////////////////////////////////////////  
     $output .= '<fieldset class="move"><legend>'.t('Move Node').'</legend>';  
     if ($_SESSION['pacs_orig']) {  
       $output .= l(t('Cancel'),$url,array('class' => 'button'),'op_cancel=1').t(' or ');  
       $output .= l(t('Move'),$url,array('class' => 'button'),'op_move=1');  
       $output .= t(  
         'node <span class="sel">%o </span> under node <span class="sel">%d </span>',  
         array('%o' => $_SESSION['pacs_orig']['title'],'%d' => $tree['cur']['title'])  
       );  
     } else {  
       $output .= l(t('Select'),$url,array('class' => 'button'),'op_set_orig=1');  
       $output .= t('the <span class="sel">highlighted </span> node to move it in the tree.');  
     }  
     $output .= '</fieldset>';  
   
390      if ($trid > 0) {      if ($trid > 0) {
391        ////////////////////////////////////////////////////////////////////////////////        ////////////////////////////////////////////////////////////////////////////////
392        $output .= '<fieldset class="perms"><legend>'.t('Set Branch Grants').'</legend>';        $output .= '<fieldset class="perms"><legend>'.t('Set Branch Grants').'</legend>';
# Line 423  function pacs_tree($nid) { Line 411  function pacs_tree($nid) {
411        $output .= '</fieldset>';        $output .= '</fieldset>';
412      }      }
413      /////////////////////////////////////////////////////////////////////////////      /////////////////////////////////////////////////////////////////////////////
414        $output .= '<fieldset class="move"><legend>'.t('Move Node').'</legend>';
415        if ($_SESSION['pacs_orig']) {
416          $output .= l(t('Cancel'),$url,array('class' => 'button'),'op_cancel=1').t(' or ');
417          $output .= l(t('Move'),$url,array('class' => 'button'),'op_move=1');
418          $output .= t(
419            'node <span class="sel">%o </span> under node <span class="sel">%d </span>',
420            array('%o' => $_SESSION['pacs_orig']['title'],'%d' => $tree['cur']['title'])
421          );
422        } else {
423          $output .= l(t('Select'),$url,array('class' => 'button'),'op_set_orig=1');
424          $output .= t('the <span class="sel">highlighted </span> node to move it in the tree.');
425        }
426        $output .= '</fieldset>';
427        ///////////////////////////////////////////////////////////////////////////////////
428        $output .= '<fieldset class="move"><legend>'.t('Export/Import Branch').'</legend>';
429        $output .= l(t('export branch'),'pacs/export/'.$nid,array('class' => 'button'));
430        $output .= l(t('import branch'),'pacs/import/'.$nid,array('class' => 'button'));
431        $output .= l(t('delete branch'),'pacs/delete/'.$nid,array('class' => 'button'));
432        $output .= '</fieldset>';
433    } else {    } else {
434      if (isset($_SESSION['pacs_grants_undo'])) {      if (isset($_SESSION['pacs_grants_undo'])) {
435          /////////////////////////////////////////////////////////////////////////////////
436        $output .= '<fieldset class="perms"><legend>'.t('Set Branch Grants').'</legend>';        $output .= '<fieldset class="perms"><legend>'.t('Set Branch Grants').'</legend>';
437        $output .= l(t('undo'),$url,array('id' => 'g'.$_SESSION['pacs_grants_undo']['gid'],        $output .= l(t('undo'),$url,array('id' => 'g'.$_SESSION['pacs_grants_undo']['gid'],
438          'class' => 'undo','title' => t('undo the previous grant setting')),'undo=1');          'class' => 'undo','title' => t('undo the previous grant setting')),'undo=1');
# Line 566  function pacs_menu($may_cache) { Line 574  function pacs_menu($may_cache) {
574        'type'     => MENU_CALLBACK,        'type'     => MENU_CALLBACK,
575      );      );
576    
577        $access = FALSE;
578        if (arg(0) == 'pacs') $access = pacs_manage_tree_perm(arg(2));
579        $items[] = array(
580          'path'     => 'pacs/export/'.arg(2),
581          'callback' => 'pacs_xml_export',
582          'callback arguments' => array(arg(2)),
583          'access'   => $access,
584          'type'     => MENU_CALLBACK,
585        );
586        $items[] = array(
587          'path'     => 'pacs/import/'.arg(2),
588          'callback' => 'pacs_xml_import',
589          'callback arguments' => array(arg(2)),
590          'access'   => $access,
591          'type'     => MENU_CALLBACK,
592        );
593        $items[] = array(
594          'path'     => 'pacs/delete/'.arg(2),
595          'callback' => 'pacs_delete_branch',
596          'callback arguments' => array(arg(2)),
597          'access'   => $access,
598          'type'     => MENU_CALLBACK,
599        );
600    
601    }    }
602    
603    // load style sheets on demand    // load style sheets on demand
# Line 683  function pacs_nodeapi(&$node, $op, $teas Line 715  function pacs_nodeapi(&$node, $op, $teas
715        }        }
716        break;        break;
717      case 'insert':      case 'insert':
718          if (isset($node->pacs_nid)) break;
719        $pnode = array('nid' => $node->nid, 'pid' => 0, 'rid' => 0, 'stops' => array());        $pnode = array('nid' => $node->nid, 'pid' => 0, 'rid' => 0, 'stops' => array());
720        pacs_update_node($pnode);        pacs_update_node($pnode);
721        $pid = 0;        $pid = 0;

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.2