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


PHP drupal_set_title函数代码示例

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


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

示例1: setTitle

 /**
  * sets the title of the page
  *
  * @param string $title
  * @paqram string $pageTitle
  *
  * @return void
  * @access public
  */
 function setTitle($title, $pageTitle = null)
 {
     if ($pageTitle) {
         $title = $pageTitle;
     }
     drupal_set_title($title);
 }
开发者ID:bhirsch,项目名称:voipdev,代码行数:16,代码来源:Drupal.php

示例2: quatro_preprocess_page

function quatro_preprocess_page(&$vars)
{
    // Set the page title for the "Verein" Panels Page
    if (arg(0) == 'verein' && is_numeric(arg(1))) {
        //dpm($vars);
        $nid = arg(1);
        // Search for the "Mannschaft" Node matching the argument
        $query = new EntityFieldQuery();
        $query->entityCondition('entity_type', 'node')->entityCondition('bundle', 'mannschaft')->propertyCondition('status', NODE_PUBLISHED)->propertyCondition('nid', $nid, '=')->addTag('DANGEROUS_ACCESS_CHECK_OPT_OUT');
        $result = $query->execute();
        // Set the page title to the Node Title of the "Mannschaft" Node
        if (isset($result['node'])) {
            $node_ids = array_keys($result['node']);
            $node_id = $node_ids[0];
            $node = node_load($node_id);
            drupal_set_title($node->title);
        }
    }
    // Set the page title for the "Spieler" Panels Page
    if (arg(0) == 'spieler' && is_numeric(arg(1))) {
        //dpm($vars);
        $nid = arg(1);
        // Search for the ticket matching the Rabattcode
        $query = new EntityFieldQuery();
        $query->entityCondition('entity_type', 'node')->entityCondition('bundle', 'spieler')->propertyCondition('status', NODE_PUBLISHED)->propertyCondition('nid', $nid, '=')->addTag('DANGEROUS_ACCESS_CHECK_OPT_OUT');
        $result = $query->execute();
        // If a ticket was found, set the price field to the ticket price
        if (isset($result['node'])) {
            $node_ids = array_keys($result['node']);
            $node_id = $node_ids[0];
            $node = node_load($node_id);
            drupal_set_title($node->title);
        }
    }
}
开发者ID:eigentor,项目名称:sbl,代码行数:35,代码来源:template.php

示例3: theme_lawmakers_api

/**
 * Implements theme_hook().
 *
 * Lawmakers Page.
 */
function theme_lawmakers_api(&$variables)
{
    $output = '';
    $node = $variables['node'];
    $full_title = $node->title . ' ' . $node->firstname . ' ' . $node->lastname;
    drupal_set_title($full_title);
    $lawmakers_image_size = '200x250';
    $image_data = array('path' => drupal_get_path('module', 'lawmakers') . '/images/' . $lawmakers_image_size . '/' . $node->bioguide_id . '.jpg');
    $output .= '<div class="image" style="float: left; margin-right: 20px">' . theme('image', $image_data) . '</div>';
    $output .= '<div class="party-info"> ' . $node->party . ' ' . $node->state . '</div>';
    $output .= '<div class="congress-office">' . $node->congress_office . '</div>';
    $output .= '<div class="congress-phone">' . $node->phone . '</div>';
    $output .= '<div class="congress-fax">' . $node->fax . '</div>';
    $output .= '<div class="congress-website">' . $node->website . '</div>';
    $output .= '<div class="congress-contact-form">' . $node->webform . '</div>';
    $output .= '<p/>';
    $output .= '<h3>Committees</h3>';
    $list_items = $variables['committees']['results'];
    $output .= '<ul class="committees-list">';
    foreach ($list_items as $list_item) {
        $output .= '<li class="committee-name"> ' . $list_item['name'] . ' </li>';
    }
    $output .= '</ul>';
    /*$bills = $variables['bills'];
      print_r($bills);
      $votes = $variables['votes'];
      print_r($votes);*/
    return $output;
}
开发者ID:drupalcrunch,项目名称:lawmakers,代码行数:34,代码来源:lawmakers-api.tpl.php

