SproutCMS

This is the code documentation for the SproutCMS project

source of /sprout/views/admin/operator_category_edit.php

  1. <?php
  2. /*
  3.  * kate: tab-width 4; indent-width 4; space-indent on; word-wrap off; word-wrap-column 120;
  4.  * :tabSize=4:indentSize=4:noTabs=true:wrap=false:maxLineLen=120:mode=php:
  5.  *
  6.  * Copyright (C) 2015 Karmabunny Pty Ltd.
  7.  *
  8.  * This file is a part of SproutCMS.
  9.  *
  10.  * SproutCMS is free software: you can redistribute it and/or modify it under the terms
  11.  * of the GNU General Public License as published by the Free Software Foundation, either
  12.  * version 3 of the License, or (at your option) any later version.
  13.  *
  14.  * For more information, visit <http://getsproutcms.com>.
  15.  */
  16.  
  17. use Sprout\Helpers\Form;
  18. use Sprout\Helpers\MultiEdit;
  19. use Sprout\Helpers\Pdb;
  20.  
  21.  
  22. Form::setData($data);
  23. Form::setErrors($errors);
  24. ?>
  25.  
  26. <h3 class="h2">Category name</h3>
  27. <?= Form::text('name'); ?>
  28.  
  29.  
  30. <h3 class="h2">Options</h3>
  31. <div class="white-box">
  32. <?= Form::checkboxList([
  33. 'access_reportemail' => 'Receives automatically-generated report emails',
  34. ]); ?>
  35. </div>
  36.  
  37. <?php
  38. Form::nextFieldDetails('Restrict access to specific IPs', false, 'Enter a comma-separated list of IP addresses or CIDR blocks that are allowed access.<br>Leave blank to have no restriction.');
  39. echo Form::text('allowed_ips');
  40. ?>
  41.  
  42.  
  43. <h3 class="h2">General Permissions</h3>
  44. <div class="white-box">
  45. <?= Form::checkboxList([
  46. 'access_operators' => 'Can edit operators, operator categories and subsites; can also use cms tools and view cms logs',
  47. 'access_homepage' => 'Can edit the home page',
  48. 'access_noapproval' => 'Page edits do not require appoval to be made live',
  49. ]); ?>
  50. </div>
  51.  
  52.  
  53. <h3 class="h2">Per-Tab Permissions</h3>
  54. <div class="info">
  55. This allows for fine-graned control of the admin tabs which are available to operators in this category.
  56. </div>
  57.  
  58. <?= Form::multiradio('default_allow', [], [
  59. '1' => 'By default allow all access, except as per below',
  60. '0' => 'By default don\'t allow access, except as per below',
  61. ]); ?>
  62.  
  63. <div id="multiedit-permissions">
  64. <input type="hidden" name="m_id">
  65.  
  66. <div class="clear-group">
  67. <div class="col col--one-half">
  68. <?php
  69. Form::nextFieldDetails('For the tab', false);
  70. echo Form::dropdown('m_controller', [], $controllers);
  71. ?>
  72. </div>
  73. <div class="col col--one-half">
  74. <?php
  75. Form::nextFieldDetails('Allow the operator to', false);
  76. echo Form::checkboxList([
  77. 'm_access_contents' => 'View the main list',
  78. 'm_access_add' => 'Add records',
  79. 'm_access_edit' => 'Edit records',
  80. 'm_access_delete' => 'Delete records',
  81. 'm_access_categories' => 'Manage categories',
  82. 'm_access_import' => 'Import records',
  83. 'm_access_export' => 'Export records',
  84. 'm_access_report' => 'Generate reports',
  85. 'm_access_reorder' => 'Update record ordering',
  86. ]);
  87. ?>
  88. </div>
  89. </div>
  90. </div>
  91.  
  92. <?php MultiEdit::display('permissions', $data['multiedit_permissions']); ?>
  93.  
  94.  
  95. <h3 class="h2">Per-Subsite Permissions</h3>
  96. <div class="white-box">
  97. <div class="info">
  98. Specify the subsites that operators of this category can manage content for.
  99. </div>
  100.  
  101. <?= Form::multiradio('access_all_subsites', [], [
  102. '1' => 'By default allow all access, except as per below',
  103. '0' => 'By default don\'t allow access, except as per below',
  104. ]); ?>
  105.  
  106. <?php Form::nextFieldDetails('Sub-site categories', false); ?>
  107. <?= Form::checkboxSet('subsites_permitted', [], $subsites); ?>
  108. </div>
  109.  
  110.  
  111. <h3 class="h2">Operator Management Permissions</h3>
  112. <div class="white-box">
  113. <div class="info">
  114. Specify the categories of operators that these operators can manage.
  115. Management is limited to adding, editing and deleting operators.
  116. For full control, use the checkbox above under <i>General Permissions</i>.
  117. </div>
  118. <?php Form::nextFieldDetails('Categories', false); ?>
  119. <?= Form::checkboxSet('manage_categories', [], Pdb::lookup('operators_cat_list')); ?>
  120. </div>
  121.