本文整理汇总了PHP中is_plugin_enabled函数的典型用法代码示例。如果您正苦于以下问题:PHP is_plugin_enabled函数的具体用法?PHP is_plugin_enabled怎么用?PHP is_plugin_enabled使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_plugin_enabled函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: blogextended_init
/**
* Blog extended initialization
*
* Register css extensions, contentes view for groups, widgets and event handlers
*/
function blogextended_init()
{
global $CONFIG;
extend_view("css", "blogextended/css");
extend_view("blog/fields_before", "blog/forms/type");
extend_view("blog/fields_before", "groups/groupselector");
//extend_view('groups/left_column', 'groups/groupcontents',1);
add_widget_type('blog', elgg_echo('blog:widget:title'), elgg_echo('blog:widget:description'));
register_elgg_event_handler("create", "object", "blog_type_handler");
register_elgg_event_handler("update", "object", "blog_type_handler");
register_elgg_event_handler("create", "object", "group_selector_handler");
register_elgg_event_handler("update", "object", "group_selector_handler");
register_page_handler('gblog', 'gblog_page_handler');
if (is_plugin_enabled("itemicon")) {
if (!isset($CONFIG->itemicon)) {
$CONFIG->itemicon[] = array();
}
$CONFIG->itemicon[] = "blog";
extend_view("blog/fields_after", "itemicon/add");
}
$options = array("" => "All", "WorkStories" => "Work Stories", "HowTo" => "How To's", "GroupGuides" => "Group Guides", "ManagingProjects" => "Managing a Project", "TellingYourStory" => "Telling your Story");
$CONFIG->BLOG_TYPES = $options;
if (file_exists(dirname(__FILE__) . "/config.php")) {
@(require_once dirname(__FILE__) . "/config.php");
}
$CONFIG->blogextended = $options;
}
示例2: notifications_plugin_pagesetup
/**
* Notification settings page setup function
*
*/
function notifications_plugin_pagesetup()
{
global $CONFIG;
if (get_context() == 'settings') {
add_submenu_item(elgg_echo('notifications:subscriptions:changesettings'), $CONFIG->wwwroot . "mod/notifications/");
if (is_plugin_enabled('groups')) {
add_submenu_item(elgg_echo('notifications:subscriptions:changesettings:groups'), $CONFIG->wwwroot . "mod/notifications/groups.php");
}
}
}
示例3: tagcloud_init
function tagcloud_init()
{
add_widget_type('tagcloud', elgg_echo('tagcloud:widget:title'), elgg_echo('tagcloud:widget:description'));
// Extend CSS
elgg_extend_view('css', 'tagcloud/css');
if (is_plugin_enabled('blog')) {
// extend blog sidebar with a tag-cloud
}
if (is_plugin_enabled('bookmarks')) {
// extend bkmrks sidebar with a tag-cloud
}
}
示例4: walledgarden_init
/**
* Walled garden support.
*
* @package ElggWalledGarden
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
* @author Curverider Ltd
* @copyright Curverider Ltd 2008-2010
* @link http://elgg.com/
*/
function walledgarden_init()
{
global $CONFIG;
$CONFIG->disable_registration = true;
// elgg_set_viewtype('default');
elgg_extend_view('pageshells/pageshell', 'walledgarden/walledgarden');
elgg_extend_view('css', 'walledgarden/css');
// Replace the default index page if the custom index plugin does not exist
if (!is_plugin_enabled("custom_index")) {
register_plugin_hook('index', 'system', 'walledgarden_index');
}
// um...what is this doing here?
// Turn off simple cache if enabled
//if (function_exists('elgg_view_disable_simplecache')) {
// elgg_view_disable_simplecache();
//}
}
示例5: country_selector_init
/**
* Country Selector
*
* Main init file
*
* @package country_selector
* @author ColdTrick IT Solutions
* @copyright Coldtrick IT Solutions 2009
* @link http://www.coldtrick.com/
* @version 0.1
*/
function country_selector_init()
{
if (is_plugin_enabled("profile_manager")) {
// default profile options
$profileoptions = array();
$profileoptions["show_on_register"] = true;
$profileoptions["mandatory"] = true;
$profileoptions["user_editable"] = true;
$profileoptions["output_as_tags"] = false;
$profileoptions["admin_only"] = true;
$profileoptions["simple_search"] = true;
$profileoptions["advanced_search"] = true;
// default group options
$groupoptions = array();
$groupoptions["output_as_tags"] = false;
$groupoptions["admin_only"] = true;
// Add profile fields
add_custom_field_type("custom_profile_field_types", 'country', elgg_echo("country_selector:field_type:country"), $profileoptions);
add_custom_field_type("custom_profile_field_types", 'ca_us_state', elgg_echo("country_selector:field_type:ca_us_state"), $profileoptions);
// Add group fields
add_custom_field_type("custom_group_field_types", 'country', elgg_echo("country_selector:field_type:country"), $groupoptions);
add_custom_field_type("custom_group_field_types", 'ca_us_state', elgg_echo("country_selector:field_type:ca_us_state"), $groupoptions);
}
}
示例6:
if (is_plugin_enabled('blog')) {
$blog_link = "<li {$blog_highlight}><a href=\"{$vars['url']}pg/blog/{$username}\">Blog</a></li>";
} else {
$blog_link = "";
}
if (is_plugin_enabled('video')) {
$video_link = "<li {$video_highlight}><a href=\"{$vars['url']}pg/video/{$username}\">Videos</a></li>";
} else {
$video_link = "";
}
if (is_plugin_enabled('pages')) {
$pages_link = "<li {$pages_highlight}><a href=\"{$vars['url']}pg/pages/owned/{$username}\">Pages</a></li>";
} else {
$pages_link = "";
}
if (is_plugin_enabled('bookmarks')) {
$bookmark_link = "<li {$bookmarks_highlight}><a href=\"{$vars['url']}pg/bookmarks/{$username}\">Bookmarks</a></li>";
} else {
$bookmark_link = "";
}
//contruct the display
$display = <<<EOT
<div id="owner_block">
\t<div class="owner_block_icon {$icon_class}">
\t\t{$icon}
\t</div>
\t{$more_info}
\t{$profile_actions}
\t<div class="owner_block_links">
\t\t<ul>
示例7: input_livesearch_page_handler
/**
* Page handler for autocomplete endpoint.
*
* @param $page
* @return unknown_type
*/
function input_livesearch_page_handler($page)
{
global $CONFIG;
// only return results to logged in users.
if (!($user = get_loggedin_user())) {
exit;
}
if (!($q = get_input('q'))) {
exit;
}
$q = mysql_real_escape_string($q);
// replace mysql vars with escaped strings
$q = str_replace(array('_', '%'), array('\\_', '\\%'), $q);
$match_on = get_input('match_on', 'all');
if ($match_on == 'all' || $match_on[0] == 'all') {
$match_on = array('users', 'groups');
}
if (!is_array($match_on)) {
$match_on = array($match_on);
}
if (get_input('match_owner', false)) {
$owner_guid = $user->getGUID();
$owner_where = 'AND e.owner_guid = ' . $user->getGUID();
} else {
$owner_guid = null;
$owner_where = '';
}
$limit = get_input('limit', 10);
// grab a list of entities and send them in json.
$results = array();
foreach ($match_on as $type) {
switch ($type) {
case 'all':
// only need to pull up title from objects.
if (!($entities = elgg_get_entities(array('owner_guid' => $owner_guid, 'limit' => $limit))) and is_array($entities)) {
$results = array_merge($results, $entities);
}
break;
case 'users':
$query = "SELECT * FROM {$CONFIG->dbprefix}users_entity as ue, {$CONFIG->dbprefix}entities as e\n\t\t\t\t\tWHERE e.guid = ue.guid\n\t\t\t\t\t\tAND e.enabled = 'yes'\n\t\t\t\t\t\tAND ue.banned = 'no'\n\t\t\t\t\t\tAND (ue.name LIKE '{$q}%' OR ue.username LIKE '{$q}%')\n\t\t\t\t\tLIMIT {$limit}\n\t\t\t\t";
if ($entities = get_data($query)) {
foreach ($entities as $entity) {
$json = json_encode(array('type' => 'user', 'name' => $entity->name, 'desc' => $entity->username, 'icon' => '<img class="livesearch_icon" src="' . get_entity($entity->guid)->getIcon('tiny') . '" />', 'guid' => $entity->guid));
$results[$entity->name . rand(1, 100)] = $json;
}
}
break;
case 'groups':
// don't return results if groups aren't enabled.
if (!is_plugin_enabled('groups')) {
continue;
}
$query = "SELECT * FROM {$CONFIG->dbprefix}groups_entity as ge, {$CONFIG->dbprefix}entities as e\n\t\t\t\t\tWHERE e.guid = ge.guid\n\t\t\t\t\t\tAND e.enabled = 'yes'\n\t\t\t\t\t\t{$owner_where}\n\t\t\t\t\t\tAND (ge.name LIKE '{$q}%' OR ge.description LIKE '%{$q}%')\n\t\t\t\t\tLIMIT {$limit}\n\t\t\t\t";
if ($entities = get_data($query)) {
foreach ($entities as $entity) {
$json = json_encode(array('type' => 'group', 'name' => $entity->name, 'desc' => strip_tags($entity->description), 'icon' => '<img class="livesearch_icon" src="' . get_entity($entity->guid)->getIcon('tiny') . '" />', 'guid' => $entity->guid));
//$results[$entity->name . rand(1,100)] = "$json|{$entity->guid}";
$results[$entity->name . rand(1, 100)] = $json;
}
}
break;
case 'friends':
$access = get_access_sql_suffix();
$query = "SELECT * FROM {$CONFIG->dbprefix}users_entity as ue, {$CONFIG->dbprefix}entity_relationships as er, {$CONFIG->dbprefix}entities as e\n\t\t\t\t\tWHERE er.relationship = 'friend'\n\t\t\t\t\t\tAND er.guid_one = {$user->getGUID()}\n\t\t\t\t\t\tAND er.guid_two = ue.guid\n\t\t\t\t\t\tAND e.guid = ue.guid\n\t\t\t\t\t\tAND e.enabled = 'yes'\n\t\t\t\t\t\tAND ue.banned = 'no'\n\t\t\t\t\t\tAND (ue.name LIKE '{$q}%' OR ue.username LIKE '{$q}%')\n\t\t\t\t\tLIMIT {$limit}\n\t\t\t\t";
if ($entities = get_data($query)) {
foreach ($entities as $entity) {
$json = json_encode(array('type' => 'user', 'name' => $entity->name, 'desc' => $entity->username, 'icon' => '<img class="livesearch_icon" src="' . get_entity($entity->guid)->getIcon('tiny') . '" />', 'guid' => $entity->guid));
$results[$entity->name . rand(1, 100)] = $json;
}
}
break;
default:
// arbitrary subtype.
//@todo you cannot specify a subtype without a type.
// did this ever work?
elgg_get_entities(array('subtype' => $type, 'owner_guid' => $owner_guid));
break;
}
}
ksort($results);
echo implode($results, "\n");
exit;
}
示例8: get_installed_plugins
/**
* Return an array of installed plugins.
*/
function get_installed_plugins()
{
global $CONFIG;
$installed_plugins = array();
if (!empty($CONFIG->pluginspath)) {
$plugins = get_plugin_list();
foreach ($plugins as $mod) {
$installed_plugins[$mod] = array();
$installed_plugins[$mod]['active'] = is_plugin_enabled($mod);
$installed_plugins[$mod]['manifest'] = load_plugin_manifest($mod);
}
}
return $installed_plugins;
}
示例9: full_url
$contents = "";
// Are there feeds to display?
global $autofeed;
if (isset($autofeed) && $autofeed == true) {
$url = $url2 = full_url();
if (substr_count($url, '?')) {
$url .= "&view=rss";
} else {
$url .= "?view=rss";
}
$label = elgg_echo('feed:rss');
$contents .= <<<END
\t<div class="rss_link clearfloat"><a href="{$url}" rel="nofollow" title="{$label}">{$label}</a></div>
END;
}
if (is_plugin_enabled('profile')) {
// Is there a page owner?
$owner = page_owner_entity();
$location = elgg_view("output/tags", array('value' => $owner->location));
if ($owner instanceof ElggEntity) {
$icon = elgg_view("profile/icon", array('entity' => $owner, 'size' => 'tiny'));
if ($owner instanceof ElggUser || $owner instanceof ElggGroup) {
$info = '<h3><a href="' . $owner->getURL() . '">' . $owner->name . '</a></h3>';
}
$display = "<div class='owner_block_icon'>" . $icon . "</div>";
$display .= "<div class='owner_block_contents clearfloat'>" . $info;
if ($owner->briefdescription) {
$desc = $owner->briefdescription;
$display .= "<p class='profile_info briefdescription'>" . $desc . "</p>";
}
$display .= "<p class='profile_info location'>{$location}</p>";
示例10: elgg_echo
//$label2 = elgg_echo('feed:odd');
$contents .= <<<END
\t<div id="owner_block_rss_feed"><a href="{$url}" rel="nofollow">{$label}</a></div>
\t\t\t
END;
}
//the follow are for logged in users only
if (isloggedin()) {
//is the bookmark plugin installed?
if (is_plugin_enabled('bookmarks')) {
$label3 = elgg_echo('bookmarks:this');
$contents .= "<div id=\"owner_block_bookmark_this\"><a href=\"javascript:location.href='" . $CONFIG->wwwroot . "mod/bookmarks/add.php?address='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)\">{$label3}</a></div>";
}
//report this button
if (is_plugin_enabled('reportedcontent')) {
$label4 = elgg_echo('reportedcontent:report');
$contents .= "<div id=\"owner_block_report_this\"><a href=\"javascript:location.href='" . $CONFIG->wwwroot . "mod/reportedcontent/add.php?address='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)\">{$label4}</a></div>";
}
}
$contents .= elgg_view('owner_block/extend');
// Have we been asked to inject any content? If so, display it
if (isset($vars['content'])) {
$contents .= $vars['content'];
}
// Initialise the submenu
$submenu = get_submenu();
// elgg_view('canvas_header/submenu');
if (!empty($submenu)) {
$contents .= "<div id=\"owner_block_submenu\">" . $submenu . "</div>";
}
示例11: selectTab
<?php
/**
* iZAP izap_videos
*
* @package youtube, vimeo, veoh and onserver uploading
* @license GNU Public License version 3
* @author iZAP Team "<support@izap.in>"
* @link http://www.izap.in/
* @version 1.5-1.0
*/
if (is_plugin_enabled('izap_videos')) {
$videos = $vars['entities'];
$total = 16;
if (isset($vars['videosTOdisplay'])) {
$total = $vars['videosTOdisplay'];
}
echo '<div class="index_box">';
echo elgg_view_title(elgg_echo('videos'));
echo '<div class="contentWrapper">';
?>
<script>
function selectTab(selectedTab, displayDiv) {
$('#ltab').removeClass('selected');
$('#vtab').removeClass('selected');
$('#ctab').removeClass('selected');
$('#latest').hide('slow');
$('#views').hide('slow');
$('#com').hide('slow');
示例12: users_init
/**
* Users initialisation function, which establishes the page handler
*
*/
function users_init()
{
// Load config
global $CONFIG;
// add Friends to tools menu - if profile mod is running
if (isloggedin() && is_plugin_enabled('profile')) {
$user = get_loggedin_user();
add_menu(elgg_echo('friends'), $CONFIG->wwwroot . "pg/friends/" . $user->username, array(), 'core:friends');
}
register_page_handler('friends', 'friends_page_handler');
register_page_handler('friendsof', 'friends_of_page_handler');
//register_page_handler('collections', 'collections_page_handler');
register_page_handler('dashboard', 'dashboard_page_handler');
register_page_handler('register', 'registration_page_handler');
register_page_handler('resetpassword', 'elgg_user_resetpassword_page_handler');
register_action("register", true);
register_action("useradd", true);
register_action("friends/add");
register_action("friends/remove");
//register_action('friends/addcollection');
//register_action('friends/deletecollection');
//register_action('friends/editcollection');
//register_action("user/spotlight");
register_action("usersettings/save");
register_action("user/passwordreset");
register_action("user/requestnewpassword");
// User name change
extend_elgg_settings_page('user/settings/name', 'usersettings/user', 1);
//register_action("user/name");
// User password change
extend_elgg_settings_page('user/settings/password', 'usersettings/user', 1);
//register_action("user/password");
// Add email settings
extend_elgg_settings_page('user/settings/email', 'usersettings/user', 1);
//register_action("email/save");
// Add language settings
extend_elgg_settings_page('user/settings/language', 'usersettings/user', 1);
// Add default access settings
extend_elgg_settings_page('user/settings/default_access', 'usersettings/user', 1);
//register_action("user/language");
// Register the user type
register_entity_type('user', '');
register_plugin_hook('usersettings:save', 'user', 'users_settings_save');
register_elgg_event_handler('create', 'user', 'user_create_hook_add_site_relationship');
// Handle a special case for newly created users when the user is not logged in
// TODO: handle this better!
register_plugin_hook('permissions_check', 'all', 'new_user_enable_permissions_check');
}
示例13: profile_manager_pagesetup
/**
* Function to add menu items to the pages
*
* @return unknown_type
*/
function profile_manager_pagesetup()
{
global $CONFIG;
if (get_context() == "admin" && isadminloggedin()) {
if (is_plugin_enabled("profile")) {
// Remake admin submenu
$subA =& $CONFIG->submenu["a"];
foreach ($subA as $index => $item) {
if ($item->name == elgg_echo("profile:edit:default")) {
unset($subA[$index]);
}
}
add_submenu_item(elgg_echo("profile:edit:default"), $CONFIG->wwwroot . "pg/profile_manager/profile_fields", "b");
}
if (is_plugin_enabled("groups")) {
add_submenu_item(elgg_echo("profile_manager:group_fields"), $CONFIG->wwwroot . "pg/profile_manager/group_fields", "b");
}
}
if (get_plugin_setting("show_members_search") == "yes" && (get_input("handler") == "search" || strpos($_SERVER["REQUEST_URI"], "/search/") === 0)) {
add_submenu_item(elgg_echo('profile_manager:members:submenu'), $CONFIG->wwwroot . "pg/members", "b");
}
}
示例14: check_plugin_dependencies
function check_plugin_dependencies($plugin_name, $force_inclusion = FALSE)
{
$dependencies = get_plugin_dependencies($plugin_name, $force_inclusion);
if (!$dependencies) {
return TRUE;
}
if ($dependencies === SQ_INCOMPATIBLE) {
return $dependencies;
}
$missing_or_bad = array();
foreach ($dependencies as $depend_name => $depend_requirements) {
// check for core plugins first
//
if (strpos(strtoupper($depend_requirements['version']), 'CORE') === 0) {
// see if the plugin is in the core (just check if the directory exists)
//
if (!file_exists(SM_PATH . 'plugins/' . $depend_name)) {
$missing_or_bad[$depend_name] = $depend_requirements;
} else {
if ($depend_requirements['activate'] && !is_plugin_enabled($depend_name)) {
$missing_or_bad[$depend_name] = $depend_requirements;
} else {
if (strpos($depend_requirements['version'], ':') !== FALSE) {
$version = explode('.', substr($depend_requirements['version'], strpos($depend_requirements['version'], ':') + 1), 3);
$version[0] = intval($version[0]);
if (isset($version[1])) {
$version[1] = intval($version[1]);
} else {
$version[1] = 0;
}
if (isset($version[2])) {
$version[2] = intval($version[2]);
} else {
$version[2] = 0;
}
if (!check_sm_version($version[0], $version[1], $version[2])) {
$missing_or_bad[$depend_name] = $depend_requirements;
}
}
}
}
continue;
}
// if the plugin is actually incompatible; check that it
// is not activated
//
if ($depend_requirements['version'] == SQ_INCOMPATIBLE) {
if (is_plugin_enabled($depend_name)) {
$missing_or_bad[$depend_name] = $depend_requirements;
}
continue;
}
// check for normal plugins
//
$version = explode('.', $depend_requirements['version'], 3);
$version[0] = intval($version[0]);
if (isset($version[1])) {
$version[1] = intval($version[1]);
} else {
$version[1] = 0;
}
if (isset($version[2])) {
$version[2] = intval($version[2]);
} else {
$version[2] = 0;
}
$force_dependency_inclusion = !$depend_requirements['activate'];
if (!check_plugin_version($depend_name, $version[0], $version[1], $version[2], $force_dependency_inclusion)) {
$missing_or_bad[$depend_name] = $depend_requirements;
}
}
if (empty($missing_or_bad)) {
return TRUE;
}
// get non-parsed required versions
//
$non_parsed_dependencies = get_plugin_dependencies($plugin_name, $force_inclusion, FALSE);
$return_array = array();
foreach ($missing_or_bad as $depend_name => $ignore) {
$return_array[$depend_name] = $non_parsed_dependencies[$depend_name];
}
return $return_array;
}
示例15: array
<?php
/**
* Elgg user search box.
*
* @package Elgg
* @subpackage Core
* @author Curverider Ltd
* @link http://elgg.org/
*/
if (is_plugin_enabled('search') && is_plugin_enabled('profile')) {
?>
<div class="admin_settings user_search">
<form action="<?php
echo $vars['url'];
?>
pg/search/" method="get">
<h3><?php
echo elgg_echo('admin:user:label:search');
?>
</h3>
<?php
echo elgg_view('input/text', array('internalname' => 'q'));
?>
<input type="hidden" name="entity_type" value="user" />
<input type="hidden" name="search_type" value="entities" />
<input type="submit" name="<?php
echo elgg_echo('admin:user:label:searchbutton');
?>
"
value="<?php