• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP variable_get函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: mooc_foundation_access_preprocess_page

/**
 * Implements template_preprocess_page.
 */
function mooc_foundation_access_preprocess_page(&$variables)
{
    // speedreader is enabled
    if (module_exists('speedreader')) {
        $variables['speedreader'] = TRUE;
    }
    // mespeak is enabled
    if (module_exists('mespeak')) {
        $variables['mespeak'] = TRUE;
    }
    // support for add child page shortcut
    $node = menu_get_object();
    if ($node && user_access('access printer-friendly version')) {
        $variables['tabs_extras'][200][] = '<hr>';
        $variables['tabs_extras'][200][] = l(t('Print'), 'book/export/html/' . arg(1));
    }
    $child_type = variable_get('book_child_type', 'book');
    if ($node && !empty($node->book) && (user_access('add content to books') || user_access('administer book outlines')) && node_access('create', $child_type) && $node->status == 1 && isset($node->book['depth']) && $node->book['depth'] < MENU_MAX_DEPTH) {
        $variables['tabs_extras'][200][] = '<hr>';
        $variables['tabs_extras'][200][] = l(t('Add child page'), 'node/add/' . str_replace('_', '-', $child_type), array('query' => array('parent' => $node->book['mlid'])));
    }
    if (user_access('access contextual links')) {
        $variables['tabs_extras'][0][] = '<li class="cis_accessibility_check"></li>';
    }
}
开发者ID:kreynen,项目名称:elmsln,代码行数:28,代码来源:template.php


示例2: hook_twitter_accounts

/**
 * Retrieves what Twitter accounts the given user can post to.
 */
function hook_twitter_accounts($drupal_user, $full_access = FALSE) {
  $accounts = array();
  if (user_access('use global twitter account') &&
      ($name = variable_get('twitter_global_name', NULL)) &&
      ($pass = variable_get('twitter_global_password', NULL))) {

    $accounts[$name] = array(
      'screen_name' => $name,
      'password' => $pass,
    );
  }

  $sql = " SELECT ta.*, tu.uid, tu.password, tu.import FROM {twitter_user} tu ";
  $sql .= "LEFT JOIN {twitter_account} ta ON (tu.screen_name = ta.screen_name) ";
  $sql .= "WHERE tu.uid = %d";

  if ($full_access) {
    $sql .= " AND tu.password IS NOT NULL";
  }
  $args = array($drupal_user->uid);
  $results = db_query($sql, $args);

  while ($account = db_fetch_array($results)) {
    $accounts[$account['screen_name']] = $account;
  }
  return $accounts;
}
开发者ID:ATouhou,项目名称:www.alim.org,代码行数:30,代码来源:twitter.api.php


示例3: odsherredweb_preprocess_page

/**
 * implements hook_preprocess_page()
 *
 **/
function odsherredweb_preprocess_page(&$variables)
{
    $current_theme = variable_get('theme_default', 'none');
    // Search form
    $variables['simple_navigation_search'] = module_invoke('search', 'block_view', 'search');
    // Navigation
    $variables['sidebar_borger'] = _bellcom_generate_menu('menu-indhold', 'sidebar');
    $variables['sidebar_erhverv'] = _bellcom_generate_menu('menu-erhverv', 'sidebar');
    $variables['sidebar_politik'] = _bellcom_generate_menu('menu-politik', 'sidebar');
    // Add the site structure term id to the page div
    $node = node_load(arg(1));
    if (is_object($node) && isset($node->field_os2web_spotbox_sitestruct)) {
        $termParents = taxonomy_get_parents($node->field_os2web_spotbox_sitestruct[LANGUAGE_NONE][0]['tid']);
        $termId = 'tid-' . $node->field_os2web_spotbox_sitestruct[LANGUAGE_NONE][0]['tid'];
        $termIdParent = "";
        if (!empty($termParents)) {
            $termIdParent = 'tid-' . key($termParents);
        }
        $variables['attributes_array']['class'] = $termIdParent . ' ' . $termId;
    }
    // Paths
    $variables['path_js'] = base_path() . drupal_get_path('theme', $current_theme) . '/js';
    $variables['path_img'] = base_path() . drupal_get_path('theme', $current_theme) . '/images';
    $variables['path_css'] = base_path() . drupal_get_path('theme', $current_theme) . '/css';
    $variables['path_font'] = base_path() . drupal_get_path('theme', $current_theme) . '/font';
}
开发者ID:odsherred,项目名称:odsherred.dk,代码行数:30,代码来源:template.php


