|
Revision 84, 1.1 kB
(checked in by schst, 5 years ago)
|
added observer concept to patForms class
|
- Property svn:eol-style set to
native
- Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
class patForms_Observer_ReadonlyFinished extends patForms_Observer |
|---|
| 23 |
{ |
|---|
| 24 |
|
|---|
| 25 |
* method called by patForms or any patForms_Element to signalise |
|---|
| 26 |
* an event |
|---|
| 27 |
* |
|---|
| 28 |
* @access public |
|---|
| 29 |
* @param object Either a patForms or patForms_Element object |
|---|
| 30 |
* @param string Property, that has changed (currently only 'status' is possible) |
|---|
| 31 |
* @param mixed new value of the property |
|---|
| 32 |
* @return boolean should always return true |
|---|
| 33 |
*/ |
|---|
| 34 |
function notify( &$container, $property, $value ) |
|---|
| 35 |
{ |
|---|
| 36 |
|
|---|
| 37 |
* act only on a status change |
|---|
| 38 |
*/ |
|---|
| 39 |
if( $property != 'status' ) |
|---|
| 40 |
return true; |
|---|
| 41 |
|
|---|
| 42 |
if( $value != 'validated' ) |
|---|
| 43 |
return true; |
|---|
| 44 |
|
|---|
| 45 |
$container->setMode( 'readonly' ); |
|---|
| 46 |
return true; |
|---|
| 47 |
} |
|---|
| 48 |
} |
|---|
| 49 |
?> |
|---|