示例4: bluemod_init

function bluemod_init()
{
    //theme ( 'bluemod_javascript' );
    error_reporting(0);
    // Redirecciona a la pantalla de ingreso
    global $user;
    //Redirecciona a home a los usuarios anónimos.
    $curr = current_path();
    $anon_main = 0;
    $link_de_registro = substr_count($curr, 'user/reset/');
    $link_de_invitacion = substr_count($curr, 'invite/accept/');
    //echo $link_de_registro.','.$curr;
    if ($user->roles[1] == 'anonymous user' && $curr != 'escritorio') {
        //echo $curr;
        //Lista de excepciones que un usuario anónimo puede ver
        if ($curr != 'user/register' && $curr != 'user/password' && $curr != 'user/reset' && $curr != 'elegir-contactos' && $curr != 'node/374' && $curr != 'node/381' && $curr != 'node/228' && $curr != 'contact' && $curr != "system/ajax" && $link_de_registro == 0 && $link_de_invitacion == 0) {
            //echo $link_de_registro.','.$curr;
            //solo si no fuera el link de registro que tiene la forma user/reset/*
            // header("Location: /");
            //$mensaje = drupal_get_message(null,false);
            //drupal_set_message($mensaje);
            drupal_goto("<front>");
        }
    }
    if (arg(0) == 'user' && arg(1) == 'password') {
        drupal_set_title(t('Recupera tu Contraseña'));
    }
    if (arg(0) == 'user' && arg(1) == 'register') {
        drupal_set_title(t('Solicitar Invitación'));
    }
}
开发者ID:e-gob,项目名称:ComunidadTecnologica,代码行数:31,代码来源:bluemod.php

示例5: form

 /**
  * {@inheritdoc}
  */
 public function form(array $form, array &$form_state)
 {
     $feed = $this->entity;
     $importer = $feed->getImporter();
     $args = array('@importer' => $importer->label(), '@title' => $feed->label());
     if ($this->operation == 'update') {
         drupal_set_title($this->t('<em>Edit @importer</em> @title', $args), PASS_THROUGH);
     } elseif ($this->operation == 'create') {
         drupal_set_title($this->t('<em>Add @importer</em>', $args), PASS_THROUGH);
     }
     $user_config = \Drupal::config('user.settings');
     $form['title'] = array('#type' => 'textfield', '#title' => $this->t('Title'), '#default_value' => $feed->label(), '#required' => TRUE);
     foreach ($importer->getPlugins() as $plugin) {
         if ($plugin instanceof FeedPluginFormInterface) {
             // Store the plugin for validate and submit.
             $this->configurablePlugins[] = $plugin;
             $form = $plugin->buildFeedForm($form, $form_state, $feed);
         }
     }
     $form['advanced'] = array('#type' => 'vertical_tabs', '#weight' => 99);
     // Feed author information for administrators.
     $form['author'] = array('#type' => 'details', '#access' => $this->currentUser()->hasPermission('administer feeds'), '#title' => $this->t('Authoring information'), '#collapsed' => TRUE, '#group' => 'advanced', '#weight' => 90);
     $form['author']['name'] = array('#type' => 'textfield', '#title' => $this->t('Authored by'), '#maxlength' => 60, '#autocomplete_path' => 'user/autocomplete', '#default_value' => $feed->getAuthor()->getUsername(), '#description' => $this->t('Leave blank for %anonymous.', array('%anonymous' => $user_config->get('anonymous'))));
     $form['author']['date'] = array('#type' => 'textfield', '#title' => $this->t('Authored on'), '#maxlength' => 25, '#description' => $this->t('Format: %time. The date format is YYYY-MM-DD and %timezone is the time zone offset from UTC. Leave blank to use the time of form submission.', array('%time' => format_date($feed->getCreatedTime(), 'custom', 'Y-m-d H:i:s O'), '%timezone' => format_date($feed->getCreatedTime(), 'custom', 'O'))));
     // Feed options for administrators.
     $form['options'] = array('#type' => 'details', '#access' => $this->currentUser()->hasPermission('administer feeds'), '#title' => $this->t('Import options'), '#collapsed' => TRUE, '#group' => 'advanced');
     $form['options']['status'] = array('#type' => 'checkbox', '#title' => $this->t('Active'), '#default_value' => $feed->isActive());
     return parent::form($form, $form_state);
 }