示例4: fusion_core_initialize_theme_settings

/**
 * Initialize theme settings if needed
 */
function fusion_core_initialize_theme_settings($theme_name)
{
    $theme_settings = theme_get_settings($theme_name);
    if (is_null($theme_settings['theme_font_size']) || $theme_settings['rebuild_registry'] == 1) {
        // Rebuild theme registry & notify user
        if ($theme_settings['rebuild_registry'] == 1) {
            drupal_rebuild_theme_registry();
            drupal_set_message(t('Theme registry rebuild completed. <a href="!link">Turn off</a> this feature for production websites.', array('!link' => url('admin/build/themes/settings/' . $GLOBALS['theme']))), 'warning');
        }
        // Retrieve saved or site-wide theme settings
        $theme_setting_name = str_replace('/', '_', 'theme_' . $theme_name . '_settings');
        $settings = variable_get($theme_setting_name, FALSE) ? theme_get_settings($theme_name) : theme_get_settings();
        // Skip toggle_node_info_ settings
        if (module_exists('node')) {
            foreach (node_get_types() as $type => $name) {
                unset($settings['toggle_node_info_' . $type]);
            }
        }
        // Retrieve default theme settings
        $defaults = fusion_core_default_theme_settings();
        // Set combined default & saved theme settings
        variable_set($theme_setting_name, array_merge($defaults, $settings));
        // Force theme settings refresh
        theme_get_setting('', TRUE);
    }
}
开发者ID:edchacon,项目名称:scratchpads,代码行数:29,代码来源:theme-settings.php


示例5: moveUploadedFile

 /**
  * Helper function that moves an uploaded file.
  *
  * @param string $filename
  *   The path of the file to move.
  * @param string $uri
  *   The path where to move the file.
  *
  * @return bool
  *   TRUE if the file was moved. FALSE otherwise.
  */
 protected static function moveUploadedFile($filename, $uri)
 {
     if (drupal_move_uploaded_file($filename, $uri)) {
         return TRUE;
     }
     return variable_get('restful_insecure_uploaded_flag', FALSE) && (bool) file_unmanaged_move($filename, $uri);
 }
开发者ID:jhoffman-tm,项目名称:waldorf-deployment,代码行数:18,代码来源:DataProviderFileTest.php


示例6: strip_dangerous_protocols

function strip_dangerous_protocols($uri)
{
    static $allowed_protocols;
    if (!isset($allowed_protocols)) {
        $allowed_protocols = array_flip(variable_get('filter_allowed_protocols', array('ftp', 'http', 'https', 'irc', 'mailto', 'news', 'nntp', 'rtsp', 'sftp', 'ssh', 'tel', 'telnet', 'webcal')));
    }
    // Iteratively remove any invalid protocol found.
    do {
        $before = $uri;
        $colonpos = strpos($uri, ':');
        if ($colonpos > 0) {
            // We found a colon, possibly a protocol. Verify.
            $protocol = substr($uri, 0, $colonpos);
            // If a colon is preceded by a slash, question mark or hash, it cannot
            // possibly be part of the URL scheme. This must be a relative URL, which
            // inherits the (safe) protocol of the base document.
            if (preg_match('![/?#]!', $protocol)) {
                break;
            }
            // Check if this is a disallowed protocol. Per RFC2616, section 3.2.3
            // (URI Comparison) scheme comparison must be case-insensitive.
            if (!isset($allowed_protocols[strtolower($protocol)])) {
                $uri = substr($uri, $colonpos + 1);
            }
        }
    } while ($before != $uri);
    return $uri;
}
开发者ID:rajarju,项目名称:ZORL,代码行数:28,代码来源:MY_drupal_helper.php


示例7: deco_preprocess_page

