當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Module::getAllModulesByComponent方法代碼示例

本文整理匯總了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",
開發者ID:tunandras,項目名稱:webtrees,代碼行數:31,代碼來源:admin_module_sidebar.php

示例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');
開發者ID:tronsmit,項目名稱:webtrees,代碼行數:31,代碼來源:admin_module_charts.php

示例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');
開發者ID:tunandras,項目名稱:webtrees,代碼行數:30,代碼來源:admin_module_blocks.php


注:本文中的Fisharebest\Webtrees\Module::getAllModulesByComponent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。