Skip to content

Commit

Permalink
Added help link - because this is a partial used by many pages - kind…
Browse files Browse the repository at this point in the history
… of hacky and changes some translations
  • Loading branch information
oharsta committed Oct 28, 2013
1 parent 7bef30b commit 7477200
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion application/layouts/scripts/1-column-blue-grey-tabs.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ require PARTIAL_DIR . 'header-start.php';
$(document).ready(function() {
$('#Tabs').tabs();

$('ul.nav>li').live('click', function(e) {
$('ul.nav>li').not('[data-external-link=true]').live('click', function(e) {
e.preventDefault();
var href = $(this).find('a').attr('href');
document.location = '/' + href + $('div#Tabs li.ui-tabs-selected>a').attr('href');
Expand Down
5 changes: 5 additions & 0 deletions application/layouts/scripts/partials/nav.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@
<li class="<?php if ($lang==='nl'): ?>active<?php endif; ?>">
<a href="<?php echo EngineBlock_View::setLanguage('nl'); ?>">NL</a>
</li>
<?php if (EngineBlock_View::moduleName() == 'profile'): ?>
<li data-external-link="true">
<a href="https://wiki.surfnet.nl/display/conextsupport/Profile+page" target="_blank">Help</a>
</li>
<?php endif; ?>
</ul>
2 changes: 1 addition & 1 deletion languages/en.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
'profile_apps_eula_th' => 'EULA',
'profile_apps_support_name_th' => 'Support person name',
'profile_apps_support_url_th' => 'Support URL',
'profile_apps_support_email_th' => 'Support person email',
'profile_apps_support_email_th' => 'Support email',
'profile_apps_support_phone_th' => 'Support person phone',
'profile_apps_consent_th' => 'Consent group information',
'profile_revoke_consent' => 'Revoke',
Expand Down
11 changes: 11 additions & 0 deletions library/EngineBlock/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,17 @@ public static function profileUrl($path = "")
return $settings->profile->protocol . '://'. $settings->profile->host . $path;
}

/**
* Return the module name
*
* @return string
*/
public static function moduleName()
{
$serverName = $_SERVER['SERVER_NAME'];
return $serverName ? strtolower(trim(substr($serverName, 0, strpos($serverName, '.')))) : 'engine';
}

/**
* Set the language on the query string and return the new query string
*
Expand Down

0 comments on commit 7477200

Please sign in to comment.