2011-02-19

Problem with log in Chrome Web Inspector

Finnaly found why logging doesn't work in Chrome (web inspector). So... problem was in fire bug for chrome, when I switched it off logging start to work in naitive chrome developer tool (web inspector).

BTW: to send smth. to console in web inspector use this js code in your web application:
<script type="text/javascript"> 
/*<![CDATA[*/
if(typeof(console)=='object')
{
console.group("Application Log");
console.log("Your message");
console.groupEnd();
}
/*]]>*/
</script>

2011-02-05

yii CAutoComplete css

To chose higlight in dropdown list use this css^

//redefine color of selected item in dropdown list
.ac_over{
 background-color:#bb0000;
}

CAutoCoplete has class names like this
<li class="ac_even ac_over">...
That's mean that this element has 2 classes at the same time (separatede by space): ac_even and ac_over

Didn't know this trik before :)

2011-02-04

yii sRBAC

soo.... while installing yii sRBAC I got some problems.

Here they are:

1) Problem with config. Finally ... AuthManager in protected/config/main.php should looks like this:
<?php
return array(
//......some code.....

// application components
'components'=>array(
  'authManager' => array(
    'class'  => 'CDbAuthManager',
    'connectionID'     => 'db',
    'itemTable'          => 'AuthItem',
    'itemChildTable'    => 'AuthItemChild',
    'assignmentTable' => 'AuthAssignment',
    'defaultRoles'       =>  array('Guest'),
  ),
),

// autoloading model and component classes
'import'=>array(
      'application.models.*',
      'application.components.*',
      'application.modules.srbac.controllers.SBaseController',
  ),

'modules'=>array(
  'srbac'   => array(
                   'userclass' => 'User',
                   'userid'    => 'id',
                   'username'  => 'username',
                   'debug'     => true,
                   'pageSize'  => 20,
                   'superUser' => 'Authority',
                   'css'       => 'srbac.css', // <=====changed
                   //'notAuthorizedView' => 'application.theme.unauthorized', // <=====changed
                   'userActions'          => array('Show','View','List','Index'),
                   'listBoxNumberOfLines' => 15,
                   //'imagesPath'           => 'images',
                   //'imagesPack'           => 'noia',
                   'iconText'             => true,
                   'layout' => 'webroot.themes.THEME_NAME.views.layouts.nocolumn', // <=====changed (use this alias if you use theme in yii)
       
  ),
),
 
 
);
?>
2) I got problems with "lower case table names" in mySQL. To allow upper case in mySQL use this advice: 'add this line lower_case_table_names=2 to your my.ini file and restart wamp' http://www.wampserver.com/phorum/read.php?2,58873

2011-02-01

Problems with UTF-8 in Yii/Php

If you've got problems with UTF-8 in Yii/Php (using strlen or substr)... here is the solution:
mb_internal_encoding("UTF-8"); //set encoding

mb_strlen($utfstring); //use mb_strlen instead strlen
mb_substr($utfstring); //the same thing for substr