Skip to content

Commit

Permalink
*8095* introduce site access options form
Browse files Browse the repository at this point in the history
  • Loading branch information
jnugent committed Feb 14, 2013
1 parent 2b9d112 commit 421a38e
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 0 deletions.
@@ -0,0 +1,37 @@
<?php

/**
* @file controllers/tab/settings/siteAccessOptions/form/SiteAccessOptionsForm.inc.php
*
* Copyright (c) 2003-2012 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* @class SiteAccessOptionsForm
* @ingroup controllers_tab_settings_siteAccessOptions_form
*
* @brief Form to edit site access options.
*/

import('lib.pkp.classes.controllers.tab.settings.form.ContextSettingsForm');

class SiteAccessOptionsForm extends ContextSettingsForm {

/**
* Constructor.
*/
function SiteAccessOptionsForm($wizardMode = false) {
$settings = array(
'disableUserReg' => 'bool',
'allowRegAuthor' => 'bool',
'allowRegReviewer' => 'bool',
'restrictSiteAccess' => 'bool',
'restrictArticleAccess' => 'bool',
'showGalleyLinks' => 'bool'
);

parent::ContextSettingsForm($settings, 'controllers/tab/settings/siteAccessOptions/form/siteAccessOptionsForm.tpl', $wizardMode);
}

}

?>
@@ -0,0 +1,42 @@
{**
* controllers/tab/settings/siteAccessOptions/form/siteAccessOptionsForm.tpl
*
* Copyright (c) 2003-2012 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* Site access options management form.
*
*}

<script type="text/javascript">
$(function() {ldelim}
// Attach the form handler.
$('#siteAccessOptionsForm').pkpHandler('$.pkp.controllers.tab.settings.siteAccessOptions.form.SiteAccessOptionsFormHandler');
{rdelim});
</script>

<form class="pkp_form" id="siteAccessOptionsForm" method="post" action="{url router=$smarty.const.ROUTE_COMPONENT component="tab.settings.AccessSettingsTabHandler" op="saveFormData" tab="siteAccessOptions"}">
{include file="controllers/notification/inPlaceNotification.tpl" notificationId="siteAccessOptionsFormNotification"}

{fbvFormArea id="siteAccess" class="border" title="manager.setup.siteAccess"}
{fbvFormSection list=true}
{fbvElement type="checkbox" id="restrictSiteAccess" value="1" checked=$restrictSiteAccess label="manager.setup.restrictSiteAccess"}
{fbvElement type="checkbox" id="restrictArticleAccess" value="1" checked=$restrictArticleAccess label="manager.setup.restrictArticleAccess"}
{fbvElement type="checkbox" id="showGalleyLinks" value="1" checked=$showGalleyLinks label="manager.setup.showGalleyLinksDescription"}
{/fbvFormSection}
{/fbvFormArea}

{fbvFormArea id="userRegistration" class="border" title="manager.setup.userRegistration"}
{fbvFormSection list=true}
{fbvElement type="radio" id="disableUserReg-0" name="disableUserReg" value="0" checked=!$disableUserReg label="manager.setup.enableUserRegistration"}
<div style="padding-left: 20px;">
{fbvElement type="checkbox" id="allowRegReader" value="1" checked=$allowRegReader disabled=$disableUserReg label="manager.setup.enableUserRegistration.reader"}
{fbvElement type="checkbox" id="allowRegAuthor" value="1" checked=$allowRegAuthor disabled=$disableUserReg label="manager.setup.enableUserRegistration.author"}
{fbvElement type="checkbox" id="allowRegReviewer" value="1" checked=$allowRegReviewer disabled=$disableUserReg label="manager.setup.enableUserRegistration.reviewer"}
</div>
{fbvElement type="radio" id="disableUserReg-1" name="disableUserReg" value="1" checked=$disableUserReg label="manager.setup.disableUserRegistration"}
{/fbvFormSection}
{/fbvFormArea}

{fbvFormButtons id="siteAccessFormSubmit" submitText="common.save" hideCancel=true}
</form>
30 changes: 30 additions & 0 deletions templates/management/settings/access.tpl
@@ -0,0 +1,30 @@
{**
* templates/management/settings/access.tpl
*
* Copyright (c) 2003-2012 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* Access and Security page.
*}

{strip}
{assign var="pageTitle" value="navigation.access"}
{include file="common/header.tpl"}
{/strip}

<script type="text/javascript">
// Attach the JS file tab handler.
$(function() {ldelim}
$('#accessTabs').pkpHandler(
'$.pkp.controllers.TabHandler');
{rdelim});
</script>
<div id="accessTabs">
<ul>
<li><a href="{url router=$smarty.const.ROUTE_COMPONENT component="tab.settings.AccessSettingsTabHandler" op="showTab" tab="users"}">{translate key="manager.users"}</a></li>
<li><a href="{url router=$smarty.const.ROUTE_COMPONENT component="tab.settings.AccessSettingsTabHandler" op="showTab" tab="roles"}">{translate key="manager.roles"}</a></li>
<li><a href="{url router=$smarty.const.ROUTE_COMPONENT component="tab.settings.AccessSettingsTabHandler" op="showTab" tab="siteAccessOptions"}">{translate key="manager.siteAccessOptions.siteAccessOptions"}</a></li>
</ul>
</div>

{include file="common/footer.tpl"}

0 comments on commit 421a38e

Please sign in to comment.