本文整理汇总了PHP中serendipity_plugin_api::enum_plugins方法的典型用法代码示例。如果您正苦于以下问题:PHP serendipity_plugin_api::enum_plugins方法的具体用法?PHP serendipity_plugin_api::enum_plugins怎么用?PHP serendipity_plugin_api::enum_plugins使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类serendipity_plugin_api
的用法示例。
在下文中一共展示了serendipity_plugin_api::enum_plugins方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show_plugins
/**
* Show the list of plugins
*
* Shows a HTML list of all installed plugins, complete with config/delete/sort order options
*
* @access public
* @param boolean Indicates if event plugins (TRUE) or sidebar plugins (FALSE) shall be shown
* @return null
*/
function show_plugins($event_only = false, $sidebars = null)
{
global $serendipity;
$sql_filter = '';
if (is_array($sidebars)) {
foreach ($sidebars as $sidebar) {
$up = strtoupper($sidebar);
if ($sidebar == 'hide') {
$opts[$sidebar] = HIDDEN;
} elseif (defined('SIDEBAR_' . $up)) {
$opts[$sidebar] = constant('SIDEBAR_' . $up);
} elseif (defined($up)) {
$opts[$sidebar] = constant($up);
} else {
$opts[$sidebar] = $up;
}
$sql_filter .= "AND placement != '" . serendipity_db_escape_string($sidebar) . "' ";
}
}
if (!$event_only) {
$sql = "SELECT * from {$serendipity['dbPrefix']}plugins\n WHERE placement != 'event'\n AND placement != 'eventh'\n " . $sql_filter;
$invisible_plugins = serendipity_db_query($sql);
if (is_array($invisible_plugins)) {
$sidebars[] = 'NONE';
$opts['NONE'] = NONE;
}
}
$opts['event'] = PLUGIN_ACTIVE;
$opts['eventh'] = PLUGIN_INACTIVE;
$data['event_only'] = $event_only;
if (!$event_only) {
$data['is_first'] = true;
}
$data['serendipity_setFormToken'] = serendipity_setFormToken();
$data['serendipity_setFormTokenUrl'] = serendipity_setFormToken('url');
/* Block display the plugins per placement location. */
if ($event_only) {
$plugin_placements = array('event', 'eventh');
} else {
$plugin_placements = $sidebars;
}
$data['plugin_placements'] = $plugin_placements;
static $users = array();
if (empty($users)) {
$users = serendipity_fetchUsers('', 'hidden');
}
$data['users'] = $users;
$i = 0;
foreach ($plugin_placements as $plugin_placement) {
if (!$event_only && $plugin_placement == 'NONE') {
$is_invisible = true;
} else {
$is_invisible = false;
}
$data['placement'][$plugin_placement]['ptitle'] = $ptitle = $opts[$plugin_placement];
$data['placement'][$plugin_placement]['pid'] = $pid = $plugin_placement;
if ($is_invisible) {
$plugins = $invisible_plugins;
} else {
$plugins = serendipity_plugin_api::enum_plugins($plugin_placement);
}
if (!is_array($plugins)) {
continue;
}
$sort_idx = 0;
foreach ($plugins as $plugin_data) {
$i++;
$plugin =& serendipity_plugin_api::load_plugin($plugin_data['name'], $plugin_data['authorid']);
$key = urlencode($plugin_data['name']);
$css_key = 's9ycid' . str_replace('%', '-', $key);
$is_plugin_owner = $plugin_data['authorid'] == $serendipity['authorid'] || serendipity_checkPermission('adminPluginsMaintainOthers');
$is_plugin_editable = $is_plugin_owner || $plugin_data['authorid'] == '0';
$cname = explode(':', $plugin_data['name']);
if (!is_object($plugin)) {
$name = $title = ERROR . '!';
$desc = ERROR . ': ' . $plugin_data['name'];
$can_configure = false;
} else {
/* query for its name, description and configuration data */
$bag = new serendipity_property_bag();
$plugin->introspect($bag);
$name = serendipity_specialchars($bag->get('name'));
$desc = '<details class="plugin_data">';
$desc .= '<summary><var class="perm_name">' . $cname[0] . '</var></summary>';
$desc .= '<div class="plugin_desc clearfix">' . serendipity_specialchars($bag->get('description')) . '</div>';
$desc .= '<span class="block_level">' . VERSION . ': ' . $bag->get('version') . '</span>';
$desc .= '</details>';
$title = serendipity_plugin_api::get_plugin_title($plugin, '[' . $name . ']');
if ($bag->is_set('configuration') && ($plugin->protected === FALSE || $plugin_data['authorid'] == '0' || $plugin_data['authorid'] == $serendipity['authorid'] || serendipity_checkPermission('adminPluginsMaintainOthers'))) {
$can_configure = true;
} else {
//.........这里部分代码省略.........
示例2: array
/**
* Prepares a cache of all event plugins and load them in queue so that they can be fetched
*
* @access public
* @param mixed If set to a string, a certain event plugin cache object will be returned by this function
* @param boolean If set to true, the list of cached event plugins will be refreshed
* @return mixed Either returns the whole list of event plugins, or only a specific instance
*/
function &get_event_plugins($getInstance = false, $refresh = false)
{
static $event_plugins;
static $false = false;
if (!$refresh && isset($event_plugins) && is_array($event_plugins)) {
if ($getInstance) {
if (isset($event_plugins[$getInstance]['p'])) {
return $event_plugins[$getInstance]['p'];
}
return $false;
}
return $event_plugins;
}
$plugins = serendipity_plugin_api::enum_plugins('event');
if (!is_array($plugins)) {
return $false;
}
$event_plugins = array();
foreach ($plugins as $plugin_data) {
if ($event_plugins[$plugin_data['name']]['p'] =& serendipity_plugin_api::load_plugin($plugin_data['name'], $plugin_data['authorid'], $plugin_data['path'])) {
/* query for its name, description and configuration data */
$event_plugins[$plugin_data['name']]['b'] = new serendipity_property_bag();
$event_plugins[$plugin_data['name']]['p']->introspect($event_plugins[$plugin_data['name']]['b']);
$event_plugins[$plugin_data['name']]['t'] = serendipity_plugin_api::get_plugin_title($event_plugins[$plugin_data['name']]['p']);
} else {
unset($event_plugins[$plugin_data['name']]);
// Unset failed plugins
}
}
if ($getInstance) {
if (isset($event_plugins[$getInstance]['p'])) {
return $event_plugins[$getInstance]['p'];
}
return $false;
}
return $event_plugins;
}
示例3: die
# All rights reserved. See LICENSE file for licensing details
if (IN_serendipity !== true) {
die('Don\'t hack!');
}
if (!serendipity_checkPermission('adminPlugins')) {
return;
}
include_once S9Y_INCLUDE_PATH . 'include/plugin_api.inc.php';
include_once S9Y_INCLUDE_PATH . 'include/plugin_internal.inc.php';
include_once S9Y_INCLUDE_PATH . 'include/functions_entries_admin.inc.php';
include_once S9Y_INCLUDE_PATH . 'include/functions_plugins_admin.inc.php';
if (isset($_GET['serendipity']['plugin_to_move']) && isset($_GET['submit']) && serendipity_checkFormToken()) {
if (isset($_GET['serendipity']['event_plugin'])) {
$plugins = serendipity_plugin_api::enum_plugins('event', false);
} else {
$plugins = serendipity_plugin_api::enum_plugins('event', true);
}
/* Renumber the sort order to be certain that one actually exists
Also look for the one we're going to move */
$idx_to_move = -1;
for ($idx = 0; $idx < count($plugins); $idx++) {
$plugins[$idx]['sort_order'] = $idx;
if ($plugins[$idx]['name'] == $_GET['serendipity']['plugin_to_move']) {
$idx_to_move = $idx;
}
}
/* If idx_to_move is still -1 then we never found it (shouldn't happen under normal conditions)
Also make sure the swaping idx is around */
if ($idx_to_move >= 0 && ($_GET['submit'] == 'move down' && $idx_to_move < count($plugins) - 1 || $_GET['submit'] == 'move up' && $idx_to_move > 0)) {
/* Swap the one were moving with the one that's in the spot we're moving to */
$tmp = $plugins[$idx_to_move]['sort_order'];
示例4: sb_plugin_status
/**
* check if sidebar plugin is available for install
*/
function sb_plugin_status()
{
$plugins = serendipity_plugin_api::enum_plugins('*', false, 'serendipity_plugin_staticpage');
if (is_array($plugins) && !empty($plugins[0]['name'])) {
return true;
}
return false;
}
示例5: event_hook
//.........这里部分代码省略.........
echo NO;
?>
</label>
</div>
</div>
<?php
}
?>
<h4><?php
echo PLUGIN_EVENT_IMAGESELECTORPLUS_QUICKBLOG;
?>
:</h4>
<em><?php
echo PLUGIN_EVENT_IMAGESELECTORPLUS_QUICKBLOG_DESC;
?>
</em>
<div id="quickblog_tablefield" class="clearfix">
<div class="quickblog_form_field">
<label for="quickblog_titel"><?php
echo TITLE;
?>
</label>
<input id="quickblog_title" class="input_textbox" name="serendipity[quickblog][title]" type="text">
</div>
<div class="quickblog_textarea_field">
<label for="nuggets2"><?php
echo ENTRY_BODY;
?>
</label>
<textarea id="nuggets2" class="quickblog_nugget" data-tarea="nuggets2" name="serendipity[quickblog][body]" rows="10" cols="80"></textarea>
<?php
if ($serendipity['wysiwyg']) {
$plugins = serendipity_plugin_api::enum_plugins('*', false, 'serendipity_event_nl2br');
?>
<input name="serendipity[properties][disable_markups][]" type="hidden" value="<?php
echo $plugins[0]['name'];
?>
">
<?php
if (!class_exists('serendipity_event_ckeditor')) {
?>
<script src="<?php
echo $serendipity['serendipityHTTPPath'];
?>
htmlarea/ckeditor/ckeditor/ckeditor.js"></script>
<?php
}
// just add a simple basic toolbar, since we cannot use embedded plugins here
?>
<script>
CKEDITOR.replace( 'nuggets2',
{
toolbar : [['Format'],['Bold','Italic','Underline','Superscript','-','NumberedList','BulletedList','Outdent','Blockquote'],['JustifyBlock','JustifyCenter','JustifyRight'],['Link','Unlink'],['Source']],
toolbarGroups: null
});
</script>
<?php
}
?>
</div>
<div class="quickblog_form_field">
<label for="quickblog_select"><?php
echo CATEGORY;
?>
示例6: show_plugins
/**
* Show the list of plugins
*
* Shows a HTML list of all installed plugins, complete with config/delete/sort order options
*
* @access public
* @param boolean Indicates if event plugins (TRUE) or sidebar plugins (FALSE) shall be shown
* @return null
*/
function show_plugins($event_only = false, $sidebars = null)
{
static $opts = array('event' => PLUGIN_ACTIVE, 'eventh' => PLUGIN_INACTIVE);
global $serendipity;
$sql_filter = '';
if (is_array($sidebars)) {
foreach ($sidebars as $sidebar) {
$up = strtoupper($sidebar);
if ($sidebar == 'hide') {
$opts[$sidebar] = HIDDEN;
} elseif (defined('SIDEBAR_' . $up)) {
$opts[$sidebar] = constant('SIDEBAR_' . $up);
} elseif (defined($up)) {
$opts[$sidebar] = constant($up);
} else {
$opts[$sidebar] = $up;
}
$sql_filter .= "AND placement != '" . serendipity_db_escape_string($sidebar) . "' ";
}
}
if (!$event_only) {
$sql = "SELECT * from {$serendipity['dbPrefix']}plugins\n WHERE placement != 'event'\n AND placement != 'eventh'\n " . $sql_filter;
$invisible_plugins = serendipity_db_query($sql);
if (is_array($invisible_plugins)) {
$sidebars[] = 'NONE';
$opts['NONE'] = NONE;
}
}
$eyecandy = !isset($serendipity['eyecandy']) || serendipity_db_bool($serendipity['eyecandy']);
if (!$eyecandy) {
echo ' <form action="?serendipity[adminModule]=plugins" method="post">';
} elseif (!$event_only) {
echo '<script type="text/javascript"> function templatePluginMoverInit() { ';
$is_first = true;
foreach ($sidebars as $sidebar) {
?>
<?php
echo $is_first ? 'var ' : '';
?>
list = document.getElementById("<?php
echo $sidebar;
?>
_col");
DragDrop.makeListContainer(list, 'g1');
list.onDragOver = function() { this.style["border"] = "1px solid #4d759b"; };
list.onDragOut = function() { this.style["border"] = "none"; };
<?php
$is_first = false;
}
echo ' } addLoadEvent(templatePluginMoverInit);</script>';
echo ' <form action="?serendipity[adminModule]=plugins" method="post" onsubmit="pluginMovergetSort(); return true">';
echo ' <input type="hidden" name="serendipity[pluginorder]" id="order" value="" />';
} else {
echo '<script type="text/javascript">addLoadEvent(pluginMoverInitEvent);</script>';
echo ' <form action="?serendipity[adminModule]=plugins" method="post" onsubmit="pluginMovergetSortEvent(); return true">';
echo ' <input type="hidden" name="serendipity[pluginorder]" id="eventorder" value="" />';
}
echo serendipity_setFormToken();
?>
<table class="pluginmanager" border="0" cellpadding="5" cellspacing="3" width="100%">
<tr>
<?php
$errors = array();
/* Block display the plugins per placement location. */
if ($event_only) {
$plugin_placements = array('event', 'eventh');
} else {
$plugin_placements = $sidebars;
}
$total = 0;
foreach ($plugin_placements as $plugin_placement) {
if (!$event_only && $plugin_placement == 'NONE') {
$is_invisible = true;
} else {
$is_invisible = false;
}
$ptitle = $opts[$plugin_placement];
$pid = $plugin_placement;
echo '<td class="pluginmanager_side pluginmanager_' . ($event_only ? 'event' : 'sidebar') . '">';
echo '<div class="heading">' . $ptitle . '</div>';
echo '<ol id="' . $pid . '_col" class="pluginmanager_container">';
if ($is_invisible) {
$plugins = $invisible_plugins;
} else {
$plugins = serendipity_plugin_api::enum_plugins($plugin_placement);
}
if (!is_array($plugins)) {
continue;
}
$sort_idx = 0;
foreach ($plugins as $plugin_data) {
//.........这里部分代码省略.........
示例7: admin_save
function admin_save()
{
global $serendipity;
global $template_vars;
serendipity_smarty_init();
if (isset($template_vars['sidebars'])) {
$sidebars = explode(',', $template_vars['sidebars']);
} elseif (isset($serendipity['sidebars'])) {
$sidebars = $serendipity['sidebars'];
} else {
$sidebars = array('left', 'hide', 'right');
}
$plugin_list = array();
$view_list = array();
$category_view_list = array();
$usergroups_view_list = array();
foreach ($sidebars as $sidebar) {
$plugins = serendipity_plugin_api::enum_plugins($sidebar);
$i = 0;
if (is_array($plugins)) {
if ($sidebar == 'left') {
$pside = 0;
} elseif ($sidebar == 'right') {
$pside = 1;
} else {
$pside = $sidebar;
}
foreach ($plugins as $plugin) {
if (isset($_REQUEST['plugin_' . $pside . '_' . $i])) {
$plugin_list[$pside][$i] = 0;
} else {
$plugin_list[$pside][$i] = 1;
}
$i++;
}
}
}
$this->set_config('plugin_list', serialize($plugin_list));
foreach ((array) $_REQUEST['plugin_view'] as $instance => $prop) {
if ($prop == 'myself') {
$view_list[base64_decode($instance)] = $serendipity['authorid'];
} elseif ($prop == 'member') {
$view_list[base64_decode($instance)] = 'member';
} elseif ($prop == 'everyone') {
//--JAM: 2005-10-18
$view_list[base64_decode($instance)] = 'everyone';
}
}
$this->set_config('view_list', serialize($view_list));
foreach ((array) $_REQUEST['plugin_category_view'] as $instance => $prop) {
$category_view_list[base64_decode($instance)] = implode(',', $prop);
}
$this->set_config('category_view_list', serialize($category_view_list));
foreach ((array) $_REQUEST['plugin_usergroups_view'] as $instance => $prop) {
$usergroups_view_list[base64_decode($instance)] = implode(',', $prop);
}
$this->set_config('usergroups_view_list', serialize($usergroups_view_list));
echo '<div class="serendipityAdminMsgSuccess"><img style="width: 22px; height: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_success.png') . '" alt="" />' . sprintf(SETTINGS_SAVED_AT, serendipity_strftime('%T')) . "<br /><br />\n</div>";
}
示例8: event_hook
function event_hook($event, &$bag, &$eventData, $addData = null)
{
global $serendipity;
$hooks =& $bag->get('event_hooks');
if (isset($hooks[$event])) {
switch ($event) {
case 'backend_sidebar_entries':
?>
<li class="serendipitySideBarMenuLink serendipitySideBarMenuEntryLinks"><a href="?serendipity[adminModule]=event_display&serendipity[adminAction]=mycalendar"><?php
echo PLUGIN_MYCALENDAR_TITLE;
?>
</a></li>
<?php
break;
case 'backend_sidebar_entries_event_display_mycalendar':
$this->showevents();
break;
case 'external_plugin':
if ($eventData == 'mycalendar.rss') {
$plugins = serendipity_plugin_api::enum_plugins('*', false, 'serendipity_plugin_mycalendar', null);
if (!is_array($plugins)) {
return;
}
foreach ($plugins as $plugin_data) {
$plugin =& serendipity_plugin_api::load_plugin($plugin_data['name'], $plugin_data['authorid'], $plugin_data['path']);
}
if (!is_object($plugin)) {
return;
}
$items = $plugin->generate_content($eventData, true);
header('Content-Type: text/xml; charset=UTF-8');
echo '<?xml version="1.0" encoding="utf-8" ?>' . "\n";
?>
<rss version="2.0"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:admin="http://webns.net/mvcb/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
>
<channel>
<title><?php
echo $serendipity['blogTitle'] . ' - ' . PLUGIN_MYCALENDAR_TITLE;
?>
</title>
<link><?php
echo $serendipity['baseURL'];
?>
</link>
<description><?php
echo PLUGIN_MYCALENDAR_SIDE_NAME;
?>
</description>
<generator>Serendipity - http://www.s9y.org/</generator>
<?php
foreach ($items as $item) {
?>
<item>
<title><?php
echo serendipity_utf8_encode(function_exists('serendipity_specialchars') ? serendipity_specialchars($item['title']) : htmlspecialchars($item['title'], ENT_COMPAT, LANG_CHARSET));
?>
</title>
<link><?php
echo serendipity_utf8_encode(function_exists('serendipity_specialchars') ? serendipity_specialchars($item['url']) : htmlspecialchars($item['url'], ENT_COMPAT, LANG_CHARSET));
?>
</link>
<author><?php
echo $serendipity['blogTitle'];
?>
</author>
<content:encoded>
<?php
echo serendipity_utf8_encode(function_exists('serendipity_specialchars') ? serendipity_specialchars($item['content']) : htmlspecialchars($item['content'], ENT_COMPAT, LANG_CHARSET));
?>
</content:encoded>
<pubDate><?php
echo $item['date'];
?>
</pubDate>
<guid isPermaLink="false"><?php
echo serendipity_utf8_encode(function_exists('serendipity_specialchars') ? serendipity_specialchars($item['url']) : htmlspecialchars($item['url'], ENT_COMPAT, LANG_CHARSET));
?>
</guid>
</item>
<?php
}
?>
</channel>
</rss>
<?php
}
break;
case 'frontend_calendar':
$this->get_month_events($eventData, $addData);
break;
}
}
return true;
}
示例9: serendipity_fetchCategoryInfo
}
if (!empty($serendipity['GET']['category'])) {
$cInfo = serendipity_fetchCategoryInfo((int) $serendipity['GET']['category']);
$title = serendipity_utf8_encode(htmlspecialchars($title . ' - ' . $cInfo['category_name']));
} elseif (!empty($serendipity['GET']['viewAuthor'])) {
list($aInfo) = serendipity_fetchAuthor((int) $serendipity['GET']['viewAuthor']);
$title = serendipity_utf8_encode(htmlspecialchars($aInfo['realname'] . ' - ' . $title));
} else {
$title = serendipity_utf8_encode(htmlspecialchars($title));
}
$description = serendipity_utf8_encode(htmlspecialchars($description));
$metadata = array('title' => $title, 'description' => $description, 'language' => $serendipity['lang'], 'additional_fields' => array(), 'link' => $serendipity['baseURL'], 'email' => $serendipity['blogMail'], 'fullFeed' => false, 'showMail' => false, 'version' => $version);
if (!defined('S9Y_FRAMEWORK_PLUGIN_API')) {
include S9Y_INCLUDE_PATH . 'include/plugin_api.inc.php';
}
$plugins = serendipity_plugin_api::enum_plugins();
if (is_array($plugins)) {
// load each plugin to make some introspection
foreach ($plugins as $plugin_data) {
if (preg_match('|@serendipity_syndication_plugin|', $plugin_data['name'])) {
$plugin =& serendipity_plugin_api::load_plugin($plugin_data['name'], $plugin_data['authorid']);
$metadata['additional_fields'] = $plugin->generate_rss_fields($metadata['title'], $metadata['description'], $entries);
if (is_array($metadata['additional_fields'])) {
// Fix up array keys, because "." are not allowed when wanting to output using Smarty
foreach ($metadata['additional_fields'] as $_aid => $af) {
$aid = str_replace('.', '', $_aid);
$metadata['additional_fields'][$aid] = $af;
}
}
$metadata['fullFeed'] = $plugin->get_config('fullfeed', false);
if ($metadata['fullFeed'] === 'client') {
示例10: event_hook
function event_hook($event, &$bag, &$eventData, $addData = null)
{
global $serendipity;
static $regex = null;
static $sub = null;
static $navigate = null;
static $pluginDir = null;
static $type = null;
$hooks =& $bag->get('event_hooks');
if (isset($hooks[$event])) {
if ($pluginDir === null) {
$pluginDir = $this->get_config('path');
}
if ($type === null) {
$type = $this->get_config('type');
#$new = array('colorbox', 'lightbox2jq', 'magnific', 'prettyPhoto');
/*$removed = array('lightbox2', 'lightbox', 'lightbox_plus', 'thickbox', 'greybox');
if (in_array($type, $removed)) {
$type = 'lightbox2jq'; // force and set new default for upgraders
$this->set_config('type', $type);
}*/
}
if ($navigate === null) {
$navigate = $this->get_config('navigate_one_entry_only');
}
if ($regex == null) {
if ($type == 'lightbox2jq') {
$regex = '/<a([^>]+)(href=(["\'])[^"\']*\\.(jpe?g|gif|png)["\'])/i';
$sub = '<a $1 rel=$3lightbox$3 $2';
} elseif ($type == 'prettyPhoto') {
$regex = '/<a([^>]+)(href=(["\'])[^"\']*\\.(jpe?g|gif|png)["\'])/i';
$sub = '<a rel=$3prettyPhoto$3 $1 $2';
} elseif ($type == 'colorbox') {
$regex = '/<a([^>]+)(href=(["\'])[^"\']*\\.(jpe?g|gif|png)["\'])/i';
$sub = '<a $1 rel=$3singlebox$3 $2';
} elseif ($type == 'magnific') {
$regex = '/<a([^>]+)(href=(["\'])[^"\']*\\.(jpe?g|gif|png)["\'])/i';
$sub = '<a rel=$3onemagnificPopup$3 $1 $2';
} else {
// force new lib to prevent empty regular expression errors in preg_replace()
$type = 'lightbox2jq';
$this->set_config('type', $type);
$regex = '/<a([^>]+)(href=(["\'])[^"\']*\\.(jpe?g|gif|png)["\'])/i';
$sub = '<a $1 rel=$3lightbox$3 $2';
}
}
switch ($event) {
case 'frontend_header':
$headcss = true;
case 'frontend_footer':
// case plugin imagesidebar on eg staticpages. We need the libs then!
$check_imagesidebar = serendipity_plugin_api::enum_plugins('*', false, 'serendipity_plugin_imagesidebar');
$cisb = $check_imagesidebar['placement'] != 'hide' ? $check_imagesidebar : null;
// If no imagelink was processed, don't add css or js files to the header! (configurable optimization)
if (serendipity_db_bool($this->get_config('header_optimization', false)) && !$this->foundImageLink && empty($cisb)) {
return true;
}
echo "\n";
// ColorBox code (https://github.com/jackmoore/colorbox) - init with :visible to ensure to not show hidden elements via hideafter function in imageselectorplus ranges
if ($type == 'colorbox') {
if ($headcss) {
echo ' <link rel="stylesheet" type="text/css" href="' . $pluginDir . '/fixchrome.css" />' . "\n";
echo ' <link rel="stylesheet" type="text/css" href="' . $pluginDir . '/colorbox/colorboxScreens.css" />' . "\n";
echo ' <link rel="stylesheet" type="text/css" href="' . $pluginDir . '/colorbox/colorbox.css" />' . "\n";
} else {
if (!class_exists('serendipity_event_jquery') && !$serendipity['capabilities']['jquery']) {
echo ' <script type="text/javascript" src="' . $pluginDir . '/jquery-1.11.3.min.js" charset="utf-8"></script>' . "\n";
}
echo ' <script type="text/javascript" src="' . $pluginDir . '/colorbox/jquery.colorbox-min.js" charset="utf-8"></script>' . "\n";
echo ' <script type="text/javascript" src="' . $pluginDir . '/colorbox/jquery.colorbox.init.js" charset="utf-8"></script>' . "\n";
}
} elseif ($type == 'lightbox2jq') {
if ($headcss) {
echo ' <link rel="stylesheet" type="text/css" href="' . $pluginDir . '/lightbox2-jquery/css/lightbox.css" />' . "\n";
} else {
if (!class_exists('serendipity_event_jquery') && !$serendipity['capabilities']['jquery']) {
echo ' <script type="text/javascript" src="' . $pluginDir . '/jquery-1.11.3.min.js" charset="utf-8"></script>' . "\n";
}
// remove anchors possible onclick handler
echo ' <script type="text/javascript"> jQuery(document).ready(function(){ jQuery(\'a[rel^="lightbox"]\').removeAttr("onclick"); }); </script>' . "\n";
echo ' <script type="text/javascript" src="' . $pluginDir . '/lightbox2-jquery/js/lightbox.min.js" charset="utf-8"></script>' . "\n";
}
} elseif ($type == 'magnific') {
if ($headcss) {
echo ' <link rel="stylesheet" type="text/css" href="' . $pluginDir . '/fixchrome.css" />' . "\n";
echo ' <link rel="stylesheet" type="text/css" href="' . $pluginDir . '/magnific-popup/magnific-popup.css" />' . "\n";
} else {
if (!class_exists('serendipity_event_jquery') && !$serendipity['capabilities']['jquery']) {
echo ' <script type="text/javascript" src="' . $pluginDir . '/jquery-1.11.3.min.js" charset="utf-8"></script>' . "\n";
}
echo ' <script type="text/javascript" src="' . $pluginDir . '/magnific-popup/jquery.magnific-popup.min.js" charset="utf-8"></script>' . "\n";
echo ' <script type="text/javascript" src="' . $pluginDir . '/magnific-popup/jquery.magnific-popup.init.js" charset="utf-8"></script>' . "\n";
}
} elseif ($type == 'prettyPhoto') {
if ($headcss) {
echo ' <link rel="stylesheet" type="text/css" href="' . $pluginDir . '/fixchrome.css" />' . "\n";
echo ' <link rel="stylesheet" type="text/css" href="' . $pluginDir . '/prettyphoto/css/prettyPhoto.css" />' . "\n";
echo ' <link rel="stylesheet" type="text/css" href="' . $pluginDir . '/prettyphoto/css/prettyPhotoScreens.css" />' . "\n";
} else {
if (!class_exists('serendipity_event_jquery') && !$serendipity['capabilities']['jquery']) {
//.........这里部分代码省略.........