function deco_preprocess_page(&$vars)
{
    $vars['sidebar_triple'] = FALSE;
    if (!empty($vars['page']['sidebar_second']) && !empty($vars['page']['sidebar_right_sec']) && !empty($vars['page']['sidebar_first'])) {
        $vars['classes_array'][] .= ' sidebar-triple';
        $vars['sidebar_triple'] = TRUE;
    }
    if (!empty($vars['page']['sidebar_right_sec']) && empty($vars['page']['sidebar_second'])) {
        $vars['page']['sidebar_second'] = $vars['page']['sidebar_right_sec'];
        $vars['page']['sidebar_right_sec'] = '';
    }
    // set variables for the logo and slogan
    $site_fields = array();
    if ($vars['site_name']) {
        $site_fields[] = check_plain($vars['site_name']);
    }
    if ($vars['site_slogan']) {
        $site_fields[] = '- ' . check_plain($vars['site_slogan']);
    }
    $vars['site_title'] = implode(' ', $site_fields);
    if (isset($site_fields[0])) {
        $site_fields[0] = '<span class="site-name">' . $site_fields[0] . '</span>';
    }
    if (isset($site_fields[1])) {
        $site_fields[1] = '<span class="site-slogan">' . $site_fields[1] . '</span>';
    }
    $vars['site_title_html'] = implode(' ', $site_fields);
    $vars['primary_menu'] = str_replace('class="menu"', 'class="links primary-links"', render(menu_tree(variable_get('menu_main_links_source', 'main-menu'))));
    $vars['secondary_menu'] = str_replace('class="menu"', 'class="links secondary-links"', render(menu_tree(variable_get('menu_secondary_links_source', 'secondary-menu'))));
}
开发者ID:siberlee526,项目名称:faa7419db,代码行数:30,代码来源:template.php


示例8: garland_preprocess_page

/**
 * Override or insert variables into the page template.
 */
function garland_preprocess_page(&$vars)
{
    $vars['tabs2'] = menu_secondary_local_tasks();
    if (isset($vars['main_menu'])) {
        $vars['primary_nav'] = theme('links__system_main_menu', array('links' => $vars['main_menu'], 'attributes' => array('class' => array('links', 'main-menu')), 'heading' => array('text' => t('Main menu'), 'level' => 'h2', 'class' => array('element-invisible'))));
    } else {
        $vars['primary_nav'] = FALSE;
    }
    if (isset($vars['secondary_menu'])) {
        $vars['secondary_nav'] = theme('links__system_secondary_menu', array('links' => $vars['secondary_menu'], 'attributes' => array('class' => array('links', 'secondary-menu')), 'heading' => array('text' => t('Secondary menu'), 'level' => 'h2', 'class' => array('element-invisible'))));
    } else {
        $vars['secondary_nav'] = FALSE;
    }
    // Prepare header.
    $site_fields = array();
    if (!empty($vars['site_name'])) {
        $site_fields[] = check_plain($vars['site_name']);
    }
    if (!empty($vars['site_slogan'])) {
        $site_fields[] = check_plain($vars['site_slogan']);
    }
    $vars['site_title'] = implode(' ', $site_fields);
    if (!empty($site_fields)) {
        $site_fields[0] = '<span>' . $site_fields[0] . '</span>';
    }
    $vars['site_html'] = implode(' ', $site_fields);
    // Set a variable for the site name title and logo alt attributes text.
    $slogan_text = filter_xss_admin(variable_get('site_slogan', ''));
    $site_name_text = filter_xss_admin(variable_get('site_name', 'Drupal'));
    $vars['site_name_and_slogan'] = $site_name_text . ' ' . $slogan_text;
}
开发者ID:sdboyer,项目名称:drupal-c2g,代码行数:34,代码来源:template.php


示例9: local_storage_admin_form

/**
 * Form callback for "admin/config/administration/local_storage".
 */
function local_storage_admin_form($form, &$form_state)
{
    $form['local_storage_enable'] = array('#type' => 'checkbox', '#title' => t('Enable Local Storage'), '#description' => t('Enable automatic storing of entered data for all new fields by default.'), '#default_value' => variable_get('local_storage_enable', 0));
    $form['local_storage_default'] = array('#type' => 'checkbox', '#title' => t('Show default (original) value by default'), '#description' => t('Show default (original) value by default for all new fields by default.'), '#default_value' => variable_get('local_storage_default', 0));
    $form['local_storage_expire'] = array('#type' => 'select', '#options' => drupal_map_assoc(range(1, 48)), '#title' => t('Expiration time'), '#description' => t('Set default expiration time for stored data (in hours).'), '#default_value' => variable_get('local_storage_expire', 48));
    return system_settings_form($form);
}
开发者ID:LamTechConsult,项目名称:slbizreviews,代码行数:10,代码来源:local_storage.admin.php


示例10: cac_preprocess_node

/**
 * @file
 * Template overrides as well as (pre-)process and alter hooks for the
 * cac theme.
 */
