CMS  Version 3.9
online_help_helper.inc
Go to the documentation of this file.
1 <?php
9 {
10 
12  {
13  return ellipsis(stripHTML($helpPage->content), 100, true);
14  }
15 
17  {
18  if($helpPage->identifier)
19  {
20  $constraint = "WHERE identifier != '{$helpPage->identifier}'";
21  }
22  $helpPages = $helpBook->Pages("$constraint ORDER BY sort_order");
23  $options = array();
24 
25  $options[0] = "";
26  if(count($helpPages))
27  {
28  foreach($helpPages as $hp)
29  {
30  if($helpPage->identifier && $hp->isChildOf($helpPage)) continue;
31  $options[$hp->help_page_id] = $hp->title;
32  }
33  }
34 
35  return $options;
36  }
37 
38  static function formatSubpages($helpPage)
39  {
40  $children = $helpPage->Children();
41 
42  if(count($children))
43  {
44  return formatItems($children, "<a style='display: inline' href='help_page_form?help_book_id={help_book_id}&help_page_id={help_page_id}'>{title}</a>", ", ");
45  }
46 
47  return "None";
48  }
49 
51  {
52  $nodes = array();
53  if(count($pages))
54  {
55  foreach($pages as $page)
56  {
57  if(!$page->parent_id)
58  {
59  $nodes[] = $page;
60  }
61  }
62  }
63 
65  }
66 
68  {
69  $table = new DataListView($pages, "help_pages");
70  $table->column("Help Page", "<a href='help_page_form?help_page_id={help_page_id}&help_book_id={help_book_id}'>{title}</a>")
71  ->column("Identifier", "{identifier}", false, "width: 25%")
72  ->column("Content", array(OnlineHelpHelper, formatHelpPageContent), false, "width: 30%")
73  ->column("Subpages", array(OnlineHelpHelper, formatSubPages), false, "width: 20%")
74  ->column("Public", "{public:Yes/No}", false, "text-align: center; width: 15%")
75  ;
76 
77  if(count($pages) > 1)
78  {
79  $table->enableDragReorder("/action/online_help/reorder_help_pages?help_book_id=$help_book_id");
80  $table->dragText = "<span style='font-size: 10px'>Click and drag to change the order of the help pages</span>";
81  }
82  $table->filter = false;
83  $table->sortable = false;
84  $table->paginate = false;
85 
86  return $table;
87  }
88 }?>
$constraint
$page
Definition: help.inc:39
static buildPageTable($pages, $help_book_id)
static formatHelpPageContent($helpPage)
static buildRootPageTable($pages, $help_book_id)
static formatSubpages($helpPage)
static formatParentOptions($helpBook, $helpPage)
$helpBook
$help_book_id
$helpPage
$pages
Definition: export.inc:38