You are here

function panels_admin_edit_custom_php in Panels 6.2

Same name and namespace in other branches
  1. 5.2 content_types/custom_php.inc \panels_admin_edit_custom_php()

Returns an edit form for the custom_php type.

1 string reference to 'panels_admin_edit_custom_php'
panels_custom_php_panels_content_types in content_types/custom_php.inc
Callback function to supply a list of content types.

File

content_types/custom_php.inc, line 90

Code

function panels_admin_edit_custom_php($id, $parents, $conf = NULL) {
  if (!is_array($conf)) {
    $conf = array(
      'title' => '',
      'body' => '',
    );
  }
  $form['title'] = array(
    '#type' => 'textfield',
    '#default_value' => $conf['title'],
    '#title' => t('Title'),
  );
  $body = t('Any content you want to have passed along to theme function for displaying MUST be stored in $block->content.') . "\n\n";
  $body .= t('MAKE SURE YOU ERASE ALL OF THIS HELP TEXT. Only error-free php code should be saved in this field.') . "\n\n";
  $body .= t('Do NOT use php tags.');
  $form['body'] = array(
    '#title' => t('Body'),
    '#type' => 'textarea',
    '#default_value' => isset($conf['body']) ? $conf['body'] : $body,
    '#rows' => 10,
    '#description' => t('The PHP code you enter here will be evaluated at render-time. Any context data present in the display will be available to this code in the $context variable. <strong>DO NOT</strong> include <em>@php</em> tags.', array(
      '@php' => '<?php ?>',
    )),
  );
  return $form;
}