开发者ID:alnutile,项目名称:drunatra,代码行数:32,代码来源:FeedFormController.php

示例6: iha_preprocess_page

function iha_preprocess_page(&$variables)
{
    $search_box = drupal_render(drupal_get_form('search_form'));
    $variables['search_box'] = $search_box;
    if (drupal_is_front_page()) {
        unset($variables['page']['content']['system_main']['default_message']);
        //will remove message "no front page content is created"
        drupal_set_title('');
        //removes welcome message (page title)
    }
    if (arg(0) == 'node') {
        $variables['node_content'] =& $variables['page']['content']['system_main']['nodes'][arg(1)];
    }
    if (isset($variables['node']->type)) {
        $variables['theme_hook_suggestions'][] = 'page__' . $variables['node']->type;
    }
    // Prepare the mobile menu.
    $user_menu = menu_tree('user-menu');
    $main_menu = menu_tree('main-menu');
    $menu_tree = array_merge($main_menu, $user_menu);
    // FYI for future dev's - If need to add more menu items, then load the other menu through menu tree as well and do a
    // array merge or for loop to attach the items to the $menu_tree.
    $mobile_menu = '<ul class="list-unstyled main-menu">';
    foreach ($menu_tree as $mlid => $mm) {
        if (is_int($mlid)) {
            $mobile_menu .= iha_render_mobile_menu($mm);
        }
    }
    $mobile_menu .= '</ul>';
    $variables['mobile_menu'] = $mobile_menu;
}
开发者ID:freighthouse,项目名称:code,代码行数:31,代码来源:template.php

示例7: authorize_access_denied_page

/**
 * Render a 403 access denied page for authorize.php
 */
function authorize_access_denied_page()
{
    drupal_add_http_header('Status', '403 Forbidden');
    watchdog('access denied', 'authorize.php', NULL, WATCHDOG_WARNING);
    drupal_set_title('Access denied');
    return t('You are not allowed to access this page.');
}
开发者ID:aslakhellesoy,项目名称:drupal,代码行数:10,代码来源:authorize.php

示例8: intranet_preprocess_page

function intranet_preprocess_page(&$vars)
{
    if (isset($vars['node'])) {
        $vars['theme_hook_suggestions'][] = 'page__' . $vars['node']->type;
        if ($vars['node']->type == 'cxo_messages') {
            drupal_set_title('');
        }
    }
    //404 page
    $status = drupal_get_http_header("status");
    if ($status == "404 Not Found") {
        $vars['theme_hook_suggestions'][] = 'page__404';
    }
    $br_banner_var = array('path' => theme_get_setting('bg_image_path', 'intranet'));
    $vars['bg_image'] = theme('image', $br_banner_var);
    $header_banner_var = array('style_name' => 'header_banner', 'path' => theme_get_setting('header_image_path', 'intranet'), 'alt' => 'header_banner', 'title' => 'Sakal header banner', 'attributes' => array('class' => 'headerImage'));
    $vars['header_image'] = theme('image_style', $header_banner_var);
    $footer_banner_var = array('style_name' => 'footer_banner', 'path' => theme_get_setting('footer_image_path', 'intranet'), 'alt' => 'footer_banner', 'title' => 'Sakal footer banner', 'attributes' => array('class' => 'footerImage'));
    $vars['footer_image'] = theme('image_style', $footer_banner_var);
    //set page title
    if (isset($vars['node'])) {
        $default_value = ucfirst(str_replace("_", " ", $vars['node']->type));
        drupal_set_title(variable_get('page_title_' . $vars['node']->type, $default_value));
    }
}
开发者ID:cap-mayank,项目名称:intranet,代码行数:25,代码来源:template.php

