Go to the source code of this file.
Functions | |
| panels_admin_content_custom ($display, $pane) | |
| panels_admin_content_types_custom () | |
| panels_admin_edit_custom ($id, $parents, $conf=NULL) | |
| panels_admin_title_custom ($conf) | |
| panels_content_custom ($conf) | |
| panels_custom_panels_content_types () | |
| panels_admin_content_custom | ( | $ | display, | |
| $ | pane | |||
| ) |
Render callback for when the custom content is in the editor so that people can have a preview on the spot.
| panels_display | $display | |
| stdClass | $pane |
Definition at line 48 of file custom.inc.
00048 { 00049 $block = new stdClass(); 00050 $block->title = filter_xss_admin($pane->configuration['title']); 00051 // We don't want to render php output on preview here, because if something is 00052 // wrong the whole display will be borked. So we check to see if the php 00053 // evaluator filter is being used, and make a temporary change to the filter 00054 // so that we get the printed php, not the eval'ed php. 00055 $php_filter = FALSE; 00056 foreach (filter_list_format($pane->configuration['format']) as $filter) { 00057 if ($filter->name == 'PHP evaluator') { // TODO stupid way to check 00058 $php_filter = TRUE; 00059 } 00060 } 00061 // If a php filter is active, pass 1 to use core's most restrictive filter. 00062 $block->content = check_markup($pane->configuration['body'], $php_filter ? 1 : $pane->configuration['format']); 00063 return $block; 00064 }
| panels_admin_content_types_custom | ( | ) |
Return all content types available.
Definition at line 69 of file custom.inc.
References panels_get_path().
00069 { 00070 return array( 00071 'custom' => array( 00072 'title' => t('New custom content'), 00073 'icon' => 'icon_block_custom.png', 00074 'path' => panels_get_path('content_types/custom'), 00075 'description' => t('Create a completely custom piece of HTML content.'), 00076 'category' => array(t('Custom'), -10), 00077 ), 00078 ); 00079 }
| panels_admin_edit_custom | ( | $ | id, | |
| $ | parents, | |||
| $ | conf = NULL | |||
| ) |
Returns an edit form for the custom type.
Definition at line 84 of file custom.inc.
00084 { 00085 if (!is_array($conf)) { 00086 $conf = array('title' => '', 'body' => ''); 00087 } 00088 $form['title'] = array( 00089 '#type' => 'textfield', 00090 '#default_value' => $conf['title'], 00091 '#title' => t('Title'), 00092 ); 00093 $form['body'] = array( 00094 '#title' => t('Body'), 00095 '#type' => 'textarea', 00096 '#default_value' => $conf['body'], 00097 ); 00098 $parents[] = 'format'; 00099 $form['format'] = filter_form($conf['format'], 1, $parents); 00100 00101 return $form; 00102 }
| panels_admin_title_custom | ( | $ | conf | ) |
Returns the administrative title for a type.
Definition at line 107 of file custom.inc.
00107 { 00108 $output = t('Custom'); 00109 if ($conf['title']) { 00110 $output .= " (" . filter_xss_admin($conf['title']) . ")"; 00111 } 00112 return $output; 00113 }
| panels_content_custom | ( | $ | conf | ) |
Output function for the 'custom' content type. Outputs a custom based on the module and delta supplied in the configuration.
Definition at line 28 of file custom.inc.
00028 { 00029 static $delta = 0; 00030 00031 $block = new stdClass(); 00032 $block->module = 'custom'; 00033 $block->delta = ++$delta; 00034 $block->subject = filter_xss_admin($conf['title']); 00035 $block->content = check_markup($conf['body'], $conf['format'], FALSE); 00036 00037 return $block; 00038 }
| panels_custom_panels_content_types | ( | ) |
Callback function to supply a list of content types.
Definition at line 8 of file custom.inc.
00008 { 00009 $items['custom'] = array( 00010 'title' => t('Custom'), 00011 'weight' => -10, 00012 'single' => TRUE, 00013 'content_types' => 'panels_admin_content_types_custom', 00014 'render callback' => 'panels_content_custom', 00015 'editor render callback' => 'panels_admin_content_custom', 00016 'add callback' => 'panels_admin_edit_custom', 00017 'edit callback' => 'panels_admin_edit_custom', 00018 'title callback' => 'panels_admin_title_custom', 00019 'no override title' => TRUE, 00020 ); 00021 return $items; 00022 }
1.5.6