The purpose of this TIP is to suggest the definition of a callback that allows implementors to be informed when ever a package parameter is changed.
The callback interface would be defined in acs-subsite/tcl/subsite-callback-procs.tcl
(i.e.):
ad_proc -public -callback subsite::parameter_changed {
-package_id:required
-parameter:required
-value:required
} {
}
The existing proc
parameter::set
would inform all implementations about the change:
callback subsite::parameter_changed -package_id $package_id -parameter $parameter -value $value
In order to be notified I only need to provide an implementation that for instance logs changes to the parameter I am interested in, for instance for file-storage parameter MaximumFileSize:
ad_proc -public -callback subsite::parameter_changed -impl log_max_f_size_param {
-package_id:required
-parameter:required
-value:required
} {
Implementation of subsite::parameter_changed to log changes for file-storage paramter MaximumFileSize
@author Nima Mazloumi (mailto:nima.mazloumi@gmx.de)
@creation-date 2005-08-17
@param package_id the package_id of the package the parameter was changed for
@param parameter the parameter name
@param value the new value
} {
# do something intelligent, either a notice in the log or an entry to database or an email to site admin,...
}