cornernote / yii-audit-module

Track and display usage information including page requests, database field changes, php errors and yii logs.
https://cornernote.github.io/yii-audit-module
Other
22 stars 13 forks source link

Search button does not show #5

Closed jbalatero closed 10 years ago

jbalatero commented 10 years ago

I followed the manual installation... Instead of putting it under protected/modules, I put it under protected/extensions, and set the alias on the extensions. Here's my path alias:

'aliases' => array(
        //yii-audit-module
        'audit' => realpath(__DIR__ . '/../extensions/yii-audit-module/audit'),
),

Here's my problem, No seach button on Error, Field, Log , Request. error field log request

In audit/views/layouts/main.php, I commented this out(line 15->22) so that it won't messed up (even if I uncomment this, still there's no search button), and added $this->beginContent() which points out to my main layout, and $this->endContent at the end.

main

cornernote commented 10 years ago

Hello @JbalTero,

The search button is inside the <h1> tag, which does not appear to be on your screenshots either.

Are you hiding the h1 tag using CSS?

cornernote commented 10 years ago

Here is a screenshot of where the search button is within my HTML:

clipboard02

cornernote commented 10 years ago

In addition...

The search button is in the controllers $this->menu, which is added into the heading in the layouts/column1.php file: https://github.com/cornernote/yii-audit-module/blob/master/audit/views/layouts/column1.php#L20

jbalatero commented 10 years ago

U mean this screenshot?. Let me check it, I did nothing about

tag main

jbalatero commented 10 years ago

hmmm.. I guess the problem is within mine,

AuditActiveForm appears..

block

because I change..., 'style' => 'display:none;' to 'style' => 'display:block;'

but there's no Search button, I guess this has something to do with my CSS,

Here's my html, I can see the AuditActiveForm but there's no h1 tag html

cornernote commented 10 years ago

I have a feeling the problem is in your main layout. Are you rendering $this->menu anywhere in your layout?

Can you try with the layout that comes with it to see if that helps?

jbalatero commented 10 years ago

I Solved it.

in AuditWebController, I added: public $layout = 'audit.views.layouts.column1';

screenshot from 2014-04-18 17 52 48

The problem is that, it does not explicitly declare the public $layout. That's why it does not use the column1.php layout.

You might consider adding the line in the repository. I don't know if this problem is only reproducable in my situation or might as well others. :)

Thanks for the assistance and the great extension! . :)

cornernote commented 10 years ago

It's declared in the module: https://github.com/cornernote/yii-audit-module/blob/master/audit/AuditModule.php#L31

This extends from CWebModule, which says "the layout that is shared by the controllers inside this module". Therefore it should not need to be defined in the controllers: http://www.yiiframework.com/doc/api/1.1/CWebModule#layout-detail

This works for me with no issues. Have you overwritten this setting in the module configuration in your config/main.php? If not, are there any other changes or config options you have set that may be interfering?

I would rather not declare this in AuditWebController because it will mean that you (and I) will not be able to change the setting using config/main.php.

cornernote commented 10 years ago

Can you share your module config from config/main.php?

Mine is like this:

return array(
    'modules' => array(
        'audit' => array(
            'class' => 'audit.AuditModule',
            'adminUsers' => array('brett@mrphp.com.au'),
            'userViewUrl' => array('/user/view', 'id' => '--user_id--'),
            'connectionID' => 'db',
        ),
       ...
    ),
    ...
);
jbalatero commented 10 years ago

Oh yeah! my bad.

in my config/main.php, under modules,

I guess I changed this...

// The layout used for module controllers. 'layout' => 'audit.views.layouts.column1',

mine was, // The layout used for module controllers. 'layout' => 'audit.views.layouts.main,

Now I see... One line of code can make a difference! hahah I reverted it back now, and changed it properly to 'layout' => 'audit.views.layouts.column1',

cornernote commented 10 years ago

Nice! Glad we got to the bottom of it.