本文整理汇总了PHP中Fisharebest\Webtrees\Module::getAllModulesByComponent方法的典型用法代码示例。如果您正苦于以下问题:PHP Module::getAllModulesByComponent方法的具体用法?PHP Module::getAllModulesByComponent怎么用?PHP Module::getAllModulesByComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fisharebest\Webtrees\Module
的用法示例。
在下文中一共展示了Module::getAllModulesByComponent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PageController
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Fisharebest\Webtrees;
use Fisharebest\Webtrees\Controller\PageController;
use Fisharebest\Webtrees\Functions\FunctionsEdit;
use Fisharebest\Webtrees\Module\ModuleConfigInterface;
define('WT_SCRIPT_NAME', 'admin_module_sidebar.php');
require 'includes/session.php';
$controller = new PageController();
$controller->restrictAccess(Auth::isAdmin())->setPageTitle(I18N::translate('Sidebars'));
$action = Filter::post('action');
$modules = Module::getAllModulesByComponent('sidebar');
if ($action === 'update_mods' && Filter::checkCsrf()) {
foreach ($modules as $module) {
foreach (Tree::getAll() as $tree) {
$access_level = Filter::post('access-' . $module->getName() . '-' . $tree->getTreeId(), WT_REGEX_INTEGER, $module->defaultAccessLevel());
Database::prepare("REPLACE INTO `##module_privacy` (module_name, gedcom_id, component, access_level) VALUES (?, ?, 'sidebar', ?)")->execute(array($module->getName(), $tree->getTreeId(), $access_level));
}
$order = Filter::post('order-' . $module->getName());
Database::prepare("UPDATE `##module` SET sidebar_order = ? WHERE module_name = ?")->execute(array($order, $module->getName()));
}
header('Location: ' . WT_BASE_URL . WT_SCRIPT_NAME);
return;
}
$controller->addInlineJavascript('
jQuery("#module_table").sortable({
items: ".sortme",
示例2: PageController
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Fisharebest\Webtrees;
use Fisharebest\Webtrees\Controller\PageController;
use Fisharebest\Webtrees\Functions\FunctionsEdit;
use Fisharebest\Webtrees\Module\ModuleConfigInterface;
define('WT_SCRIPT_NAME', 'admin_module_charts.php');
require 'includes/session.php';
$controller = new PageController();
$controller->restrictAccess(Auth::isAdmin())->setPageTitle(I18N::translate('Charts'));
$action = Filter::post('action');
$modules = Module::getAllModulesByComponent('chart');
if ($action === 'update_mods' && Filter::checkCsrf()) {
foreach ($modules as $module) {
foreach (Tree::getAll() as $tree) {
$access_level = Filter::post('access-' . $module->getName() . '-' . $tree->getTreeId(), WT_REGEX_INTEGER, $module->defaultAccessLevel());
Database::prepare("REPLACE INTO `##module_privacy` (module_name, gedcom_id, component, access_level) VALUES (?, ?, 'chart', ?)")->execute(array($module->getName(), $tree->getTreeId(), $access_level));
}
}
header('Location: ' . WT_BASE_URL . WT_SCRIPT_NAME);
return;
}
$controller->pageHeader();
?>
<ol class="breadcrumb small">
<li><a href="admin.php"><?php
echo I18N::translate('Control panel');
示例3: PageController
/**
* Defined in session.php
*
* @global Tree $WT_TREE
*/
global $WT_TREE;
use Fisharebest\Webtrees\Controller\PageController;
use Fisharebest\Webtrees\Functions\FunctionsEdit;
use Fisharebest\Webtrees\Module\ModuleConfigInterface;
define('WT_SCRIPT_NAME', 'admin_module_blocks.php');
require 'includes/session.php';
$controller = new PageController();
$controller->restrictAccess(Auth::isAdmin())->setPageTitle(I18N::translate('Blocks'));
$action = Filter::post('action');
$modules = Module::getAllModulesByComponent('block');
if ($action === 'update_mods' && Filter::checkCsrf()) {
foreach ($modules as $module) {
foreach (Tree::getAll() as $tree) {
$access_level = Filter::post('access-' . $module->getName() . '-' . $tree->getTreeId(), WT_REGEX_INTEGER, $module->defaultAccessLevel());
Database::prepare("REPLACE INTO `##module_privacy` (module_name, gedcom_id, component, access_level) VALUES (?, ?, 'block', ?)")->execute(array($module->getName(), $tree->getTreeId(), $access_level));
}
}
header('Location: ' . WT_BASE_URL . WT_SCRIPT_NAME);
return;
}
$controller->pageHeader();
?>
<ol class="breadcrumb small">
<li><a href="admin.php"><?php
echo I18N::translate('Control panel');