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


PHP drupal_get_html_head函数代码示例

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


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

示例1: phptemplate_preprocess

function phptemplate_preprocess(&$vars, $hook)
{
    if ($hook == 'page') {
        // Add a 'page-node' class if this is a node that is rendered as page
        if (isset($vars['node']) && $vars['node']->type) {
            $vars['body_classes'] .= ' page-node';
        }
        // Add Feed icon
        $array_q = explode('/', $_GET['q']);
        if ($array_q[0] == 'blog') {
            drupal_add_feed(url('blog/rss.xml', array('absolute' => TRUE)));
        } elseif ($array_q[0] == 'projects') {
            drupal_add_feed(url('projects/rss.xml', array('absolute' => TRUE)));
        } elseif ($array_q[0] == '字') {
            drupal_add_feed(url('字/rss.xml', array('absolute' => TRUE)));
        } else {
            drupal_add_feed(url('rss.xml', array('absolute' => TRUE)));
        }
        $vars['head'] = drupal_get_html_head();
        // Refresh $head variable
        $vars['feed_icons'] = drupal_get_feeds();
        // Refresh $feed_icons variable
    }
    // Replace funny chinese characters in section name
    //$vars['body_classes'] = str_replace('-e6-bc-a2-e5-ad-97-e6-84-9f-e3-81-98', 'kanjikanji', $vars['body_classes']);
}
开发者ID:victoriachan,项目名称:peter-blog-drupal6,代码行数:26,代码来源:template.php

示例2: lotusPD_img_assist_page

/**
 * Image assist module support.
 */
function lotusPD_img_assist_page($content, $attributes = NULL)
{
    $title = drupal_get_title();
    $output = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' . "\n";
    $output .= '<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">' . "\n";
    $output .= "<head>\n";
    $output .= '<title>' . $title . "</title>\n";
    // Note on CSS files from Benjamin Shell:
    // Stylesheets are a problem with image assist. Image assist works great as a
    // TinyMCE plugin, so I want it to LOOK like a TinyMCE plugin. However, it's
    // not always a TinyMCE plugin, so then it should like a themed Drupal page.
    // Advanced users will be able to customize everything, even TinyMCE, so I'm
    // more concerned about everyone else. TinyMCE looks great out-of-the-box so I
    // want image assist to look great as well. My solution to this problem is as
    // follows:
    // If this image assist window was loaded from TinyMCE, then include the
    // TinyMCE popups_css file (configurable with the initialization string on the
    // page that loaded TinyMCE). Otherwise, load drupal.css and the theme's
    // styles. This still leaves out sites that allow users to use the TinyMCE
    // plugin AND the Add Image link (visibility of this link is now a setting).
    // However, on my site I turned off the text link since I use TinyMCE. I think
    // it would confuse users to have an Add Images link AND a button on the
    // TinyMCE toolbar.
    //
    // Note that in both cases the img_assist.css file is loaded last. This
    // provides a way to make style changes to img_assist independently of how it
    // was loaded.
    $output .= drupal_get_html_head();
    $output .= drupal_get_js();
    $output .= "\n<script type=\"text/javascript\"><!-- \n";
    $output .= "  if (parent.tinyMCE && parent.tinyMCEPopup && parent.tinyMCEPopup.getParam('popups_css')) {\n";
    $output .= "    document.write('<link href=\"' + parent.tinyMCEPopup.getParam('popups_css') + '\" rel=\"stylesheet\" type=\"text/css\">');\n";
    $output .= "  } else {\n";
    foreach (drupal_add_css() as $media => $type) {
        $paths = array_merge($type['module'], $type['theme']);
        foreach (array_keys($paths) as $path) {
            // Don't import img_assist.css twice.
            if (!strstr($path, 'img_assist.css')) {
                $output .= "  document.write('<style type=\"text/css\" media=\"{$media}\">@import \"" . base_path() . $path . "\";<\\/style>');\n";
            }
        }
    }
    $output .= "  }\n";
    $output .= "--></script>\n";
    // Ensure that img_assist.js is imported last.
    $path = drupal_get_path('module', 'img_assist') . '/img_assist_popup.css';
    $output .= "<style type=\"text/css\" media=\"all\">@import \"" . base_path() . $path . "\";</style>\n";
    $output .= '<!--[if IE 6]><link rel="stylesheet" href="' . get_full_path_to_theme() . '/style.ie6.css" type="text/css" /><![endif]-->' . "\n";
    $output .= '<!--[if IE 7]><link rel="stylesheet" href="' . get_full_path_to_theme() . '/style.ie7.css" type="text/css" /><![endif]-->' . "\n";
    $output .= "</head>\n";
    $output .= '<body' . drupal_attributes($attributes) . ">\n";
    $output .= theme_status_messages();
    $output .= "\n";
    $output .= $content;
    $output .= "\n";
    $output .= '</body>';
    $output .= '</html>';
    return $output;
}
开发者ID:householdsteve,项目名称:lotus-drupal,代码行数:62,代码来源:template.php

