function render_pane($pane) { // Pass through to normal rendering if not in admin mode. if (!$this->admin) { return parent::render_pane($pane); } ctools_include('content'); $content_type = ctools_get_content_type($pane->type); // This is just used for the title bar of the pane, not the content itself. // If we know the content type, use the appropriate title for that type, // otherwise, set the title using the content itself. $title = ctools_content_admin_title($content_type, $pane->subtype, $pane->configuration, $this->display->context); if (!$title) { $title = t('Deleted/missing content type @type', array('@type' => $pane->type)); } $buttons = $this->get_pane_links($pane, $content_type); // Render administrative buttons for the pane. $block = new stdClass(); if (empty($content_type)) { $block->title = '<em>' . t('Missing content type') . '</em>'; $block->content = t('This pane\'s content type is either missing or has been deleted. This pane will not render.'); } else { $block = ctools_content_admin_info($content_type, $pane->subtype, $pane->configuration, $this->display->context); } $output = ''; $class = 'panel-pane'; if (empty($pane->shown)) { $class .= ' hidden-pane'; } if (isset($this->display->title_pane) && $this->display->title_pane == $pane->pid) { $class .= ' panel-pane-is-title'; } $output = '<div class="' . $class . '" id="panel-pane-' . $pane->pid . '">'; if (!$block->title) { $block->title = t('No title'); } $output .= '<div class="grabber">'; if ($buttons) { $output .= '<span class="buttons">' . $buttons . '</span>'; } $output .= '<span class="text">' . $title . '</span>'; $output .= '</div>'; // grabber $output .= '<div class="panel-pane-collapsible">'; $output .= '<div class="pane-title">' . $block->title . '</div>'; $output .= '<div class="pane-content">' . filter_xss_admin($block->content) . '</div>'; $output .= '</div>'; // panel-pane-collapsible $output .= '</div>'; // panel-pane return $output; }
/** * Render pane replacement. * * Parse multilingual config and choose apropriate for current language. */ function render_pane(&$pane) { global $language; // Check if we should skip pane translation. if (_mlpanels_pane_skip($pane->type, $pane->subtype)) { // Pass to default renderer. return parent::render_pane($pane); } // Prepare language dependent config. if (!empty($pane->configuration['mlpanels'])) { $ml_config = $pane->configuration['mlpanels']; $ml_config[LANGUAGE_NONE] = $pane->configuration; unset($ml_config[LANGUAGE_NONE]['mlpanels']); } else { $ml_config[LANGUAGE_NONE] = $pane->configuration; } // Set pane config to render. $pane->configuration = !empty($ml_config[$language->language]) ? $ml_config[$language->language] : $ml_config[LANGUAGE_NONE]; // Pass to default renderer. return parent::render_pane($pane); }
/** * Get the Panels storage oparation for a given renderer AJAX method. * * @param string $method * The method name. * * @return string * The Panels storage op. */ function get_panels_storage_op_for_ajax($method) { switch ($method) { case 'ajax_show': case 'ajax_hide': case 'ajax_select_content': case 'ajax_add_pane': case 'ajax_edit_pane': case 'ajax_panel_title': case 'ajax_cache_method': case 'ajax_cache_settings': case 'ajax_style_type': case 'ajax_style_settings': case 'ajax_pane_css': case 'ajax_lock': case 'ajax_access_settings': case 'ajax_access_add_test': case 'ajax_access_configure_test': case 'ajax_layout': case 'ajax_style': return 'update'; } return parent::get_panels_storage_op_for_ajax($method); }