当前位置: 首页>>代码示例>>PHP>>正文


PHP elgg_get_calling_plugin_id函数代码示例

本文整理汇总了PHP中elgg_get_calling_plugin_id函数的典型用法代码示例。如果您正苦于以下问题:PHP elgg_get_calling_plugin_id函数的具体用法?PHP elgg_get_calling_plugin_id怎么用?PHP elgg_get_calling_plugin_id使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了elgg_get_calling_plugin_id函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: deyan_load_page

/**
 * This function loads a page wich need to be in page folder in caller plugin root directory.
 *
 * @param string $page	The name of the page in page's folder to be loaded.
 * @param array  $vars  An array of values to be passed to the page
 *
 * @return all the page required
*/
function deyan_load_page($page, $vars = array()) {
	$dir = elgg_get_plugins_path();
	$plugin = elgg_get_calling_plugin_id();
	
	$dir .= $plugin;
	$dir .= "/pages/$page.php";
	
	
	return require_once $dir;
}
开发者ID:redvabel,项目名称:Deyan-Shell,代码行数:18,代码来源:deyan.php

示例2: get_plugin_name

/**
 * Get the name of the most recent plugin to be called in the
 * call stack (or the plugin that owns the current page, if any).
 *
 * i.e., if the last plugin was in /mod/foobar/, get_plugin_name would return foo_bar.
 *
 * @deprecated 1.8 Use elgg_get_calling_plugin_id()
 *
 * @param boolean $mainfilename If set to true, this will instead determine the
 *                              context from the main script filename called by
 *                              the browser. Default = false.
 *
 * @return string|false Plugin name, or false if no plugin name was called
 */
function get_plugin_name($mainfilename = false)
{
    elgg_deprecated_notice('get_plugin_name() is deprecated by elgg_get_calling_plugin_id()', 1.8);
    return elgg_get_calling_plugin_id($mainfilename);
}
开发者ID:elainenaomi,项目名称:labxp2014,代码行数:19,代码来源:deprecated-1.8.php

示例3: elgg_get_calling_plugin_entity

/**
 * Returns the \ElggPlugin entity of the last plugin called.
 *
 * @return ElggPlugin|false
 * @since 1.8.0
 * @access private
 * @deprecated 1.9
 */
function elgg_get_calling_plugin_entity()
{
    elgg_deprecated_notice("elgg_get_calling_plugin_entity() is deprecated.", 1.9);
    $plugin_id = elgg_get_calling_plugin_id();
    if ($plugin_id) {
        return elgg_get_plugin_from_id($plugin_id);
    }
    return false;
}
开发者ID:gzachos,项目名称:elgg_ellak,代码行数:17,代码来源:deprecated-1.9.php

示例4: elgg_get_entities_from_plugin_user_settings

/**
 * Returns entities based upon plugin settings.
 * Takes all the options for {@see elgg_get_entities_from_private_settings()}
 * in addition to the ones below.
 *
 * @param array $options Array in the format:
 *
 * 	plugin_id => NULL|STR The plugin id. Defaults to calling plugin
 *
 * 	plugin_user_setting_names => NULL|ARR private setting names
 *
 * 	plugin_user_setting_values => NULL|ARR metadata values
 *
 * 	plugin_user_setting_name_value_pairs => NULL|ARR (
 *                                         name => 'name',
 *                                         value => 'value',
 *                                         'operand' => '=',
 *                                        )
 * 	                             Currently if multiple values are sent via
 *                               an array (value => array('value1', 'value2')
 *                               the pair's operand will be forced to "IN".
 *
 * 	plugin_user_setting_name_value_pairs_operator => NULL|STR The operator to use for combining
 *                                        (name = value) OPERATOR (name = value); default AND
 *
 * @return mixed int If count, int. If not count, array. false on errors.
 */
function elgg_get_entities_from_plugin_user_settings(array $options = array())
{
    // if they're passing it don't bother
    if (!isset($options['plugin_id'])) {
        $options['plugin_id'] = elgg_get_calling_plugin_id();
    }
    $singulars = array('plugin_user_setting_name', 'plugin_user_setting_value', 'plugin_user_setting_name_value_pair');
    $options = elgg_normalise_plural_options_array($options, $singulars);
    // rewrite plugin_user_setting_name_* to the right PS ones.
    $map = array('plugin_user_setting_names' => 'private_setting_names', 'plugin_user_setting_values' => 'private_setting_values', 'plugin_user_setting_name_value_pairs' => 'private_setting_name_value_pairs', 'plugin_user_setting_name_value_pairs_operator' => 'private_setting_name_value_pairs_operator');
    foreach ($map as $plugin => $private) {
        if (!isset($options[$plugin])) {
            continue;
        }
        if (isset($options[$private])) {
            if (!is_array($options[$private])) {
                $options[$private] = array($options[$private]);
            }
            $options[$private] = array_merge($options[$private], $options[$plugin]);
        } else {
            $options[$private] = $options[$plugin];
        }
    }
    $plugin_id = $options['plugin_id'];
    $prefix = elgg_namespace_plugin_private_setting('user_setting', '', $plugin_id);
    $options['private_setting_name_prefix'] = $prefix;
    return elgg_get_entities_from_private_settings($options);
}
开发者ID:pleio,项目名称:subsite_manager,代码行数:55,代码来源:plugins.php