示例3: instant_indicia_preprocess_page

function instant_indicia_preprocess_page(&$variables)
{
    // Check path to determine widget pages
    $pathargs = explode('/', drupal_get_path_alias($_GET['q']));
    if ($pathargs[0] == 'external' || !empty($_GET['external']) && $_GET['external'] === 't') {
        // Use template: page__widgets
        $variables['template_file'] = 'page-iframe';
    } elseif ($pathargs[0] == 'popup' || !empty($_GET['popup']) && $_GET['popup'] === 't') {
        // Use template: page__widgets
        $variables['template_file'] = 'page-popup';
    }
    drupal_set_html_head('<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">');
    $variables['head'] = drupal_get_html_head();
}
开发者ID:BirenRathod,项目名称:drupal-6,代码行数:14,代码来源:template.php

示例4: testBasicFeedAddNoTitle

 /**
  * Tests attaching feeds with paths, URLs, and titles.
  */
 function testBasicFeedAddNoTitle()
 {
     $path = $this->randomMachineName(12);
     $external_url = 'http://' . $this->randomMachineName(12) . '/' . $this->randomMachineName(12);
     $fully_qualified_local_url = Url::fromUri('base:' . $this->randomMachineName(12), array('absolute' => TRUE))->toString();
     $path_for_title = $this->randomMachineName(12);
     $external_for_title = 'http://' . $this->randomMachineName(12) . '/' . $this->randomMachineName(12);
     $fully_qualified_for_title = Url::fromUri('base:' . $this->randomMachineName(12), array('absolute' => TRUE))->toString();
     $urls = array('path without title' => array('url' => Url::fromUri('base:' . $path, array('absolute' => TRUE))->toString(), 'title' => ''), 'external URL without title' => array('url' => $external_url, 'title' => ''), 'local URL without title' => array('url' => $fully_qualified_local_url, 'title' => ''), 'path with title' => array('url' => Url::fromUri('base:' . $path_for_title, array('absolute' => TRUE))->toString(), 'title' => $this->randomMachineName(12)), 'external URL with title' => array('url' => $external_for_title, 'title' => $this->randomMachineName(12)), 'local URL with title' => array('url' => $fully_qualified_for_title, 'title' => $this->randomMachineName(12)));
     $build = [];
     foreach ($urls as $feed_info) {
         $build['#attached']['feed'][] = [$feed_info['url'], $feed_info['title']];
     }
     drupal_process_attached($build);
     $this->setRawContent(drupal_get_html_head());
     foreach ($urls as $description => $feed_info) {
         $this->assertPattern($this->urlToRSSLinkPattern($feed_info['url'], $feed_info['title']), format_string('Found correct feed header for %description', array('%description' => $description)));
     }
 }
开发者ID:RealLukeMartin,项目名称:drupal8tester,代码行数:22,代码来源:AddFeedTest.php

示例5: navin_process_maintenance_page

function navin_process_maintenance_page(&$variables)
{
    // Include @font-your-face support
    if (module_exists('fontyourface')) {
        fontyourface_preprocess_page($variables);
        $fonts = (array) $variables['fontyourface'];
        foreach ($fonts as $font) {
            if (module_hook($font->provider, 'preprocess_page')) {
                call_user_func_array($font->provider . '_preprocess_page', array(&$variables));
            }
        }
    }
    // Add theme's maintenance CSS
    drupal_add_css(path_to_theme() . '/css/maintenance.css', array('group' => CSS_THEME, 'weight' => 10));
    // Reset variables
    $variables['head'] = drupal_get_html_head();
    $variables['css'] = drupal_add_css();
    $variables['styles'] = drupal_get_css();
    $variables['scripts'] = drupal_get_js();
}
开发者ID:keylorm,项目名称:manatus,代码行数:20,代码来源:template.php

示例6: t

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php 
print $GLOBALS['language']->language;
?>
" xml:lang="<?php 
print $GLOBALS['language']->language;
?>
">
<head>
  <title><?php 
print t('File Browser');
?>
</title>
  <?php 
print drupal_get_html_head();
print elfinder_browser_css();
print elfinder_browser_js();
?>
</head>
<body class="elfinder">
<div id="elfinder-messages"><?php 
print theme('status_messages');
?>
</div>
<div id="finder"></div>
<?php 
print drupal_get_js('footer');
?>
</body>
</html>
开发者ID:amenyonish,项目名称:trunk,代码行数:31,代码来源:elfinder-page.tpl.php

示例7: omega_template_process_html_override

/**
 * Overrides template_process_html().
 */
function omega_template_process_html_override(&$variables)
{
    // Render page_top and page_bottom into top level variables.
    $variables['page_top'] = drupal_render($variables['page']['page_top']);
    $variables['page_bottom'] = drupal_render($variables['page']['page_bottom']);
    // Place the rendered HTML for the page body into a top level variable.
    $variables['page'] = $variables['page']['#children'];
    $variables['page_bottom'] .= omega_get_js('footer');
    $variables['head'] = drupal_get_html_head();
    $variables['css'] = drupal_add_css();
    $variables['styles'] = drupal_get_css();
    $variables['scripts'] = omega_get_js();
}
开发者ID:Aladjinn,项目名称:upstream,代码行数:16,代码来源:template.php

示例8: phptemplate_maintenance_page

function phptemplate_maintenance_page($content, $messages = TRUE, $partial = FALSE)
{
    drupal_set_header('Content-Type: text/html; charset=utf-8');
    //drupal_set_html_head('<style type="text/css" media="all">@import "'. base_path() .'misc/maintenance.css";</style>');
    drupal_set_html_head('<style type="text/css" media="all">@import "' . base_path() . drupal_get_path('theme', 'newsflash') . '/maintenance.css";</style>');
    drupal_set_html_head('<style type="text/css" media="all">@import "' . base_path() . drupal_get_path('module', 'system') . '/defaults.css";</style>');
    drupal_set_html_head('<style type="text/css" media="all">@import "' . base_path() . drupal_get_path('module', 'system') . '/system.css";</style>');
    //drupal_set_html_head('<style type="text/css" media="all">@import "'. base_path() . drupal_get_path('theme', 'newsflash') .'/style.css";</style>');
    drupal_set_html_head('<link rel="shortcut icon" href="' . base_path() . 'misc/favicon.ico" type="image/x-icon" />');
    $output = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
    $output .= '<html xmlns="http://www.w3.org/1999/xhtml">';
    $output .= '<head>';
    $output .= '<title>Tribute Media</title>';
    $output .= drupal_get_html_head();
    $output .= drupal_get_js();
    $output .= '</head>';
    $output .= '<body>';
    $output .= '<div class="logo"><img src="' . drupal_get_path('theme', 'newsflash') . '/images/tribute_comingsoon.png" id="logo"/></div>';
    //$output .= '<h1 id="title">' . drupal_get_title() . '</h1>';
    if ($messages) {
        $output .= theme('status_messages');
    }
    $output .= "\n<!-- begin content -->\n";
    //$output .= $content;
    $output .= "\n<!-- end content -->\n";
    if (!$partial) {
        $output .= '</body></html>';
    }
    return $output;
}
开发者ID:noslokire,项目名称:Project-206,代码行数:30,代码来源:template.php