示例9: ebog_preprocess_ting_object

/**
 * Implements hook_preprocess_ting_object().
 *
 * Add extra information form elib to the ting object.
 */
function ebog_preprocess_ting_object(&$vars)
{
    $isbn = $vars['object']->record['dc:identifier']['oss:PROVIDER-ID'][0];
    // Override ting object page title.
    drupal_set_title(check_plain($vars['object']->title . ' ' . t('af') . ' ' . $vars['object']->creators_string));
    // Create the author field.
    $vars['author'] = publizon_get_authors($vars['object']);
    // Load the product.
    try {
        $product = new PublizonProduct($isbn);
        // Get cover image.
        $vars['cover'] = $product->getCover('170_x');
        // Get ebook sample link.
        if (!empty($product->teaser_link)) {
            $vars['elib_sample_link'] = 'stream/' . $isbn . '/preview/';
        }
        if ($product->getFormat()) {
            $vars['elib_format'] = $product->getFormat();
        }
        // Check if the book is loaned by the user.
        global $user;
        if ($user->uid > 0) {
            $user_loans = new PublizonUserLoans($user->uid);
            $vars['is_loan'] = $user_loans->isLoan($isbn, TRUE);
            if ($vars['is_loan']) {
                $vars['cvo'] = $user_loans->loans[$isbn]->internal_order_number;
            }
        }
    } catch (Exception $e) {
        drupal_set_message($e->getMessage(), 'error');
    }
}
开发者ID:cableman,项目名称:ereolen,代码行数:37,代码来源:template.php

示例10: corporatex3_preprocess_page

/**
 * @file
 * template.php
 */
function corporatex3_preprocess_page(&$vars)
{
    $path = drupal_get_path_alias();
    if ($path == 'contact') {
        $vars['title'] = t('Contact us');
        drupal_set_title(t('Contact us'));
    }
}
开发者ID:bikramth19,项目名称:wordpress,代码行数:12,代码来源:template.php

示例11: brush_preprocess_page

/**
 * Implements template_preprocess_page.
 */
function brush_preprocess_page(&$variables)
{
    if (drupal_is_front_page()) {
        unset($variables['page']['content']['system_main']['default_message']);
        //will remove message "no front page content is created"
        drupal_set_title('');
        //removes welcome message (page title)
    }
}
开发者ID:kaktusist,项目名称:sad-multisite-dr,代码行数:12,代码来源:template.php