function cac_preprocess_node(&$vars)
{
    if (variable_get('node_submitted_' . $vars['node']->type, TRUE)) {
        $date = format_date($vars['node']->created, 'date_type');
        $vars['submitted'] = t('Submitted by !username on !datetime', array('!username' => 'editor', '!datetime' => $date));
    }
}
开发者ID:spicecadet,项目名称:aging,代码行数:12,代码来源:template.php


示例11: razorDrupal_process_page

function razorDrupal_process_page(&$variables)
{
    // Hook into color.module.
    if (module_exists('color')) {
        _color_page_alter($variables);
    }
    // Always print the site name and slogan, but if they are toggled off, we'll
    // just hide them visually.
    $variables['hide_site_name'] = theme_get_setting('toggle_name') ? FALSE : TRUE;
    $variables['hide_site_slogan'] = theme_get_setting('toggle_slogan') ? FALSE : TRUE;
    if ($variables['hide_site_name']) {
        // If toggle_name is FALSE, the site_name will be empty, so we rebuild it.
        $variables['site_name'] = filter_xss_admin(variable_get('site_name', 'Drupal'));
    }
    if ($variables['hide_site_slogan']) {
        // If toggle_site_slogan is FALSE, the site_slogan will be empty, so we rebuild it.
        $variables['site_slogan'] = filter_xss_admin(variable_get('site_slogan', ''));
    }
    // Since the title and the shortcut link are both block level elements,
    // positioning them next to each other is much simpler with a wrapper div.
    if (!empty($variables['title_suffix']['add_or_remove_shortcut']) && $variables['title']) {
        // Add a wrapper div using the title_prefix and title_suffix render elements.
        $variables['title_prefix']['shortcut_wrapper'] = array('#markup' => '<div class="shortcut-wrapper clearfix">', '#weight' => 100);
        $variables['title_suffix']['shortcut_wrapper'] = array('#markup' => '</div>', '#weight' => -99);
        // Make sure the shortcut link is the first item in title_suffix.
        $variables['title_suffix']['add_or_remove_shortcut']['#weight'] = -100;
    }
}
开发者ID:RazorEdgeLabs,项目名称:razordrupal,代码行数:28,代码来源:template.php


示例12: bootstrap_status_messages

/**
 * Returns HTML for status and/or error messages, grouped by type.
 *
 * An invisible heading identifies the messages for assistive technology.
 * Sighted users see a colored box. See http://www.w3.org/TR/WCAG-TECHS/H69.html
 * for info.
 *
 * @param array $variables
 *   An associative array containing:
 *   - display: (optional) Set to 'status' or 'error' to display only messages
 *     of that type.
 *
 * @return string
 *   The constructed HTML.
 *
 * @see theme_status_messages()
 *
 * @ingroup theme_functions
 */
function bootstrap_status_messages($variables)
{
    $display = $variables['display'];
    $output = '';
    $status_heading = array('status' => t('Status message'), 'error' => t('Error message'), 'warning' => t('Warning message'), 'info' => t('Informative message'));
    // Map Drupal message types to their corresponding Bootstrap classes.
    // @see http://twitter.github.com/bootstrap/components.html#alerts
    $status_class = array('status' => 'success', 'error' => 'danger', 'warning' => 'warning', 'info' => 'info');
    // Retrieve messages.
    $message_list = drupal_get_messages($display);
    // Allow the disabled_messages module to filter the messages, if enabled.
    if (module_exists('disable_messages') && variable_get('disable_messages_enable', '1')) {
        $message_list = disable_messages_apply_filters($message_list);
    }
    foreach ($message_list as $type => $messages) {
        $class = isset($status_class[$type]) ? ' alert-' . $status_class[$type] : '';
        $output .= "<div class=\"alert alert-block{$class} messages {$type}\">\n";
        $output .= "  <a class=\"close\" data-dismiss=\"alert\" href=\"#\">&times;</a>\n";
        if (!empty($status_heading[$type])) {
            $output .= '<h4 class="element-invisible">' . $status_heading[$type] . "</h4>\n";
        }
        if (count($messages) > 1) {
            $output .= " <ul>\n";
            foreach ($messages as $message) {
                $output .= '  <li>' . $message . "</li>\n";
            }
            $output .= " </ul>\n";
        } else {
            $output .= $messages[0];
        }
        $output .= "</div>\n";
    }
    return $output;
}
开发者ID:PixelGarage,项目名称:hso2,代码行数:53,代码来源:status-messages.func.php


