Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read only mode CM #2710

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions mod/gcconnex_read_only_CM/languages/en.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

return array(

'readonly:message' => 'GCConnex is in Read-Only Mode',
'readonly:message:1' => 'You can no longer make new posts or create new content anywhere on GCConnex except for the <a href="https://gcconnex.gc.ca/missions/main" target="_blank">Career Marketplace</a>. You can export and save your existing content up until the decommission date on <b>April 1, 2025.</b>',
'readonly:message:2' => '<a href="https://gcconnex.gc.ca/gcconnex_is_moving" target="_blank">Learn how to export and store your GCConnex content.</a>',
'readonly:message:3' => 'We are encouraging all GCConnex users to move to GCXchange. Most departments have automatically created GCXchange accounts for their employees. <a href="https://gcxgce.sharepoint.com/SitePages/Home.aspx" target="_blank">Visit GCXchange</a> to explore the homepage.',
'readonly:message:4' => 'If the GCXchange link didn’t work, you might not have a GCXchange account yet. <a href="https://www.gcx-gce.gc.ca" target="_blank">Register for an account today.</a>'
);
10 changes: 10 additions & 0 deletions mod/gcconnex_read_only_CM/languages/fr.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

return array(

'readonly:message' => 'GCConnex est en mode lecture seule',
'readonly:message:1' => 'Désormais, vous ne pouvez plus publier de messages ni créer de contenu dans GCConnex, à l’exception du <a href="https://gcconnex.gc.ca/missions/main" target="_blank">Carrefour de carrière</a>. Vous pouvez toutefois exporter et sauvegarder votre contenu existant jusqu’au <b>1er avril 2025</b>, date où GCConnex sera mis hors service.',
'readonly:message:2' => '<a href="https://gcconnex.gc.ca/gcconnex_demenage" target="_blank">Directives sur l’exportation et le stockage de votre contenu GCConnex.</a>',
'readonly:message:3' => 'Nous invitons les utilisateurs de GCConnex à migrer vers GCÉchange. La plupart des ministères ont automatiquement créé des comptes GCÉchange pour leurs employés. <a href="https://gcxgce.sharepoint.com/SitePages/fr/Home.aspx" target="_blank">Cliquez ici</a> pour découvrir la page d’accueil de GCÉchange.',
'readonly:message:4' => 'Si le lien ci-dessus ne fonctionne pas, c’est peut-être parce que vous n’avez pas encore de compte. <a href="https://www.gcx-gce.gc.ca" target="_blank">Inscrivez-vous à GCÉchange dès aujourd’hui.</a>'
);
30 changes: 30 additions & 0 deletions mod/gcconnex_read_only_CM/manifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin_manifest xmlns="http://www.elgg.org/plugin_manifest/1.8">
<name>Read Only Mode CM</name>
<id>gcconnex_read_only_CM</id>
<author>Government of Canada</author>
<version>1.0</version>
<category>Decommission CM</category>
<description>Read Only Mode for gcconnex CM</description>
<website>http://www.canada.ca/</website>
<license>Creative Commons Attribution 3.0 Unported License</license>

<requires>
<type>elgg_release</type>
<version>1.12</version>
</requires>

<requires>
<type>priority</type>
<plugin>missions</plugin>
<priority>after</priority>
</requires>

<requires>
<type>priority</type>
<plugin>read_only_mod</plugin>
<priority>after</priority>
</requires>

<activate_on_install>false</activate_on_install>
</plugin_manifest>
84 changes: 84 additions & 0 deletions mod/gcconnex_read_only_CM/start.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?php
/*
* GC-Elgg Read Only Mode CM
*
* Read only mode for gcconnex CM
*
* @author Adi github.com/AdiMakkar
* @version 1.0
*/

elgg_register_event_handler('init', 'system', 'read_only_mode_CM');

function read_only_mode_CM(){

}

function init_ajax_block_no_edit_CM($title, $section, $user) {

switch($section){
case 'about-me':
$field = elgg_echo('gcconnex_profile:about_me');
break;
case 'education':
$field = elgg_echo('gcconnex_profile:education');
break;
case 'work-experience':
$field = elgg_echo('gcconnex_profile:experience');
break;
case 'skills':
$field = elgg_echo('gcconnex_profile:gc_skills');
break;
case 'languages':
$field = elgg_echo('gcconnex_profile:langs');
break;
case 'portfolio':
$field = elgg_echo('gcconnex_profile:portfolio');
break;
}

echo '<div class="panel">';
echo'<div class="panel-body profile-title">';
echo '<h2 class="pull-left">' . $title . '</h2>'; // create the profile section title

echo '</div>';
// create the profile section wrapper div for css styling
echo '<div id="edit-' . $section . '" tabindex="-1" class="gcconnex-profile-section-wrapper panel-body gcconnex-' . $section . '">';
}

