forked from internet2/comanage-grouper-widget
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Implemented form code for configuration
Showing
6 changed files
with
310 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
yoy are home | ||
you are home |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,71 @@ | ||
<div id="grouper-plugin" class="pt-2"> | ||
<div class="d-flex align-items-center"> | ||
<h2><?php echo $title; ?></h2> | ||
</div> | ||
</div> | ||
<?php | ||
echo $this->Form->create('CoGrouperLites'); | ||
echo $this->Form->input('connUrl'); | ||
echo $this->Form->input('connVer'); | ||
echo $this->Form->input('connUser'); | ||
echo $this->Form->input('connPass'); | ||
echo $this->Form->input('id', array('type' => 'hidden')); | ||
echo $this->Form->end('Save Post'); | ||
?> | ||
|
||
/** | ||
* COmanage Registry Standard Edit View | ||
* | ||
* Portions licensed to the University Corporation for Advanced Internet | ||
* Development, Inc. ("UCAID") under one or more contributor license agreements. | ||
* See the NOTICE file distributed with this work for additional information | ||
* regarding copyright ownership. | ||
* | ||
* UCAID licenses this file to you under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with the | ||
* License. You may obtain a copy of the License at: | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* @link http://www.internet2.edu/comanage COmanage Project | ||
* @package registry | ||
* @since COmanage Registry v0.1 | ||
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) | ||
*/ | ||
|
||
// Get a pointer to our model | ||
$model = $this->name; | ||
$req = Inflector::singularize($model); | ||
|
||
// Add page title & page buttons | ||
$params = array(); | ||
$params['title'] = $title_for_layout; | ||
|
||
// For Authenticators during enrollment | ||
if(!empty($vv_co_enrollment_authenticator) | ||
&& ($vv_co_enrollment_authenticator['CoEnrollmentAuthenticator']['required'] == RequiredEnum::Optional) | ||
&& !empty($this->request->params['named']['onFinish'])) { | ||
$params['topLinks'][] = $this->Html->link(_txt('op.skip'), | ||
urldecode($this->request->params['named']['onFinish']), | ||
array('class' => 'forwardbutton')); | ||
} | ||
|
||
if(!empty($this->plugin)) { | ||
if(file_exists(APP . "Plugin/" . $this->plugin . "/View/" . $model . "/buttons.inc")) { | ||
include(APP . "Plugin/" . $this->plugin . "/View/" . $model . "/buttons.inc"); | ||
} elseif(file_exists(LOCAL . "Plugin/" . $this->plugin . "/View/" . $model . "/buttons.inc")) { | ||
include(LOCAL . "Plugin/" . $this->plugin . "/View/" . $model . "/buttons.inc"); | ||
} | ||
} else { | ||
if(file_exists(APP . "View/" . $model . "/buttons.inc")) { | ||
include(APP . "View/" . $model . "/buttons.inc"); | ||
} | ||
} | ||
print $this->element("pageTitleAndButtons", $params); | ||
|
||
$submit_label = _txt('op.save'); | ||
print $this->Form->create($req, array('inputDefaults' => array('label' => false, 'div' => false))); | ||
if(!empty($this->plugin)) { | ||
if(file_exists(APP . "Plugin/" . $this->plugin . "/View/" . $model . "/fields.inc")) { | ||
include(APP . "Plugin/" . $this->plugin . "/View/" . $model . "/fields.inc"); | ||
} elseif(file_exists(LOCAL . "Plugin/" . $this->plugin . "/View/" . $model . "/fields.inc")) { | ||
include(LOCAL . "Plugin/" . $this->plugin . "/View/" . $model . "/fields.inc"); | ||
} | ||
} else { | ||
include(APP . "View/" . $model . "/fields.inc"); | ||
} | ||
print $this->Form->end(); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,209 @@ | ||
<!-- | ||
/** | ||
* COmanage Registry CO Grouper Groups Widgets Fields | ||
* | ||
* Portions licensed to the University Corporation for Advanced Internet | ||
* Development, Inc. ("UCAID") under one or more contributor license agreements. | ||
* See the NOTICE file distributed with this work for additional information | ||
* regarding copyright ownership. | ||
* | ||
* UCAID licenses this file to you under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with the | ||
* License. You may obtain a copy of the License at: | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* @link http://www.internet2.edu/comanage COmanage Project | ||
* @package registry-plugin | ||
* @since COmanage Registry v3.2.0 | ||
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) | ||
*/ | ||
--> | ||
<?php | ||
// Determine if fields are editable | ||
$addable = ($this->action === "add" && $permissions['add']); | ||
$editable = ($this->action === "edit" && $permissions['edit']); | ||
|
||
$e = (!$addable && !$editable) ? false : true; | ||
|
||
// We shouldn't get here if we don't have at least read permission, but check just in case | ||
|
||
if (!$e && !$permissions['view']) { | ||
return false; | ||
} | ||
|
||
// Add breadcrumbs | ||
print $this->element("coCrumb"); | ||
|
||
$args = array(); | ||
$args['plugin'] = null; | ||
$args['controller'] = 'co_dashboards'; | ||
$args['action'] = 'index'; | ||
$args['co'] = $cur_co['Co']['id']; | ||
$this->Html->addCrumb(_txt('ct.co_dashboards.pl'), $args); | ||
|
||
$args = array(); | ||
$args['plugin'] = null; | ||
$args['controller'] = 'co_dashboards'; | ||
$args['action'] = 'edit'; | ||
$args[] = $co_grouper_lites[0]['CoDashboardWidget']['co_dashboard_id']; | ||
$this->Html->addCrumb(_txt('ct.co_dashboards.1'), $args); | ||
|
||
$args = array(); | ||
$args['plugin'] = null; | ||
$args['controller'] = 'co_dashboard_widgets'; | ||
$args['action'] = 'index'; | ||
$args['codashboard'] = $co_grouper_lites[0]['CoDashboardWidget']['co_dashboard_id']; | ||
$this->Html->addCrumb(_txt('ct.co_dashboard_widgets.1'), $args); | ||
|
||
$crumbTxt = _txt('op.' . $this->action . '-a', array(filter_var($co_grouper_widgets[0]['CoDashboardWidget']['description'], FILTER_SANITIZE_SPECIAL_CHARS))); | ||
$this->Html->addCrumb($crumbTxt); | ||
|
||
print $this->Form->hidden('co_dashboard_widget_id', array('default' => $vv_dwid)) . "\n"; | ||
|
||
?> | ||
<ul id="<?php print $this->action; ?>_co_grouper_lite" class="fields form-list form-list-admin"> | ||
<li> | ||
<div class="field-name"> | ||
<div class="field-title"> | ||
<?php print($e ? $this->Form->label('connUrl', _txt('pl.grouperlite.config.grouper-url')) : _txt('pl.grouperlite.config.grouper-url')); ?> | ||
<span class="required">*</span> | ||
</div> | ||
</div> | ||
<div class="field-info"> | ||
<?php | ||
$attrs = array(); | ||
$attrs['value'] = (isset($co_grouper_lites[0]['CoGrouperLite']['connUrl']) | ||
? $co_grouper_lites[0]['CoGrouperLite']['connUrl'] | ||
: ''); | ||
$attrs['empty'] = true; | ||
$attrs['required'] = true; | ||
|
||
if ($e) { | ||
print $this->Form->input('connUrl', $attrs); | ||
|
||
if ($this->Form->isFieldError('connUrl')) { | ||
print $this->Form->error('connUrl'); | ||
} | ||
} else { | ||
if (!empty($co_grouper_lites[0]['CoGrouperLite']['connUrl'])) { | ||
print filter_var($co_grouper_lites[0]['CoGrouperLite']['connUrl'], FILTER_SANITIZE_SPECIAL_CHARS); | ||
} | ||
} | ||
?> | ||
</div> | ||
</li> | ||
<li> | ||
<div class="field-name"> | ||
<div class="field-title"> | ||
<?php print($e ? $this->Form->label('connVer', _txt('pl.grouperlite.config.grouper-version')) : _txt('pl.grouperlite.config.grouper-version')); ?> | ||
<span class="required">*</span> | ||
</div> | ||
</div> | ||
<div class="field-info"> | ||
<?php | ||
$attrs = array(); | ||
$attrs['value'] = (isset($co_grouper_lites[0]['CoGrouperLite']['connVer']) | ||
? $co_grouper_lites[0]['CoGrouperLite']['connVer'] | ||
: ''); | ||
$attrs['empty'] = true; | ||
$attrs['required'] = true; | ||
|
||
if ($e) { | ||
print $this->Form->input('connVer', $attrs); | ||
|
||
if ($this->Form->isFieldError('connVer')) { | ||
print $this->Form->error('connVer'); | ||
} | ||
} else { | ||
if (!empty($co_grouper_lites[0]['CoGrouperLite']['connVer'])) { | ||
print filter_var($co_grouper_lites[0]['CoGrouperLite']['connVer'], FILTER_SANITIZE_SPECIAL_CHARS); | ||
} | ||
} | ||
?> | ||
</div> | ||
</li> | ||
<li> | ||
<div class="field-name"> | ||
<div class="field-title"> | ||
<?php print($e ? $this->Form->label('connUser', _txt('pl.grouperlite.config.grouper-un')) : _txt('pl.grouperlite.config.grouper-un')); ?> | ||
<span class="required">*</span> | ||
</div> | ||
</div> | ||
<div class="field-info"> | ||
<?php | ||
$attrs = array(); | ||
$attrs['value'] = (isset($co_grouper_lites[0]['CoGrouperLite']['connUser']) | ||
? $co_grouper_lites[0]['CoGrouperLite']['connUser'] | ||
: ''); | ||
$attrs['empty'] = true; | ||
$attrs['required'] = true; | ||
|
||
if ($e) { | ||
print $this->Form->input('connUser', $attrs); | ||
|
||
if ($this->Form->isFieldError('connUser')) { | ||
print $this->Form->error('connUser'); | ||
} | ||
} else { | ||
if (!empty($co_grouper_lites[0]['CoGrouperLite']['connUser'])) { | ||
print filter_var($co_grouper_lites[0]['CoGrouperLite']['connUser'], FILTER_SANITIZE_SPECIAL_CHARS); | ||
} | ||
} | ||
?> | ||
</div> | ||
</li> | ||
<li> | ||
<div class="field-name"> | ||
<div class="field-title"> | ||
<?php print($e ? $this->Form->label('connPass', _txt('pl.grouperlite.config.grouper-pw')) : _txt('pl.grouperlite.config.grouper-pw')); ?> | ||
<span class="required">*</span> | ||
</div> | ||
</div> | ||
<div class="field-info"> | ||
<?php | ||
$attrs = array(); | ||
$attrs['value'] = (isset($co_grouper_lites[0]['CoGrouperLite']['connPass']) | ||
? $co_grouper_lites[0]['CoGrouperLite']['connPass'] | ||
: ''); | ||
$attrs['empty'] = true; | ||
$attrs['required'] = true; | ||
|
||
if ($e) { | ||
print $this->Form->password('connPass', $attrs); | ||
|
||
if ($this->Form->isFieldError('connPass')) { | ||
print $this->Form->error('connPass'); | ||
} | ||
} else { | ||
if (!empty($co_grouper_lites[0]['CoGrouperLite']['connPass'])) { | ||
print filter_var($co_grouper_lites[0]['CoGrouperLite']['connPass'], FILTER_SANITIZE_SPECIAL_CHARS); | ||
} | ||
} | ||
?> | ||
</div> | ||
</li> | ||
|
||
<?php if ($e) : ?> | ||
<li class="fields-submit"> | ||
<div class="field-name"> | ||
<span class="required"><?php print _txt('fd.req'); ?></span> | ||
</div> | ||
<div class="field-info"> | ||
<?php print $this->Form->submit($submit_label); ?> | ||
</div> | ||
</li> | ||
<?php endif; ?> | ||
</ul> | ||
|
||
<div id="grouper-plugin" class="pt-2"> | ||
<div class="d-flex align-items-center"> | ||
<h2><?php echo $title; ?></h2> | ||
</div> | ||
</div> |