示例13: __construct

 public function __construct()
 {
     parent::__construct();
     // Map fields that don't need extra definitions.
     $field_names = array('id', 'weekday', 'hour_from', 'hour_to', 'cap');
     $this->addSimpleMappings($field_names);
     $this->addFieldMapping('meter_nid', 'meter_nid')->sourceMigration(array('NegawattIecMeterMigrate', 'NegawattModbusMeterMigrate'));
     $this->description = t('Import @type - from CSV file.', array('@type' => $this->entityType));
     // Create a map object for tracking the relationships between source rows
     $key = array('id' => array('type' => 'int', 'not null' => TRUE));
     $destination_handler = new MigrateDestinationEntityAPI($this->entityType, $this->bundle);
     $this->map = new MigrateSQLMap($this->machineName, $key, $destination_handler->getKeySchema($this->entityType));
     // Create a MigrateSource object.
     $sql_migrate = variable_get('negawatt_migrate_sql', FALSE);
     if ($sql_migrate) {
         // SQL migration.
         $query = db_select('_negawatt_power_cap_analyzer_info_migrate', $this->bundle)->fields($this->bundle, $field_names);
         $this->source = new MigrateSourceSQL($query);
     } else {
         // CSV migration.
         // Allow using variable to set path other than default.
         $csv_path = variable_get('negawatt_migrate_csv_path', drupal_get_path('module', 'negawatt_migrate') . '/csv');
         $this->source = new MigrateSourceCSV($csv_path . '/normalizer/' . $this->entityType . '.csv', $this->csvColumns, array('header_rows' => 1));
     }
     $this->destination = new MigrateDestinationEntityAPI($this->entityType, $this->bundle);
 }
开发者ID:Gizra,项目名称:negawatt-server,代码行数:26,代码来源:NegawattPowerCapAnalyzerInfoMigrate.php


示例14: quickdrupal_username

/**
 * Override theme_username() function.
 * Removes the text '(not verified)' for anonymous users.
 */
function quickdrupal_username($object)
{
    if ($object->uid && $object->name) {
        if (drupal_strlen($object->name) > 20) {
            $name = drupal_substr($object->name, 0, 15) . '...';
        } else {
            $name = $object->name;
        }
        if (user_access('access user profiles')) {
            $output = l($name, 'user/' . $object->uid, array('attributes' => array('title' => t('View user profile.'))));
        } else {
            $output = check_plain($name);
        }
    } else {
        if ($object->name) {
            if (!empty($object->homepage)) {
                $output = l($object->name, $object->homepage, array('attributes' => array('rel' => 'nofollow')));
            } else {
                $output = check_plain($object->name);
            }
        } else {
            $output = check_plain(variable_get('anonymous', t('Anonymous')));
        }
    }
    return $output;
}
开发者ID:jpshayes,项目名称:quickdrupal,代码行数:30,代码来源:template.php


示例15: arthemia_primary

/**
 * Return a full tree of the expanded menu. Thank you multiflex-3 for this code!
 */
function arthemia_primary()
{
    $output = '<div id="page-bar">';
    $output .= menu_tree(variable_get('menu_primary_links_source', 'primary-links'));
    $output .= '</div>';
    return $output;
}
开发者ID:redbtn,项目名称:wcc,代码行数:10,代码来源:template.php


示例16: sendRequest

 protected function sendRequest($identifiers)
 {
     $ids = array();
     foreach ($identifiers as $i) {
         $ids = array_merge($ids, array_values($i));
     }
     $authInfo = array('authenticationUser' => $this->username, 'authenticationGroup' => $this->group, 'authenticationPassword' => $this->password);
     if (preg_match('/moreinfo.addi.dk/', $this->wsdlUrl)) {
         // New moreinfo service.
         $client = new SoapClient($this->wsdlUrl . '/moreinfo.wsdl');
         $method = 'moreInfo';
     } else {
         // Legacy additionalInformation service.
         $client = new SoapClient($this->wsdlUrl);
         $method = 'additionalInformation';
     }
     $startTime = explode(' ', microtime());
     $response = $client->{$method}(array('authentication' => $authInfo, 'identifier' => $identifiers));
     $stopTime = explode(' ', microtime());
     $time = floatval($stopTime[1] + $stopTime[0] - ($startTime[1] + $startTime[0]));
     //Drupal specific code - consider moving this elsewhere
     if (variable_get('addi_enable_logging', false)) {
         watchdog('addi', 'Completed request (' . round($time, 3) . 's): Ids: %ids', array('%ids' => implode(', ', $ids)), WATCHDOG_DEBUG, 'http://' . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]);
     }
     if ($response->requestStatus->statusEnum != 'ok') {
         throw new AdditionalInformationServiceException($response->requestStatus->statusEnum . ': ' . $response->requestStatus->errorText);
     }
     if (!is_array($response->identifierInformation)) {
         $response->identifierInformation = array($response->identifierInformation);
     }
     return $response;
 }