示例12: get_form

 /**
  * Return the generated form output.
  * @param array $args List of parameter values passed through to the form depending on how the form has been configured.
  * This array always contains a value for language.
  * @param object $node The Drupal node object.
  * @param array $response When this form is reloading after saving a submission, contains the response from the service call.
  * Note this does not apply when redirecting (in this case the details of the saved object are in the $_GET data).
  * @return Form HTML.
  */
 public static function get_form($args, $node, $response = null)
 {
     if (!hostsite_get_user_field('indicia_user_id')) {
         return 'Please ensure that you\'ve filled in your surname on your user profile before creating or editing groups.';
     }
     iform_load_helpers(array('report_helper', 'map_helper'));
     $args = array_merge(array('include_code' => false, 'include_dates' => false, 'include_report_filter' => true, 'include_private_records' => false, 'include_administrators' => false, 'include_members' => false, 'filter_types' => '{"":"what,where,when","Advanced":"source,quality"}'), $args);
     $args['filter_types'] = json_decode($args['filter_types'], true);
     $reloadPath = self::getReloadPath();
     data_entry_helper::$website_id = $args['website_id'];
     $auth = data_entry_helper::get_read_write_auth($args['website_id'], $args['password']);
     if (!empty($_GET['group_id'])) {
         self::loadExistingGroup($_GET['group_id'], $auth, $args);
     } else {
         if (!empty($args['parent_group_relationship_type']) && empty($_GET['from_group_id'])) {
             return 'This form should be called with a from_group_id parameter to define the parent when creating a new group';
         }
     }
     $r = "<form method=\"post\" id=\"entry_form\" action=\"{$reloadPath}\">\n";
     $r .= $auth['write'] . "<input type=\"hidden\" id=\"website_id\" name=\"website_id\" value=\"" . $args['website_id'] . "\" />\n";
     $r .= data_entry_helper::hidden_text(array('fieldname' => 'group:id'));
     if (!empty($args['group_type'])) {
         $r .= '<input type="hidden" name="group:group_type_id" value="' . $args['group_type'] . '"/>';
         $response = data_entry_helper::get_population_data(array('table' => 'termlists_term', 'extraParams' => $auth['read'] + array('id' => $args['group_type'])));
         self::$groupType = strtolower($response[0]['term']);
     }
     if (!empty(data_entry_helper::$entity_to_load['group:title']) && function_exists('drupal_set_title')) {
         drupal_set_title(lang::get('Edit {1}', data_entry_helper::$entity_to_load['group:title']));
     }
     $r .= data_entry_helper::text_input(array('label' => lang::get('{1} name', ucfirst(self::$groupType)), 'fieldname' => 'group:title', 'validation' => array('required'), 'class' => 'control-width-5', 'helpText' => lang::get('The full title of the {1}', self::$groupType)));
     if ($args['include_code']) {
         $r .= data_entry_helper::text_input(array('label' => lang::get('Code'), 'fieldname' => 'group:code', 'class' => 'control-width-4', 'helpText' => lang::get('A code or abbreviation identifying the {1}', self::$groupType)));
     }
     if (empty($args['group_type'])) {
         $r .= data_entry_helper::select(array('label' => lang::get('Group type'), 'fieldname' => 'group:group_type_id', 'required' => true, 'table' => 'termlists_term', 'valueField' => 'id', 'captionField' => 'term', 'extraParams' => $auth['read'] + array('termlist_external_key' => 'indicia:group_types'), 'class' => 'control-width-4'));
     }
     $r .= self::joinMethodsControl($args);
     $r .= data_entry_helper::textarea(array('label' => ucfirst(lang::get('{1} description', self::$groupType)), 'fieldname' => 'group:description', 'helpText' => lang::get('Description and notes about the {1}.', self::$groupType)));
     $r .= self::dateControls($args);
     if ($args['include_private_records']) {
         $r .= data_entry_helper::checkbox(array('label' => lang::get('Records are private'), 'fieldname' => 'group:private_records', 'helpText' => lang::get('Tick this box if you want to withold the release of the records from this {1} until a ' . 'later point in time, e.g. when a project is completed.', self::$groupType)));
     }
     $r .= self::memberControls($args, $auth);
     $r .= self::reportFilterBlock($args, $auth, $hiddenPopupDivs);
     // auto-insert the creator as an admin of the new group, unless the admins are manually specified
     if (!$args['include_administrators'] && empty($_GET['group_id'])) {
         $r .= '<input type="hidden" name="groups_user:admin_user_id[]" value="' . hostsite_get_user_field('indicia_user_id') . '"/>';
     }
     $r .= '<input type="hidden" name="groups_user:administrator" value="t"/>';
     $r .= '<input type="submit" class="indicia-button" id="save-button" value="' . (empty(data_entry_helper::$entity_to_load['group:id']) ? lang::get('Create {1}', self::$groupType) : lang::get('Update {1} settings', self::$groupType)) . "\" />\n";
     $r .= '</form>';
     $r .= $hiddenPopupDivs;
     data_entry_helper::enable_validation('entry_form');
     // JavaScript to grab the filter definition and store in the form for posting when the form is submitted
     data_entry_helper::$javascript .= "\n\$('#entry_form').submit(function() {\n  \$('#filter-title-val').val('" . lang::get('Filter for user group') . " ' + \$('#group\\\\:title').val());\n  \$('#filter-def-val').val(JSON.stringify(indiciaData.filter.def));\n});\n";
     return $r;
 }
开发者ID:BirenRathod,项目名称:drupal-6,代码行数:66,代码来源:group_edit.php

示例13: _scratchy_forum_display

function _scratchy_forum_display($forums, $topics, $parents, $tid, $sortby, $forum_per_page)
{
    global $user;
    // forum list, topics list, topic browser and 'add new topic' link
    $vocabulary = taxonomy_get_vocabulary(variable_get('forum_nav_vocabulary', ''));
    $title = $vocabulary->name;
    // Breadcrumb navigation:
    $breadcrumb = array();
    if ($tid) {
        $breadcrumb[] = array('path' => 'forum', 'title' => $title);
    }
    if ($parents) {
        $parents = array_reverse($parents);
        foreach ($parents as $p) {
            if ($p->tid == $tid) {
                $title = $p->name;
            } else {
                $breadcrumb[] = array('path' => 'forum/' . $p->tid, 'title' => $p->name);
            }
        }
    }
    drupal_set_title(check_plain($title));
    $breadcrumb[] = array('path' => $_GET['q']);
    menu_set_location($breadcrumb);
    if (count($forums) || count($parents)) {
        $output = '<div class="node">
  <div class="boxtop"><div class="bc ctr"></div><div class="bc ctl"></div></div>
  <div class="boxcontent">
    <div class="subboxcontent"><div class="content"><div id="forum"><ul style="margin-top:0">';
        if (user_access('create forum topics')) {
            $output .= '<li>' . l(t('Post new forum topic.'), "node/add/forum/{$tid}") . '</li>';
        } else {
            if ($user->uid) {
                $output .= '<li>' . t('You are not allowed to post a new forum topic.') . '</li>';
            } else {
                $output .= '<li>' . t('<a href="@login">Login</a> to post a new forum topic.', array('@login' => url('user/login', drupal_get_destination()))) . '</li>';
            }
        }
        $output .= '</ul>';
        $output .= theme('forum_list', $forums, $parents, $tid);
        if ($tid && !in_array($tid, variable_get('forum_containers', array()))) {
            $output .= theme('forum_topic_list', $tid, $topics, $sortby, $forum_per_page);
            drupal_add_feed(url('taxonomy/term/' . $tid . '/0/feed'), 'RSS - ' . $title);
        }
        $output .= '</div></div></div>
  </div>
  <div class="boxbtm">
    <div class="bc cbr"></div>
    <div class="bc cbl"></div>
  </div>
</div>';
    } else {
        drupal_set_title(t('No forums defined'));
        $output = '';
    }
    return $output;
}
开发者ID:edchacon,项目名称:scratchpads,代码行数:57,代码来源:scratchy-forum.inc.php

示例14: view

 public function view()
 {
     if (!$this->isLinkedToQuestion()) {
         return;
     }
     if ($this->page) {
         drupal_set_title($this->getTitle());
     }
 }
开发者ID:chgk,项目名称:db.chgk.info,代码行数:9,代码来源:DbIssue.class.php

示例15: excelpoint_page_alter

/**
 * Implements hook_page_alter().
 */
function excelpoint_page_alter(&$page)
{
    if (drupal_is_front_page()) {
        drupal_set_title('');
    }
    if ($page['#type'] === 'page') {
        drupal_set_title('');
    }
}
开发者ID:TommyTran1,项目名称:excelpoint,代码行数:12,代码来源:template.php


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