CMS  Version 3.9
OnlineHelpManager Class Reference

Public Member Functions

 OnlineHelpManager ($book)
 
 startFrame ($class)
 
 endFrame ()
 

Static Public Member Functions

static setDefaults ()
 
static onInitialize ()
 
static substituteHelpLink ($output)
 
static getAdminTabs ($key)
 
static upgradeComponent ($version)
 
static registerSerializationHandler ()
 

Public Attributes

 $book
 

Detailed Description

Definition at line 60 of file online_help_manager.inc.

Member Function Documentation

◆ endFrame()

OnlineHelpManager::endFrame ( )

Definition at line 171 of file online_help_manager.inc.

172  {
173 ?>
174  </body>
175 </html>
176 <?
177  }

◆ getAdminTabs()

static OnlineHelpManager::getAdminTabs (   $key)
static

Definition at line 104 of file online_help_manager.inc.

105  {
106  $tabs = array( "Details" => "/admin/help_book_form",
107  "Help Pages" => "/admin/help_pages"
108  );
109 
110  $qs = ($key) ? "help_book_id=$key" : "";
111  return new TabBar("tabs", $tabs, $qs);
112  }
$tabs

◆ onInitialize()

static OnlineHelpManager::onInitialize ( )
static

Definition at line 77 of file online_help_manager.inc.

78  {
79  global $help_book;
80  global $help_page;
81  }

◆ OnlineHelpManager()

OnlineHelpManager::OnlineHelpManager (   $book)

Definition at line 64 of file online_help_manager.inc.

65  {
66  $this->book = $book;
67  }

◆ registerSerializationHandler()

static OnlineHelpManager::registerSerializationHandler ( )
static

Definition at line 120 of file online_help_manager.inc.

121  {
122  SerializationManager::registerHandler("online_help", "Online Help", new OnlineHelpSerializationHandler());
123  }
registerHandler($component, $title, $handler)
Registers a serialization handler for a component.

◆ setDefaults()

static OnlineHelpManager::setDefaults ( )
static

Definition at line 69 of file online_help_manager.inc.

70  {
71  Settings::setDefaultValue("online_help", "default_book", "", String, "Specify the default help book to which the help link will connect");
72  Settings::setDefaultValue("online_help", "use_page_identifiers", "", Boolean, "Use page identifiers as the default help identifier");
73  Settings::setDefaultValue("online_help", "help_text", "Help", String, "The text to display on the help link");
74  Settings::setDefaultValue("online_help", "help_css", "/components/online_help/css/online_help.css", String, "CSS Files defining the help popup look and feel (comma separated)");
75  }
static setDefaultValue($component, $name, $value, $field_type="String", $annotation="", $category="", $options="", $weight=0)
Sets the default value of the given component setting.
Definition: settings.inc:174

◆ startFrame()

OnlineHelpManager::startFrame (   $class)

Definition at line 125 of file online_help_manager.inc.

126  {
127  global $script;
129 
130  // Ensure that video player is configured.
131 
132  $flowPlayerScript = Settings::getValue("video", "flowplayer_script");
133 
134  if ($flowPlayerScript)
135  {
136  $script .= "<script type='text/javascript' src='$flowPlayerScript'></script>\n";
137  }
138 
139  $flowPlayer = Settings::getValue("video", "flowplayer_player");
140 
141  $script .= "<script type='text/javascript'>\nvar flowplayerPath = '$flowPlayer';\n</script>\n";
142 
143 
145 
146  $css = explode(",", Settings::getValue("online_help", "help_css"));
147  $additional = explode(",", $this->book->additional_css_files);
148 
149  foreach($css as $c)
150  {
151  $styles .= "<link href='$c' rel='stylesheet'/>\n";
152  }
153 
154  foreach($additional as $c)
155  {
156  $styles .= "<link href='$c' rel='stylesheet'/>\n";
157  }
158 
159 ?>
160 <!DOCTYPE html>
161 <html>
162  <head>
163  <?echo $styles?>
164  <?echo $script?>
165  </head>
166  <body class='<?echo $class?>'>
167 <?
168  $script = "";
169  }
static getStyles()
Returns the HTML link tags for CSS files specified by the registered components in their manifest fil...
Definition: core.inc:603
static getScripts()
Returns the HTML scripts tags for Javascript files specified by the registered components in their ma...
Definition: core.inc:554
static getValue($component, $name)
Retrieve the value of the specified Setting.
Definition: settings.inc:104
if(!checkRole("admin")) $c
$styles

◆ substituteHelpLink()

static OnlineHelpManager::substituteHelpLink (   $output)
static

Definition at line 83 of file online_help_manager.inc.

84  {
85  global $help_book;
86  global $help_page;
87  global $page;
88 
89  $useIdentifier = Settings::getValue("online_help", "use_page_identifiers");
90  if (!$help_book) $help_book = Settings::getValue("online_help", "default_book");
91  if (!$help_page && $useIdentifier) $help_page = $page->identifier;
92 
93  if ($help_book && $help_page)
94  {
95  $helpText = Settings::getValue("online_help", "help_text");
96  $helpLink = "<a class='help_link' href='#' onclick='OnlineHelp.help(\"{$help_book}\", \"{$help_page}\"); return false;'>$helpText</a>";
97 
98  $output = str_replace("{help}", $helpLink, $output);
99  }
100 
101  return $output;
102  }
$page
Definition: help.inc:39
$output
Definition: generate.inc:9

◆ upgradeComponent()

static OnlineHelpManager::upgradeComponent (   $version)
static

Definition at line 114 of file online_help_manager.inc.

115  {
117  $mgr->upgrade($version);
118  }

Member Data Documentation

◆ $book

OnlineHelpManager::$book

Definition at line 62 of file online_help_manager.inc.


The documentation for this class was generated from the following file: