CMS
Version 3.9
help_pages.inc
Go to the documentation of this file.
1
<?php
2
/**************************************************************
3
4
Copyright (c) 2010 Sonjara, Inc
5
6
Permission is hereby granted, free of charge, to any person
7
obtaining a copy of this software and associated documentation
8
files (the "Software"), to deal in the Software without
9
restriction, including without limitation the rights to use,
10
copy, modify, merge, publish, distribute, sublicense, and/or sell
11
copies of the Software, and to permit persons to whom the
12
Software is furnished to do so, subject to the following
13
conditions:
14
15
The above copyright notice and this permission notice shall be
16
included in all copies or substantial portions of the Software.
17
18
Except as contained in this notice, the name(s) of the above
19
copyright holders shall not be used in advertising or otherwise
20
to promote the sale, use or other dealings in this Software
21
without prior written authorization.
22
23
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
25
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
27
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
28
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
30
OTHER DEALINGS IN THE SOFTWARE.
31
32
*****************************************************************/
33
34
Fakoli::using
(
"online_help"
);
35
Fakoli::usingFeature
(
"tree"
);
36
37
$help_book_id
= checkNumeric($_GET[
"help_book_id"
]);
38
if
(!
$help_book_id
) redirect(
"help_books"
);
39
40
$menu_item
=
"Online Help"
;
41
42
$helpBook
=
new
HelpBook
(
$help_book_id
);
43
$title
=
"Help Pages for {$helpBook->title}"
;
44
45
$tabs
=
OnlineHelpManager::getAdminTabs
(
$help_book_id
);
46
47
$helppages
=
$helpBook
->Pages(
"ORDER BY sort_order"
);
48
49
$helpTree
=
new
TreeControl(
"help_tree"
);
50
51
$helpTree
->height = 300;
52
53
if
(count(
$helppages
) > 0)
54
{
55
foreach
(
$helppages
as $helppage)
56
{
57
$help_pageNode =
new
TreeNode(
"helppage_{$helppage->help_page_id}"
, $helppage->title,
null
,
false
,
"tree_node_closed"
,
"tree_node_open"
,
"help_page_form?help_book_id={$help_book_id}&help_page_id={$helppage->help_page_id}&parent_id={$helppage->parent_id}"
);
58
$help_pageNode->leafStyle =
"file_node_leaf"
;
59
$tmp = array(
'parent'
=> $helppage->parent_id,
60
'node'
=> $help_pageNode);
61
$displays
[$helppage->help_page_id] = $tmp;
62
}
63
64
foreach
(
$displays
as $display)
65
{
66
if
(empty($display[
'parent'
]))
67
{
68
$helpTree
->add($display[
'node'
]);
69
}
70
else
71
{
72
$parentNode =
$displays
[ $display[
'parent'
] ][
'node'
];
73
$parentNode->add($display[
'node'
]);
74
}
75
}
76
}
77
78
$table
=
OnlineHelpHelper::buildRootPageTable
(
$helppages
,
$help_book_id
);
79
$table
->emptyMessage =
"There are no help pages."
;
80
81
$script
.=
$helpTree
->writeScript();
82
$script
.=
$table
->writeScript();
83
84
$tabs
->writeHTML();
85
?>
86
<div
id
=
"tab_border"
>
87
<?php
88
echo
"<p><a class='button' href='help_page_form?help_book_id=$help_book_id&parent_id=0'>Add a New Help Page</a></p>\n"
;
89
90
echo
"<h3><{$helpBook->title}</h3>\n"
;
91
92
$helpTree
->writeHTML();
93
94
echo
"<h3>Table View of {$helpBook->title}</h3>\n"
;
95
96
$table
->drawView();
97
98
echo
"<p><a class='button' href='help_page_form?help_book_id=$help_book_id&parent_id=0'>Add a New Help Page</a></p>\n"
;
99
100
?>
101
</div>
$displays
$displays
Definition:
menu_items.inc:59
Fakoli\usingFeature
static usingFeature()
Uses the specified framework feature(s).
Definition:
core.inc:388
Fakoli\using
static using()
Import the datamodels, views and manifest for the specified component(s).
Definition:
core.inc:116
HelpBook
Definition:
help_book.inc:40
OnlineHelpHelper\buildRootPageTable
static buildRootPageTable($pages, $help_book_id)
Definition:
online_help_helper.inc:50
OnlineHelpManager\getAdminTabs
static getAdminTabs($key)
Definition:
online_help_manager.inc:104
$table
if(count($helppages) > 0) $table
Definition:
help_pages.inc:78
$helpBook
$helpBook
Definition:
help_pages.inc:42
$help_book_id
$help_book_id
Definition:
help_pages.inc:37
$helppages
$helppages
Definition:
help_pages.inc:47
$tabs
$tabs
Definition:
help_pages.inc:45
$menu_item
$menu_item
Definition:
help_pages.inc:40
$helpTree
$helpTree
Definition:
help_pages.inc:49
$title
$title
Definition:
help_pages.inc:43
$script
$script
Definition:
help_pages.inc:81
code
cms.sonjara.com
cms
components
online_help
admin
help_pages.inc
Generated on Tue Mar 23 2021 15:36:13 for CMS by
1.9.1