| [ Index ] |
PHP Cross Reference of Drupal 6 (yi-drupal) |
[Summary view] [Print] [Text view]
1 <?php 2 // $Id: stylizer.module,v 1.1.2.3 2010/07/23 22:11:53 merlinofchaos Exp $ 3 4 /** 5 * @file 6 * Stylizer module 7 * 8 * This module allows styles to be created and managed on behalf of modules 9 * that implement styles. 10 * 11 * The Stylizer tool allows recolorable styles to be created via a miniature 12 * scripting language. Panels utilizes this to allow administrators to add 13 * styles directly to any panel display. 14 */ 15 16 /** 17 * Implementation of hook_perm() 18 */ 19 function stylizer_perm() { 20 return array( 21 'administer stylizer', 22 ); 23 } 24 25 /** 26 * Implementation of hook_ctools_plugin_directory() to let the system know 27 * we implement task and task_handler plugins. 28 */ 29 function stylizer_ctools_plugin_directory($module, $plugin) { 30 // Most of this module is implemented as an export ui plugin, and the 31 // rest is in ctools/includes/stylizer.inc 32 if ($module == 'ctools' && $plugin == 'export_ui') { 33 return 'plugins/' . $plugin; 34 } 35 } 36 37 /** 38 * Implementation of hook_panels_dashboard_blocks(). 39 * 40 * Adds page information to the Panels dashboard. 41 */ 42 function stylizer_panels_dashboard_blocks(&$vars) { 43 $vars['links']['stylizer'] = array( 44 'title' => l(t('Custom style'), 'admin/build/stylizer/add'), 45 'description' => t('Custom styles can be applied to Panel regions and Panel panes.'), 46 ); 47 48 // Load all mini panels and their displays. 49 ctools_include('export'); 50 ctools_include('stylizer'); 51 $items = ctools_export_crud_load_all('stylizer'); 52 $count = 0; 53 $rows = array(); 54 55 $base_types = ctools_get_style_base_types(); 56 foreach ($items as $item) { 57 $style = ctools_get_style_base($item->settings['style_base']); 58 if ($style && $style['module'] == 'panels') { 59 $type = $base_types[$style['module']][$style['type']]['title']; 60 61 $rows[] = array( 62 check_plain($item->admin_title), 63 $type, 64 array( 65 'data' => l(t('Edit'), "admin/build/stylizer/list/$item->name/edit"), 66 'class' => 'links', 67 ), 68 ); 69 70 // Only show 10. 71 if (++$count >= 10) { 72 break; 73 } 74 } 75 } 76 77 if ($rows) { 78 $content = theme('table', array(), $rows, array('class' => 'panels-manage')); 79 } 80 else { 81 $content = '<p>' . t('There are no custom styles.') . '</p>'; 82 } 83 84 $vars['blocks']['stylizer'] = array( 85 'title' => t('Manage styles'), 86 'link' => l(t('Go to list'), 'admin/build/stylizer'), 87 'content' => $content, 88 'class' => 'dashboard-styles', 89 'section' => 'left', 90 ); 91 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Mon Jul 9 18:01:44 2012 | Cross-referenced by PHPXref 0.7 |