/[drupal]/contributions/modules/blockbar/blockbar.module
ViewVC logotype

Diff of /contributions/modules/blockbar/blockbar.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.7, Thu May 25 17:37:15 2006 UTC revision 1.8, Tue Jan 30 20:59:34 2007 UTC
# Line 1  Line 1 
1  <?php  <?php
2    // $Id:
3  /**  /**
4   * @file   * @file
5   * Enables the use of a block bar container.   * Enables the use of a block bar container.
6   */   */
 /**  
  * Implementation of hook_help().  
  */  
 function blockbar_help($section) {  
   switch ($section) {  
     case 'admin/modules#description':  
       return t('Enables the use of a blockbar block container.');  
   }  
 }  
7    
8  /**  /**
9   * Menu callback: block bar.   * Menu callback: block bar.
# Line 19  function blockbar_help($section) { Line 11  function blockbar_help($section) {
11  function blockbar_build_blockbar($block_num = NULL) {  function blockbar_build_blockbar($block_num = NULL) {
12    static $sent = array();    static $sent = array();
13    if (!isset($sent[drupal_get_path('module','blockbar') . '/blockbar.css'])) {    if (!isset($sent[drupal_get_path('module','blockbar') . '/blockbar.css'])) {
14      theme_add_style(drupal_get_path('module','blockbar') .'/blockbar.css');      drupal_add_css(drupal_get_path('module', 'blockbar') .'/blockbar.css');
15      $sent[drupal_get_path('module','blockbar') . '/blockbar.css'] = TRUE;      $sent[drupal_get_path('module','blockbar') . '/blockbar.css'] = TRUE;
16    }    }
17    if (!isset($sent[drupal_get_path('module','blockbar') . '/blockbar.js'])) {    if (!isset($sent[drupal_get_path('module','blockbar') . '/blockbar.js'])) {
# Line 57  function blockbar_build_blockbar($block_ Line 49  function blockbar_build_blockbar($block_
49    return $content;    return $content;
50  }  }
51    
52    function blockbar_menu($maycache) {
53     $items = array();
54     $items[] = array(
55          'path' => 'admin/settings/blockbar',
56          'title' => t('BlockBar'),
57          'description' => t('BlockBar settings'),
58          'callback' => 'drupal_get_form',
59          'callback arguments' => 'blockbar_admin_settings',
60          'access' => user_access('administer site configuration'),
61          'type' => MENU_NORMAL_ITEM
62         );
63      return $items;
64    }
65    
66    function blockbar_admin_settings() {
67      $number_of_blocks = drupal_map_assoc(array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15));
68    
69      $form = array();
70      $form['block'] = array(
71        '#type' => 'fieldset', '#title' => t('Block settings'),
72        '#collapsible' => FALSE, '#collapsed' => False
73      );
74      $form['block']['blockbar_number_of_blocks'] = array(
75        '#type' => 'select', '#title' => t('Number of blocks'), '#default_value' => variable_get('blockbar_number_of_blocks', 0), '#options' => $number_of_blocks,
76        '#description' => t('Select the number of BlockBar blocks you wish to generate.  BlockBar blocks are configured individually in the block configuration pages.')
77      );
78    
79      return system_settings_form($form);
80    }
81    
82  function theme_blockbar_build_panels($panel_title, $panel_id, $blockbar_num, $block){  function theme_blockbar_build_panels($panel_title, $panel_id, $blockbar_num, $block){
83    // when overriding this theme function care should be taken so as to not break the javascript    // when overriding this theme function care should be taken so as to not break the javascript
84    // being called in the onclick event of the title <div>    // being called in the onclick event of the title <div>
# Line 73  function theme_blockbar_build_panels($pa Line 95  function theme_blockbar_build_panels($pa
95    return $output;    return $output;
96  }  }
97    
 /**  
  * Implementation of hook_settings().  
  */  
 function blockbar_settings() {  
   $number_of_blocks = drupal_map_assoc(array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15));  
   
   $form['block'] = array(  
     '#type' => 'fieldset', '#title' => t('Block settings'),  
     '#collapsible' => FALSE, '#collapsed' => False  
   );  
   $form['block']['blockbar_number_of_blocks'] = array(  
     '#type' => 'select', '#title' => t('Number of blocks'), '#default_value' => variable_get('blockbar_number_of_blocks', 0), '#options' => $number_of_blocks,  
     '#description' => t('Select the number of BlockBar blocks you wish to generate.  BlockBar blocks are configured individually in the block configuration pages.')  
   );  
   
   return $form;  
 }  
   
98  function _blockbar_settings_form($block_num = NULL){  function _blockbar_settings_form($block_num = NULL){
99    $form['blockbar_name' . $block_num] = array(    $form['blockbar_name' . $block_num] = array(
100      '#type' => 'textfield',      '#type' => 'textfield',

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.2