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


PHP module_load_include函数代码示例

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


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

示例1: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(array $form, FormStateInterface $form_state)
 {
     module_load_include('inc', 'pathauto');
     $config = $this->config('pathauto.settings');
     $form = array();
     $form['verbose'] = array('#type' => 'checkbox', '#title' => t('Verbose'), '#default_value' => $config->get('verbose'), '#description' => t('Display alias changes (except during bulk updates).'));
     $form['separator'] = array('#type' => 'textfield', '#title' => t('Separator'), '#size' => 1, '#maxlength' => 1, '#default_value' => $config->get('separator'), '#description' => t('Character used to separate words in titles. This will replace any spaces and punctuation characters. Using a space or + character can cause unexpected results.'));
     $form['case'] = array('#type' => 'radios', '#title' => t('Character case'), '#default_value' => $config->get('case'), '#options' => array(self::CASE_LEAVE_ASIS => t('Leave case the same as source token values.'), self::CASE_LOWER => t('Change to lower case')));
     $max_length = \Drupal::service('pathauto.alias_storage_helper')->getAliasSchemaMaxlength();
     $form['max_length'] = array('#type' => 'number', '#title' => t('Maximum alias length'), '#size' => 3, '#maxlength' => 3, '#default_value' => $config->get('max_length'), '#min' => 1, '#max' => $max_length, '#description' => t('Maximum length of aliases to generate. 100 is the recommended length. @max is the maximum possible length. See <a href="@pathauto-help">Pathauto help</a> for details.', array('@pathauto-help' => $this->getUrlGenerator()->generateFromPath('admin/help/pathauto'), '@max' => $max_length)));
     $form['max_component_length'] = array('#type' => 'number', '#title' => t('Maximum component length'), '#size' => 3, '#maxlength' => 3, '#default_value' => $config->get('max_component_length'), '#min' => 1, '#max' => $max_length, '#description' => t('Maximum text length of any component in the alias (e.g., [title]). 100 is the recommended length. @max is the maximum possible length. See <a href="@pathauto-help">Pathauto help</a> for details.', array('@pathauto-help' => $this->getUrlGenerator()->generateFromPath('admin/help/pathauto'), '@max' => $max_length)));
     $description = t('What should Pathauto do when updating an existing content item which already has an alias?');
     if (\Drupal::moduleHandler()->moduleExists('redirect')) {
         $description .= ' ' . t('The <a href="!url">Redirect module settings</a> affect whether a redirect is created when an alias is deleted.', array('!url' => \Drupal::url('redirect.settings')));
     } else {
         $description .= ' ' . t('Considering installing the <a href="!url">Redirect module</a> to get redirects when your aliases change.', array('!url' => 'http://drupal.org/project/redirect'));
     }
     $form['update_action'] = array('#type' => 'radios', '#title' => t('Update action'), '#default_value' => $config->get('update_action'), '#options' => array(PathautoManagerInterface::UPDATE_ACTION_NO_NEW => t('Do nothing. Leave the old alias intact.'), PathautoManagerInterface::UPDATE_ACTION_LEAVE => t('Create a new alias. Leave the existing alias functioning.'), PathautoManagerInterface::UPDATE_ACTION_DELETE => t('Create a new alias. Delete the old alias.')), '#description' => $description);
     $form['transliterate'] = array('#type' => 'checkbox', '#title' => t('Transliterate prior to creating alias'), '#default_value' => $config->get('transliterate'), '#description' => t('When a pattern includes certain characters (such as those with accents) should Pathauto attempt to transliterate them into the US-ASCII alphabet? Transliteration is handled by the Transliteration module.'));
     $form['reduce_ascii'] = array('#type' => 'checkbox', '#title' => t('Reduce strings to letters and numbers'), '#default_value' => $config->get('reduce_ascii'), '#description' => t('Filters the new alias to only letters and numbers found in the ASCII-96 set.'));
     $form['ignore_words'] = array('#type' => 'textarea', '#title' => t('Strings to Remove'), '#default_value' => $config->get('ignore_words'), '#description' => t('Words to strip out of the URL alias, separated by commas. Do not use this to remove punctuation.'), '#wysiwyg' => FALSE);
     $form['punctuation'] = array('#type' => 'fieldset', '#title' => t('Punctuation'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#tree' => TRUE);
     $punctuation = \Drupal::service('pathauto.manager')->getPunctuationCharacters();
     foreach ($punctuation as $name => $details) {
         $details['default'] = PathautoManagerInterface::PUNCTUATION_REMOVE;
         if ($details['value'] == $config->get('separator')) {
             $details['default'] = PathautoManagerInterface::PUNCTUATION_REPLACE;
         }
         $form['punctuation']['punctuation' . $name] = array('#type' => 'select', '#title' => $details['name'] . ' (<code>' . SafeMarkup::checkPlain($details['value']) . '</code>)', '#default_value' => $details['default'], '#options' => array(PathautoManagerInterface::PUNCTUATION_REMOVE => t('Remove'), PathautoManagerInterface::PUNCTUATION_REPLACE => t('Replace by separator'), PathautoManagerInterface::PUNCTUATION_DO_NOTHING => t('No action (do not replace)')));
     }
     return parent::buildForm($form, $form_state);
 }
开发者ID:dev981,项目名称:gaptest,代码行数:35,代码来源:PathautoSettingsForm.php

示例2: getForm

 /**
  * Get all the form contents for rendering
  * @return type renderable array
  */
 function getForm($form, &$form_state, $disabled, $myvalues)
 {
     $loaded = module_load_include('inc', 'raptor_contraindications', 'core/ContraIndEngine');
     if (!$loaded) {
         $msg = 'Failed to load the Contraindication Engine';
         throw new \Exception($msg);
         //This is fatal, so stop everything now.
     }
     $oCIE = new \raptor\ContraIndEngine(NULL);
     $form["data_entry_area1"] = array('#prefix' => "\n<section class='raptor-report'>\n", '#suffix' => "\n</section>\n");
     $form['data_entry_area1']['blurb']['p2'] = array('#type' => 'item', '#markup' => '<p>The flags and measures listed as "database" are configured in the database.  The items listed as "coded" are implemented by programmers in the RAPTOR codebase.  The "database" configured flags and measures can be customized for a deployed site, the "coded" items cannot.</p>');
     $form['data_entry_area1']['blurb']['p3'] = array('#type' => 'item', '#markup' => '<p>Both the flags and the measures listed here can be used in flag formulas, but only boolean items can be used in Rule formulas.  Boolean items are shown in this report as having value type "boolean".  A boolean flag can have one of three values "True","False", or "Null".  A "Null" value occurs when input criteria for a flag or measure is not available or is unknown at evaluation time.</p>');
     $form["data_entry_area1"]['table_container'] = array('#type' => 'item', '#prefix' => '<div class="raptor-dialog-table-container">', '#suffix' => '</div>', '#tree' => TRUE);
     $rows = "\n";
     $aAllInputs = $oCIE->getSREContext()->getDictionary()->getActiveRuleInputs();
     foreach ($aAllInputs as $aInputs) {
         $sLocked = isset($aInputs['locked']) && $aInputs['locked'] == 1 ? 'Yes' : 'No';
         $return_type = $aInputs['return'];
         if ($return_type > '') {
             $rtparts = explode(' ', $return_type);
             $rtclassmarkup = ' class="' . $rtparts[0] . '-measure" ';
         } else {
             $rtclassmarkup = '';
         }
         $rows .= "\n" . '<tr>' . '<td>' . $aInputs['source'] . '</td>' . '<td>' . $sLocked . '</td>' . '<td><span ' . $rtclassmarkup . '>' . $return_type . '</span></td>' . '<td>' . $aInputs['category_nm'] . '</td>' . '<td>' . $aInputs['name'] . '</td>' . '<td>' . $aInputs['purpose_tx'] . '</td>' . '<td>' . $aInputs['criteria_tx'] . '</td>' . '</tr>';
     }
     $form["data_entry_area1"]['table_container']['users'] = array('#type' => 'item', '#markup' => '<table id="my-raptor-dialog-table" class="raptor-dialog-table dataTable">' . '<thead><tr>' . '<th>Implementation Location</th>' . '<th>Read Only</th>' . '<th>Value Type</th>' . '<th>Category Date</th>' . '<th>Name</th>' . '<th>Purpose</th>' . '<th>Formula</th>' . '</tr>' . '</thead>' . '<tbody>' . $rows . '</tbody>' . '</table>');
     $form['data_entry_area1']['action_buttons'] = array('#type' => 'item', '#prefix' => '<div class="raptor-action-buttons">', '#suffix' => '</div>', '#tree' => TRUE);
     $form['data_entry_area1']['action_buttons']['refresh'] = array('#type' => 'submit', '#attributes' => array('class' => array('admin-action-button'), 'id' => 'refresh-report'), '#value' => t('Refresh Report'));
     $form['data_entry_area1']['action_buttons']['cancel'] = array('#type' => 'item', '#markup' => '<input class="admin-cancel-button" type="button" value="Exit" data-redirect="/drupal/worklist?dialog=viewReports">');
     return $form;
 }
开发者ID:rmurray1,项目名称:RAPTOR,代码行数:36,代码来源:ViewReportContraindicationInputs.php

示例3: createFedoraDataStreams

 function createFedoraDataStreams($form_values, &$dom, &$rootElement)
 {
     module_load_include('php', 'Fedora_Repository', 'mimetype');
     global $base_url;
     $mimetype = new mimetype();
     $server = null;
     $file = $form_values['ingest-file-location'];
     $dformat = $mimetype->getType($file);
     $fileUrl = $base_url . '/' . drupal_urlencode($file);
     $beginIndex = strrpos($fileUrl, '/');
     $dtitle = substr($fileUrl, $beginIndex + 1);
     $dtitle = substr($dtitle, 0, strpos($dtitle, "."));
     $ds1 = $dom->createElement("foxml:datastream");
     $ds1->setAttribute("ID", "COLLECTION_POLICY");
     //set the ID
     $ds1->setAttribute("STATE", "A");
     $ds1->setAttribute("CONTROL_GROUP", "M");
     $ds1v = $dom->createElement("foxml:datastreamVersion");
     $ds1v->setAttribute("ID", "COLLECTION_POLICY.0");
     $ds1v->setAttribute("MIMETYPE", "{$dformat}");
     $ds1v->setAttribute("LABEL", "{$dtitle}");
     $ds1content = $dom->createElement('foxml:contentLocation');
     $ds1content->setAttribute("REF", "{$fileUrl}");
     $ds1content->setAttribute("TYPE", "URL");
     $ds1->appendChild($ds1v);
     $ds1v->appendChild($ds1content);
     $rootElement->appendChild($ds1);
 }
开发者ID:ratzeni,项目名称:islandora,代码行数:28,代码来源:CollectionFormBuilder.php

示例4: submitForm

 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     module_load_include('inc', 'sociallogin');
     $data = get_authentication($form_state->getValue('api_key'), $form_state->getValue('api_secret'));
     if (isset($data['status']) && $data['status'] != 'status') {
         drupal_set_message($data['message'], $data['status']);
         return FALSE;
     }
     parent::SubmitForm($form, $form_state);
     $this->config('sociallogin.settings')->set('sso_site_name', $form_state->getValue('sso_site_name'))->set('api_key', $form_state->getValue('api_key'))->set('api_secret', $form_state->getValue('api_secret'))->set('username_option', $form_state->getValue('username_option'))->set('login_redirection', $form_state->getValue('login_redirection'))->set('register_redirection', $form_state->getValue('register_redirection'))->set('custom_login_url', $form_state->getValue('custom_login_url'))->set('custom_register_url', $form_state->getValue('custom_register_url'))->set('enable_linking', $form_state->getValue('enable_linking'))->set('linking_text', $form_state->getValue('linking_text'))->save();
     if (count(\Drupal::moduleHandler()->getImplementations('add_extra_sociallogin_config_settings')) > 0) {
         // Call all modules that implement the hook, and let them make changes to $variables.
         $config_data = \Drupal::moduleHandler()->invokeAll('add_extra_sociallogin_config_settings');
     }
     if (isset($config_data) && is_array($config_data)) {
         foreach ($config_data as $key => $value) {
             $this->config('sociallogin.settings')->set($value, $form_state->getValue($value))->save();
         }
     }
     drupal_set_message(t('Social Login settings have been saved.'), 'status');
     //Clear page cache
     foreach (Cache::getBins() as $service_id => $cache_backend) {
         if ($service_id == 'dynamic_page_cache') {
             $cache_backend->deleteAll();
         }
     }
 }
开发者ID:LoginRadius,项目名称:drupal-identity-module,代码行数:30,代码来源:SocialLoginSettingsForm.php

示例5: getExtraInit

 /**
  * Payment method settings form.
  *
  * @param $order
  * The order transaction
  * @param $payment_method
  * The payment method used
  *
  * @return array
  *   Settings form array
  */
 public function getExtraInit($order, $payment_method)
 {
     $array = array();
     module_load_include('inc', 'commerce_payment', 'includes/commerce_payment.credit_card');
     $payment_token = $this->generatePaymentToken($order, $payment_method);
     if ($order) {
         $order_wrapper = entity_metadata_wrapper('commerce_order', $order);
         $billing_address = $order_wrapper->commerce_customer_billing->commerce_customer_address->value();
         $order_array = $order_wrapper->commerce_order_total->value();
         $default_currency = commerce_default_currency();
         $amount_cents = commerce_currency_convert($order_array['amount'], $order_array['currency_code'], $default_currency);
         $config = array();
         $config['publicKey'] = $payment_method['settings']['public_key'];
         $config['mode'] = $payment_method['settings']['mode'];
         $config['iconcolor'] = $payment_method['settings']['iconcolor'];
         $config['logourl'] = $payment_method['settings']['logourl'];
         $config['buttoncolor'] = $payment_method['settings']['buttoncolor'];
         $config['themecolor'] = $payment_method['settings']['themecolor'];
         $config['currencycode'] = $payment_method['settings']['currencycode'];
         $config['email'] = $order->mail;
         $config['name'] = "{$billing_address['first_name']} {$billing_address['last_name']}";
         $config['amount'] = $amount_cents;
         $config['currency'] = $default_currency;
         $config['localpayment'] = $payment_method['settings']['localpayment'] == 'false' ? 'card' : 'mixed';
         $config['paymentToken'] = $payment_token['token'];
         $array['script'] = $config;
         $array['paymentToken'] = $payment_token;
     }
     return $array;
 }
开发者ID:ravish-ramrakha-cko,项目名称:checkout-drupalcommerce-plugin,代码行数:41,代码来源:creditcard.php

示例6: add_Datastream

function add_Datastream($pid, $datastream, $dsLabel, $mimetype, $xml_url)
{
    module_load_include('php', 'Fedora_Repository', 'ObjectHelper');
    module_load_include('php', 'Fedora_Repository', 'ConnectionHelper');
    global $user;
    if (!fedora_repository_access(OBJECTHELPER::$ADD_FEDORA_STREAMS, $pid, $user)) {
        drupal_set_message('You do not have permission to add datastreams to this object!');
        return false;
    }
    global $base_url;
    module_load_include('php', 'Fedora_Repository', 'ConnectionHelper');
    $controlGroup = "M";
    $params = array('pid' => $pid, 'dsID' => $datastream, 'altIDs' => "", 'dsLabel' => $dsLabel, 'versionable' => "true", 'MIMEType' => $mimetype, 'formatURI' => "URL", 'dsLocation' => $xml_url, 'controlGroup' => "{$controlGroup}", 'dsState' => "A", 'checksumType' => "DISABLED", 'checksum' => "none", 'logMessage' => "datastream added");
    try {
        $soapHelper = new ConnectionHelper();
        $client = $soapHelper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl'));
        if ($client == null) {
            drupal_set_message(t('Error Getting Soap Client.'), 'error');
            return false;
        }
        $object = $client->__soapCall('addDatastream', array('parameters' => $params));
        return true;
    } catch (exception $e) {
        try {
            $params['force'] = 'true';
            $object = $client->__soapCall('ModifyDatastreamByReference', array($params));
            return true;
        } catch (exception $e1) {
            drupal_set_message(t($e1->getMessage()), 'error');
            return false;
        }
    }
}
开发者ID:0x27,项目名称:apiary-project,代码行数:33,代码来源:functions_islandora.php

示例7: prepareRequest

 /**
  * Modify the url and add headers appropriate to authenticate to Acquia Search.
  *
  * @return
  *  The nonce used in the request.
  */
 protected function prepareRequest(&$url, &$options, $use_data = TRUE)
 {
     module_load_include('inc', 'acquia_agent', 'acquia_agent_streams');
     $id = uniqid();
     if (!stristr($url, '?')) {
         $url .= "?";
     } else {
         $url .= "&";
     }
     $url .= 'request_id=' . $id;
     if ($use_data && isset($options['data'])) {
         list($cookie, $nonce) = acquia_search_auth_cookie($url, $options['data'], NULL, $this->env_id);
     } else {
         list($cookie, $nonce) = acquia_search_auth_cookie($url, NULL, NULL, $this->env_id);
     }
     if (empty($cookie)) {
         throw new Exception('Invalid authentication string - subscription keys expired or missing.');
     }
     $options['headers']['Cookie'] = $cookie;
     $options['headers'] += array('User-Agent' => 'acquia_search/' . variable_get('acquia_search_version', '6.x'));
     $options['context'] = acquia_agent_stream_context_create($url, 'acquia_search');
     if (!$options['context']) {
         throw new Exception(t("Could not create stream context"));
     }
     return $nonce;
 }
开发者ID:qltd,项目名称:kresge_d6,代码行数:32,代码来源:Acquia_Search_Service.php

示例8: canIngestHere

 function canIngestHere($collection_pid)
 {
     global $user;
     module_load_include('php', 'Fedora_Repository', 'ObjectHelper');
     $objectHelper = new ObjectHelper();
     //get the childsecurity policy from the collection.
     $policyStream = $objectHelper->getStream($collection_pid, SECURITYCLASS::$SECURITYSTREAM, false);
     if ($policyStream == null) {
         //no child policy stream so collection is wide open to anyone to ingest, that has the permission ingest in Drupal.
         //maybe we should return false here?? would be more secure.
         return true;
     }
     $allowedUsersAndRoles = $this->getAllowedUsersAndRoles($policyStream);
     if (!$allowedUsersAndRoles) {
         //error processing stream so don't let them ingest here.
         return false;
     }
     $allowedUsers = $allowedUsersAndRoles["users"];
     $allowedRoles = $allowedUsersAndRoles["roles"];
     foreach ($user->roles as $role) {
         if (in_array($role, $allowedRoles)) {
             return true;
         }
     }
     if (in_array($user->name, $allowedUsers)) {
         return true;
     }
     return false;
 }
开发者ID:ratzeni,项目名称:islandora,代码行数:29,代码来源:SecurityClass.php

示例9: setUp

 /**
  * {@inheritdoc}
  */
 public function setUp()
 {
     // Load two modules: the captcha module itself and the comment
     // module for testing anonymous comments.
     parent::setUp();
     module_load_include('inc', 'captcha');
     $this->drupalCreateContentType(array('type' => 'page'));
     // Create a normal user.
     $permissions = array('access comments', 'post comments', 'skip comment approval', 'access content', 'create page content', 'edit own page content');
     $this->normalUser = $this->drupalCreateUser($permissions);
     // Create an admin user.
     $permissions[] = 'administer CAPTCHA settings';
     $permissions[] = 'skip CAPTCHA';
     $permissions[] = 'administer permissions';
     $permissions[] = 'administer content types';
     $this->adminUser = $this->drupalCreateUser($permissions);
     // Open comment for page content type.
     $this->addDefaultCommentField('node', 'page');
     // Put comments on page nodes on a separate page.
     $comment_field = FieldConfig::loadByName('node', 'page', 'comment');
     $comment_field->setSetting('form_location', CommentItemInterface::FORM_SEPARATE_PAGE);
     $comment_field->save();
     /* @var \Drupal\captcha\Entity\CaptchaPoint $captcha_point */
     $captcha_point = \Drupal::entityManager()->getStorage('captcha_point')->load('user_login_form');
     $captcha_point->enable()->save();
     $this->config('captcha.settings')->set('default_challenge', 'captcha/test')->save();
 }
开发者ID:Wylbur,项目名称:gj,代码行数:30,代码来源:CaptchaBaseWebTestCase.php

示例10: settingsSummary

 /**
  * {@inheritdoc}
  */
 public function settingsSummary()
 {
     $settings = $this->getSettings();
     $summary = array();
     $field_name = explode('.', $this->fieldDefinition->id());
     $field_name = end($field_name);
     $machine_name = isset($settings['format']) ? $settings['format'] : 'default';
     $name_format = entity_load('name_format', $machine_name);
     if ($name_format) {
         $summary[] = t('Format: %format (@machine_name)', array('%format' => $name_format->label(), '@machine_name' => $name_format->id()));
     } else {
         $summary[] = t('Format: <strong>Missing format.</strong><br/>This field will be displayed using the Default format.');
         $machine_name = 'default';
     }
     // Provide an example of the selected format.
     module_load_include('admin.inc', 'name');
     $used_components = $this->getFieldSetting('components');
     $excluded_components = array_diff_key($used_components, _name_translations());
     $examples = name_example_names($excluded_components, $field_name);
     if ($examples && ($example = array_shift($examples))) {
         $format = name_get_format_by_machine_name($machine_name);
         $formatted = SafeMarkup::checkPlain(NameFormatParser::parse($example, $format));
         if (empty($formatted)) {
             $formatted = '<em>&lt;&lt;empty&gt;&gt;</em>';
         }
         $summary[] = t('Example: !example', array('!example' => $formatted));
     }
     $summary[] = t('Markup: @yesno', array('@yesno' => empty($settings['markup']) ? t('no') : t('yes')));
     $output_options = _name_formatter_output_options();
     $output = empty($settings['output']) ? 'default' : $settings['output'];
     $summary[] = t('Output: @format', array('@format' => $output_options[$output]));
     return $summary;
 }
开发者ID:darrylri,项目名称:protovbmwmo,代码行数:36,代码来源:NameFormatter.php

示例11: edit

 /**
  * @todo Remove content_translation_edit_page().
  */
 public function edit(Request $request, $language)
 {
     $entity = $request->attributes->get($request->attributes->get('_entity_type_id'));
     module_load_include('pages.inc', 'content_translation');
     $language = language_load($language);
     return content_translation_edit_page($entity, $language);
 }
开发者ID:anatalsceo,项目名称:en-classe,代码行数:10,代码来源:ContentTranslationController.php

示例12: settingsForm

 /**
  * Override EntityReferenceHandler::settingsForm().
  */
 public function settingsForm($field, $instance)
 {
     $form = parent::settingsForm($field, $instance);
     $settings = !empty($instance['settings']['behaviors']['og_widget']) ? $instance['settings']['behaviors']['og_widget'] : array();
     $settings += array('default' => array('widget_type' => 'options_select', 'widget_settings' => array()), 'admin' => array('widget_type' => 'entityreference_autocomplete', 'widget_settings' => array()));
     $field_types = array('default' => array('title' => t('Default widget type'), 'description' => t('The widget type of the field as it will appear to the user.')), 'admin' => array('title' => t('Administrator widget type'), 'description' => t('The widget type of the field that will appear only to a user with "Administer group" permission.')));
     module_load_include('inc', 'field_ui', 'field_ui.admin');
     $widget_types = field_ui_widget_type_options('entityreference');
     unset($widget_types['og_complex']);
     $field_info_widget_types = field_info_widget_types();
     foreach ($field_types as $field_type => $value) {
         $settings_id = 'og-' . $field_type . '-settings';
         $form[$field_type]['widget_type'] = array('#type' => 'select', '#title' => $value['title'], '#required' => TRUE, '#options' => $widget_types, '#default_value' => $settings[$field_type]['widget_type'], '#description' => $value['description'], '#ajax' => array('callback' => 'og_' . $field_type . '_settings_form_ajax', 'wrapper' => $settings_id, 'method' => 'replace', 'event' => 'change'));
         $form[$field_type]['widget_settings'] = array('#type' => 'fieldset', '#title' => t('@title Settings', array('@title' => $value['title'])), '#tree' => TRUE, '#attributes' => array('id' => $settings_id));
         if ($settings[$field_type]['widget_type'] && !empty($field_info_widget_types[$settings[$field_type]['widget_type']])) {
             $widget_type = $field_info_widget_types[$settings[$field_type]['widget_type']];
             $current_settings = isset($settings[$field_type]['widget_settings']) ? $settings[$field_type]['widget_settings'] : array();
             $fake_instance = array('widget' => array('type' => $settings[$field_type]['widget_type'], 'module' => $widget_type['module'], 'settings' => $current_settings) + $instance['widget']) + $instance;
             $additions = module_invoke($widget_type['module'], 'field_widget_settings_form', $field, $fake_instance);
             if ($additions) {
                 $form[$field_type]['widget_settings'] += $additions;
             }
         }
     }
     // Field access settings.
     $form['access_override'] = array('#title' => t('Allow entity access to control field access'), '#description' => t('By default, the <em>administer group</em> permission is required to directly edit this field. Selecting this option will allow access to anybody with access to edit the entity.'), '#type' => 'checkbox', '#default_value' => isset($settings['access_override']) ? $settings['access_override'] : FALSE);
     return $form;
 }
开发者ID:redponey,项目名称:openatrium-7.x-2.51,代码行数:31,代码来源:OgWidgetHandler.class.php

示例13: __construct

 /**
  * Initialises this item using data from an XML node.
  * @param DOMElement $node The node to use for initialisation.
  * @param CqQuestionInterface $context The question or other object that the mapping
  * can query for things like the current answer, draggables and hotspots.
  */
 public function __construct(DOMElement $node, $context)
 {
     module_load_include('inc.php', 'closedquestion', 'lib/XmlLib');
     if ($node) {
         $attribs = $node->attributes;
         if ($attribs) {
             $item = $attribs->getNamedItem('identifier');
             if ($item === NULL) {
                 $item = $attribs->getNamedItem('id');
             }
             if ($item === NULL) {
                 $item = $attribs->getNamedItem('name');
             }
             if ($item !== NULL) {
                 $this->identifier = $item->nodeValue;
             }
             $item = $attribs->getNamedItem('src');
             if ($item !== NULL) {
                 $this->imgSrc = $item->nodeValue;
             }
             $item = $attribs->getNamedItem('class');
             if ($item !== NULL) {
                 $this->cssClass = $item->nodeValue;
             }
         }
         $this->text = cq_get_text_content($node, $context);
     }
 }
开发者ID:rollinsb1010,项目名称:elearning,代码行数:34,代码来源:CqDraggable.class.php

示例14: hook_bootstrap_modal_forms

/**
 * Registers forms with Bootstrap to be displayed as modals.
 *
 * This example registers the sitewide "Contact Us" form.
 *
 * @return array
 */
function hook_bootstrap_modal_forms()
{
    module_load_include('inc', 'contact', 'contact.pages');
    $items = array();
    $items['contact_modal_form'] = array('form' => drupal_get_form('contact_site_form'), 'title' => t('Contact Us'), 'action' => 'contact');
    return $items;
}
开发者ID:nevetS,项目名称:flame,代码行数:14,代码来源:bootstrap_modal_forms.api.php

示例15: getMetadata

 function getMetadata(&$form_values)
 {
     module_load_include('php', 'Fedora_Repository', 'mimetype');
     global $base_url;
     //$mimetype = new mimetype();
     if (!empty($_SESSION['fedora_ingest_files'])) {
         foreach ($_SESSION['fedora_ingest_files'] as $dsid => $createdFile) {
             $file = $form_values['ingest-file-location'];
             $fileUrl = $base_url . '/fedora/repository/' . $form_values['pid'] . '/FULL_SIZE';
             $file_size = filesize($createdFile);
             $file_md5 = md5_file($createdFile);
             $file_path = $fileUrl;
             $imagesize = getimagesize($createdFile);
             //list($file_width, $file_height, $file_format, $attr,$file_mime) = getimagesize($createdFile);
             $file_width = $imagesize['0'];
             $file_height = $imagesize['1'];
             $file_format = $imagesize['2'];
             $attr = $imagesize['3'];
             $file_mime = $imagesize['mime'];
             continue;
         }
     }
     $form_values['img_size'] = $file_size;
     $form_values['img_md5'] = $file_md5;
     $form_values['img_file'] = $file_path;
     $form_values['img_imagelength'] = $file_height;
     $form_values['img_imagewidth'] = $file_width;
     $form_values['img_format'] = str_replace(array('1', '2', '3', '4'), array('GIF', 'JPG', 'PNG', 'SWF'), $file_format);
     $form_values['img_mime'] = $file_mime;
     $form_values['img_samplingfrequencyunit'] = '1';
     $form_values['img_samplingfrequencyplane'] = '1';
 }
开发者ID:ratzeni,项目名称:epistemetec,代码行数:32,代码来源:ImageManipulation.php


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