开发者ID:revealit,项目名称:ting,代码行数:32,代码来源:AdditionalInformationService.php


示例17: hook_mongodb_block_ui_configure

/**
 * Configuration form for the mongodb_block_ui.
 *
 * @param string $delta
 *   Which mongodb_block_ui to return. This is a descriptive string used to
 *   identify mongodb_block_uis within each module and also within the theme
 *   system.
 *   The $delta for each mongodb_block_ui is defined within the array that your
 *   module returns when the hook_mongodb_block_ui_info() implementation is
 *   called.
 *
 * @return array
 *   Optionally return the configuration form.
 *
 * For a detailed usage example, see mongodb_block_ui_example.module.
 */
function hook_mongodb_block_ui_configure($delta = '')
{
    if ($delta == 'exciting') {
        $form['items'] = array('#type' => 'select', '#title' => t('Number of items'), '#default_value' => variable_get('mymodule_mongodb_block_ui_items', 0), '#options' => array('1', '2', '3'));
        return $form;
    }
}
开发者ID:picpen,项目名称:dentalevents,代码行数:23,代码来源:mongodb_block_ui.api.php


示例18: hook_feeds_term_processor_targets_alter

/**
 * Alter mapping targets for taxonomy terms. Use this hook to add additional
 * target options to the mapping form of Taxonomy term processor.
 *
 * For an example implementation, look at geotaxnomy module.
 * http://drupal.org/project/geotaxonomy
 *
 * @param &$targets
 *   Array containing the targets to be offered to the user. Add to this array
 *   to expose additional options. Remove from this array to suppress options.
 *   Remove with caution.
 * @param $vid
 *   The vocabulary id
 */
function hook_feeds_term_processor_targets_alter(&$targets, $vid)
{
    if (variable_get('mymodule_vocabulary_' . $vid, 0)) {
        $targets['lat'] = array('name' => t('Latitude'), 'description' => t('Latitude of the term.'));
        $targets['lon'] = array('name' => t('Longitude'), 'description' => t('Longitude of the term.'));
    }
}
开发者ID:voidfiles,项目名称:Basic-Drupal,代码行数:21,代码来源:feeds.api.php


示例19: get_url

function get_url($url)
{
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 1);
    //curl_setopt($ch,CURLOPT_HTTPPROXYTUNNEL, 1);
    $proxy_internet = variable_get('proxy_internet', null);
    $proxy_internet_userpwd = variable_get('proxy_internet_userpwd', null);
    if ($proxy_internet != null && $proxy_internet_userpwd != null) {
        curl_setopt($ch, CURLOPT_PROXY, $proxy_internet);
        curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxy_internet_userpwd);
    }
    $content = curl_exec($ch);
    /*On a une erreur alors on la lève*/
    if ($content === false) {
        trigger_error('Erreur curl : ' . curl_error($ch) . "--url--" . $url, E_USER_WARNING);
    }
    /*Si tout c'est bien passé on affiche le contenu de la requête*/
    /*On ferme la ressource*/
    curl_close($ch);
    return $content;
}
开发者ID:singhneeraj,项目名称:fr-store,代码行数:25,代码来源:gmaps-api.php


示例20: hook_menu_delete

/**
 * Respond to a custom menu deletion.
 *
 * This hook is used to notify modules that a custom menu along with all links
 * contained in it (if any) has been deleted. Contributed modules may use the
 * information to perform actions based on the information entered into the menu
 * system.
 *
 * @param $menu
 *   An array representing a custom menu:
 *   - menu_name: The unique name of the custom menu.
 *   - title: The human readable menu title.
 *   - description: The custom menu description.
 *
 * @see hook_menu_insert()
 * @see hook_menu_update()
 */
function hook_menu_delete($menu)
{
    // Delete the record from our variable.
    $my_menus = variable_get('my_module_menus', array());
    unset($my_menus[$menu['menu_name']]);
    variable_set('my_module_menus', $my_menus);
}
开发者ID:HamzaBendidane,项目名称:prel,代码行数:24,代码来源:menu.api.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP variable_initialize函数代码示例发布时间:2022-05-23
下一篇:
PHP variable_del函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap