/[cvs]/nfo/php/libs/org.netfrag.patches/phphtmllib/widgets/FlexibleNegotiation.php
ViewVC logotype

Diff of /nfo/php/libs/org.netfrag.patches/phphtmllib/widgets/FlexibleNegotiation.php

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

revision 1.1 by joko, Fri Apr 11 00:40:31 2003 UTC revision 1.4 by jonen, Sat May 10 18:02:13 2003 UTC
# Line 14  Line 14 
14   * $Id$   * $Id$
15   *   *
16   * $Log$   * $Log$
17     * Revision 1.4  2003/05/10 18:02:13  jonen
18     * + implemented multi-selection (special for multi-delete)
19     *
20     * Revision 1.3  2003/04/11 01:34:46  joko
21     * don't show any form content on this negotation (does delete only by now)
22     *
23     * Revision 1.2  2003/04/11 00:59:10  joko
24     * minor update regarding function rename
25     *
26   * Revision 1.1  2003/04/11 00:40:31  joko   * Revision 1.1  2003/04/11 00:40:31  joko
27   * initial commit   * initial commit
28   *   *
# Line 44  class FlexibleNegotiation extends EditDa Line 53  class FlexibleNegotiation extends EditDa
53       *       *
54       */       */
55    function FlexibleNegotiation($title, $options = array(), $negotiation_options = array()) {    function FlexibleNegotiation($title, $options = array(), $negotiation_options = array()) {
56        
57      $this->_negotiation_options = $negotiation_options;      $this->_negotiation_options = $negotiation_options;
58            
59      // change phpHtmlLib default behavior to change      // change phpHtmlLib default behavior to change
# Line 52  class FlexibleNegotiation extends EditDa Line 61  class FlexibleNegotiation extends EditDa
61      // TODO: integrate into negotiation options!?      // TODO: integrate into negotiation options!?
62      $_POST[FORM_VISITED] = 1;      $_POST[FORM_VISITED] = 1;
63      //$_POST[FORM_CONFIRM] = 1;      //$_POST[FORM_CONFIRM] = 1;
64        
65         // on multi-selections we can't currently confirm relating on problems at var forwarding
66         if(is_array($options[data_locator_meta][ident])) {
67          $_POST[FORM_CONFIRM] = 1;
68         }
69            
70      // call constructor of base class      // call constructor of base class
71      $this->EditDataItem($title, $options);      $this->EditDataItem($title, $options);
72      //$this->StandardFormContent($title, $PHP_SELF, 600);      //$this->StandardFormContent($title, $PHP_SELF, 600);
73            
74        // disable any form content (we just need buttons)
75        $this->_datasource = null;
76    
77      // debug      // debug
78      //print "options: " . Dumper($this->_options);      //print "options: " . Dumper($this->_options);
79    }    }
# Line 78  class FlexibleNegotiation extends EditDa Line 95  class FlexibleNegotiation extends EditDa
95            "nowrap"            "nowrap"
96          ),          ),
97          //form_submit('ecdfc', "Back")          //form_submit('ecdfc', "Back")
98          link::plain( url::viewrpcdatanode($this->_options[data_locator_meta][nodename]), 'Back' )          link::plain( url::viewdatanode($this->_options[data_locator_meta][nodename]), 'Back' )
99          //'abc'          //'abc'
100        );        );
101        return $div;        return $div;
# Line 95  class FlexibleNegotiation extends EditDa Line 112  class FlexibleNegotiation extends EditDa
112           */           */
113          function form_confirm( ) {          function form_confirm( ) {
114    
115          //print "Duids: " . Dumper($this->_options[data_locator_meta][ident]);
116    
117        $this->add_hidden_element('ecmod', 'delete');        $this->add_hidden_element('ecmod', 'delete');
118        $this->add_hidden_element('ecdid', $this->_options[data_locator_meta][ident]);  
119        $this->add_hidden_element('ecdm', $this->_options[data_locator_meta][nodename]);        // if ident is an array( multi-selection!) forward this
120          // TODO: make it work!! Problem is that '$this->add_hidden_element'
121          //     adds an 'FEHidden' object which replaces '[]' at array vars with '_', what will not work at request handling
122          if(is_array($this->_options[data_locator_meta][ident])) {
123            $this->add_hidden_element('ecdid', $this->_options[data_locator_meta][nodename]);
124            $this->add_hidden_element('ecdfa', 'delete');
125            foreach($this->_options[data_locator_meta][ident] as $key => $ident) {
126              //$this->add_hidden_element("checkbox[".$key."]", $ident);
127            }
128            $this->add_hidden_element('checkbox', $this->_options[data_locator_meta][ident]);
129          } else {
130            $this->add_hidden_element('ecdid', $this->_options[data_locator_meta][ident]);
131            $this->add_hidden_element('ecdm', $this->_options[data_locator_meta][nodename]);
132          }
133    
134          $title = "Form Confirmation / " . $this->_options['caption'];          $title = "Form Confirmation / " . $this->_options['caption'];
135          $title .="( ".$this->_required_field_marker." ".$this->_required_field_text." )";          $title .="( ".$this->_required_field_marker." ".$this->_required_field_text." )";
# Line 139  class FlexibleNegotiation extends EditDa Line 171  class FlexibleNegotiation extends EditDa
171       */       */
172      function confirm_action() {      function confirm_action() {
173    
174          //print "Guid(s): " . Dumper($this->_options['data_locator_meta']['ident']);
175        
176        // If user confirms action, issue delete request on current item.        // If user confirms action, issue delete request on current item.
177        $this->_options['data_locator_meta']['action'] = "delete";        $this->_options['data_locator_meta']['action'] = "delete";
178        $error = $this->data_prefetch();        $error = $this->data_prefetch();
179                
180          // disable any form content (we just need buttons)
181        $this->_datasource = null;        $this->_datasource = null;
182                
183        $msg = "Action confirmed! Changes may take a while to propagate through all parts of the system.";        $msg = "Action confirmed! Changes may take a while to propagate through all parts of the system.";

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

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed