Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion app/plugins/helpMenu/controllers/ShowController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,20 @@
* ----------------------------------------------------------------------
*/
class ShowController extends ActionController {
public function __construct(&$po_request, &$po_response, $pa_view_paths=null) {
// Set view path for plugin views directory
if (!is_array($pa_view_paths)) { $pa_view_paths = array(); }
$pa_view_paths[] = __CA_APP_DIR__."/plugins/helpMenu/themes/".__CA_THEME__."/views";

// Load plugin configuration file
$this->config = Configuration::load(__CA_APP_DIR__.'/plugins/helpMenu/conf/helpMenu.conf');


parent::__construct($po_request, $po_response, $pa_view_paths);

// Load plugin stylesheet
//MetaTagManager::addLink('stylesheet', __CA_URL_ROOT__."/app/plugins/ArtefactsCanada/themes/".__CA_THEME__."/css/ArtefactsCanada.css",'text/css');
}
# -------------------------------------------------------
/**
*
Expand All @@ -45,5 +59,13 @@ public function __call($ps_method, $pa_path) {
return;
}
}
# -------------------------------------------------------
# -------------------------------------------------------
public function Info(){
$current_page = new ca_site_pages($this->request->getAction());

$this->view->setVar('current_page', $current_page );

return $this->render('widget_helpmenu_info_html.php',true);

}
}
14 changes: 14 additions & 0 deletions app/plugins/helpMenu/helpMenuPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,18 @@ public function hookRenderMenuBar($pa_menu_bar) {
return $pa_menu_bar;
}
# -------------------------------------------------------
/**
* Inserts a quick access menu to other help pages
* This could be replaced if a Menu Sidebar hook is ever implemented
*/
public function hookRenderWidgets($pa_widgets_config){
$pa_widgets_config['helpMenuInfo'] = array(
"domain" => array("module" => "helpMenu", "controller" => "Show"),
"handler" => array("module" => "helpMenu", "controller" => "Show", "action" => "Info", "isplugin" => true),
"requires" => array(),
"parameters" => array()
);
return $pa_widgets_config;

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

$current_page = $this->getVar("current_page");
$current_page_id = $current_page->get('ca_site_pages.page_id');

$pages = ca_site_pages::getPageList(['type' => 'PROVIDENCE_HELP_TEXT']);

if(is_array($pages) && sizeof($pages)){
print "<nav>";
foreach( $pages as $page ) {
$page_id = $page['page_id'];
$page_title = $page['title'];
print "<h2>";
print caNavLink($this->request, $page_title, ($current_page_id == $page_id) ? 'sf-menu-selected' : '', 'helpMenu', 'Show', $page_id);
print "</h2>";
}
print "</nav>";
}
?>