示例#1
0
文件: template.php 项目: nievo/nub
/**
 * Implementation of preprocess_page().
 */
function nub_core_preprocess_page(&$vars)
{
    $html_attr = array();
    $html_attr['lang'] = $vars['language']->language;
    $html_attr['dir'] = $vars['language']->dir;
    $vars['html_attr'] = array_filter($html_attr);
    $body_attr = array();
    $body_attr['class'] = $vars['body_classes'];
    $vars['body_attr'] = array_filter($body_attr);
    // Theme primary and secondary menu.
    $vars['primary_links'] = !empty($vars['primary_links']) ? menu_tree(variable_get('menu_primary_links_source', 'primary-links')) : "";
    $vars['secondary_links'] = !empty($vars['secondary_links']) ? theme('links', $vars['secondary_links'], array('class' => 'menu')) : "";
    // Split primary and secondary local tasks
    $vars['tabs_primary'] = theme('menu_local_tasks', 'primary');
    $vars['tabs_secondary'] = theme('menu_local_tasks', 'secondary');
    // Branding
    $logo_path = ltrim($vars['logo'], '/');
    $vars['logo_linked'] = file_exists($logo_path) ? l(theme('image', $logo_path, $vars['site_name'] . ' logo'), '<front>', array('html' => TRUE, 'attributes' => array('class' => 'site-logo', 'title' => 'Back to home'))) : '';
    $vars['site_name_linked'] = l($vars['site_name'], '<front>', array('attributes' => array('title' => 'Back to home')));
    // Skip navigation links (508).
    $vars['skip_nav'] = '<a id="skip-nav" class="anchorLink" href="#main">' . t('Skip navigation') . '</a>';
    // Back to top.
    $vars['back_to_top'] = '<a id="back-to-top" class="anchorLink" href="#header">' . t('&uarr; Back to top') . '</a>';
    // Copyright text
    $vars['copyright'] = "&copy; " . date("Y") . " " . $vars['site_name'] . '.';
    // Remove duplicate content-type header -- see http://drupal.org/node/451304
    $vars['head'] = drupal_set_html_head();
}
示例#2
0
 /**
  * UI helper methods
  */
 public function GetLink($link_key, $token, $returnURL, $is_iframe = FALSE)
 {
     $links = array('profile_view' => 'Profile/ViewProfile.aspx', 'profile_edit' => 'Profile/EditProfile.aspx', 'profile_register' => 'Profile/CreateNewUser.aspx', 'profile_password' => 'LogIn/RetrievePassword.aspx', 'iframe_js' => 'javascripts/iframe.js');
     if (array_key_exists($link_key, $links)) {
         $format = $this->ui_root . $links[$link_key];
         $query = $params = array();
         if (!empty($token)) {
             $query[] = 'Token=%s';
             $params[] = $token;
         }
         if (!empty($returnURL)) {
             $query[] = 'ReturnPage=%s';
             $params[] = $returnURL;
         }
         if (!empty($query)) {
             $format .= '?' . implode('&', $query);
         }
         $path = vsprintf($format, $params);
         if ($is_iframe) {
             drupal_set_html_head('<script type="text/javascript" src="' . $this->ui_root . $links['iframe_js'] . '"></script>');
             return '<iframe src="' . $path . '" isgwebsite="1" name="ISGwebContainer" id="ISGwebContainer" marginwidth="1" marginheight="0" frameborder="0" vspace="0" hspace="0" scrolling="no" style="width:100%; height:800px;"></iframe>';
         }
         return $path;
     }
     return NULL;
 }
示例#3
0
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();
}
示例#4
0
 public function addJavascriptToHeader()
 {
     $js = '<script type="text/javascript" src="https://www.google.com/jsapi"></script>';
     $js .= '<script>
   google.load("visualization", "1", {packages:["corechart"]});
   google.setOnLoadCallback(drawChart);
   function drawChart() {
     var data = ' . json_encode($this->data) . ';
     var titles = ' . json_encode($this->titles) . ';
     var i;
     for ( i in data ) {
       var options = {
         title: titles[i]
       };
       var chart = new google.visualization.LineChart(document.getElementById(i));
       var d = google.visualization.arrayToDataTable(data[i]);
       chart.draw(d, options);         
     }
   }  
   ';
     $js .= '</script>';
     drupal_set_html_head($js);
 }
示例#5
0
<?php

$my_rss_data = '<link rel="alternate" type="application/rss+xml" title="RSS - ' . $profile->profile_title . '" href="/blog/' . $profile->uid . '/feed" />';
drupal_set_html_head($my_rss_data);
global $user;
?>

<h1>
<?php 
if ($profile->profile_title) {
    drupal_set_title($profile->profile_title);
} else {
    $profile->profile_title = $profile->name . '\'s paddling profile';
}
print $profile->profile_title;
?>

</h1>

<?php 
if ($profile->profile_tagline) {
    print '<h3>' . $profile->profile_tagline . '</h3>';
}
?>

<?php 
if ($profile->uid == $user->uid) {
    ?>
<p>(<em><a href="/node/add/blog" title="Write a blog entry!">Add a blog post</a></em>)</p>
    <?php 
}
		<?php 
    //}
    ?>
	  </ul>
	  <?php 
}
?>
	  <div id="details"><div class="tabs-in-wrapper">
      <?php 
print $node->content['body']['#value'];
?>
          <?php 
//dsm($node);
if ($appid = variable_get('facebook_comments_appid', '733615273329934')) {
    $element = '<meta property="fb:app_id" content="' . $appid . '" />';
    drupal_set_html_head($element);
}
global $base_url;
$fb_url = $base_url . '/' . drupal_get_path_alias($_GET['q']);
?>
           <div id="fb-root"></div>
          <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) return;
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.4";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'facebook-jssdk'));</script>
        <div class="fb-comments" data-href="<?php 
echo $fb_url;
?>
示例#7
0
<?php

/*
* Initialize theme settings
*/
if (is_null(theme_get_setting('mies_unit'))) {
    // <-- change this line
    global $theme_key;
    // Save default theme settings
    $defaults = array('mies_collumns_number' => 8, 'mies_collumn_width' => 112, 'mies_interspace_width' => 10, 'mies_unit' => "px");
    variable_set(str_replace('/', '_', 'theme_' . $theme_key . '_settings'), array_merge($defaults, theme_get_settings($theme_key)));
    // Force refresh of Drupal internals
    theme_get_setting('', TRUE);
}
drupal_set_html_head('  ' . mies_display_grid_css());
//drupal_set_html_head('  '.mies_display_grid());
//drupal_add_css(drupal_get_path('theme', 'mies')."/yaml/core.css", 'theme');
//drupal_rebuild_theme_registry();
function mies_theme()
{
    return array('links' => array('arguments' => array('links' => NULL, 'attributes' => array('class' => 'links'))), 'comment_block' => array('arguments' => ''), 'comment_wrapper' => array('arguments' => array('content' => NULL, 'node' => NULL)), 'recent_bookmarks_block' => array('arguments' => array('items' => array())));
}
function mies_links($links, $attributes = array('class' => 'links'))
{
    global $teaser;
    //dprint_r($links);
    // Unset the "node read more" link.
    if (isset($links["node_read_more"])) {
        $readmore = $links["node_read_more"];
        unset($links["node_read_more"]);
        //array_push($links,$readmore);
示例#8
0
$video = $locum->csv_parser($locum_config['format_groups']['video']);
$music = $locum->csv_parser($locum_config['format_groups']['music']);
if (in_array($item['mat_code'], $books)) {
    drupal_set_html_head('<meta property="og:type" content="book" />');
} else {
    if (in_array($item['mat_code'], $music)) {
        drupal_set_html_head('<meta property="og:type" content="album" />');
    } else {
        if (in_array($item['mat_code'], $video)) {
            if (stristr('DVD TV', $item['callnum'])) {
                drupal_set_html_head('<meta property="og:type" content="tv_show" />');
            } else {
                drupal_set_html_head('<meta property="og:type" content="movie" />');
            }
        } else {
            drupal_set_html_head('<meta property="og:type" content="product" />');
        }
    }
}
$useriplabels = ipmap_labels();
if ($item['trailers']) {
    if ($item['trailers'][0]['type'] == 'trailer') {
        $trailer_url = $item['trailers'][0]['url'];
        if ($item['trailers'][0]['image']) {
            $trailer_image = $item['trailers'][0]['image'];
        }
        if ($item['trailers'][0]['cached'] && in_array('internal', $useriplabels)) {
            $trailer_url = 'http://media.aadl.org/trailers/' . $item['bnum'] . '.mp4';
        }
    }
}
/**
 * Perform updates for the non-JS version and return the status page.
 */
function update_progress_page_nojs()
{
    drupal_set_title('Updating');
    $new_op = 'do_update';
    if ($_SERVER['REQUEST_METHOD'] == 'GET') {
        // Error handling: if PHP dies, it will output whatever is in the output
        // buffer, followed by the error message.
        ob_start();
        $fallback = '<p class="error">An unrecoverable error has occurred. You can find the error message below. It is advised to copy it to the clipboard for reference. Please continue to the <a href="cvs_to_versioncontrol_project_update.php?op=error">update summary</a>.</p>';
        print theme('maintenance_page', $fallback, FALSE, TRUE);
        list($percentage, $message) = update_do_updates();
        if ($percentage == 100) {
            $new_op = 'finished';
        }
        // Updates successful; remove fallback
        ob_end_clean();
    } else {
        // Abort the update if the necessary modules aren't installed.
        if (!module_exists('versioncontrol') || !module_exists('versioncontrol_project') || !module_exists('cvs')) {
            print update_finished_page(FALSE);
            return NULL;
        }
        // This is the first page so return some output immediately.
        $percentage = 0;
        $message = 'Starting updates';
    }
    drupal_set_html_head('<meta http-equiv="Refresh" content="0; URL=cvs_to_versioncontrol_project_update.php?op=' . $new_op . '">');
    $output = theme('progress_bar', $percentage, $message);
    $output .= '<p>Updating your site will take a few seconds.</p>';
    // Note: do not output drupal_set_message()s until the summary page.
    print theme('maintenance_page', $output, FALSE);
    return NULL;
}
示例#10
0
/**
 * Override default geomap theming
 * Surround with <div> for proper boxing
 * Use modified jquery
 *
 * The Javascript will use this div to render tha map. 
 * This will be empty if no geo microformats exist on the current page.
 * 
 * @param $delta If more than one map needs to be displayed add an identifier
 * @ingroup themeable
 * @return Map div
 */
function phptemplate_geomap($delta = '')
{
    if ($google_key = variable_get('googlemaps_key', '')) {
        drupal_set_html_head('<script type="text/javascript" src="http://maps.google.com/maps?file=api&t=h&z=7&amp;v=2&amp;key=' . $google_key . '" ></script>');
        drupal_add_js(path_to_theme() . '/jquery.nabuur.googlemaps.js', 'theme');
        drupal_add_css(drupal_get_path('module', 'geomap') . '/geomap.css', 'module');
        //TODO: Allow a different ID one day (use delta)
        $mapid = 'map';
        $output .= '<div class="map-box"><div id="' . $mapid . '" class="googlemap googlemap-' . $delta . '"></div></div>';
        $GLOBALS['geomap'] = true;
    } else {
        if (user_access('administer site configuration')) {
            $output = l(t('No geomap googleapi key'), 'admin/settings/geomap');
        }
    }
    return $output;
}
/**
 * Perform imports for the non-JS version and return the status page.
 */
function import_progress_page_nojs()
{
    drupal_set_title('Importing');
    $new_op = 'do_import_nojs';
    if ($_SERVER['REQUEST_METHOD'] == 'GET') {
        // Error handling: if PHP dies, it will output whatever is in the output
        // buffer, followed by the error message.
        ob_start();
        $fallback = '<p class="error">An unrecoverable error has occurred. You can find the error message below. It is advised to copy it to the clipboard for reference. Please continue to the <a href="merci_import.php?op=error">import summary</a>.</p>';
        print theme('maintenance_page', $fallback, FALSE, TRUE);
        list($percentage, $message) = import_do_imports();
        if ($percentage == 100) {
            $new_op = 'finished';
        }
        // Imports successful; remove fallback
        ob_end_clean();
    } else {
        // This is the first page so return some output immediately.
        $percentage = 0;
        $message = 'Starting import';
    }
    drupal_set_html_head('<meta http-equiv="Refresh" content="0; URL=merci_import.php?op=' . $new_op . '">');
    $output = theme('progress_bar', $percentage, $message);
    $output .= '<p>Importing the data will take a few seconds.</p>';
    // Note: do not output drupal_set_message()s until the summary page.
    print theme('maintenance_page', $output, FALSE);
    return NULL;
}
示例#12
0
<?php

/**
**  moo fx pack
**/
drupal_add_js(path_to_theme() . '/scripts/prototype.lite.js');
drupal_add_js(path_to_theme() . '/scripts/moo.fx.js');
drupal_add_js(path_to_theme() . '/scripts/moo.fx.pack.js');
drupal_add_js(path_to_theme() . '/scripts/site.js');
drupal_add_js(path_to_theme() . '/scripts/tooltip.js');
drupal_set_html_head('<!--[if lt IE 7]>
<script defer type="text/javascript" src="' . base_path() . path_to_theme() . '/scripts/png.js"></script>
<style type="text/css" media="all">@import "' . base_path() . path_to_theme() . '/ie.css";</style>
<![endif]-->');
/**
**  set some styles
**/
drupal_set_html_head('<style type="text/css" media="all">@import "' . base_path() . path_to_theme() . '/style.css";</style>');
<?php

/**
 * This is a bunch of custom form code to show a much prettier story create form within the group
 * Extensive use of suggestions at:
 *   http://drupal.org/node/601646
 **/
// remove some other buttons
unset($form['buttons']['preview']);
// include the libraries for geocoding from the single address text input field
drupal_set_html_head('<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>');
jquery_ui_add(array("jquery.ui.core", "jquery.ui.widget", "jquery.ui.position", "jquery.ui.autocomplete"));
drupal_add_js(drupal_get_path('theme', 'cdh_juarez') . '/js/location-autocomplete.js');
?>
<div class="row cdhj-submit-form">


    <div class="sixcol">
    
        <?php 
print drupal_render($form['title']);
?>
        
        <?php 
print drupal_render($form['body_field']);
?>

        <div class="form-item">
            <?php 
print drupal_render($form['field_image']);
?>
示例#14
0
function html5_base_preprocess_page(&$vars, $hook)
{
    // charrset
    // Set charset to html5 method
    $vars['head'] = str_replace('<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />', '<meta charset="utf-8" />', $vars['head']);
    // Modernizr
    // Add "no-js" class to <html> if Modernizr is included
    if (theme_get_setting('html5_base_modernizr')) {
        $vars['modernizr_head'] = 'class="no-js"';
    }
    // Always force latest IE rendering engine (even in intranet) & Chrome Frame
    if (theme_get_setting('html5_base_include_chrome_frame')) {
        $vars['head'] = drupal_set_html_head('<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">');
    }
    // dsm($vars);
    // Mobile Viewport Fix
    if (theme_get_setting('html5_base_use_mobile_viewport') && strlen(theme_get_setting('html5_base_mobile_viewport')) > 1) {
        $vars['head'] = drupal_set_html_head('<meta name="viewport" content="' . theme_get_setting('html5_base_mobile_viewport') . '">');
    }
    // Don't display empty help from node_help().
    if ($vars['help'] == "<div class=\"help\"><p></p>\n</div>") {
        $vars['help'] = '';
    }
    // Classes for body element. Allows advanced theming based on context
    // (home page, node of certain type, etc.)
    $body_classes = explode(' ', $vars['body_classes']);
    if (user_access('administer blocks')) {
        $body_classes[] = 'admin';
    }
    if (theme_get_setting('html5_base_wireframe')) {
        $body_classes[] = 'with-wireframes';
        // Optionally add the wireframes style.
    }
    if (!empty($vars['primary_links']) or !empty($vars['secondary_links'])) {
        $body_classes[] = 'with-navigation';
    }
    if (!empty($vars['secondary_links'])) {
        $body_classes[] = 'with-secondary';
    }
    if (module_exists('taxonomy') && isset($vars['node']) && $vars['node']->nid) {
        foreach (taxonomy_node_get_terms($vars['node']) as $term) {
            $body_classes[] = 'tax-' . eregi_replace('[^a-z0-9]', '-', $term->name);
        }
    }
    if (!$vars['is_front']) {
        // Add unique classes for each page and website section
        $path = drupal_get_path_alias($_GET['q']);
        list($section, ) = explode('/', $path, 2);
        $body_classes[] = html5_base_id_safe('page-' . $path);
        $body_classes[] = html5_base_id_safe('section-' . $section);
        if (arg(0) == 'node') {
            if (arg(1) == 'add') {
                if ($section == 'node') {
                    array_pop($body_classes);
                    // Remove 'section-node'
                }
                $body_classes[] = 'section-node-add';
                // Add 'section-node-add'
            } elseif (is_numeric(arg(1)) && (arg(2) == 'edit' || arg(2) == 'delete')) {
                if ($section == 'node') {
                    array_pop($body_classes);
                    // Remove 'section-node'
                }
                $body_classes[] = 'section-node-' . arg(2);
                // Add 'section-node-edit' or 'section-node-delete'
            }
        }
    }
    $vars['layout'] = 'none';
    if (!empty($vars['sidebar_first'])) {
        $vars['layout'] = 'first';
    }
    if (!empty($vars['sidebar_second'])) {
        $vars['layout'] = $vars['layout'] == 'first' ? 'both' : 'second';
    }
    // If the layout is 'none', then template_preprocess_page() will already have
    // set a 'no-sidebars' class since it won't find a 'left' or 'right' sidebar.
    if ($vars['layout'] != 'none') {
        // Remove the incorrect 'no-sidebars' class.
        if ($index = array_search('no-sidebars', $body_classes)) {
            unset($body_classes[$index]);
        }
        // Set the proper layout body classes.
        if ($vars['layout'] == 'both') {
            $body_classes[] = 'two-sidebars';
        } else {
            $body_classes[] = 'one-sidebar';
            $body_classes[] = 'sidebar-' . $vars['layout'];
        }
    }
    /*  // Check what the user's browser is and add it as a body class
          // DEACTIVATED - Only works if page cache is deactivated
          $user_agent = $_SERVER['HTTP_USER_AGENT'];
          if($user_agent) {
            if (strpos($user_agent, 'MSIE')) {
              $body_classes[] = 'browser-ie';
            } else if (strpos($user_agent, 'MSIE 6.0')) {
              $body_classes[] = 'browser-ie6';
            } else if (strpos($user_agent, 'MSIE 7.0')) {
              $body_classes[] = 'browser-ie7';
            } else if (strpos($user_agent, 'MSIE 8.0')) {
              $body_classes[] = 'browser-ie8'; 
            } else if (strpos($user_agent, 'Firefox/2')) {
              $body_classes[] = 'browser-firefox2';
            } else if (strpos($user_agent, 'Firefox/3')) {
              $body_classes[] = 'browser-firefox3';
            }else if (strpos($user_agent, 'Safari')) {
              $body_classes[] = 'browser-safari';
            } else if (strpos($user_agent, 'Opera')) {
              $body_classes[] = 'browser-opera';
            }
          }
      
      /* Add template suggestions based on content type
       * You can use a different page template depending on the
       * content type or the node ID
       * For example, if you wish to have a different page template
       * for the story content type, just create a page template called
       * page-type-story.tpl.php
       * For a specific node, use the node ID in the name of the page template
       * like this : page-node-22.tpl.php (if the node ID is 22)
       */
    if (isset($vars['node']) && $vars['node']->type != "") {
        $vars['template_files'][] = "page-type-" . $vars['node']->type;
    }
    $vars['body_classes'] = implode(' ', $body_classes);
    // Concatenate with spaces
}
示例#15
0
/**
 * guifi_graph_detail
 * outputs a page with node detailed graphs
 */
function guifi_graph_detail()
{
    $type = $_GET['type'];
    if (isset($_GET['device'])) {
        $device_id = $_GET['device'];
    } else {
        if (isset($_GET['radio'])) {
            $device_id = $_GET['radio'];
        }
    }
    if (isset($device_id)) {
        $query = db_query("SELECT r.id, r.nick, n.title, r.nid, l.zone_id " . "FROM {guifi_devices} r, {node} n, {guifi_location} l " . "WHERE r.id=%d " . "  AND n.nid=r.nid " . "  AND n.nid = l.id", $device_id);
        $radio = db_fetch_object($query);
        $zid = $radio->zone_id;
    }
    if ($type == 'supernode') {
        $node = node_load(array('nid' => $_GET['node']));
        if ($node->graph_server == -1) {
            $rows[] = array(t('This node has the graphs disabled.'));
            return array_merge($rows);
        }
        if (!empty($node->graph_server)) {
            $gs = node_load(array('nid' => $node->graph_server));
        } else {
            $gs = node_load(array('nid' => guifi_graphs_get_server($node->id, 'node')));
        }
    } else {
        if ($radio->graph_server == -1) {
            $rows[] = array(t('This device has the graphs disabled.'));
            return array_merge($rows);
        }
        if (!empty($radio->graph_server)) {
            $gs = node_load(array('nid' => $radio->graph_server));
        } else {
            $gs = node_load(array('nid' => guifi_graphs_get_server($radio->id, 'device')));
        }
    }
    $help = t('Here you have a detailed view of the available information for several periods of time (daily, weekly, monthly and yearly). You can obtain a detailed graph for a given period of time by entering the period in the boxes below.');
    $args = array('type' => $type, 'node' => $_GET['node'], 'device' => $device_id);
    if (isset($_GET['direction'])) {
        $args['direction'] = $_GET['direction'];
    }
    switch ($type) {
        case 'clients':
            $title = '<a href="' . base_path() . 'guifi/device/' . $radio->id . '">' . $radio->nick . '</a> ' . t('at') . ' ' . '<a href=' . base_path() . 'node/' . $radio->nid . '>' . $radio->title . '</a>';
            $help .= '<br />' . t('The clients graph displays the top clients by transit.');
            break;
        case 'supernode':
            $zid = $node->zone_id;
            $title = '<a href=' . base_path() . 'node/' . $_GET['node'] . '>' . $node->title . '</a>';
            $help .= '<br />' . t('Supernode graph displays the transit of each radio.');
            break;
        case 'radio':
        case 'device':
            $help = '<br />' . t('The radio graph show in &#038; out transit.');
        case 'pings':
            if ($type != 'radio') {
                $help = '<br />' . t('The ping graph displays the latency and availability. High latency usually means bad connection. Yellow means % of failed pings, could be some yellow on the graphs, but must not reach value of 100, if the value reaches 100, that means that the radio is offline.');
            }
            $title = $radio->nick . ' ' . t('at') . ' ' . '<a href=' . base_path() . 'node/' . $radio->nid . '>' . $radio->title . '</a>';
            break;
    }
    $secs_day = 60 * 60 * 24;
    drupal_set_breadcrumb(guifi_zone_ariadna($zid));
    $output = '<div id="guifi">';
    //  $rows[] = array(t('enter a timeframe to graph a customized period'));
    $output .= '<h3>' . $type . '</h3>' . $help;
    switch ($type) {
    }
    if (isset($_POST['date1'])) {
        $date1 = $_POST['date1'];
    } else {
        $date1 = date('d-m-Y H:i', time() - 60 * 60 * 2);
    }
    if (isset($_POST['date2'])) {
        $date2 = $_POST['date2'];
    } else {
        $date2 = date('d-m-Y H:i', time() - 300);
    }
    $str = '<form name="form_timespan_selector" method="post"><strong>&nbsp;' . t('From:');
    $str .= '&nbsp;</strong><input type="text" name="date1" id=\'date1\' size=\'14\' value="' . $date1 . '">&nbsp;<input type="image"
src="' . base_path() . drupal_get_path('module', 'guifi') . '/contrib/calendar.gif" alt="Start date selector" onclick="return showCalendar(\'date1\');">&nbsp;';
    $str .= '<strong>' . t('To:') . '&nbsp;</strong> <input type="text" name="date2" id=\'date2\' size="14" value="' . $date2 . '"> &nbsp;';
    $str .= '<input type="image" src="' . base_path() . drupal_get_path('module', 'guifi') . '/contrib/calendar.gif" alt="End date selector" align="absmiddle" onclick="return showCalendar(\'date2\');"> &nbsp;&nbsp;';
    $str .= '<input type="submit" name="button_refresh" action="submit" value="refresh">';
    $rows[] = array($str);
    if (isset($_POST['date1'])) {
        list($day, $month, $year, $hour, $min) = sscanf($_POST['date1'], '%d-%d-%d %d:%d');
        $start = mktime($hour, $min, 0, $month, $day, $year);
        list($day, $month, $year, $hour, $min) = sscanf($_POST['date2'], '%d-%d-%d %d:%d');
        $end = mktime($hour, $min, 0, $month, $day, $year);
        $rows[] = array(t('customized graph'));
        $rows[] = array('<img src="' . guifi_cnml_call_service($gs->var['url'], 'graph', $args, sprintf('start=%d&end=%d">', $start, $end)));
    }
    $rows[] = array(t('day'));
    $rows[] = array('<img src="' . guifi_cnml_call_service($gs->var['url'], 'graph', $args, sprintf('start=-%d&end=%d">', $secs_day, -300)));
    $rows[] = array(t('week'));
    $rows[] = array('<img src="' . guifi_cnml_call_service($gs->var['url'], 'graph', $args, sprintf('start=-%d&end=%d">', $secs_day * 7, -300)));
    $rows[] = array(t('month'));
    $rows[] = array('<img src="' . guifi_cnml_call_service($gs->var['url'], 'graph', $args, sprintf('start=-%d&end=%d">', $secs_day * 31, -300)));
    $rows[] = array(t('year'));
    $rows[] = array('<img src="' . guifi_cnml_call_service($gs->var['url'], 'graph', $args, sprintf('start=-%d&end=%d">', $secs_day * 365, -300)));
    $output .= theme('table', NULL, array_merge($rows));
    $output .= "</div>" . _guifi_script_calendar();
    drupal_set_html_head('<script type="text/javascript" src="' . base_path() . drupal_get_path('module', 'guifi') . '/contrib/calendar.js"></script> <script type="text/javascript" src="' . base_path() . drupal_get_path('module', 'guifi') . '/contrib/lang/calendar-ca.js"></script></script> <script type="text/javascript" src="' . base_path() . drupal_get_path('module', 'guifi') . '/contrib/calendar-setup.js"></script>');
    drupal_set_title(t('graph details for') . ' ' . $title);
    return print theme('page', $output, t('graph details for') . ' ' . $title);
}
示例#16
0
function guifi_gmap_key()
{
    drupal_add_js(drupal_get_path('module', 'guifi') . '/js/wms-gs-2_0_0.js', 'module');
    drupal_set_html_head('<script src="//maps.googleapis.com/maps/api/js?sensor=false&amp;libraries=places' . '" type="text/javascript"></script>');
    return TRUE;
}
示例#17
0
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;
}
示例#18
0
<?php

drupal_set_html_head('<style type="text/css" media="all">@import "/' . path_to_theme() . '/node-poll.css";</style>');
?>
 

 <?php 
if ($page == 0) {
    ?>
	 <div class="nodePreview<?php 
    print $sticky ? " sticky" : "";
    ?>
">
	  <?php 
    if ($title != "") {
        ?>
	  
	  <h2><div class="cornerR_yellow"></div>
	  
	  <a href="<?php 
        print $node_url;
        ?>
" title="<?php 
        print $title;
        ?>
">
	  <?php 
        print $title;
        ?>
</a>
	  </h2>
示例#19
0
 *
 * @see template_preprocess()
 * @see template_preprocess_page()
 */
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru" lang="ru">

<head>
  <?php 
print $head;
?>
  <title>Neformat.com.ua - Музыкальный информационный ресурс</title>
  <?php 
drupal_set_html_head(drupal_add_css(drupal_get_path('theme', 'neformat') . '/neformat_index.css', 'theme'));
print $styles;
print '<link type="text/css" rel="stylesheet" media="all" href="/sites/all/themes/neformat/neformat_index.css?I" />';
print $scripts;
?>
  <!--[if lte IE 6]>
    <link type="text/css" rel="stylesheet" media="all" href="<?php 
print $directory;
?>
/ie6.css" />
    <script src="<?php 
print $directory;
?>
/js/DD_belatedPNG_0.0.8a-min.js"></script>
    <script>
      DD_belatedPNG.fix('#top-menu, #top-menu .tl, #top-menu .tr, .corners-bottom .l, .corners-bottom .r');
示例#20
0
/**
 * Adds a print stylesheet to the page's $head variable.
 *
 * This is a work-around for a serious bug in IE5 in which it loads print
 * stylesheets for screen display when using an @import method, Drupal's default
 * method when using drupal_add_css().
 *
 * @param $url
 *   The URL of the print stylesheet
 * @return
 *   All the rendered links for the $head variable
 */
function zen_add_print_css($url)
{
    global $base_path;
    return drupal_set_html_head('<link' . drupal_attributes(array('rel' => 'stylesheet', 'href' => $base_path . $url, 'type' => 'text/css', 'media' => 'print')) . " />\n");
}
 /**
  * Append a string to the head of the html file
  *
  * @param string $head the new string to be appended
  *
  * @return void
  * @access public
  */
 function addHTMLHead($head)
 {
     drupal_set_html_head($head);
 }
示例#22
0
    });
  }
});
END;
drupal_add_js($javascript, 'inline', 'footer', false, false);
/* XXX add rss feed to home page. this is a workaround.  */
if (function_exists('_get_bucket')) {
    switch (_get_bucket()) {
        case 'home':
        case 'news':
            $_rss_feed = '<link rel="alternate" type="application/rss+xml" title="UPEI Media Releases" href="http://www.upei.ca/news/media/feed" />';
            if (function_exists('drupal_add_html_head')) {
                drupal_add_html_head($_rss_feed);
                // drupal 7
            } else {
                drupal_set_html_head($_rss_feed);
                // drupal 6
            }
    }
}
/* END */
function sunshine_preprocess_block(&$vars)
{
    $subject = db_result(db_query("SELECT title from {blocks} where bid=%d", $vars['block']->bid));
    if ($subject) {
        $vars['block']->subject = $subject;
    }
}
function sunshine_preprocess_page(&$vars)
{
    $page_classes = array();