I created a module to add styles to panels, but when i enable module, the IPE button disappear.

Comments

cesabal’s picture

??? Any answers for this issue? i don't understand why happened this... I need an answer please!!

merlinofchaos’s picture

Priority:Critical» Normal
Status:Active» Postponed (maintainer needs more info)

Well, you created a module. Something happened when you enabled that module.

By the power of deduction,I can say "Something is wrong with the code in your module."

You didn't attach anything about your module, so there's no real way to debug your code remotely. I'm sorry that it's difficult to help you, but people who post 1 sentence issue requests are unlikely to get their issues resolved. You should read the resources on how to submit helpful requests.

You've also marked this critical, and yet made it pretty clear that the problem is probably in your code. I think that pretty clearly makes this issue not critical -- but I'm going to guess that you haven't taken the time to read the issue priority guide that is linked right next to the priority widget either.

The short answer is: In order to get good results, you need to provide good information.

cesabal’s picture

Status:Postponed (maintainer needs more info)» Active

Ok, You're right!

Here more information!

I create a module to add style to panels, with plugins/styles

mymodule.info:

name = mymodule plugins styles extra
description = "Define news styles to render as plugins"
package = "mymodule"
dependencies[] = panels
core = 6.x

version = "6.x-1.0"
project = "mymodule_extra_styles"

plugins[panels][styles] = plugins_custom/styles

mymodule.module

<?php
/** The help page link **/
function mymodule_styles_help($path, $arg) {
  switch (
$path) {
    case
"admin/help#mymodule_styles":
      return
'<p>'t("Panels Custom Styles is a set of extra styles for panels. Adding more varation to your pages and Panels layouts") .'</p>';
      break;
  }
}
/**
* Implementation of hook_ctools_plugin_directory().
*/
function mymodule_styles_ctools_plugin_directory($module, $plugin) {
  if (
$module == 'panels') {
    return
'plugins/' . $plugin;
  }
}
?>

This module require a folder plugins_custom/style/ with folders styles,

plugin blue_tab file blue_tab.inc:

<?php
/**
* Implementation of hook_panels_styles().
*/

$plugin =  array(
       
'title' => t('Custom tab'),
       
'description'   => t('Apply a tab highlighted style, with different colors'),
       
'render pane' => 'blue_tab_render_pane',

       
'pane settings form' => 'blue_tab_settings_form',
       
'hook theme'    => array(
           
'blue_tab_pane' => array(
               
'template' => 'blue-tab-pane',
               
'path' => drupal_get_path('module', 'mymodule') .'/plugins_custom/styles/blue_tab',
               
'variables' => array('content' => NULL, 'settings' => NULL),
            ),
        ),
);

function
theme_blue_tab_render_pane($vars) {
   
$settings = $vars['settings'];
   
$content = $vars['content'];
    return
theme('blue_tab_pane', array('content' => $content, 'settings' => $settings));theme >>
}

function
blue_tab_settings_form($style_settings) {
   
$form['top_color'] = array(   
       
'#type' => 'select',   
       
'#title' => t('Top color'),
       
'#options' => array(
           
'blue' => t('Blue'),
           
'green' => t('Green'),
           
'gray' => t('Gray'),
           
'dark-blue' => t('Dark blue'),
           
'orange' => t('Orange'),
           
'white' => t('White'),
        ),
       
'#default_value' => (isset($style_settings['top_color'])) ? $style_settings['top_color'] : 'blue', // Un valor por defecto
   
);
 
    return
$form;
}
?>

It's true that I'm wrong about something, but I do not know why.

When enable the module, the button customize this page, of the ipe interface disappear.

I solve this, when add plugins into sites/all/modules/panels/plugins/styles/ directly but is not the correct way.

cesabal’s picture

I solve this in drupal 7, works great!, but on drupal 6 i don't know

merlinofchaos’s picture

    return theme('blue_tab_pane', array('content' => $content, 'settings' => $settings));theme >>

That line has a bug on it. Maybe when the plugin loads that error is doing something that breaks the IPE's javascript?

merlinofchaos’s picture

Also, in D6, the theme() calls are different!

You'll need to adjust your theme stuff to match Drupal 6 standards. And I apologize but I've not worked with D6 in so long that I don't remember the exact bits. I know that it should be: return theme('blue_tab_pane', $content, $settings) but there may be subtle differences in your theme definition as well.