Skip to content

Commit

Permalink
Remove Platform menu, refactor several message strings to use correct…
Browse files Browse the repository at this point in the history
… localization, and replace Match references from copied files (CFM-55)
  • Loading branch information
arlen committed Jan 3, 2022
1 parent a1aad0d commit c1ec867
Show file tree
Hide file tree
Showing 17 changed files with 66 additions and 88 deletions.
2 changes: 1 addition & 1 deletion app/config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @link http://www.internet2.edu/comanage COmanage Project
* @link https://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v5.0.0
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
Expand Down
18 changes: 18 additions & 0 deletions app/resources/locales/en_US/operation.po
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,21 @@ msgstr "Generate API Key"
msgid "api.key.generate.confirm"
msgstr "Are you sure you wish to generate a new API Key?"

msgid "cancel"
msgstr "Cancel"

msgid "clear"
msgstr "Clear"

msgid "clear.filters"
msgstr "{0,plural,=1{Clear Filter} other{Clear Filters}}"

msgid "close"
msgstr "Close"

msgid "confirm"
msgstr "Confirm"

msgid "dashboard.configuration"
msgstr "Manage {0} Configuration"

Expand All @@ -51,6 +66,9 @@ msgstr "Edit"
msgid "edit.a"
msgstr "Edit {0}"

msgid "filter"
msgstr "Filter"

msgid "first"
msgstr "First"

