| 1 |
<?php |
| 2 |
/** |
| 3 |
* TabList.php |
| 4 |
* |
| 5 |
* Shows the tab list at the admin panel. |
| 6 |
* |
| 7 |
* PHP versions 5 |
| 8 |
* |
| 9 |
* @author Alexander Schneider <alexanderschneider85@gmail.com> |
| 10 |
* @copyright 2008-2017 Alexander Schneider |
| 11 |
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 |
| 12 |
* @version SVN: $id$ |
| 13 |
* @link http://wordpress.org/extend/plugins/user-access-manager/ |
| 14 |
*/ |
| 15 |
|
| 16 |
/** |
| 17 |
* @var ControllerTabNavigationTrait $controller |
| 18 |
*/ |
| 19 |
|
| 20 |
use UserAccessManager\Controller\Backend\ControllerTabNavigationTrait; |
| 21 |
|
| 22 |
?> |
| 23 |
<h2 class="nav-tab-wrapper"> |
| 24 |
<?php |
| 25 |
$currentGroupKey = $controller->getCurrentTabGroup(); |
| 26 |
$tabGroups = $controller->getTabGroups(); |
| 27 |
|
| 28 |
foreach ($tabGroups as $group => $defaultSection) { |
| 29 |
$cssClass = 'nav-tab'; |
| 30 |
|
| 31 |
if ($currentGroupKey === $group) { |
| 32 |
$cssClass .= ' nav-tab-active'; |
| 33 |
} |
| 34 |
?> |
| 35 |
<a class="<?php echo $cssClass; ?>" |
| 36 |
href="<?php echo $controller->getTabGroupLink($group); ?>"> |
| 37 |
<?php echo $controller->getGroupText($group); ?> |
| 38 |
</a> |
| 39 |
<?php |
| 40 |
} |
| 41 |
?> |
| 42 |
</h2> |
| 43 |
<?php |
| 44 |
$sections = $controller->getSections(); |
| 45 |
if (count($sections) > 1) { |
| 46 |
$currentSection = $controller->getCurrentTabGroupSection(); |
| 47 |
|
| 48 |
?> |
| 49 |
<table class="form-table"> |
| 50 |
<tbody> |
| 51 |
<tr> |
| 52 |
<th> |
| 53 |
<label for="uam_settings_group_section"> |
| 54 |
<?php echo $controller->getGroupText($currentGroupKey . '_SECTION_SELECTION'); ?> |
| 55 |
</label> |
| 56 |
</th> |
| 57 |
<td> |
| 58 |
<select id="uam_settings_group_section" name="section"> |
| 59 |
<?php |
| 60 |
foreach ($sections as $section) { |
| 61 |
?> |
| 62 |
<option value="<?php echo $section ?>" |
| 63 |
data-link="<?php |
| 64 |
echo $controller->getTabGroupSectionLink($currentGroupKey, $section); |
| 65 |
?>" |
| 66 |
<?php |
| 67 |
if ($currentSection === $section) { |
| 68 |
echo 'selected="selected"'; |
| 69 |
} |
| 70 |
?>><?php |
| 71 |
echo $controller->getGroupSectionText($section); |
| 72 |
?></option> |
| 73 |
<?php |
| 74 |
} |
| 75 |
?> |
| 76 |
</select> |
| 77 |
</td> |
| 78 |
</tr> |
| 79 |
</tbody> |
| 80 |
</table> |
| 81 |
<?php |
| 82 |
} |
| 83 |
|