本文整理汇总了PHP中module_invoke_all函数的典型用法代码示例。如果您正苦于以下问题:PHP module_invoke_all函数的具体用法?PHP module_invoke_all怎么用?PHP module_invoke_all使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了module_invoke_all函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: gd_ext
function gd_ext () {
ob_get_clean();
if ( !empty($_REQUEST['datasource']) ) {
gd_datasource_set_active($_REQUEST['datasource']);
}
$ext = array();
$dashboards = gd_dashboard_findall_by_datasource(LOAD_ENTITY);
foreach ( $dashboards as $dashboard ) {
$ext[] = array('id'=>$dashboard->nid,'title'=>$dashboard->title);
}
$response = new stdClass();
$response->status = new stdClass();
$response->status->code = 200;
$response->status->message = 'OK';
if ( isset($_REQUEST['id']) ) {
$response->data = array('id'=>$_REQUEST['id'], 'title'=>$dashboards[$_REQUEST['id']]->title);
}
else {
$response->data = $ext;
}
module_invoke_all('gd_ext_response_alter',$response);
echo \GD\Utility\Json::getPayload($response,$_GET['callback']);
gd_get_session_messages();
drupal_exit();
}
示例2: overviewForm
public function overviewForm($form, &$form_state)
{
// Add table and pager.
$form = parent::overviewForm($form, $form_state);
// Allow modules to insert their own action links to the 'table', like cleanup module.
$top_actions = module_invoke_all('workflow_operations', 'top_actions', NULL);
// Allow modules to insert their own workflow operations.
foreach ($form['table']['#rows'] as &$row) {
$url = $row[0]['data']['#url'];
$workflow = $url['options']['entity'];
foreach ($actions = module_invoke_all('workflow_operations', 'workflow', $workflow) as $action) {
$action['attributes'] = isset($action['attributes']) ? $action['attributes'] : array();
$row[] = l(strtolower($action['title']), $action['href'], $action['attributes']);
}
}
// @todo: add these top actions next to the core 'Add workflow' action.
$top_actions_args = array('links' => $top_actions, 'attributes' => array('class' => array('inline', 'action-links')));
$form['action-links'] = array('#type' => 'markup', '#markup' => theme('links', $top_actions_args), '#weight' => -1);
if (module_exists('workflownode')) {
// Append the type_map form, changing the form by reference.
// The 'type_map' form is only valid for Workflow Node API.
module_load_include('inc', 'workflow_admin_ui', 'workflow_admin_ui.page.type_map');
workflow_admin_ui_type_map_form($form);
}
// Add a submit button. The submit functions are added in the sub-forms.
$form['submit'] = array('#type' => 'submit', '#value' => t('Save'), '#weight' => 100);
return $form;
}
示例3: DrupalUnitTests
/**
* Constructor
* @param array $class_list list containing the classes of tests to be processed
* default: NULL - run all tests
*/
function DrupalUnitTests($class_list = NULL)
{
static $classes;
$this->DrupalTestSuite('Drupal Unit Tests');
/* Tricky part to avoid double inclusion */
if (!$classes) {
$files = module_invoke_all('simpletest');
$existing_classes = get_declared_classes();
foreach ($files as $file) {
include_once $file;
}
$classes = array_diff(get_declared_classes(), $existing_classes);
}
if (!is_null($class_list)) {
$classes = $class_list;
}
if (count($classes) == 0) {
$this->addTestCase(new BadGroupTest($test_file, 'No new test cases'));
return;
}
$groups = array();
foreach ($classes as $class) {
$this->_addClassToGroups($groups, $class);
}
foreach ($groups as $group_name => $group) {
$group_test =& new DrupalTestSuite($group_name);
foreach ($group as $key => $v) {
$group_test->addTestCase($group[$key]);
}
$this->addTestCase($group_test);
}
}
示例4: clean
public function clean($expression) {
$adjustedExpression = $expression;
if (!isset($this->cleanHandlers)) {
$handlerConfigurations = module_invoke_all('dp_formula_expression_sql_clean');
if (isset($handlerConfigurations)) {
foreach ($handlerConfigurations as $handlerConfiguration) {
$priority = $handlerConfiguration['priority'];
$classname = $handlerConfiguration['classname'];
if (isset($this->cleanHandlers[$priority])) {
throw new IllegalStateException(t(
'Several SQL expression cleaners have the same priority: [%classname1, %classname2]',
array('%classname1' => $this->cleanHandlers[$priority], '%classname2' => $classname)));
}
$this->cleanHandlers[$priority] = new $classname();
}
if (isset($this->cleanHandlers)) {
ksort($this->cleanHandlers, SORT_NUMERIC);
}
}
}
if (isset($this->cleanHandlers)) {
foreach ($this->cleanHandlers as $handler) {
$adjustedExpression = $handler->clean($adjustedExpression);
}
}
return $adjustedExpression;
}
示例5: delete
/**
* Permanently deletes the entity.
*/
public function delete()
{
// Notify any interested modules before we delete, in case there's data needed.
// @todo D8: this can be replaced by a hook_entity_delete(?)
module_invoke_all('workflow', 'transition delete', $this->tid, NULL, NULL, FALSE);
return parent::delete();
}
示例6: connect_node_functions_form
function connect_node_functions_form()
{
drupal_add_css(drupal_get_path('module', 'connect') . '/connect.css');
$child = array();
$options = array();
$p_nid = arg(1);
$parent = node_load($p_nid);
// determine possible and enabled actions
$requirements_OK = TRUE;
$actions = connect_get_actions($parent->nid);
$action_list = module_invoke_all('connect');
unset($action_list['connect_action_basic']);
foreach ($action_list as $function => $action) {
$status = '';
if (in_array($function, $actions)) {
if (TRUE === _connect_hook_check_requirements($parent, $child, $function, 'parent')) {
$status = ' ' . theme_image(drupal_get_path('module', 'connect') . '/images/accept.png', '(ACTIVE)', 'This function is active.');
} else {
$requirements_OK = FALSE;
$status = ' ' . theme_image(drupal_get_path('module', 'connect') . '/images/exclamation.png', '(INACTIVE)', 'This function is not active. Please check the settings tab.');
}
}
$options[$function] = $action['title'] . $status . '<p class="connect-comment">' . $action['desc'] . '</p>';
}
if (!$requirements_OK) {
drupal_set_message('One or more of your selected functions requires additional settings to be configured.<br />Please check the settings tab for details.', 'error');
}
$form = array();
$form['parent_id'] = array('#type' => 'value', '#value' => $parent->nid);
$form['connect_actions'] = array('#type' => 'fieldset', '#title' => 'Choose functions to apply to this campaign');
$form['connect_actions']['actions'] = array('#type' => 'checkboxes', '#title' => '', '#options' => $options, '#default_value' => $actions);
$form['submit'] = array('#type' => 'submit', '#value' => t('Submit'));
return $form;
}
示例7: mongodb_cache_flush_caches
/**
* Implements hook_flush_caches().
*
* Support triggering expiration in modules not declaring their cache bins,
* either by taking them from an explicit variable, or by performing a discovery
* assuming the cache bin names to start by 'cache_'.
*/
function mongodb_cache_flush_caches()
{
// Recursion protection, not static caching, so no drupal_static().
static $reentry = FALSE;
if ($reentry) {
return [];
}
// Hardcoded in drupal_flush_all_caches() or system_cron(), but not declared
// in system_flush_caches().
$system_bins = ['cache', 'cache_bootstrap', 'cache_filter', 'cache_form', 'cache_menu', 'cache_page', 'cache_path'];
$reentry = TRUE;
$owned_bins = module_invoke_all('flush_caches');
$reentry = FALSE;
$detected_bins = variable_get('mongodb_cache_extra_bins', NULL);
// As with databases, NULL means unknown, so perform a discovery.
if (!isset($detected_bins)) {
$detected_bins = [];
$names = mongodb()->getCollectionNames(FALSE);
foreach ($names as $name) {
if (strpos($name, 'cache_') === 0) {
$detected_bins[] = $name;
}
}
}
$adopted_bins = array_diff($detected_bins, $system_bins, $owned_bins);
return $adopted_bins;
}
示例8: parse
/**
* Implementation of FeedsParser::parse().
*/
public function parse(FeedsSource $source, FeedsFetcherResult $fetcher_result)
{
$fetched = $fetcher_result->getRaw();
$mailbox = $fetched['mailbox'];
$result = new FeedsParserResult();
if (!empty($fetched['messages'])) {
foreach ($fetched['messages'] as $mid => &$message) {
$this->authenticate($message, $mailbox);
if ($class = mailhandler_plugin_load_class('mailhandler', $mailbox->settings['retrieve'], 'retrieve', 'handler')) {
$class->purge_message($mailbox, $message);
}
if ($message['authenticated_uid'] == 0) {
// User was not authenticated
module_invoke_all('mailhandler_auth_failed', $message);
$source_config = $source->getConfigFor($this);
if ($source_config['auth_required']) {
mailhandler_report('warning', 'User could not be authenticated. Please check your Mailhandler authentication plugin settings.');
continue;
}
}
$this->commands($message, $source);
$result->items[] = $message;
}
}
return $result;
}
示例9: getQueues
/**
* {@inheritdoc}
*/
public function getQueues()
{
if (!isset(static::$queues)) {
static::$queues = module_invoke_all('cron_queue_info');
drupal_alter('cron_queue_info', static::$queues);
}
return static::$queues;
}
示例10: delete
public function delete($options = array())
{
// Append default options.
$options += $this->defaultCrudOptions['delete'];
db_delete('versioncontrol_operation_labels')->condition('label_id', $this->label_id)->execute();
db_delete('versioncontrol_labels')->condition('label_id', $this->label_id)->execute();
$this->backendDelete($options);
module_invoke_all('versioncontrol_entity_tag_delete', $this);
}
示例11: __construct
public function __construct()
{
parent::__construct();
$this->handlerConfigurations = module_invoke_all('dc_cache');
// preparing default value for cache entry expiration time
$cacheConfigurationSection = Environment::getInstance()->getConfigurationSection('Cache');
if (isset($cacheConfigurationSection['Entry Expiration']['Default'])) {
AbstractCacheHandler::$DEFAULT__ENTRY_EXPIRATION = $cacheConfigurationSection['Entry Expiration']['Default'];
}
}
示例12: hook_wysiwyg_fields_wysiwyg_plugins
/**
* Implements hook_wysiwyg_fields_wysiwyg_plugins().
*/
function hook_wysiwyg_fields_wysiwyg_plugins($content_type)
{
$plugins = array();
foreach (content_fields() as $field) {
if (!in_array(TRUE, module_invoke_all('wysiwyg_fields_field_bypass', $field)) && !is_null(content_fields($field['field_name'], $content_type)) && isset($field['widget']['wysiwyg_fields_status']) && $field['widget']['wysiwyg_fields_status']) {
$plugins[$field['field_name']] = array('label' => $field['widget']['label'], 'icon' => $field['widget']['wysiwyg_fields_icon']);
}
}
return $plugins;
}
示例13: connect_get_lookup_types
function connect_get_lookup_types($select = FALSE)
{
static $return = array();
$empty = array();
if (empty($return)) {
$return = module_invoke_all('connect_lookup');
$return[0] = '';
asort($return);
}
return $return;
}
示例14: hook_oauth2_server_pre_authorize
/**
* Execute operations before oauth2_server_authorize() main logic.
*
* Allow modules to perform additional operations at the very beginning of
* the OAuth2 authorize callback.
*/
function hook_oauth2_server_pre_authorize()
{
// Make sure we're not in the middle of a running operation.
if (empty($_SESSION['oauth2_server_authorize'])) {
global $user;
// Ensure that the current session is killed before authorize.
module_invoke_all('user_logout', $user);
// Destroy the current session, and reset $user to the anonymous user.
session_destroy();
}
}
示例15: logout
/**
* {@inheritdoc}
* @see user_logout()
*/
public function logout(Request $request, Response $response, TokenInterface $token)
{
$user = $token->getUser();
if (is_a($user, 'Bangpound\\Bundle\\DrupalBundle\\Security\\User\\User')) {
/** @var \Bangpound\Bundle\DrupalBundle\Security\User\User $user */
$user = $token->getUser()->getDrupalUser();
watchdog('user', 'Session closed for %name.', array('%name' => $user->name));
module_invoke_all('user_logout', $user);
$GLOBALS['user'] = drupal_anonymous_user();
}
}