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

GT-127 Outdated links to be configurable #436

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
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
13 changes: 13 additions & 0 deletions config/local_info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@
<!-- If page_banner is not empty the text is used to create a page banner strip -->
<page_banner></page_banner>

<!-- Documentation links to be configurable -->
<project>
<doc_link></doc_link>
</project>

<ngi>
<doc_link></doc_link>
</ngi>

<service_group>
<doc_link></doc_link>
</service_group>

<!-- Email addresses to send from and reply to -->
<email_from>no-reply@localhost</email_from>
<email_to>gocdb-admins@localhost</email_to>
Expand Down
7 changes: 7 additions & 0 deletions htdocs/web_portal/controllers/ngi/view_ngis.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ function view_ngis() {
require_once __DIR__ . '/../utils.php';
require_once __DIR__.'/../../../../lib/Gocdb_Services/Factory.php';

$configService = \Factory::getConfigservice();

$filterParams = array();

// $scope = '%%';
Expand Down Expand Up @@ -68,6 +70,11 @@ function view_ngis() {
$params['ngis'] = $ngis;
$params['scopes']=$scopes;
$params['selectedScopes']=$selectedScopes;

// adding the configurable ngi documentation link to the params array
$ngiDocLink = $configService->getNgiDocLink();
$params['ngiDocLink'] = $ngiDocLink;

show_view('ngi/view_ngis.php', $params, "NGIs");
}

Expand Down
15 changes: 13 additions & 2 deletions htdocs/web_portal/controllers/project/view_all.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,20 @@

function show_all_projects() {
require_once __DIR__.'/../../../../lib/Gocdb_Services/Factory.php';
$projects = \Factory::getProjectService()->getProjects();

$params = array();

$configService = \Factory::getConfigService();
$projectService = \Factory::getProjectService();

$projects = $projectService->getProjects();
$params['Projects'] = $projects;

// adding the configurable project documentation link to the params array
$projectDocLink = $configService->getProjectDocLink();
$params['projectDocLink'] = $projectDocLink;

show_view('project/view_all.php', $params, "Projects");
}

?>
?>
7 changes: 7 additions & 0 deletions htdocs/web_portal/controllers/service_group/view_all.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
function showAllServiceGroups(){
require_once __DIR__.'/../../../../lib/Gocdb_Services/Factory.php';

$configService = \Factory::getConfigService();

$filterParams = array();

// Scope parameters
Expand Down Expand Up @@ -90,5 +92,10 @@ function showAllServiceGroups(){
$params['selectedExtKeyName'] = $extensionPropName; //$sgKeyNames;
$params['selectedExtKeyValue'] = $extensionPropValue; //$sgKeyValues;
$params['extKeyName'] = $keynames;

// adding the configurable service group documentation link to the params array
$serviceGroupDocLink = $configService->getServiceGroupDocLink();
$params['serviceGroupDocLink'] = $serviceGroupDocLink;

show_view("service_group/view_all.php", $params);
}
2 changes: 1 addition & 1 deletion htdocs/web_portal/views/ngi/view_ngis.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
National Grid Initiatives
</span>
<span style="clear: both; float: left; padding-bottom: 0.4em;">
<a style="float: left; padding-top: 0.3em;" href="http://www.egi.eu/about/glossary/glossary_N.html">What is an NGI?</a>
<a style="float: left; padding-top: 0.3em;" href="<?php echo $params['ngiDocLink'] ?>">What is an NGI?</a>
</span>
</div>

Expand Down
2 changes: 1 addition & 1 deletion htdocs/web_portal/views/project/view_all.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</span>
<span style="clear: both; float: left; padding-bottom: 0.4em;">
<!-- TODO: link -->
<a style="float: left; padding-top: 0.3em;" href="https://wiki.egi.eu/wiki/GOCDB/Input_System_User_Documentation#Projects">
<a style="float: left; padding-top: 0.3em;" href="<?php echo $params['projectDocLink'] ?>">
What is a project?
</a>
</span>
Expand Down
2 changes: 1 addition & 1 deletion htdocs/web_portal/views/service_group/view_all.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
All Service Groups in GOCDB.
</span>
<span style="clear: both; float: left; padding-bottom: 0.4em;">
<a style="float: left; padding-top: 0.3em;" href="https://wiki.egi.eu/wiki/GOCDB/Input_System_User_Documentation#Service_Groups">
<a style="float: left; padding-top: 0.3em;" href="<?php echo $params['serviceGroupDocLink'] ?>">
What is a service group?
</a>
</span>
Expand Down
21 changes: 21 additions & 0 deletions lib/Gocdb_Services/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -556,4 +556,25 @@ public function getEmailTo()

return $emailTo;
}

public function getProjectDocLink()
{
$projectDocLink = $this->GetLocalInfoXML()->project->doc_link;

return $projectDocLink;
}

public function getNgiDocLink()
{
$ngiDocLink = $this->GetLocalInfoXML()->ngi->doc_link;

return $ngiDocLink;
}

public function getServiceGroupDocLink()
{
$serviceGroupDocLink = $this->GetLocalInfoXML()->service_group->doc_link;

return $serviceGroupDocLink;
}
}