Skip to content
Snippets Groups Projects
Commit 20208e55 authored by spennythug's avatar spennythug
Browse files

Merge branch 'develop' of git.unl.edu:iim/PlanetRed into develop

parents 2f3e4c7c 92ef009a
No related branches found
No related tags found
No related merge requests found
<?php
cas_auth_unl_logout_page_handler();
\ No newline at end of file
......@@ -21,20 +21,21 @@
$auth->singleLogOut();
// Set up login page, this creates the url /login to be used as our login page
elgg_register_page_handler('login', 'login_page_handler');
elgg_register_page_handler('logout', 'logout_page_handler');
elgg_register_page_handler('register', 'registration_page_handler');
elgg_register_page_handler('login', 'cas_auth_unl_login_page_handler');
elgg_register_page_handler('logout', 'cas_auth_unl_logout_page_handler');
elgg_register_page_handler('register', 'cas_auth_unl_registration_page_handler');
/* set up getemail page */
elgg_register_page_handler('getemail', 'getemail_page_handler');
elgg_register_page_handler('getemail', 'cas_auth_unl_getemail_page_handler');
elgg_register_action('getemail', $CONFIG->pluginspath . 'cas_auth_unl/actions/getemail.php', 'public');
elgg_register_action('logout', $CONFIG->pluginspath . 'cas_auth_unl/actions/logout.php', 'public');
}
// Fire up the plugin initialization using the elgg handler
elgg_register_event_handler('init','system','cas_auth_unl_init');
function login_page_handler($page) {
function cas_auth_unl_login_page_handler($page) {
// If we're not logged in, display the login page
if (!elgg_is_logged_in()) {
$auth = new UnlCAS();
......@@ -45,7 +46,7 @@
forward();
}
function logout_page_handler($page) {
function cas_auth_unl_logout_page_handler($page) {
if (elgg_is_logged_in()) {
// If we're not logged in, display the login page
$auth = new UnlCAS();
......@@ -56,7 +57,7 @@
forward();
}
function registration_page_handler($page) {
function cas_auth_unl_registration_page_handler($page) {
if (elgg_is_logged_in()) {
// Otherwise, forward to the index page
forward();
......@@ -79,7 +80,7 @@
forward();
}
function getemail_page_handler($page) {
function cas_auth_unl_getemail_page_handler($page) {
if (!isloggedin()) {
page_draw(elgg_echo('Your Email'), elgg_view("account/forms/getemail"));
} else {
......
......@@ -56,12 +56,15 @@ function unl_theme_init() {
* Elgg has its own requireJS, and expects a different baseURL than the UNL framework. Reset back to the framework.
*/
$base_url = elgg_get_site_url();
//Add paths stuff to the requirejs config
_elgg_services()->amdConfig->addPath('languages/en', '/elgg/js/languages');
//_elgg_services()->amdConfig->addPath('elgg/reportedcontent', '/elgg/mod/reportedcontent/views/default/elgg/reportedcontent');
_elgg_services()->amdConfig->addPath('unl_theme/js', '/elgg/mod/unl_theme/views/default/js/unl_theme/js');
_elgg_services()->amdConfig->addPath('bootstrap', '/elgg/mod/unl_theme/vendors/bower_components/bootstrap/dist/js/bootstrap');
_elgg_services()->amdConfig->addPath('moment', '/elgg/mod/unl_theme/vendors/bower_components/moment/moment');
_elgg_services()->amdConfig->removePath('languages/en');
_elgg_services()->amdConfig->addPath('languages/en', $base_url.'js/languages');
_elgg_services()->amdConfig->addPath('elgg/reportedcontent', $base_url.'mod/reportedcontent/views/default/elgg/reportedcontent');
_elgg_services()->amdConfig->addPath('unl_theme/js', $base_url.'mod/unl_theme/views/default/js/unl_theme/js');
_elgg_services()->amdConfig->addPath('bootstrap', $base_url.'mod/unl_theme/vendors/bower_components/bootstrap/dist/js/bootstrap');
_elgg_services()->amdConfig->addPath('moment', $base_url.'mod/unl_theme/vendors/bower_components/moment/moment');
......
......@@ -13,9 +13,18 @@ unset($amdConfig['deps']);
require(['jquery', 'jqueryui'], function($) {
window.$ = $;
});
<?php
/**
* Elgg ships with is own baseUrl, which conflicts with the framework baseUrl.
* So, we need to
* 1) remove Elgg's base url (in favor of the framework's)
* 2) define absolute paths to elgg's modules (see start.php)
*/
unset($amdConfig['baseUrl']);
?>
//Merge the framework require config with elgg's require config (prefer UNL's settings)
require.config($.extend(<?php echo json_encode($amdConfig, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); ?>, requirejs.s.contexts._.config));
require.config(<?php echo json_encode($amdConfig, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); ?>);
<?php
// Note we don't process the require() queue yet because it may require('elgg')
......
......@@ -23,6 +23,11 @@ use UNL\Templates\Templates;
$unl_template = Templates::factory('Fixed', Templates::VERSION_4_1);
$wdn_include_path = elgg_get_root_path();
if (file_exists($wdn_include_path . '/wdn/templates_4.1')) {
$unl_template->setLocalIncludePath($wdn_include_path);
}
$unl_template->navlinks = elgg_view_menu('site', array(
'sort_by' => 'priority'
));
......@@ -33,15 +38,5 @@ $unl_template->titlegraphic ="Planet Red";
$unl_template->pagetitle ="";
$unl_template->affiliation ="";
$unl_template->head = $vars['head'];
$unl_template->head .= "<script type='text/javascript'>require.config({
paths: {
'languages/en': '/elgg/js/languages',
'elgg/reportedcontent': '/elgg/mod/reportedcontent/views/default/js/elgg/reportedcontent',
'unl_theme/js': '/elgg/mod/unl_theme/views/default/js/unl_theme/js',
'bootstrap': '/elgg/mod/unl_theme/vendors/bower_components/bootstrap/dist/js/bootstrap',
//'fuelux': '/elgg/mod/unl_theme/vendors/bower_components/fuelux/dist/js/fuelux.min',
'moment': '/elgg/mod/unl_theme/vendors/bower_components/moment/moment'
}
});</script>";
echo $unl_template;
......@@ -76,7 +76,7 @@ apache:
serveraliases:
- localhost
- '*'
docroot: /var/www/html
docroot: /var/www/html/elgg
port: '80'
setenv:
- 'APP_ENV dev'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment