Отображение блока авторизации (block-user-login)

Главные вкладки

Аватар пользователя Rap3r Rap3r 31 марта 2015 в 10:08

Здравствуйте. Столкнулся с проблемой отображения авторизации на странице /?q=user в бесплатном шаблоне (Phoenix).

Хочу отключить блок авторизации на всех страницах и логиниться в админку через /?q=user, но на этой странице нет форм для ввода логина и пароля. Не могу разобраться, где править эту страницу. Подскажите, пожалуйста?

Вложения:
login1 как сейчас
login2 как должно быть (скрин дефолтной темы)

Есть вот такой block.tpl.php

<?php

/**
 * file
 * touch theme implementation to display a block.
 *
 * Available variables:
 * - $block->subject: Block title.
 * - $content: Block content.
 * - $block->module: Module that generated the block.
 * - $block->delta: An ID for the block, unique within each module.
 * - $block->region: The block region embedding the current block.
 * - $classes: String of classes that can be used to style contextually through
 *   CSS. It can be manipulated through the variable $classes_array from
 *   preprocess functions. The default values can be one or more of the following:
 *   - block: The current template type, i.e., "theming hook".
 *   - block-[module]: The module generating the block. For example, the user module
 *     is responsible for handling the default user navigation block. In that case
 *     the class would be "block-user".
 * - $title_prefix (array): An array containing additional output populated by
 *   modules, intended to be displayed in front of the main title tag that
 *   appears in the template.
 * - $title_suffix (array): An array containing additional output populated by
 *   modules, intended to be displayed after the main title tag that appears in
 *   the template.
 *
 * Helper variables:
 * - $classes_array: Array of html class attribute values. It is flattened
 *   into a string within the variable $classes.
 * - $block_zebra: Outputs 'odd' and 'even' dependent on each block region.
 * - $zebra: Same output as $block_zebra but independent of any block region.
 * - $block_id: Counter dependent on each block region.
 * - $id: Same output as $block_id but independent of any block region.
 * - $is_front: Flags true when presented in the front page.
 * - $logged_in: Flags true when the current user is a logged-in member.
 * - $is_admin: Flags true when the current user is an administrator.
 *
 * see template_preprocess()
 * see template_preprocess_block()
 * see template_process()
 */
?>
<div id="<?php print $block_html_id?>" class="<?php print $classes?>"<?php print $attributes?>>

  <?php print render($title_prefix); ?>
  <?php if (!empty($block->subject)): ?>
    <h2 <?php print $title_attributes?>><?php print $block->subject ?></h2>
  <?php endif;?>
  <?php print render($title_suffix); ?>

  <div class="content"<?php print $content_attributes?>>
    <?php print $content ?>
  </div>
  
</div> <!-- /.block -->
?>

И template.php

<?php
/**
 * Implements hook_html_head_alter().
 * This will overwrite the default meta character type tag with HTML5 version.
 */
function phoenix_responsive_theme_html_head_alter(&$head_elements) {
  
$head_elements['system_meta_content_type']['#attributes'] = array(
    
'charset' => 'utf-8'
  
);
}

/**
 * Insert themed breadcrumb page navigation at top of the node content.
 */
function phoenix_responsive_theme_breadcrumb($variables) {
  
$breadcrumb $variables['breadcrumb'];
  if (!empty(
$breadcrumb)) {
    
// Use CSS to hide titile .element-invisible.
    
$output '<h2 class="element-invisible">' t('You are here') . '</h2>';
    
// comment below line to hide current page to breadcrumb
    
$breadcrumb[] = drupal_get_title();
    
$output .= '<nav class="breadcrumb">' implode(' » '$breadcrumb) . '</nav>';
    return 
$output;
  }
}

/**
 * Override or insert variables into the page template.
 */
function phoenix_responsive_theme_preprocess_page(&$vars) {
  if (isset(
$vars['main_menu'])) {
    
$vars['main_menu'] = theme('links__system_main_menu', array(
      
'links' => $vars['main_menu'],
      
'attributes' => array(
        
'class' => array('links''main-menu''clearfix'),
      ),
      
'heading' => array(
        
'text' => t('Main menu'),
        
'level' => 'h2',
        
'class' => array('element-invisible'),
      )
    ));
  }
  else {
    
$vars['main_menu'] = FALSE;
  }
  if (isset(
$vars['secondary_menu'])) {
    
$vars['secondary_menu'] = theme('links__system_secondary_menu', array(
      
'links' => $vars['secondary_menu'],
      
'attributes' => array(
        
'class' => array('links''secondary-menu''clearfix'),
      ),
      
'heading' => array(
        
'text' => t('Secondary menu'),
        
'level' => 'h2',
        
'class' => array('element-invisible'),
      )
    ));
  }
  else {
    
$vars['secondary_menu'] = FALSE;
  }
}

/**
 * Duplicate of theme_menu_local_tasks() but adds clearfix to tabs.
 */
function phoenix_responsive_theme_menu_local_tasks(&$variables) {
  
$output '';

  if (!empty(

$variables['primary'])) {
    
$variables['primary']['#prefix'] = '<h2 class="element-invisible">' t('Primary tabs') . '</h2>';
    
$variables['primary']['#prefix'] .= '<ul class="tabs primary clearfix">';
    
$variables['primary']['#suffix'] = '</ul>';
    
$output .= drupal_render($variables['primary']);
  }
  if (!empty(
$variables['secondary'])) {
    
$variables['secondary']['#prefix'] = '<h2 class="element-invisible">' t('Secondary tabs') . '</h2>';
    
$variables['secondary']['#prefix'] .= '<ul class="tabs secondary clearfix">';
    
$variables['secondary']['#suffix'] = '</ul>';
    
$output .= drupal_render($variables['secondary']);
  }
  return 
$output;
}

/**
 * Override or insert variables into the node template.
 */
function phoenix_responsive_theme_preprocess_node(&$variables) {
  
$node $variables['node'];
  if (
$variables['view_mode'] == 'full' && node_is_page($variables['node'])) {
    
$variables['classes_array'][] = 'node-full';
  }
}

function 

phoenix_responsive_theme_page_alter($page) {
  
// <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
  
$viewport = array(
    
'#type' => 'html_tag',
    
'#tag' => 'meta',
    
'#attributes' => array(
    
'name' =>  'viewport',
    
'content' =>  'width=device-width'
    
)
  );
  
drupal_add_html_head($viewport'viewport');
}
?>
ВложениеРазмер
Иконка изображения login1.jpg96.51 КБ
Иконка изображения login2.jpg28.31 КБ

Комментарии

Аватар пользователя SLHammer SLHammer 1 апреля 2015 в 11:05

Привет.
Мой совет.
1. Отключи блок стандартной авторизации в блоках.
2. Поставь https://www.drupal.org/project/ajax_register
3. Выведи этот блок в нужном регионе (и на нужных страницах).
4. Отредактирую стили отображения.
5. Включить чистые ссылки (Конфигурация/Поиск и метаданные)

И будет то что тебе нужно.