diff options
| author | Nigel Osborne <kiwi3685@me.com> | 2010-08-19 05:19:38 +0000 |
|---|---|---|
| committer | Nigel Osborne <kiwi3685@me.com> | 2010-08-19 05:19:38 +0000 |
| commit | e3bd596d1d5f31353389fa7e8804e619340af043 (patch) | |
| tree | 57eb8ed31e03c0767f1c4d2a260b4848251d129a | |
| parent | 27b1b8851110c601af55c88c426f6691a3bcf8a2 (diff) | |
| download | webtrees-e3bd596d1d5f31353389fa7e8804e619340af043.tar.gz webtrees-e3bd596d1d5f31353389fa7e8804e619340af043.tar.bz2 webtrees-e3bd596d1d5f31353389fa7e8804e619340af043.zip | |
Bug #619778 - "Module Configuration - De-selecting Media module fails [in ie8]"
| -rw-r--r-- | module_admin.php | 628 |
1 files changed, 314 insertions, 314 deletions
diff --git a/module_admin.php b/module_admin.php index 5584b1f9b3..e27f0d629e 100644 --- a/module_admin.php +++ b/module_admin.php @@ -300,243 +300,155 @@ print_header(i18n::translate('Module administration')); <p><?php echo "<h2>".i18n::translate('Module administration')."</h2>"; ?></p> <p><?php echo i18n::translate('Below is the list of all the modules installed in this instance of webtrees. Modules are installed by placing them in the <i>modules</i> directory. Here you can set the access level per GEDCOM for each module. If a module includes tabs for the individual page or menus for the menu bar, you can also set the access level and order of each of them.')?></p> <p><input TYPE="button" VALUE="<?php echo i18n::translate('Return to Administration page');?>" onclick="javascript:window.location='admin.php'" /></p> - <form method="post" action="module_admin.php"> - <input type="hidden" name="action" value="update_mods" /> - <!-- page tabs --> - <div id="tabs"> - <ul> - <li><a href="#installed_tab"><span><?php echo i18n::translate('All modules')?></span></a></li> - <li><a href="#menus_tab"><span><?php echo i18n::translate('Menus')?></span></a></li> - <li><a href="#tabs_tab"><span><?php echo i18n::translate('Tabs')?></span></a></li> - <li><a href="#sidebars_tab"><span><?php echo i18n::translate('Sidebar')?></span></a></li> - <li><a href="#blocks_tab"><span><?php echo i18n::translate('Blocks')?></span></a></li> - <li><a href="#charts_tab"><span><?php echo i18n::translate('Charts')?></span></a></li> - <li><a href="#reports_tab"><span><?php echo i18n::translate('Reports')?></span></a></li> - <li><a href="#themes_tab"><span><?php echo i18n::translate('Themes')?></span></a></li> - </ul> - </div) - <!-- installed --> - <div id="installed_tab"> - <table id="installed_table" class="tablesorter" border="0" cellpadding="0" cellspacing="1"> - <thead> - <tr> - <th><?php echo i18n::translate('Enabled'); ?></th> - <th><?php echo i18n::translate('Configuration'); ?></th> - <th><?php echo i18n::translate('Module Name'); ?></th> - <th><?php echo i18n::translate('Description'); ?></th> - <th><?php echo i18n::translate('Menu'); ?></th> - <th><?php echo i18n::translate('Tab'); ?></th> - <th><?php echo i18n::translate('Sidebar'); ?></th> - <th><?php echo i18n::translate('Block'); ?></th> - <th><?php echo i18n::translate('Chart'); ?></th> - <th><?php echo i18n::translate('Report'); ?></th> - <th><?php echo i18n::translate('Theme'); ?></th> - </tr> - </thead> - <tbody> - <?php - foreach (WT_Module::getInstalledModules() as $module) { - $status=WT_DB::prepare( - "SELECT status FROM `##module` WHERE module_name=?" - )->execute(array($module->getName()))->fetchOne(); - echo '<tr><td>', two_state_checkbox('status-'.$module->getName(), $status=='enabled'), '</td><td>'; - if ($module instanceof WT_Module_Config) echo '<a href="', $module->getConfigLink(), '"><img class="adminicon" src="', $WT_IMAGES["admin"], '" border="0" alt="', $module->getName(), '" /></a>'; ?></td> - <td><?php echo $module->getTitle()?></td> - <td><?php echo $module->getDescription()?></td> - <td><?php if ($module instanceof WT_Module_Menu) echo i18n::translate('Yes'); else echo i18n::translate('No');?></td> - <td><?php if ($module instanceof WT_Module_Tab) echo i18n::translate('Yes'); else echo i18n::translate('No');?></td> - <td><?php if ($module instanceof WT_Module_Sidebar) echo i18n::translate('Yes'); else echo i18n::translate('No');?></td> - <td><?php if ($module instanceof WT_Module_Block) echo i18n::translate('Yes'); else echo i18n::translate('No');?></td> - <td><?php if ($module instanceof WT_Module_Chart) echo i18n::translate('Yes'); else echo i18n::translate('No');?></td> - <td><?php if ($module instanceof WT_Module_Report) echo i18n::translate('Yes'); else echo i18n::translate('No');?></td> - <td><?php if ($module instanceof WT_Module_Theme) echo i18n::translate('Yes'); else echo i18n::translate('No');?></td> - </tr> - <?php - } - ?> - </tbody> - </table> - <div id="pager" class="pager"> - <form> - <img src="<?php echo WT_THEME_DIR; ?>images/jquery/first.png" class="first"/> - <img src="<?php echo WT_THEME_DIR; ?>images/jquery/prev.png" class="prev"/> - <input type="text" class="pagedisplay"/> - <img src="<?php echo WT_THEME_DIR; ?>images/jquery/next.png" class="next"/> - <img src="<?php echo WT_THEME_DIR; ?>images/jquery/last.png" class="last"/> - <select class="pagesize"> - <option value="10">10</option> - <option selected="selected" value="15">15</option> - <option value="30">30</option> - <option value="40">40</option> - <option value="50">50</option> - <option value="100">100</option> - </select> - </form> + <div id="tabs"> + <form method="post" action="module_admin.php"> + <input type="hidden" name="action" value="update_mods" /> + <!-- page tabs --> + <ul> + <li><a href="#installed_tab"><span><?php echo i18n::translate('All modules')?></span></a></li> + <li><a href="#menus_tab"><span><?php echo i18n::translate('Menus')?></span></a></li> + <li><a href="#tabs_tab"><span><?php echo i18n::translate('Tabs')?></span></a></li> + <li><a href="#sidebars_tab"><span><?php echo i18n::translate('Sidebar')?></span></a></li> + <li><a href="#blocks_tab"><span><?php echo i18n::translate('Blocks')?></span></a></li> + <li><a href="#charts_tab"><span><?php echo i18n::translate('Charts')?></span></a></li> + <li><a href="#reports_tab"><span><?php echo i18n::translate('Reports')?></span></a></li> + <li><a href="#themes_tab"><span><?php echo i18n::translate('Themes')?></span></a></li> + </ul> + <!-- installed --> + <div id="installed_tab"> + <table id="installed_table" class="tablesorter" border="0" cellpadding="0" cellspacing="1"> + <thead> + <tr> + <th><?php echo i18n::translate('Enabled'); ?></th> + <th><?php echo i18n::translate('Configuration'); ?></th> + <th><?php echo i18n::translate('Module Name'); ?></th> + <th><?php echo i18n::translate('Description'); ?></th> + <th><?php echo i18n::translate('Menu'); ?></th> + <th><?php echo i18n::translate('Tab'); ?></th> + <th><?php echo i18n::translate('Sidebar'); ?></th> + <th><?php echo i18n::translate('Block'); ?></th> + <th><?php echo i18n::translate('Chart'); ?></th> + <th><?php echo i18n::translate('Report'); ?></th> + <th><?php echo i18n::translate('Theme'); ?></th> + </tr> + </thead> + <tbody> + <?php + foreach (WT_Module::getInstalledModules() as $module) { + $status=WT_DB::prepare( + "SELECT status FROM `##module` WHERE module_name=?" + )->execute(array($module->getName()))->fetchOne(); + echo '<tr><td>', two_state_checkbox('status-'.$module->getName(), $status=='enabled'), '</td><td>'; + if ($module instanceof WT_Module_Config) echo '<a href="', $module->getConfigLink(), '"><img class="adminicon" src="', $WT_IMAGES["admin"], '" border="0" alt="', $module->getName(), '" /></a>'; ?></td> + <td><?php echo $module->getTitle()?></td> + <td><?php echo $module->getDescription()?></td> + <td><?php if ($module instanceof WT_Module_Menu) echo i18n::translate('Yes'); else echo i18n::translate('No');?></td> + <td><?php if ($module instanceof WT_Module_Tab) echo i18n::translate('Yes'); else echo i18n::translate('No');?></td> + <td><?php if ($module instanceof WT_Module_Sidebar) echo i18n::translate('Yes'); else echo i18n::translate('No');?></td> + <td><?php if ($module instanceof WT_Module_Block) echo i18n::translate('Yes'); else echo i18n::translate('No');?></td> + <td><?php if ($module instanceof WT_Module_Chart) echo i18n::translate('Yes'); else echo i18n::translate('No');?></td> + <td><?php if ($module instanceof WT_Module_Report) echo i18n::translate('Yes'); else echo i18n::translate('No');?></td> + <td><?php if ($module instanceof WT_Module_Theme) echo i18n::translate('Yes'); else echo i18n::translate('No');?></td> + </tr> + <?php + } + ?> + </tbody> + </table> + <div id="pager" class="pager"> + <!--<form>--> + <img src="<?php echo WT_THEME_DIR; ?>images/jquery/first.png" class="first"/> + <img src="<?php echo WT_THEME_DIR; ?>images/jquery/prev.png" class="prev"/> + <input type="text" class="pagedisplay"/> + <img src="<?php echo WT_THEME_DIR; ?>images/jquery/next.png" class="next"/> + <img src="<?php echo WT_THEME_DIR; ?>images/jquery/last.png" class="last"/> + <select class="pagesize"> + <option value="10">10</option> + <option selected="selected" value="15">15</option> + <option value="30">30</option> + <option value="40">40</option> + <option value="50">50</option> + <option value="100">100</option> + </select> + <!--</form>--> + </div> </div> - </div> - <!-- menus --> - <div id="menus_tab"> - <table id="menus_table" class="list_table"> - <thead> - <tr> - <th class="list_label"><?php echo i18n::translate('Module Name')?></th> - <th class="list_label"><?php echo i18n::translate('Order')?></th> - <th class="list_label"><?php echo i18n::translate('Access level')?></th> - </tr> - </thead> - <tbody> - <?php - $order = 1; - foreach(WT_Module::getInstalledMenus() as $module) {?> - <tr class="sortme"> - <td class="list_value"><?php echo $module->getTitle()?></td> - <td class="list_value"><input type="text" size="5" value="<?php echo $order; ?>" name="menuorder-<?php echo $module->getName() ?>" /> - <img class="uarrow" style="vertical-align:bottom;" src="<?php echo $WT_IMAGES["uarrow"];?>" border="0" title="<?php echo i18n::translate('Move up')?>" /> - <img class="udarrow" style="vertical-align:bottom;" src="<?php echo $WT_IMAGES["udarrow"];?>" border="0" title="<?php echo i18n::translate('Move to top')?>" /> - <img class="darrow" style="vertical-align:bottom;" src="<?php echo $WT_IMAGES["darrow"];?>" border="0" title="<?php echo i18n::translate('Move down')?>" /> - <img class="ddarrow" style="vertical-align:bottom;" src="<?php echo $WT_IMAGES["ddarrow"];?>" border="0" title="<?php echo i18n::translate('Move to bottom')?>" /> - </td> - <td class="list_value_wrap"> - <table> - <?php - foreach (get_all_gedcoms() as $ged_id=>$ged_name) { - $varname = 'menuaccess-'.$module->getName().'-'.$ged_id; - $access_level=WT_DB::prepare( - "SELECT access_level FROM `##module_privacy` WHERE gedcom_id=? AND module_name=? AND component='menu'" - )->execute(array($ged_id, $module->getName()))->fetchOne(); - if ($access_level===null) { - $access_level=$module->defaultAccessLevel(); - } - echo '<tr><td>', htmlspecialchars($ged_name), '</td><td>'; - echo edit_field_access_level($varname, $access_level); - } - ?> - </table> - </td> - </tr> - <?php - $order++; - } - ?> - </tbody> - </table> - </div> - <!-- tabs --> - <div id="tabs_tab"> - <table id="tabs_table" class="list_table"> - <thead> - <tr> - <th class="list_label"><?php echo i18n::translate('Module Name')?></th> - <th class="list_label"><?php echo i18n::translate('Order')?></th> - <th class="list_label"><?php echo i18n::translate('Access level')?></th> - </tr> - </thead> - <tbody> - <?php - $order = 1; - foreach(WT_Module::getInstalledTabs() as $module) {?> - <tr class="sortme"> - <td class="list_value"><?php echo $module->getTitle()?></td> - <td class="list_value"><input type="text" size="5" value="<?php echo $order; ?>" name="taborder-<?php echo $module->getName() ?>" /> - <img class="uarrow" style="vertical-align:bottom;" src="<?php echo $WT_IMAGES["uarrow"];?>" border="0" title="<?php echo i18n::translate('Move up')?>" /> - <img class="udarrow" style="vertical-align:bottom;" src="<?php echo $WT_IMAGES["udarrow"];?>" border="0" title="<?php echo i18n::translate('Move to top')?>" /> - <img class="darrow" style="vertical-align:bottom;" src="<?php echo $WT_IMAGES["darrow"];?>" border="0" title="<?php echo i18n::translate('Move down')?>" /> - <img class="ddarrow" style="vertical-align:bottom;" src="<?php echo $WT_IMAGES["ddarrow"];?>" border="0" title="<?php echo i18n::translate('Move to bottom')?>" /> - </td> - <td class="list_value_wrap"> - <table> - <?php - foreach (get_all_gedcoms() as $ged_id=>$ged_name) { - $varname = 'tabaccess-'.$module->getName().'-'.$ged_id; - $access_level=WT_DB::prepare( - "SELECT access_level FROM `##module_privacy` WHERE gedcom_id=? AND module_name=? AND component='tab'" - )->execute(array($ged_id, $module->getName()))->fetchOne(); - if ($access_level===null) { - $access_level=$module->defaultAccessLevel(); - } - echo '<tr><td>', htmlspecialchars($ged_name), '</td><td>'; - echo edit_field_access_level($varname, $access_level); - } - ?> - </table> - </td> - </tr> - <?php - $order++; - } - ?> - </tbody> - </table> - </div> - <!-- sidebars --> - <div id="sidebars_tab"> - <table id="sidebars_table" class="list_table"> - <thead> - <tr> - <th class="list_label"><?php echo i18n::translate('Module Name')?></th> - <th class="list_label"><?php echo i18n::translate('Order')?></th> - <th class="list_label"><?php echo i18n::translate('Access level')?></th> - </tr> - </thead> - <tbody> - <?php - $order = 1; - foreach(WT_Module::getInstalledSidebars() as $module) {?> + <!-- menus --> + <div id="menus_tab"> + <table id="menus_table" class="list_table"> + <thead> + <tr> + <th class="list_label"><?php echo i18n::translate('Module Name')?></th> + <th class="list_label"><?php echo i18n::translate('Order')?></th> + <th class="list_label"><?php echo i18n::translate('Access level')?></th> + </tr> + </thead> + <tbody> + <?php + $order = 1; + foreach(WT_Module::getInstalledMenus() as $module) {?> <tr class="sortme"> <td class="list_value"><?php echo $module->getTitle()?></td> - <td class="list_value"><input type="text" size="5" value="<?php echo $order; ?>" name="sidebarorder-<?php echo $module->getName() ?>" /> + <td class="list_value"><input type="text" size="5" value="<?php echo $order; ?>" name="menuorder-<?php echo $module->getName() ?>" /> <img class="uarrow" style="vertical-align:bottom;" src="<?php echo $WT_IMAGES["uarrow"];?>" border="0" title="<?php echo i18n::translate('Move up')?>" /> - <img class="udarrow" style="vertical-align:bottom;" src="<?php echo $WT_IMAGES["udarrow"];?>" border="0" title="<?php echo i18n::translate('Move to top')?>" /> - <img class="darrow" style="vertical-align:bottom;" src="<?php echo $WT_IMAGES["darrow"];?>" border="0" title="<?php echo i18n::translate('Move down')?>" /> - <img class="ddarrow" style="vertical-align:bottom;" src="<?php echo $WT_IMAGES["ddarrow"];?>" border="0" title="<?php echo i18n::translate('Move to bottom')?>" /> + <img class="udarrow" style="vertical-align:bottom;" src="<?php echo $WT_IMAGES["udarrow"];?>" border="0" title="<?php echo i18n::translate('Move to top')?>" /> + <img class="darrow" style="vertical-align:bottom;" src="<?php echo $WT_IMAGES["darrow"];?>" border="0" title="<?php echo i18n::translate('Move down')?>" /> + <img class="ddarrow" style="vertical-align:bottom;" src="<?php echo $WT_IMAGES["ddarrow"];?>" border="0" title="<?php echo i18n::translate('Move to bottom')?>" /> </td> <td class="list_value_wrap"> - <table> + <table> <?php - foreach (get_all_gedcoms() as $ged_id=>$ged_name) { - $varname = 'sidebaraccess-'.$module->getName().'-'.$ged_id; - $access_level=WT_DB::prepare( - "SELECT access_level FROM `##module_privacy` WHERE gedcom_id=? AND module_name=? AND component='sidebar'" - )->execute(array($ged_id, $module->getName()))->fetchOne(); - if ($access_level===null) { - $access_level=$module->defaultAccessLevel(); - } - echo '<tr><td>', htmlspecialchars($ged_name), '</td><td>'; - echo edit_field_access_level($varname, $access_level); - } + foreach (get_all_gedcoms() as $ged_id=>$ged_name) { + $varname = 'menuaccess-'.$module->getName().'-'.$ged_id; + $access_level=WT_DB::prepare( + "SELECT access_level FROM `##module_privacy` WHERE gedcom_id=? AND module_name=? AND component='menu'" + )->execute(array($ged_id, $module->getName()))->fetchOne(); + if ($access_level===null) { + $access_level=$module->defaultAccessLevel(); + } + echo '<tr><td>', htmlspecialchars($ged_name), '</td><td>'; + echo edit_field_access_level($varname, $access_level); + } ?> </table> </td> </tr> - <?php - $order++; - } - ?> - </tbody> - </table> - </div> - <!-- blocks --> - <div id="blocks_tab"> - <table id="blocks_table" class="list_table"> - <thead> - <tr> - <th class="list_label"><?php echo i18n::translate('Module Name')?></th> - <th class="list_label"><?php echo i18n::translate('Access level')?></th> - </tr> - </thead> - <tbody> - <?php - $order = 1; - foreach(WT_Module::getInstalledBlocks() as $module) {?> - <tr class="sortme"> - <td class="list_value"><?php echo $module->getTitle()?></td> - <td class="list_value_wrap"> + <?php + $order++; + } + ?> + </tbody> + </table> + </div> + <!-- tabs --> + <div id="tabs_tab"> + <table id="tabs_table" class="list_table"> + <thead> + <tr> + <th class="list_label"><?php echo i18n::translate('Module Name')?></th> + <th class="list_label"><?php echo i18n::translate('Order')?></th> + <th class="list_label"><?php echo i18n::translate('Access level')?></th> + </tr> + </thead> + <tbody> + <?php + $order = 1; + foreach(WT_Module::getInstalledTabs() as $module) {?> + <tr class="sortme"> + <td class="list_value"><?php echo $module->getTitle()?></td> + <td class="list_value"><input type="text" size="5" value="<?php echo $order; ?>" name="taborder-<?php echo $module->getName() ?>" /> + <img class="uarrow" style="vertical-align:bottom;" src="<?php echo $WT_IMAGES["uarrow"];?>" border="0" title="<?php echo i18n::translate('Move up')?>" /> + <img class="udarrow" style="vertical-align:bottom;" src="<?php echo $WT_IMAGES["udarrow"];?>" border="0" title="<?php echo i18n::translate('Move to top')?>" /> + <img class="darrow" style="vertical-align:bottom;" src="<?php echo $WT_IMAGES["darrow"];?>" border="0" title="<?php echo i18n::translate('Move down')?>" /> + <img class="ddarrow" style="vertical-align:bottom;" src="<?php echo $WT_IMAGES["ddarrow"];?>" border="0" title="<?php echo i18n::translate('Move to bottom')?>" /> + </td> + <td class="list_value_wrap"> <table> <?php foreach (get_all_gedcoms() as $ged_id=>$ged_name) { - $varname = 'blockaccess-'.$module->getName().'-'.$ged_id; + $varname = 'tabaccess-'.$module->getName().'-'.$ged_id; $access_level=WT_DB::prepare( - "SELECT access_level FROM `##module_privacy` WHERE gedcom_id=? AND module_name=? AND component='block'" + "SELECT access_level FROM `##module_privacy` WHERE gedcom_id=? AND module_name=? AND component='tab'" )->execute(array($ged_id, $module->getName()))->fetchOne(); if ($access_level===null) { $access_level=$module->defaultAccessLevel(); @@ -544,39 +456,86 @@ print_header(i18n::translate('Module administration')); echo '<tr><td>', htmlspecialchars($ged_name), '</td><td>'; echo edit_field_access_level($varname, $access_level); } - ?> + ?> </table> - </td> - </tr> - <?php - $order++; - } - ?> - </tbody> - </table> - </div> - <!-- charts --> - <div id="charts_tab"> - <table id="charts_table" class="list_table"> - <thead> - <tr> - <th class="list_label"><?php echo i18n::translate('Module Name')?></th> - <th class="list_label"><?php echo i18n::translate('Access level')?></th> - </tr> - </thead> - <tbody> - <?php - $order = 1; - foreach(WT_Module::getInstalledCharts() as $module) {?> + </td> + </tr> + <?php + $order++; + } + ?> + </tbody> + </table> + </div> + <!-- sidebars --> + <div id="sidebars_tab"> + <table id="sidebars_table" class="list_table"> + <thead> + <tr> + <th class="list_label"><?php echo i18n::translate('Module Name')?></th> + <th class="list_label"><?php echo i18n::translate('Order')?></th> + <th class="list_label"><?php echo i18n::translate('Access level')?></th> + </tr> + </thead> + <tbody> + <?php + $order = 1; + foreach(WT_Module::getInstalledSidebars() as $module) {?> + <tr class="sortme"> + <td class="list_value"><?php echo $module->getTitle()?></td> + <td class="list_value"><input type="text" size="5" value="<?php echo $order; ?>" name="sidebarorder-<?php echo $module->getName() ?>" /> + <img class="uarrow" style="vertical-align:bottom;" src="<?php echo $WT_IMAGES["uarrow"];?>" border="0" title="<?php echo i18n::translate('Move up')?>" /> + <img class="udarrow" style="vertical-align:bottom;" src="<?php echo $WT_IMAGES["udarrow"];?>" border="0" title="<?php echo i18n::translate('Move to top')?>" /> + <img class="darrow" style="vertical-align:bottom;" src="<?php echo $WT_IMAGES["darrow"];?>" border="0" title="<?php echo i18n::translate('Move down')?>" /> + <img class="ddarrow" style="vertical-align:bottom;" src="<?php echo $WT_IMAGES["ddarrow"];?>" border="0" title="<?php echo i18n::translate('Move to bottom')?>" /> + </td> + <td class="list_value_wrap"> + <table> + <?php + foreach (get_all_gedcoms() as $ged_id=>$ged_name) { + $varname = 'sidebaraccess-'.$module->getName().'-'.$ged_id; + $access_level=WT_DB::prepare( + "SELECT access_level FROM `##module_privacy` WHERE gedcom_id=? AND module_name=? AND component='sidebar'" + )->execute(array($ged_id, $module->getName()))->fetchOne(); + if ($access_level===null) { + $access_level=$module->defaultAccessLevel(); + } + echo '<tr><td>', htmlspecialchars($ged_name), '</td><td>'; + echo edit_field_access_level($varname, $access_level); + } + ?> + </table> + </td> + </tr> + <?php + $order++; + } + ?> + </tbody> + </table> + </div> + <!-- blocks --> + <div id="blocks_tab"> + <table id="blocks_table" class="list_table"> + <thead> + <tr> + <th class="list_label"><?php echo i18n::translate('Module Name')?></th> + <th class="list_label"><?php echo i18n::translate('Access level')?></th> + </tr> + </thead> + <tbody> + <?php + $order = 1; + foreach(WT_Module::getInstalledBlocks() as $module) {?> <tr class="sortme"> <td class="list_value"><?php echo $module->getTitle()?></td> <td class="list_value_wrap"> <table> <?php foreach (get_all_gedcoms() as $ged_id=>$ged_name) { - $varname = 'chartaccess-'.$module->getName().'-'.$ged_id; + $varname = 'blockaccess-'.$module->getName().'-'.$ged_id; $access_level=WT_DB::prepare( - "SELECT access_level FROM `##module_privacy` WHERE gedcom_id=? AND module_name=? AND component='chart'" + "SELECT access_level FROM `##module_privacy` WHERE gedcom_id=? AND module_name=? AND component='block'" )->execute(array($ged_id, $module->getName()))->fetchOne(); if ($access_level===null) { $access_level=$module->defaultAccessLevel(); @@ -584,39 +543,119 @@ print_header(i18n::translate('Module administration')); echo '<tr><td>', htmlspecialchars($ged_name), '</td><td>'; echo edit_field_access_level($varname, $access_level); } - ?> + ?> </table> </td> </tr> <?php - $order++; - } - ?> - </tbody> - </table> - </div> - <!-- reports --> - <div id="reports_tab"> - <table id="reports_table" class="list_table"> - <thead> - <tr> - <th class="list_label"><?php echo i18n::translate('Module Name')?></th> - <th class="list_label"><?php echo i18n::translate('Access level')?></th> - </tr> - </thead> - <tbody> - <?php - $order = 1; - foreach(WT_Module::getInstalledReports() as $module) {?> + $order++; + } + ?> + </tbody> + </table> + </div> + <!-- charts --> + <div id="charts_tab"> + <table id="charts_table" class="list_table"> + <thead> + <tr> + <th class="list_label"><?php echo i18n::translate('Module Name')?></th> + <th class="list_label"><?php echo i18n::translate('Access level')?></th> + </tr> + </thead> + <tbody> + <?php + $order = 1; + foreach(WT_Module::getInstalledCharts() as $module) {?> + <tr class="sortme"> + <td class="list_value"><?php echo $module->getTitle()?></td> + <td class="list_value_wrap"> + <table> + <?php + foreach (get_all_gedcoms() as $ged_id=>$ged_name) { + $varname = 'chartaccess-'.$module->getName().'-'.$ged_id; + $access_level=WT_DB::prepare( + "SELECT access_level FROM `##module_privacy` WHERE gedcom_id=? AND module_name=? AND component='chart'" + )->execute(array($ged_id, $module->getName()))->fetchOne(); + if ($access_level===null) { + $access_level=$module->defaultAccessLevel(); + } + echo '<tr><td>', htmlspecialchars($ged_name), '</td><td>'; + echo edit_field_access_level($varname, $access_level); + } + ?> + </table> + </td> + </tr> + <?php + $order++; + } + ?> + </tbody> + </table> + </div> + <!-- reports --> + <div id="reports_tab"> + <table id="reports_table" class="list_table"> + <thead> + <tr> + <th class="list_label"><?php echo i18n::translate('Module Name')?></th> + <th class="list_label"><?php echo i18n::translate('Access level')?></th> + </tr> + </thead> + <tbody> + <?php + $order = 1; + foreach(WT_Module::getInstalledReports() as $module) {?> + <tr class="sortme"> + <td class="list_value"><?php echo $module->getTitle()?></td> + <td class="list_value_wrap"> + <table> + <?php + foreach (get_all_gedcoms() as $ged_id=>$ged_name) { + $varname = 'reportaccess-'.$module->getName().'-'.$ged_id; + $access_level=WT_DB::prepare( + "SELECT access_level FROM `##module_privacy` WHERE gedcom_id=? AND module_name=? AND component='report'" + )->execute(array($ged_id, $module->getName()))->fetchOne(); + if ($access_level===null) { + $access_level=$module->defaultAccessLevel(); + } + echo '<tr><td>', htmlspecialchars($ged_name), '</td><td>'; + echo edit_field_access_level($varname, $access_level); + } + ?> + </table> + </td> + </tr> + <?php + $order++; + } + ?> + </tbody> + </table> + </div> + <!-- themes --> + <div id="themes_tab"> + <table id="themes_table" class="list_table"> + <thead> + <tr> + <th class="list_label"><?php echo i18n::translate('Module Name')?></th> + <th class="list_label"><?php echo i18n::translate('Access level')?></th> + </tr> + </thead> + <tbody> + <?php + $order = 1; + foreach(WT_Module::getInstalledThemes() as $module) {?> <tr class="sortme"> <td class="list_value"><?php echo $module->getTitle()?></td> <td class="list_value_wrap"> <table> <?php foreach (get_all_gedcoms() as $ged_id=>$ged_name) { - $varname = 'reportaccess-'.$module->getName().'-'.$ged_id; + $varname = 'themeaccess-'.$module->getName().'-'.$ged_id; $access_level=WT_DB::prepare( - "SELECT access_level FROM `##module_privacy` WHERE gedcom_id=? AND module_name=? AND component='report'" + "SELECT access_level FROM `##module_privacy` WHERE gedcom_id=? AND module_name=? AND component='theme'" )->execute(array($ged_id, $module->getName()))->fetchOne(); if ($access_level===null) { $access_level=$module->defaultAccessLevel(); @@ -632,51 +671,12 @@ print_header(i18n::translate('Module administration')); $order++; } ?> - </tbody> - </table> - </div> - <!-- themes --> - <div id="themes_tab"> - <table id="themes_table" class="list_table"> - <thead> - <tr> - <th class="list_label"><?php echo i18n::translate('Module Name')?></th> - <th class="list_label"><?php echo i18n::translate('Access level')?></th> - </tr> - </thead> - <tbody> - <?php - $order = 1; - foreach(WT_Module::getInstalledThemes() as $module) {?> - <tr class="sortme"> - <td class="list_value"><?php echo $module->getTitle()?></td> - <td class="list_value_wrap"> - <table> - <?php - foreach (get_all_gedcoms() as $ged_id=>$ged_name) { - $varname = 'themeaccess-'.$module->getName().'-'.$ged_id; - $access_level=WT_DB::prepare( - "SELECT access_level FROM `##module_privacy` WHERE gedcom_id=? AND module_name=? AND component='theme'" - )->execute(array($ged_id, $module->getName()))->fetchOne(); - if ($access_level===null) { - $access_level=$module->defaultAccessLevel(); - } - echo '<tr><td>', htmlspecialchars($ged_name), '</td><td>'; - echo edit_field_access_level($varname, $access_level); - } - ?> - </table> - </td> - </tr> - <?php - $order++; - } - ?> - </tbody> - </table> - </div> - <input type="submit" value="<?php echo i18n::translate('Save')?>" /> - </form> + </tbody> + </table> + </div> + <input type="submit" value="<?php echo i18n::translate('Save')?>" /> + </form> + </div> </div> <?php print_footer(); |