示例5: getEntitiesFromUserSettings

 /**
  * Returns entities based upon plugin user settings.
  * Takes all the options for {@link elgg_get_entities_from_private_settings()}
  * in addition to the ones below.
  *
  * @param array $options Array in the format:
  *
  * 	plugin_id => STR The plugin id. Required.
  *
  * 	plugin_user_setting_names => null|ARR private setting names
  *
  * 	plugin_user_setting_values => null|ARR metadata values
  *
  * 	plugin_user_setting_name_value_pairs => null|ARR (
  *                                         name => 'name',
  *                                         value => 'value',
  *                                         'operand' => '=',
  *                                        )
  * 	                             Currently if multiple values are sent via
  *                               an array (value => array('value1', 'value2')
  *                               the pair's operand will be forced to "IN".
  *
  * 	plugin_user_setting_name_value_pairs_operator => null|STR The operator to use for combining
  *                                        (name = value) OPERATOR (name = value); default AND
  *
  * @return mixed int If count, int. If not count, array. false on errors.
  */
 function getEntitiesFromUserSettings(array $options = array())
 {
     if (!isset($options['plugin_id'])) {
         elgg_deprecated_notice("'plugin_id' is now required for elgg_get_entities_from_plugin_user_settings()", 1.9);
         $options['plugin_id'] = elgg_get_calling_plugin_id();
     }
     $singulars = array('plugin_user_setting_name', 'plugin_user_setting_value', 'plugin_user_setting_name_value_pair');
     $options = _elgg_normalize_plural_options_array($options, $singulars);
     // rewrite plugin_user_setting_name_* to the right PS ones.
     $map = array('plugin_user_setting_names' => 'private_setting_names', 'plugin_user_setting_values' => 'private_setting_values', 'plugin_user_setting_name_value_pairs' => 'private_setting_name_value_pairs', 'plugin_user_setting_name_value_pairs_operator' => 'private_setting_name_value_pairs_operator');
     foreach ($map as $plugin => $private) {
         if (!isset($options[$plugin])) {
             continue;
         }
         if (isset($options[$private])) {
             if (!is_array($options[$private])) {
                 $options[$private] = array($options[$private]);
             }
             $options[$private] = array_merge($options[$private], $options[$plugin]);
         } else {
             $options[$private] = $options[$plugin];
         }
     }
     $prefix = _elgg_namespace_plugin_private_setting('user_setting', '', $options['plugin_id']);
     $options['private_setting_name_prefix'] = $prefix;
     return elgg_get_entities_from_private_settings($options);
 }
开发者ID:ibou77,项目名称:elgg,代码行数:54,代码来源:Plugins.php

示例6: deyan_register_iconlib

/**
 * Register a Icon Library in $CONFIG
 *
 * @return void
*/
function deyan_register_iconlib($iconlib) {
	 	
	 $icons = elgg_get_config('iconlibs');
	 $icons[$iconlib] = elgg_get_calling_plugin_id();
	 elgg_set_config('iconlibs', $icons);
}
开发者ID:redvabel,项目名称:Deyan-Shell,代码行数:11,代码来源:icons.php

示例7: deyan_register_theme

/**
 * Registers a theme in $CONFIG
 *
 * @return void	
 *
*/
function deyan_register_theme($theme) {
	$themes = elgg_get_config('themes');
	$themes[$theme] = elgg_get_calling_plugin_id();
	elgg_set_config('themes', $themes);
}
开发者ID:redvabel,项目名称:Deyan-Shell,代码行数:11,代码来源:themes.php

示例8: elgg_get_entities

 * Website:  http://socia.us
 * 
 */
$sociaRoller = elgg_get_entities(array('type' => 'object', 'subtype' => 'sociaRollerSettings', 'limit' => '1'));
$sociaRollerValues = array_shift(array_values($sociaRoller));
$variables = socia_roller_variables();
$patterns = range(1, 20);
foreach ($patterns as $pattern) {
    echo ".socia_pattern-{$pattern} { background:url({$CONFIG->url}mod/socia_roller/graphics/patterns/{$pattern}.png); }\r\n";
}
echo ".socia_pattern-0 { background-image:none; }\r\n";
$pixels = array('font-size', 'line-height', 'height', 'margin-top', 'margin-left', 'margin-bottom', 'margin-right', 'top', 'left', 'bottom', 'right', 'padding', 'padding-top', 'padding-left', 'padding-right', 'padding-bottom', 'border-top-right-radius', 'border-top-left-radius', 'border-bottom-right-radius', 'border-bottom-left-radius', 'border-radius', 'border-width');
$colors = array('color', 'background-color', 'border-color');
foreach ($variables as $key => $value) {
    $property = $sociaRollerValues->{$key};
    echo elgg_get_calling_plugin_id();
    foreach ($value['divs'] as $div => $attribute) {
        if (in_array($attribute, $pixels)) {
            echo $div . "{" . $attribute . ":" . $property . "px;}\r\n";
            echo $div . ":hover {" . $attribute . ":" . $property . "px;}\r\n";
        } elseif (in_array($attribute, $colors)) {
            echo $div . "{" . $attribute . ": #" . $property . ";}\r\n";
            echo $div . ":hover {" . $attribute . ": #" . $property . ";}\r\n";
        } elseif ($attribute == 'div') {
            switch ($property) {
                case "yes":
                    echo $div . " { display:block; }\r\n";
                    break;
                case "no":
                    echo $div . " { display:none; }\r\n";
                    break;
开发者ID:duanhv,项目名称:mdg-social,代码行数:31,代码来源:css.php


注:本文中的elgg_get_calling_plugin_id函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。