materio-base-legacy/materio_page_title.module
bachy 948913bc82 Page title
Signed-off-by: bachy <git@g-u-i.net>
2012-11-09 11:51:55 +01:00

76 lines
1.7 KiB
Plaintext

<?php
/**
* Implements hook_block_info().
*/
function materio_page_title_block_info() {
// This example comes from node.module.
/*
*$blocks['syndicate'] = array(
* 'info' => t('Syndicate'),
* 'cache' => DRUPAL_NO_CACHE
*);
*/
$blocks['materio_page_title'] = array(
'info' => t('Materio page title'),
'cache' => DRUPAL_NO_CACHE
);
return $blocks;
}
/**
* Implements hook_block_view().
*/
function materio_page_title_block_view($delta = '') {
$block = array();
switch ($delta) {
case 'materio_page_title':
$block['subject'] = t('Page title');
$block['content'] = theme('materio_page_title', array('title' => drupal_get_title()));
drupal_add_js(drupal_get_path('module', 'materio_page_title').'/js/materio_page_title-ck.js');
break;
}
return $block;
}
/**
* Implements hook_theme().
*/
function materio_page_title_theme($existing, $type, $theme, $path) {
return array(
'materio_page_title' => array(
'variables' => array('title' => NULL,),
),
);
}
function theme_materio_page_title($vars){
if($vars['title'])
return '<h1 id="materio-page-title" class="page-title">'.$vars['title'].'</h1>';
return;
}
/**
* Implements hook_menu().
*/
// function materio_page_title_menu() {
// $items = array();
// $base = array(
// 'type' => MENU_CALLBACK,
// 'file' => 'materio_page_title.pages.inc',
// );
// $items['materio_page_title/refresh/block'] = $base+array(
// 'title' => 'Materio page title refresh block',
// 'page callback' => 'materio_page_title_refresh_block',
// 'page arguments' => array(),
// 'access callback' => TRUE,
// );
// return $items;
// }