示例9: drupal_13584_img_assist_page

function drupal_13584_img_assist_page($content, $attributes = NULL)
{
    $title = drupal_get_title();
    $output = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' . "\n";
    $output .= '<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">' . "\n";
    $output .= "<head>\n";
    $output .= '<title>' . $title . "</title>\n";
    $output .= drupal_get_html_head();
    $output .= drupal_get_js();
    $output .= "\n<script type=\"text/javascript\"><!-- \n";
    $output .= "  if (parent.tinyMCE && parent.tinyMCEPopup && parent.tinyMCEPopup.getParam('popups_css')) {\n";
    $output .= "    document.write('<link href=\"' + parent.tinyMCEPopup.getParam('popups_css') + '\" rel=\"stylesheet\" type=\"text/css\">');\n";
    $output .= "  } else {\n";
    foreach (drupal_add_css() as $media => $type) {
        $paths = array_merge($type['module'], $type['theme']);
        foreach (array_keys($paths) as $path) {
            if (!strstr($path, 'img_assist.css')) {
                $output .= "  document.write('<style type=\"text/css\" media=\"{$media}\">@import \"" . base_path() . $path . "\";<\\/style>');\n";
            }
        }
    }
    $output .= "  }\n";
    $output .= "--></script>\n";
    $path = drupal_get_path('module', 'img_assist') . '/img_assist_popup.css';
    $output .= "<style type=\"text/css\" media=\"all\">@import \"" . base_path() . $path . "\";</style>\n";
    $output .= '<link rel="stylesheet" href="' . get_full_path_to_theme() . '/style.css" type="text/css" />' . "\n";
    $output .= '<!--[if IE 6]><link rel="stylesheet" href="' . get_full_path_to_theme() . '/style.ie6.css" type="text/css" /><![endif]-->' . "\n";
    $output .= '<!--[if IE 7]><link rel="stylesheet" href="' . get_full_path_to_theme() . '/style.ie7.css" type="text/css" /><![endif]-->' . "\n";
    $output .= "</head>\n";
    $output .= '<body' . drupal_attributes($attributes) . ">\n";
    $output .= theme_status_messages();
    $output .= "\n";
    $output .= $content;
    $output .= "\n";
    $output .= '</body>';
    $output .= '</html>';
    return $output;
}
开发者ID:Lanou94,项目名称:intranet,代码行数:38,代码来源:drupal6_theme_methods.php

示例10: drupal_add_feed

" xml:lang="<?php 
print $language->language;
?>
" dir="<?php 
print $language->dir;
?>
">
<head>
<title><?php 
print $head_title;
?>
</title>
<?php 
drupal_add_feed('http://feeds.feedburner.com/pandionblog', t('Pandion Blog'));
drupal_add_feed('http://twitter.com/statuses/user_timeline/pandion.rss', t('Pandion Tweets'));
$head = drupal_get_html_head();
print $head;
print $styles;
$js = drupal_add_js('misc/jquery.js', 'core', 'header');
print drupal_get_js('header', $js);
?>
<!--[if lt IE 7]>
	<script type="text/javascript" src="js/unitpngfix.js"></script>
<![endif]--> 
</head>
<body>