Expand Down
2 changes: 1 addition & 1 deletion app/src/Controller/AppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @link http://www.internet2.edu/comanage COmanage Project
* @link https://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v5.0.0
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
Expand Down
2 changes: 1 addition & 1 deletion app/src/Controller/Component/RegistryAuthComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ public function getAuthenticatedUser() {
public function getMenuPermissions() {
$permissions = [];

// XXX need to set permissions according to current user's roles
// XXX need to set permissions according to current user's roles
$permissions['platform'] = true;

// Can access the Configuration Dashboard for the current CO
Expand Down
2 changes: 1 addition & 1 deletion app/src/Lib/Enum/SuspendableStatusEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @link http://www.internet2.edu/comanage COmanage Project
* @link https://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v5.0.0
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
Expand Down
2 changes: 1 addition & 1 deletion app/src/Lib/Random/RandomString.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* limitations under the License.
*
* @link https://www.internet2.edu/comanage COmanage Project
* @package match
* @package registry
* @since COmanage Registry v5.0.0
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/
Expand Down
1 change: 0 additions & 1 deletion app/templates/Cos/select.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
<div class="row co-row linked-row spin">
<div class=col collab-name">
<?= $this->Html->link(
// XXX do we need filter_var? -- Yes -- should sanitize
$co->name,
['plugin' => null,
'controller' => 'dashboards',
Expand Down
30 changes: 15 additions & 15 deletions app/templates/Standard/index.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* COmanage Standard Index Template
* COmanage Registry Standard Index Template
*
* Portions licensed to the University Corporation for Advanced Internet
* Development, Inc. ("UCAID") under one or more contributor license agreements.
Expand Down Expand Up @@ -61,26 +61,26 @@ function _column_key($modelsName, $c, $tz=null) {
if(strpos($c, "_id", strlen($c)-3)) {
// Key is of the form field_id, use .ct label instead
$k = \Cake\Utility\Inflector::classify(\Cake\Utility\Inflector::pluralize(substr($c, 0, strlen($c)-3)));

return __d('controller' ,$k, [1]);
}

// Look for a model specific key first
$label = __d('field', $modelsName.'.'.$c);

if($label != $modelsName.'.'.$c) {
return $label;
}

if($tz) {
// If there is a timezone aware label, use that
$label = __d('field', $c.'.tz', [$tz]);

if($label != $c.'.tz') {
return $label;
}
}

// Otherwise look for the general key
return __d('field', $c);
}
Expand Down Expand Up @@ -108,7 +108,7 @@ function _column_key($modelsName, $c, $tz=null) {
} else {
$t['link']['?'] = $linkFilter;
}

print '<li>' .
$this->Html->link(
'<em class="material-icons" aria-hidden="true">' . $t['icon']. '</em> ' . $t['label'],
Expand Down Expand Up @@ -197,7 +197,7 @@ function _column_key($modelsName, $c, $tz=null) {
$f = null;
if(preg_match('/^(.*?)_id$/', $col, $f)) {
$avv = \Cake\Utility\Inflector::variable(\Cake\Utility\Inflector::pluralize($f[1]));

if(!empty(${$avv}[$entity->$col])) {
// We found the viewvar (eg: $foos), and it has a corresponding value
// (eg: $foos[3]), so render it
Expand Down Expand Up @@ -248,18 +248,18 @@ function _column_key($modelsName, $c, $tz=null) {
default:
// By default our label is the column value, but it might be overridden
$label = $entity->$col;

if(!empty($cfg['model']) && !empty($cfg['field'])) {
$m = $cfg['model'];
$f = $cfg['field'];

if(!empty($entity->$m->$f)) {
$label = $entity->$m->$f;
}
}

$linked = false;

if($cfg['type'] == 'link') {
foreach($linkActions as $a) {
// Does this user have permission for this action?
Expand All @@ -271,7 +271,7 @@ function _column_key($modelsName, $c, $tz=null) {
}
}
}

if(!$linked) {
// Just echo the value
print $label;
Expand Down Expand Up @@ -358,4 +358,4 @@ function _column_key($modelsName, $c, $tz=null) {
</div>

<?php
print $this->element("pagination");
print $this->element("pagination");
8 changes: 4 additions & 4 deletions app/templates/element/badgeList.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
* COmanage Match Badge List
* COmanage Registry Badge List
*
* Portions licensed to the University Corporation for Advanced Internet
* Development, Inc. ("UCAID") under one or more contributor license agreements.
Expand Down Expand Up @@ -32,9 +32,9 @@
* );
*
*
* @link http://www.internet2.edu/comanage COmanage Project
* @package match
* @since COmanage Match v1.0.0
* @link https://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v5.0.0
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/
?>
Expand Down
10 changes: 5 additions & 5 deletions app/templates/element/dialog.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @link http://www.internet2.edu/comanage COmanage Project
* @link https://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v5.0.0
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
Expand All @@ -34,16 +34,16 @@
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h2 class="modal-title" id="dialog-title"><?= __('match.op.confirm'); ?></h2>
<button type="button" class="btn-close nospin" data-bs-dismiss="modal" aria-label="Close"/>
<h2 class="modal-title" id="dialog-title"><?= __d('operation', 'confirm'); ?></h2>
<button type="button" class="btn-close nospin" data-bs-dismiss="modal" aria-label="<?= __d('operation', 'close'); ?>"/>
</div>
<div id="dialog-text" class="modal-body">
</div>
<div class="modal-footer">
<button type="button" class="btn nospin"
id="dialog-cancel-button" data-bs-dismiss="modal"><?= __('match.op.cancel'); ?></button>
id="dialog-cancel-button" data-bs-dismiss="modal"><?= __d('operation', 'cancel'); ?></button>
<button type="button" class="btn btn-primary" data-bs-dismiss="modal"
id="dialog-confirm-button"><?= __('match.op.confirm'); ?></button>
id="dialog-confirm-button"><?= __d('operation', 'confirm'); ?></button>
</div>
</div>
</div>
Expand Down
10 changes: 5 additions & 5 deletions app/templates/element/menuAction.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
* COmanage Match Action Menu
* COmanage Registry Action Menu
*
* Portions licensed to the University Corporation for Advanced Internet
* Development, Inc. ("UCAID") under one or more contributor license agreements.
Expand All @@ -19,9 +19,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @link http://www.internet2.edu/comanage COmanage Project
* @package match
* @since COmanage Match v1.0.0
* @link https://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v5.0.0
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/

Expand All @@ -41,7 +41,7 @@ class="<?= $actionsMenuClass; ?>">
'data-bs-toggle' => 'dropdown',
'aria-haspopup' => true,
'aria-expanded' => false,
'title' => __('match.fd.action')
'title' => __d('field', 'action')
);
print $this->Html->link(
'<span class="material-icons">settings</span>',
Expand Down
40 changes: 0 additions & 40 deletions app/templates/element/menuTop.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,46 +28,6 @@
?>
<?php if(!empty($vv_user)): ?>
<ul>
<?php if($vv_menu_permissions['platform']): // when globally available, add: && !empty($vv_platform_menu_items) ?>
<li id="top-menu-platform">
<a class="dropdown-toggle nospin" href="#" role="button" id="platform-dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="top-menu-link-text">
<?= __d('menu','co.platform'); ?>
</span>
<em class="material-icons">build</em>
</a>

<div class="dropdown-menu" aria-labelledby="platform-dropdown-toggle">
<!-- XXX Remove this static link when/if $vv_platform_menu_items are global -->
<?= $this->Html->link(
'<em class="material-icons" aria-hidden="true">build</em>'
. '<span class="menu-title">' . __d('controller','Cos', [99]) . '</span>',
['plugin' => null,
'controller' => 'cos',
'action' => 'index'],
['escape' => false,'class' => 'dropdown-item']
); ?>

<!-- XXX Keep the following for when/if $vv_platform_menu_items are global. Then remove the static link above. -->
<!-- The following "if" test can also go away and be placed in the upper wrapper when/if $vv_platform_menu_items are global -->
<?php if(!empty($vv_platform_menu_items)): ?>
<?php foreach($vv_platform_menu_items as $label => $cfg): ?>
<?php
$linkContent = '<em class="material-icons" aria-hidden="true">' . $icon . '</em>'
. '<span class="menu-title">' . $label . '</span>';
?>
<?= $this->Html->link(
$linkContent,
['plugin' => null,
'controller' => $cfg['controller'],
'action' => $cfg['action']],
['escape' => false,'class' => 'dropdown-item']
); ?>
<?php endforeach; // $vv_configuration_menu_items ?>
<?php endif; ?>
</div>
</li>
<?php endif; // $vv_platform_menu_items ?>
<li id="top-menu-user">
<a class="dropdown-toggle nospin" href="#" role="button" id="user-panel-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="top-menu-link-text">
Expand Down
15 changes: 8 additions & 7 deletions app/templates/element/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
<fieldset onclick="event.stopPropagation();">
<legend id="top-search-toggle">
<em class="material-icons">search</em>
<?= __('match.op.filter');?>
<?= __d('operation', 'filter'); ?>


<?php if(!empty($search_params)):?>
<span id="top-search-active-filters">
Expand All @@ -71,7 +72,7 @@
// We have active filters - not just a sort.
$hasActiveFilters = true;
?>
<button class="top-search-active-filter deletebutton spin btn btn-default btn-sm" type="button" aria-controls="<?php print $aria_controls; ?>" title="<?= __('match.op.clear.filters',[1]);?>">
<button class="top-search-active-filter deletebutton spin btn btn-default btn-sm" type="button" aria-controls="<?php print $aria_controls; ?>" title="<?= __d('operation', 'clear.filters',[2]); ?>">
<em class="material-icons">cancel</em>
<span class="top-search-active-filter-title">
<?= $vv_searchable_attributes[$key]['label']; ?>
Expand All @@ -83,7 +84,7 @@
<?php endforeach; ?>
<?php if($hasActiveFilters): ?>
<button id="top-search-clear-all-button" class="filter-clear-all-button spin btn" type="button" aria-controls="top-search-clear" onclick="event.stopPropagation()">
<?= __('match.op.clear.filters',[2]);?>
<?= __d('operation', 'clear.filters',[2]); ?>
</button>
<?php endif; ?>
</span>
Expand Down Expand Up @@ -123,16 +124,16 @@
$args = array();
// search button (submit)
$args['id'] = 'top-search-filter-button';
$args['aria-label'] = __('match.op.filter');
$args['aria-label'] = __d('operation', 'filter');
$args['class'] = 'submit-button spin btn btn-primary';
print $this->Form->submit(__('match.op.filter'),$args);
print $this->Form->submit(__d('operation', 'filter'),$args);

// clear button
$args['id'] = 'top-search-clear';
$args['class'] = 'clear-button spin btn btn-default';
$args['aria-label'] = __('match.op.clear');
$args['aria-label'] = __d('operation', 'clear');
$args['onclick'] = 'clearTopSearch(this.form)';
print $this->Form->button(__('match.op.clear'),$args);
print $this->Form->button(__d('operation', 'clear'),$args);
?>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions app/webroot/css/co-base.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @link http://www.internet2.edu/comanage COmanage Project
* @package match
* @link https://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v1.0.0
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/
Expand Down
2 changes: 1 addition & 1 deletion app/webroot/css/co-color.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @link http://www.internet2.edu/comanage COmanage Project
* @link https://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage registry v5.0.0
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
Expand Down
4 changes: 2 additions & 2 deletions app/webroot/css/co-responsive.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @link http://www.internet2.edu/comanage COmanage Project
* @package match
* @link https://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Match v1.0.0
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/
Expand Down
2 changes: 1 addition & 1 deletion app/webroot/js/comanage.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @link http://www.internet2.edu/comanage COmanage Project
* @link https://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v5.0.0
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
Expand Down

0 comments on commit c1ec867

Please sign in to comment.