本文整理汇总了PHP中plugins::getPlugins方法的典型用法代码示例。如果您正苦于以下问题:PHP plugins::getPlugins方法的具体用法?PHP plugins::getPlugins怎么用?PHP plugins::getPlugins使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类plugins
的用法示例。
在下文中一共展示了plugins::getPlugins方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
foreach ($dirs as $dir) {
$dir .= '/page';
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if (preg_match('/^([a-zA-Z-0-9]+)(.class)?.php$/', $file, $matches)) {
$list[] = $matches[1];
}
}
}
}
return array_unique($list);
}
}
$plugins_root = 'tools/';
$objPlugins = new plugins($plugins_root);
$objPlugins->getPlugins(true);
$plugins_list = $objPlugins->getPluginsList();
$wakkaConfig['formatter_path'] = 'formatters';
$wikiClasses[] = 'WikiTools';
$wikiClassesContent[] = '';
foreach ($plugins_list as $k => $v) {
if (file_exists($plugins_root . $k . '/wiki.php')) {
include $plugins_root . $k . '/wiki.php';
}
// language files : first default language, then preferred language
if (file_exists($plugins_root . $k . '/lang/' . $k . '_fr.inc.php')) {
include $plugins_root . $k . '/lang/' . $k . '_fr.inc.php';
}
if ($GLOBALS['prefered_language'] != 'fr' && file_exists($plugins_root . $k . '/lang/' . $k . '_' . $GLOBALS['prefered_language'] . '.inc.php')) {
include $plugins_root . $k . '/lang/' . $k . '_' . $GLOBALS['prefered_language'] . '.inc.php';
}
示例2: array
// --------------------------------------------------------------------------------------------
// RECUPERATION des mods déjà installés et NON installés
//
$sql = 'SELECT id_mod, nom
FROM ' . AREABB_MODS . '
ORDER BY nom ASC';
if (!($result = $db->sql_query($sql))) {
message_die(GENERAL_ERROR, "Impossible d'afficher la liste des blocs", '', __LINE__, __FILE__, $sql);
}
$listes_mods = array();
$liste_id = array();
while ($row = $db->sql_fetchrow($result)) {
$listes_mods[] = $row['nom'];
$liste_id[$row['nom']] = $row['id_mod'];
}
$plugins->getPlugins(true);
$plugins_list = $plugins->getPluginsList();
// --------------------------------------------------------------------------------------------
// AFFiCHAGE
//
$template->set_filenames(array('body' => 'admin/areabb_mods.tpl'));
foreach ($plugins_list as $k => $v) {
$titre = !empty($v['label']) ? $v['label'] : $v['nom'];
if (file_exists(CHEMIN_MODS . $k . '/logo.png')) {
$image = CHEMIN_MODS . $k . '/logo.png';
}
$template->assign_block_vars('mods', array('ID' => $k, 'TITRE' => $titre, 'IMAGE' => $image, 'DESC' => $v['description'], 'AUTEUR' => $v['auteur'], 'VERSION' => $v['version'], 'SUPPRIMER' => append_sid('admin_areabb_mods.php?action=supprime&titre=' . $k . '&id_mod=' . $liste_id[$k]), 'INSTALLER' => append_sid('admin_areabb_mods.php?action=install&titre=' . $k . '&page=' . $v['page']), 'PACKAGER' => append_sid('admin_areabb_mods.php?action=package&titre=' . $k . '&version=' . $v['version']), 'TELECHARGER' => $phpbb_root_path . 'areabb/dl.php?extension=' . $liste_id[$k]));
// mod déjà installé ?
if (in_array($k, $listes_mods)) {
// Lien pour le supprimer
$template->assign_block_vars("mods.supprimer", array());
示例3: dirname
# ***** END LICENSE BLOCK *****
#
# Contributors :
# - Olivier Meunier
#
require dirname(__FILE__) . '/lib.php';
$err = '';
$tool_url = 'tools.php?p=packager';
# Liste des thèmes
$themes_root = dirname(__FILE__) . '/../../../themes';
$themes = new plugins($themes_root, 'theme');
$themes->getPlugins(false);
$themes_list = $themes->getPluginsList();
$plugins_root = dirname(__FILE__) . '/..';
$plugins = new plugins($plugins_root);
$plugins->getPlugins(false);
$plugins_list = $plugins->getPLuginsList();
# Préparation des tableaux pour les combo
$t_list = $p_list = array();
foreach ($themes_list as $k => $v) {
$t_list[$v['label'] . ' - ' . __('version') . ' ' . $v['version']] = $k;
}
foreach ($plugins_list as $k => $v) {
$p_list[$v['label'] . ' - ' . __('version') . ' ' . $v['version']] = $k;
}
# Téléchargement ou sauvegarde d'un plugin
if (!empty($_POST['p_plugin'])) {
$fname = 'plugin-' . $_POST['p_plugin'];
if (!empty($plugins_list[$_POST['p_plugin']]['version'])) {
$fname .= '-' . $plugins_list[$_POST['p_plugin']]['version'];
}