<?php 
// print($site_name)
// print($site_title)
// print($site_slogan)
开发者ID:pandion,项目名称:pandion-drupal-theme,代码行数:31,代码来源:page-front.tpl.php

示例11: processAttachments

 /**
  * {@inheritdoc}
  */
 public function processAttachments(AttachmentsInterface $response)
 {
     // @todo Convert to assertion once https://www.drupal.org/node/2408013 lands
     if (!$response instanceof HtmlResponse) {
         throw new \InvalidArgumentException('\\Drupal\\Core\\Render\\HtmlResponse instance expected.');
     }
     $attached = $response->getAttachments();
     // Get the placeholders from attached and then remove them.
     $placeholders = $attached['html_response_placeholders'];
     unset($attached['html_response_placeholders']);
     $variables = $this->processAssetLibraries($attached, $placeholders);
     // Handle all non-asset attachments. This populates drupal_get_html_head()
     // and drupal_get_http_header().
     $all_attached = ['#attached' => $attached];
     drupal_process_attached($all_attached);
     // Get HTML head elements - if present.
     if (isset($placeholders['head'])) {
         $variables['head'] = drupal_get_html_head(FALSE);
     }
     // Now replace the placeholders in the response content with the real data.
     $this->renderPlaceholders($response, $placeholders, $variables);
     // Finally set the headers on the response.
     $headers = drupal_get_http_header();
     $this->setHeaders($response, $headers);
     return $response;
 }
开发者ID:nsp15,项目名称:Drupal8,代码行数:29,代码来源:HtmlResponseAttachmentsProcessor.php

示例12: processAttachments

 /**
  * {@inheritdoc}
  */
 public function processAttachments(AttachmentsInterface $response)
 {
     // @todo Convert to assertion once https://www.drupal.org/node/2408013 lands
     if (!$response instanceof HtmlResponse) {
         throw new \InvalidArgumentException('\\Drupal\\Core\\Render\\HtmlResponse instance expected.');
     }
     // First, render the actual placeholders; this may cause additional
     // attachments to be added to the response, which the attachment
     // placeholders rendered by renderHtmlResponseAttachmentPlaceholders() will
     // need to include.
     //
     // @todo Exceptions should not be used for code flow control. However, the
     //   Form API does not integrate with the HTTP Kernel based architecture of
     //   Drupal 8. In order to resolve this issue properly it is necessary to
     //   completely separate form submission from rendering.
     //   @see https://www.drupal.org/node/2367555
     try {
         $response = $this->renderPlaceholders($response);
     } catch (EnforcedResponseException $e) {
         return $e->getResponse();
     }
     $attached = $response->getAttachments();
     // Get the placeholders from attached and then remove them.
     $attachment_placeholders = $attached['html_response_attachment_placeholders'];
     unset($attached['html_response_attachment_placeholders']);
     $variables = $this->processAssetLibraries($attached, $attachment_placeholders);
     // Handle all non-asset attachments. This populates drupal_get_html_head().
     $all_attached = ['#attached' => $attached];
     drupal_process_attached($all_attached);
     // Get HTML head elements - if present.
     if (isset($attachment_placeholders['head'])) {
         $variables['head'] = drupal_get_html_head(FALSE);
     }
     // Now replace the attachment placeholders.
     $this->renderHtmlResponseAttachmentPlaceholders($response, $attachment_placeholders, $variables);
     // Finally set the headers on the response if any bubbled.
     if (!empty($attached['http_header'])) {
         $this->setHeaders($response, $attached['http_header']);
     }
     return $response;
 }
开发者ID:ravindrasingh22,项目名称:Drupal-8-rc,代码行数:44,代码来源:HtmlResponseAttachmentsProcessor.php

示例13: test_foundation_utf8_charset

 function test_foundation_utf8_charset()
 {
     $headers = drupal_get_html_head();
     $this->assertContains('<meta charset="utf-8" />', $headers, "utf-8 charset not found");
 }
