本文整理汇总了PHP中Plugins::enabledPlugins方法的典型用法代码示例。如果您正苦于以下问题:PHP Plugins::enabledPlugins方法的具体用法?PHP Plugins::enabledPlugins怎么用?PHP Plugins::enabledPlugins使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plugins
的用法示例。
在下文中一共展示了Plugins::enabledPlugins方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: adminHead
function adminHead()
{
$plugins = Plugins::enabledPlugins();
$html = '';
foreach ($plugins as $plugin) {
if (method_exists($plugin, 'adminHead')) {
$html .= $plugin::adminHead();
}
}
echo $html;
}
示例2: pluginSettings
public static function pluginSettings()
{
$plugins = Plugins::enabledPlugins();
$html = '';
foreach ($plugins as $plugin) {
if (method_exists($plugin, 'adminSettings')) {
$html .= "<fieldset>";
$html .= $plugin::adminSettings();
$html .= "</fieldset>";
}
}
echo $html;
}
示例3: getField
function getField($field)
{
global $Candy;
$page = isset($_GET['page']) ? $_GET['page'] : $Candy['options']->getOption('homepage');
$id = $Candy['pages']->getInfo('page_id', $page);
$dbh = new CandyDB();
$sth = $dbh->prepare("SELECT field_value FROM " . DB_PREFIX . "fields WHERE field_name='{$field}' AND post_id={$id}");
$sth->execute();
$content = $sth->fetchColumn();
$plugins = Plugins::enabledPlugins();
foreach ($plugins as $plugin) {
if (method_exists($plugin, 'addShorttag')) {
$replace = $plugin::addShorttag();
foreach ($replace as $key => $value) {
$content = str_replace($key, $value, $content);
}
}
}
return $content;
}
示例4: error_reporting
* @package CandyCMS
* @version 0.7.4
* @since 0.1
* @copyright Copyright 2012 (C) Cocoon Design Ltd. - All Rights Reserved
*
* Admin bootstrap
*/
#ini_set('display_errors', 1);
error_reporting(E_ALL);
define('CANDYVERSION', '0.7.4');
require_once '../core/config.php';
# Fire up the autoloader I'm going back to 1977!
function __autoload($class_name)
{
if (file_exists("classes/{$class_name}.php")) {
include 'classes/' . $class_name . '.php';
} else {
include CMS_PATH . 'core/classes/' . $class_name . '.php';
}
}
$Candy = array();
$Candy['options'] = new Options();
# Include our admin functions file
include_once 'functions.php';
# Load all of our enabled plugins and include the files
$plugins = Plugins::enabledPlugins();
if (is_array($plugins)) {
foreach ($plugins as $plugin) {
include_once PLUGIN_PATH . $plugin . '/' . $plugin . '.php';
}
}
示例5: foreach
<div id="container">
<?php
if (isset($_POST['save'])) {
?>
<p class="message success">Plugins Saved</p>
<?php
Plugins::savePlugins($_POST['enabled']);
}
?>
<form action="dashboard.php?page=plugins" method="post">
<?php
$plugins = Plugins::listPlugins();
$enabled = Plugins::enabledPlugins();
if ($plugins != false) {
echo '<ul class="list">';
foreach ($plugins as $plugin) {
echo '<li>';
echo '<p class="plugin-ttl">', $plugin['plugin'], '</p>', $plugin['description'], '<br /><span>Author: <a href="' . $plugin['authorURI'] . '" target="_blank">', $plugin['author'], '</a></span>';
$check = in_array($plugin['dir'], $enabled) ? '<input type="checkbox" value="' . $plugin['dir'] . '" name="enabled[]" checked="checked" class="right" />' : '<input type="checkbox" value="' . $plugin['dir'] . '" name="enabled[]" class="right" />';
echo $check;
echo '</li>';
}
echo '</ul>';
echo '<input type="submit" class="button" value="Save" name="save" />';
}
?>
</form>
</div>