From: <jer...@us...> - 2007-05-17 21:31:08
|
Revision: 12402 http://squirrelmail.svn.sourceforge.net/squirrelmail/?rev=12402&view=rev Author: jervfors Date: 2007-05-17 14:31:02 -0700 (Thu, 17 May 2007) Log Message: ----------- Adding comments to code example for plugin pages called directly by the client browser. Modified Paths: -------------- trunk/documentation/devel/devel.sgml Modified: trunk/documentation/devel/devel.sgml =================================================================== --- trunk/documentation/devel/devel.sgml 2007-05-17 16:36:42 UTC (rev 12401) +++ trunk/documentation/devel/devel.sgml 2007-05-17 21:31:02 UTC (rev 12402) @@ -2304,19 +2304,33 @@ such pages should start with the following code: <tscreen><verb> -if (file_exists('../../include/init.php')) - include_once('../../include/init.php'); -else if (file_exists('../../include/validate.php')) -{ - define('SM_PATH', '../../'); - include_once(SM_PATH . 'include/validate.php'); +/* + * Pages that are called directly by the client browser need to load the + * SquirrelMail framework. This differs between various SquirrelMail versions. + * Plugins that doesn't support all SquirrelMail versions can strip some of this + * code away. + */ +if (file_exists('../../include/init.php')) { + /* + * "include/init.php" is used since SquirrelMail 1.5.2. This isn't needed + * for plugins that doesn't support SquirrelMail 1.5.2. + */ + include_once('../../include/init.php'); +} elseif (file_exists('../../include/validate.php')) { + /* + * "include/validate.php" is used since SquirrelMail 1.4.0 and 1.5.0. + */ + define('SM_PATH', '../../'); + include_once(SM_PATH . 'include/validate.php'); +} else { + /* + * "src/validate.php" is used since SquirrelMail 1.2.0. This isn't needed + * for plugins that doesn't support SquirrelMail 1.2. + */ + chdir('..'); + define('SM_PATH', '../'); + include_once(SM_PATH . 'src/validate.php'); } -else -{ - chdir('..'); - define('SM_PATH', '../'); - include_once(SM_PATH . 'src/validate.php'); -} </verb></tscreen> TODO: Possibly provide link to the include hierarchy provided by init.php/validate.php This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |