[dev] Maintenance stuff/IMP Terms Of Service
Michael M Slusarz
slusarz@bigworm.colorado.edu
Thu, 25 Apr 2002 12:33:51 -0600
Quoting Chuck Hagenbuch <chuck@horde.org>:
| I guess I don't have real objections to it, although it doesn't seem like
| something that many of our users, historically, have wanted... I had
| visions of this being slightly more flexible and letting us use the
| maintenance system to easily provide users with custom polls and such,
| which would be _really_ cool. ;)
|
| -chuck
[Begin sales pitch now...]
Uh, it's still really cool now.
[End sales pitch]
Pretty lame pitch I realize. But the functionality is really already
there - there is a new maintenance screen type 'NOTICE' that is essentially
a catch-all for anything you want to generate. It will be displayed and
any input fields you set up will be available to the processing function.
Example: you could set up a notice screen that asks the question 'Do you
like IMP?' and have a radio checkbox for Yes/No. Then, the processing
function would actually process the data - saving the response if the
answer is yes and reasking the question if the answer is no :)
Pseudocode example (would appear in imp/lib/Maintenance/Tasks) --
class Maintenance_Task_impquestion extends Maintenance_Task {
var $display_type = MAINTENANCE_OUTPUT_NOTICE;
function describeMaintenance() {
// 'Do you like IMP?'
// Radio box field 'imp_answer': YES OR NO
}
function doMaintenance() {
if (Horde::getFormData('imp_answer') == 'YES') {
// Store data in file
// exit and continue processing login
} else {
// What? Is this user on crack? Ask them again
}
}
}
michael
______________________________________________
Michael Slusarz [slusarz@bigworm.colorado.edu]
The University of Colorado at Boulder