Commit b4f94f40298c6b82ad3d11f8179acfaaa842e47a
1 parent
165c4807
initial revision of SiteMap class
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@39 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
60 additions
and
0 deletions
lib/SiteMap.inc
0 → 100644
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * $Id$ | ||
| 4 | + * | ||
| 5 | + * Maintains page-level access map, as well as section, page map. | ||
| 6 | + * | ||
| 7 | + * @version $Revision$ | ||
| 8 | + * @author michael@jamwarehouse.com | ||
| 9 | + * @package dms | ||
| 10 | + */ | ||
| 11 | +class SiteMap { | ||
| 12 | + | ||
| 13 | + /** | ||
| 14 | + * Adds a site mapping entry. | ||
| 15 | + * | ||
| 16 | + * @param $action | ||
| 17 | + * the controller action | ||
| 18 | + * @param $page | ||
| 19 | + * the corresponding page for this action | ||
| 20 | + * @param $sectionName | ||
| 21 | + * the section this page falls under | ||
| 22 | + * @param $userClass | ||
| 23 | + * the user class with access to this page | ||
| 24 | + */ | ||
| 25 | + function addMap($action, $page, $sectionName, $userClass) { | ||
| 26 | + global $default; | ||
| 27 | + | ||
| 28 | + $realAction = $_ACTIONS[$action]; | ||
| 29 | + // add to map impl. | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + /** | ||
| 33 | + * Returns the pages in the specified section accessible to the | ||
| 34 | + * specified userClass. | ||
| 35 | + * | ||
| 36 | + * @param $sectionName | ||
| 37 | + * the section to retrieve pages for | ||
| 38 | + * @param $userClass | ||
| 39 | + * the user class to return pages for | ||
| 40 | + * @return | ||
| 41 | + * an array containing the actions for the specified section | ||
| 42 | + */ | ||
| 43 | + function getSection($sectionName, $userClass) { | ||
| 44 | + } | ||
| 45 | + | ||
| 46 | + /** | ||
| 47 | + * Returns the page mapped to the action, userClass pair. | ||
| 48 | + * | ||
| 49 | + * @param $action | ||
| 50 | + * the action to lookup pages for | ||
| 51 | + * @param $userClass | ||
| 52 | + * the userclass to perform page level validation against | ||
| 53 | + * @return | ||
| 54 | + * the page to redirect to, or false if the user class doesn't | ||
| 55 | + * have access to the page | ||
| 56 | + */ | ||
| 57 | + function getPage($action, $userClass) { | ||
| 58 | + } | ||
| 59 | +} | ||
| 60 | +?> |