开发者ID:nyl-auster,项目名称:meghann,代码行数:5,代码来源:foundation_Test.php

示例14: leggy_preprocess

/**
 ***********************************************************************************
 * Preprocess page templates
 */
function leggy_preprocess(&$vars, $hook)
{
    if ($hook == 'page') {
        // Add a 'page-node' class if this is a node that is rendered as page
        if (isset($vars['node']) && $vars['node']->type) {
            $vars['body_classes'] .= ' page-node';
        }
        // remove 'Notification settings' tab from user page
        $array_q = explode('/', $_REQUEST['q']);
        if ($array_q[0] == 'user') {
            _leggy_removetab('Notification settings', $vars);
            _leggy_removetab('Track', $vars);
        }
        // Add Feed icon
        if ($array_q[0] == 'geek') {
            drupal_add_feed(url('geek/feed', array('absolute' => TRUE)), 'VictoriaC RSS | Geek');
        } elseif ($array_q[0] == 'life') {
            drupal_add_feed(url('life/feed', array('absolute' => TRUE)), 'VictoriaC RSS | Life');
        } elseif ($array_q[0] == 'today') {
            drupal_add_feed(url('today/feed', array('absolute' => TRUE)), 'VictoriaC RSS | Today');
        } elseif ($array_q[0] == '漢字感じ') {
            drupal_add_feed(url('漢字感じ/feed', array('absolute' => TRUE)), 'VictoriaC RSS | 漢字感じ');
        } else {
            drupal_add_feed(url('feed', array('absolute' => TRUE)), 'VictoriaC RSS | All');
        }
        $vars['head'] = drupal_get_html_head();
        // Refresh $head variable
        $vars['feed_icons'] = drupal_get_feeds();
        // Refresh $feed_icons variable
    }
    // Replace funny kanji characters in section name
    $vars['body_classes'] = str_replace('-e6-bc-a2-e5-ad-97-e6-84-9f-e3-81-98', 'kanjikanji', $vars['body_classes']);
}
开发者ID:victoriachan,项目名称:victoriac-blog,代码行数:37,代码来源:template.php

示例15: processAttachments

 /**
  * {@inheritdoc}
  */
 public function processAttachments(AttachmentsInterface $response)
 {
     // @todo Convert to assertion once https://www.drupal.org/node/2408013 lands
     if (!$response instanceof HtmlResponse) {
         throw new \InvalidArgumentException('\\Drupal\\Core\\Render\\HtmlResponse instance expected.');
     }
     // First, render the actual placeholders; this may cause additional
     // attachments to be added to the response, which the attachment
     // placeholders rendered by renderHtmlResponseAttachmentPlaceholders() will
     // need to include.
     $response = $this->renderPlaceholders($response);
     $attached = $response->getAttachments();
     // Get the placeholders from attached and then remove them.
     $attachment_placeholders = $attached['html_response_attachment_placeholders'];
     unset($attached['html_response_attachment_placeholders']);
     $variables = $this->processAssetLibraries($attached, $attachment_placeholders);
     // Handle all non-asset attachments. This populates drupal_get_html_head().
     $all_attached = ['#attached' => $attached];
     drupal_process_attached($all_attached);
     // Get HTML head elements - if present.
     if (isset($attachment_placeholders['head'])) {
         $variables['head'] = drupal_get_html_head(FALSE);
     }
     // Now replace the attachment placeholders.
     $this->renderHtmlResponseAttachmentPlaceholders($response, $attachment_placeholders, $variables);
     // Finally set the headers on the response if any bubbled.
     if (!empty($attached['http_header'])) {
         $this->setHeaders($response, $attached['http_header']);
     }
     return $response;
 }
开发者ID:scratch,项目名称:gai,代码行数:34,代码来源:HtmlResponseAttachmentsProcessor.php


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