致命错误:第1075行/includes/theme.inc中不支持的操作数类型

时间:2013-09-13 01:27:14

标签: drupal-7

我正在尝试将Drupal6主题转换为Drupal7,并尝试进行必要的更改。 但是我收到了错误 致命错误:第1075行/includes/theme.inc中不支持的操作数类型 第1075行是 $ variables + = $ info ['variables'];

我的template.php文件如下

function template_preprocess_search_theme_form(&$variables) {
  $variables['search'] = array();
  $hidden = array();
  // Provide variables named after form keys so themers can print each element independently.
  foreach (element_children($variables['form']) as $key) {
    $type = $variables['form'][$key]['#type'];
    if ($type == 'hidden' || $type == 'token') {
      $hidden[] = drupal_render($variables['form'][$key]);
    }
    else {
      $variables['search'][$key] = drupal_render($variables['form'][$key]);
    }
  }
  // Hidden form elements have no value to themers. No need for separation.
  $variables['search']['hidden'] = implode($hidden);
  // Collect all form elements to make it easier to print the whole form.
  $variables['search_form'] = implode($variables['search']);
}



function template_breadcrumb($variables) {
  $breadcrumb = $variables['breadcrumb'];

  if (!empty($breadcrumb)) {
    // Provide a navigational heading to give context for breadcrumb links to
    // screen-reader users. Make the heading invisible with .element-invisible.
    $output = '<h2 class="element-invisible">' . t('You are here') . '</h2>';

    $output .= '<div class="breadcrumb">' . implode(' » ', $breadcrumb) . '</div>';
    return $output;
  }
}

    function template_node_submitted(&$variables){
      return t('By !username on @datetime', array(
          '!username' => theme('username', $variables['node']),
          '@datetime' => format_date($variable['node']->created),
      ));
    }




    function template_preprocess_page(&$variables){
      $search_box = drupal_render(drupal_get_form('search_form'));
       `enter code here`$variables['search_box'] = $search_box;
      }

请帮助我找到错误。因为我对Drupal很新,我无法调试它。

0 个答案:

没有答案