function mm_create_button_set_base_CM($mission, $full_view=false) {
$returner = array();

if(!$full_view) {
// Handles the case where a read more button is needed.
$button_zero = '<div id="read-more-button-mission-' . $mission->guid . '" name="read-more-button" style="display:inline-block;">' . elgg_view('output/url', array(
'href' => $mission->getURL(),
'text' => elgg_echo('missions:view').elgg_echo("mission:button:oppurtunity", array($mission->title)),
'class' => 'elgg-button btn btn-default',
'style' => 'margin:2px;'
)) . '</div>';
}

$returner['button_zero'] = $button_zero;
return $returner;
}

function decommission_message_CM() {

echo "<div class='panel panel-default'>
<div class='panel-body'>
<div class='col-md-4'>
<img src='" . $site_url . "/mod/gcconnex_read_only_CM/graphics/GCconnex_Decom_Final_Banner.png' alt='" . elgg_echo('readonly:message') . "' />
</div>
<div class='col-md-8'>
<div class='mrgn-lft-lg'>
<div class='mrgn-bttm-md h3 mrgn-tp-0'>" . elgg_echo('readonly:message') . "</div>
<div class='mrgn-bttm-md'>" . elgg_echo('readonly:message:1') . "</div>
<div class='mrgn-bttm-md'>" . elgg_echo('readonly:message:2') . "</div>
<div class='mrgn-bttm-md'>" . elgg_echo('readonly:message:3') . "</div>
<div>" . elgg_echo('readonly:message:4') . "</div>
</div>
</div>
</div>
</div>";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
/*
* GC-Elgg Read Only Mode
*
* Read only mode for gcconnex
*
* @author Adi github.com/AdiMakkar
* @version 1.0
*/

decommission_message_CM();
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
/*
* GC-Elgg Read Only Mode
*
* Read only mode for gcconnex
*
* @author Adi github.com/AdiMakkar
* @version 1.0
*/

decommission_message_CM();
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?php
/*
* Author: National Research Council Canada
* Website: http://www.nrc-cnrc.gc.ca/eng/rd/ict/
*
* License: Creative Commons Attribution 3.0 Unported License
* Copyright: Her Majesty the Queen in Right of Canada, 2015
*/

$tabs = '';
$navigation_tabs = array(
array(
'text' => elgg_echo('missions:search_opportunities'),
'href' => elgg_get_site_url() . 'missions/main/find',
'selected' => $vars['highlight_one'],
'id' => 'mission-navigate-to-find-opportunity'
),
array(
'text' => elgg_echo('missions:find_members'),
'href' => elgg_get_site_url() . 'missions/main/members',
'selected' => $vars['highlight_three'],
'id' => 'mission-navigate-to-member-search'
),
array(
'text' => elgg_echo('missions:my_opportunities'),
'href' => elgg_get_site_url() . 'missions/main/mine',
'selected' => $vars['highlight_two'],
'id' => 'mission-navigate-to-my-opportunities'
),
array(
'text' => elgg_echo('missions:archive'),
'href' => elgg_get_site_url() . 'missions/main/archive',
'selected' => $vars['highlight_four'],
'id' => 'mission-navigate-to-archive'
)
);
if(elgg_get_plugin_setting('mission_analytics_on', 'missions') != 'NO') {
$navigation_tabs[4] = array(
'text' => elgg_echo('missions:analytics'),
'href' => elgg_get_site_url() . 'missions/main/analytics',
'selected' => $vars['highlight_five'],
'id' => 'mission-navigate-to-analytics'
);
}

$tabs = elgg_view('navigation/tabs', array(
'class' => 'elgg-menu elgg-menu-filter list-inline mrgn-lft-sm elgg-menu-filter-default mission-tab',
'tabs' => $navigation_tabs
));
//Nick - need to test if we are on analytics to not show the create button
//Nick - find out if the user is on the analytics page
$current_url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
$break_url = explode('/',$current_url);
$current_path = array_pop($break_url);

if($current_path == "analytics"){ //Nick - Are we on analytics? don't show create button
$create_button = '';
}else{
// $create_button = elgg_view('output/url', array(
// 'href' => elgg_get_site_url() . 'action/missions/pre-create-opportunity',
// 'text' => elgg_echo('missions:create_opportunity'),
// 'is_action' => true,
// 'class' => 'elgg-button btn btn-primary',
// 'style' => 'float:right;',
// 'id' => 'mission-create-opportunity-button'
// )) . '</br>';
}



?>

<div class="clearfix col-sm-12" style="margin-bottom:4px;">
<div class="col-sm-9">
<?php echo $tabs;

?>

</div>
<div class="col-sm-3">
<?php echo $create_button; ?>
</div>
</div>
Loading