mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-08 20:46:05 +00:00
add more examples for hooks
This commit is contained in:
parent
e8e19385cc
commit
1b52cdaebc
|
@ -22,7 +22,6 @@
|
||||||
* This copyright notice MUST APPEAR in all copies of the script!
|
* This copyright notice MUST APPEAR in all copies of the script!
|
||||||
***************************************************************/
|
***************************************************************/
|
||||||
|
|
||||||
require_once("inc/inc.ClassExtBase.php");
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Example extension
|
* Example extension
|
||||||
|
@ -38,6 +37,7 @@ class SeedDMS_ExtExample extends SeedDMS_ExtBase {
|
||||||
*/
|
*/
|
||||||
function init() { /* {{{ */
|
function init() { /* {{{ */
|
||||||
$GLOBALS['SEEDDMS_HOOKS']['addDocument'][] = new SeedDMS_ExtExample_AddDocument;
|
$GLOBALS['SEEDDMS_HOOKS']['addDocument'][] = new SeedDMS_ExtExample_AddDocument;
|
||||||
|
$GLOBALS['SEEDDMS_HOOKS']['viewFolder'][] = new SeedDMS_ExtExample_ViewFolder;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
function main() { /* {{{ */
|
function main() { /* {{{ */
|
||||||
|
@ -59,4 +59,33 @@ class SeedDMS_ExtExample_AddDocument {
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class SeedDMS_ExtExample_ViewFolder {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hook when showing a folder
|
||||||
|
*
|
||||||
|
* The returned string will be output after the object menu and before
|
||||||
|
* the actual content on the page
|
||||||
|
*
|
||||||
|
* @param object $view the current view object
|
||||||
|
* @return string content to be output
|
||||||
|
*/
|
||||||
|
function preContent($view) { /* {{{ */
|
||||||
|
return $view->infoMsg("Content created by viewFolder::preContent hook");
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hook when showing a folder
|
||||||
|
*
|
||||||
|
* The returned string will be output at the end of the content area
|
||||||
|
*
|
||||||
|
* @param object $view the current view object
|
||||||
|
* @return string content to be output
|
||||||
|
*/
|
||||||
|
function postContent($view) { /* {{{ */
|
||||||
|
return $view->infoMsg("Content created by viewFolder::postContent hook");
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user