-
Notifications
You must be signed in to change notification settings - Fork 6
/
atknodetools.inc
54 lines (47 loc) · 1.58 KB
/
atknodetools.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/**
* This file is part of the Achievo ATK distribution.
* Detailed copyright and licensing information can be found
* in the doc/COPYRIGHT and doc/LICENSE files which should be
* included in the distribution.
*
* @package atk
*
* Contains a set of functions for general node manipulation.
*
* @copyright (c)2000-2004 Ibuildings.nl BV
* @license http://www.achievo.org/atk/licensing ATK Open Source License
*
* @version $Revision$
* $Id$
*/
/**
* Tells ATK that a node exists, and what actions are available to
* perform on that node. Note that registerNode() is not involved in
* deciding which users can do what, only in establishing the full set
* of actions that can potentially be performed on the node.
*
* @param $node name of the node
* @param $action array with actions that can be performed on the node
* @param $tabs array of tabnames for which security should be handled.
* Note that tabs that every user may see need not be
* registered.
*/
function registerNode($node, $action, $tabs=array(), $section=null)
{
if (!is_array($tabs))
{
$section = $tabs;
$tabs = array();
}
global $g_nodes;
$module = getNodeModule($node);
$type = getNodeType($node);
// prefix tabs with tab_
for($i=0, $_i=count($tabs); $i<$_i; $i++)
$tabs[$i] = "tab_" . $tabs[$i];
if ($module=="") $module="main";
if ($section == null) $section = $module;
$g_nodes[$section][$module][$type] = array_merge($action,$tabs);
}
?>