Re: PHP Warning: SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/persistent/cake_core_file_map)

2012-02-19 Thread huoxito
Still dont understand why CakePHP 2.x has this kind of issue, getting 
permissions errors for command line user and apache user. 

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cake 2.0 Auth Component login method

2011-11-17 Thread huoxito
AD I came into this issue because Im migrating a 1.3 app to Cake 2.0 . And 
I did pass args to login method on Cake 1.3, I already liked to manually 
login the user back then, and it only returned true if the data passed was 
on the db, just like the warning on the new docs says.

Anyway I think I get it now. You're right I was confusing stuff. And I was 
used to the idea that Auth magically took care of both authentication and 
authorization.

ps. I logged in the user manually because I had that situation where a 
register and a login form appear in a same view. So I had to fake input 
names on one of the forms, get the values on the controller method, mount a 
new array and pass the data to the login method.

Thanks for helping

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cake 2.0 Auth Component login method

2011-11-16 Thread huoxito
So it seems I got a stupid question. Sorry folks sometimes I just cant see 
the sutff Im looking for.

Just read the new Auth doc carefully. I realized that theres authenticate 
and authorize configs but I did not realize why it is ok to authenticate 
when a user submitts a blank login form or whatever else. I pass empty 
values or values of a user that doesnt exist on the model and it still 
passes authentication .. why? It doesnt sound weird?

I get it that this works fine $this->Auth->login(). But I really don't get 
it why $this->Auth->login("whatever shit is submitted passes 
authentication") always return true. If there is any clear explanation 
about that on the docs I'm sorry I just miss it.

Should be looking into the core class to study it and try to understand it 
better when I get a break.




-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cake 2.0 Auth Component login method

2011-11-16 Thread huoxito
Hi

Thats why I asked the question. Because I read the warning on the doc.

"Warning -> In 2.0 $this->Auth->login($this->request->data) will log the 
user in with whatever data is posted"

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Cake 2.0 Auth Component login method

2011-11-15 Thread huoxito
Hi there everybody!

Could anyone please tell me why 2.0 Auth Component login method logs in the 
user whatever data is posted, even if the user is not on the database? I 
mean is this really a good idea?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakePHP & AJAX auto-refresh div in specified time interval - is it possible?

2011-10-13 Thread huoxito
yeah CakePHP is simply a PHP framework but it already offers some built in 
Ajax functionality.

And I've been studying Ruby on Rails a lot lately and I find it really great 
the way the framework works with Ajax. I haven't written any Ajax 
functionality with CakePHP in a while but next time I do it I will try to 
get it as close as possible to the way Rails does it.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: please help me

2011-10-11 Thread huoxito
.. worked great till I found out I need to figure out a way to make Acl 
behavior recognizes User model itself when saving a new record to Aros 
table.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: please help me

2011-10-10 Thread huoxito
Thanks for this post.

Making a new model and extend it to User model works great. Same situation 
here, two forms on the same view using the same model.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Which is the better IDE for cakePHP?

2011-09-28 Thread huoxito
Vim !!! You should give it a try. Though it may not be called as an IDE.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Pagination and JQuery: Passing parameters with JQuery to controller

2011-08-29 Thread huoxito
Have u tried to do it use cake built in ajax pagination?

http://book.cakephp.org/view/1600/Ajax-Pagination

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


CakeSession 2.0 custom handler config

2011-07-05 Thread huoxito
So here I was trying to help to improve the docs for 2.0. Speciffically how 
to config correctly the new Session settings.

I tried to write an example on building a new custom handler for Sessions. 
Created a file called MySession.php under app/Model/Datasource/Session/. 
Implemented the CakeSessionHandlerInterface class.

class MySession implements CakeSessionHandlerInterface {
function open($path, $session_name){}
function read($id){} 
function close(){}
function write($id, $data){}
function destroy($id){}
function gc($expires = null){}
}

Configured Session on core.php

Configure::write('Session', array(
'cookieTimeout' => 100,
'timeout' => 10,
'cookie' => 'teste',
'handler' => array('engine' => 'MySession')
));

I did some tests on the Methods on MySession class, they're all running. The 
problem is the $_SESSION var is cleaned somewhere at the end of the page 
loading. 
So I get to write values with the Session->write method but when I reload 
the page they're gone. That only happens when I set the custom handler 
Session config at core.php .

I could check that by puttting a debug($_SESSION) after this line 
https://github.com/cakephp/cakephp/blob/2.0/lib/Cake/Model/Datasource/CakeSession.php#L629
 . 
So When I use the defaults php built in config the debug print everything I 
had written to Session. But When I use the custom handler $_SESSION is just 
an empty array.

Has anyone bothered to give a look and write some examples on how custom 
handlers for Session on 2.0 should work? Anyone know how this works?

Also should the write and read methods on CakeSession ever to be called when 
setting a custom handlers at core.php?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Using Jquery-JSON to Send Data to the Server

2011-05-26 Thread huoxito
did you check on firebug if all params are passed correctly?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Using Jquery-JSON to Send Data to the Server

2011-05-25 Thread huoxito
do some debug($this->params) on the controller and you should see that data

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cookbook is partially offline/broken

2011-05-11 Thread huoxito
someone had a good intention trying to improve the book and setting up a new 
layout, but i miss the old one. for all the server erros, broken layout, and 
horizontal scroll bar that i see on the new one.  

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: What's the best way to upload an image in cakephp 1.3

2011-05-11 Thread huoxito
I had that same question when i began with cake, tried meio upload and media 
plugin. I ended up with none of them ... didnt like the way media upload 
arrange the upload / image configs. 

I think you should consider studying how model callbacks work and try to 
implement your own behavior with your own needs. Its really not that 
difficult even for a beginner.

As for a general class to use on your behavior to treat images you could use 
this one http://www.verot.net/php_class_upload_docs.htm It has lots of 
useful methods.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: TDD in CakePHP

2011-05-11 Thread huoxito
a bit off topic.

euromark answer might be rude but its really funny, havent seen that yet, 
rsrsrs

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Does pagination with custom urls really sucks?

2011-04-18 Thread huoxito
im not able to make route class and paginator helper work as i want too i 
guess.

if i try to reach example.com/controller/slug1/slug2/page:2 cakephp tries to 
find an action called slug1. Its like as if it ignores completely the route 
i defined.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Does pagination with custom urls really sucks?

2011-04-18 Thread huoxito
Im trying to use pagination in a view like these:

example.com/controller/slug1/slug2

so theres no action in the url

but when i try to paginate it the best i could get was: 

example.com/controller/action/slug1/slug2/page:2

Could anyone help to exclude that 'action' part of the url, please?

I've set a rule like this:

Route::connect('/:controller/:slug1/:slug2', array('action' => 
'someaction'), array('pass' => array('slug1', 'slug2')));
I also use the options on paginator to add the slugs paramters but i cant 
exclude the 'action' from the url.

...

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Is there any place on the web where we can submit and check migrations plugin issues?

2011-04-15 Thread huoxito
problem solved. I had to add a length => null to the field array

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Is there any place on the web where we can submit and check migrations plugin issues?

2011-04-15 Thread huoxito
I was just looking for something like that and couldn't find it.

Guess theres a bug when you generate migrations to change a varchar field to 
datetime. It write a query with datetime(100) for example .. 

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cake core might benefit from some more developers helping out

2011-04-07 Thread huoxito
I dont think cake development is based on the free time of one single 
person, for what i can see on github. But yes cake and every other framework 
might improve a lot with more developers joining the core team. I really 
wish i will fully understand how the framework work so i can begin to help 
as well.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: You favorite IDE/ Dev Setup?

2011-04-02 Thread huoxito
Ubuntu
Vim (still learning but already useful for me)
Gedit
Git
Shell
Apache
Mysql

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: session management

2011-03-30 Thread huoxito
the timeout you can set in core.php file

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: SUMIF in Cakephp

2011-03-30 Thread huoxito
yeah i have used the SUM mysql function just like Jeremy said above and it 
worked great 

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Migrations plugin - how to generate schema diffs

2011-03-28 Thread huoxito
So here I am kind of sutck with this migration plugin. I'm trying to 
generate schema diffs, followed the tutorials on the cakeDC website and doc. 

The first three steps are ok.

I generate my first migration with cake migration generate.
Then I generate a schema file with cake schema generate.
Generate another migration with cake migration generate.

>From now on all migrations i generate seems to be related to the schema file 
generated by the cakephp console on the second step above. So if table 
'examples' is created on third step it still appears on every other 
migration I generate later. I guess it shouldnt be like that as I keep 
getting errors like table 'examples' already exists when I try to execute a 
'cake migration all' on other workstation. 

Am I doing something stupid, or missing something? Any help would be 
appreciated. 

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: login and register system

2011-03-22 Thread huoxito
i believe it would be best for you to read the cakephp manual at first and 
only after that try plugins 

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: RE: CakePHP 1.3.8 and 1.2.10 released

2011-03-20 Thread huoxito
thanks!!!

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakePHP 2.0.0 Stable

2011-03-17 Thread huoxito
>From what I see on my github timeline mark commit most of the times, though 
there are a few other programmers helping as well. I have a great admiration 
fot the whole team

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Several questions about ACL

2011-02-16 Thread huoxito
I still have'n created a web interace to control permissioins with aros and 
acos but i guess the Acl component would deal with most of the stuff. 

Are you using the Acl behavior on your user model? I don't think that user 
should be repeated on the aros table ...

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: deployment, git hooks, migrations ... updating your app with command line

2011-02-16 Thread huoxito
... sharing how ended up the git hook post-receive script:

cd ~/myapp/public_html
env -i git reset --hard
env -i git pull origin master
cake migration all
cake deploy cache

I used both plugins said above, and it's been working great so far. 
Now I'm able to update my app with only one push command from my local 
server. One just needs have git installed on both local and production 
server, and have the deploy kit and migrations plugins along with the 
aplicattion.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: SWF Uploader ... or any Good One...?

2011-02-11 Thread huoxito
I used uploadify once and worked great though the app was not built on 
cakephp., lookin forward to try to implement it with cakephp

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Great Job on The Cookbook

2011-02-04 Thread huoxito
i know it might be necessary but the google ads kind of sucks

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: 2 Col Layout / Jquery / JSON

2011-01-28 Thread huoxito
something like this

$array(
'nome' => 'huoxito',
'bebida' => 'vinho',
'musica' => 'reggae'
);
$jsonArray = json_encode($array);












$.ajax({
 
 ... on request result
 success: function(result){
 var json = $.parseJSON(result);
 
 $.each(json, function(i,item) {
  $('#divnome').html(item.nome);
  $('#divbebida').html(item.bebida);
  $('#divmusica').html(item.musica);
 });
 
});

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: 2 Col Layout / Jquery / JSON

2011-01-28 Thread huoxito
convert a php array to a json array with json_encode (there's a built in 
function in php) and then on your response on ajax request you can do a 
foreach to put each key content of the array anywhere you want on the page.


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Paginate 2 models data as 1

2011-01-25 Thread huoxito
aren't the models related? If so a find 'all' call would do the work ..

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: deployment, git hooks, migrations ... updating your app with command line

2011-01-18 Thread huoxito
wwoww! thanks for those links! it might be exactly what I was looking for 

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Problem with saveAll() not saving related modelg any

2011-01-18 Thread huoxito
Maybe your data input array is not properly set up.

Array
(
[Article] => Array
(
[title] => My first article
)
[Comment] => Array
(
[0] => Array
(
[comment] => Comment 1
[user_id] => 1
)
[1] => Array
(
[comment] => Comment 2
[user_id] => 2
)
)
)


And I think it is not inserting any SalesTransaction records because it has 
not any direction relation with the Vendor model. Starting a manually 
transaction with getDataSource should work for inserting those records.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


deployment, git hooks, migrations ... updating your app with command line

2011-01-17 Thread huoxito
I'd like to share some thoughts on how I'm updating a cakephp app I've been 
working on and I'd apprecciate to hear how you do it for your apps ...

I'm about to make some important changes on this website that is already in 
production mode and I wonder if there is any way to do it using only git 
hooks and the cake console.

In a couple of days I'll need to create a new table on the production 
database and change / add some fields in existing tables. So far to update 
this app I used only a pretty small script on a git post-receive hook of the 
bare repository on my server, like this ( it runs every time I use a  'git 
push origin master' from my local machine ):

cd ~/myapp/public_html/
env -i git reset --hard
env -i pull origin master

which already saved me from having to use any ftp client. But now with this 
lots of changes I have to do in my production database I'm not sure if cake 
console migrattions can do that automatically. Does schema update really 
only alter tables? I mean what do you do to update a database without having 
to create tables by hand? 

Besides creating and modifying tables with migrattions I guess I also have 
to write some kind of shell script to clear all cache on my application so 
that models are refreshed. Otherwise it won't recognize the recently added 
table fields, Am I right about that? Or there is any other way for models to 
be refreshed on production mode?

If I could add only two more lines to the git hook script mentioned above, 
one for updating the database, including creating new tables if necessary, 
something like "cake schema update" to run the last schema created. And 
other line to execute a shell script to clear all cache ...  Updating this 
app and others by this example would be so much faster and secure ...


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Media Plugin - Set Up Many Custom Settings example

2011-01-15 Thread huoxito
I ended up creating a lot of attachments models, because each one of them 
had to have different settings, some would require only three images, other 
two, other images and pdf files ...

and I put the Configure::write('Media.Filter' ... configuration array on the 
constructor of each one of those models. LIke this:

function __construct(){
  parent::__construct();
  $l = array('convert' => 'image/jpeg', 'fit' => array(600, 450));
  $m = array('convert' => 'image/jpeg', 'fitCrop' => array(318, 160));
  $s = array('convert' => 'image/jpeg', 'fit' => array(200, 125));
  Configure::write('Media.filter', array('image' => compact('m','l','s'),
   'document' => array()));
 }

It's been some weeks I don't work on this app, but I guess it worked at that 
time. Still I don't understand why the plugin developer put the 
configurations of images sizes, and other files like one unique array on a 
core.php file. It sounds a lot more usual to me that different models would 
mostly require different upload settings ... 

anyway, the plugin is really interesting, I intend to stick with it and 
hopefully adapt it to my specific needs ...

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: how to use transactions in cakephp

2011-01-13 Thread huoxito
yeah, i'll take a look at that .., thanks

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: how to use transactions in cakephp

2011-01-11 Thread huoxito
great topic, just helped me alot here, thanks! so good cake got this group!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: to Test or not to Test

2011-01-08 Thread huoxito
i've been studyin cake a lot recently but like still don't get the test part 
of it. Maybe because I'm new to frameworks and oop and even the programming 
world.

I once tried to install simple test and make run some testing but I didnt 
find any nice tutotials, got kind of stuck really soon on this and decided 
to stop and check it later, what I'll do. 

I also watched the mark story video on cakefest but it also wasn't much 
helpful for me. It really conviced me that testing is essecial to prevent 
bugs on your app but I don't remember it explaining how to begin with it. 
Maybe I'll have to watch that again.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Youtube API

2011-01-02 Thread huoxito
I decided to give a try on youtube api today but I did things differently

I put all zend files in libs directory, added this line in my core.php file 
...

set_include_path(get_include_path() . PATH_SEPARATOR . APP.'libs');

... and wherever I want to work with the api I just do a normal require for 
the zend loader class 

require_once 'Zend/Loader.php'; // the Zend dir must be in your include_path
Zend_Loader::loadClass('Zend_Gdata_YouTube');
$yt = new Zend_Gdata_YouTube();

I've only tested this approach on my local server, Hopefully it won't slow 
down the application in a production environment. 
Has anybody else worked with any google api on cakephp? How would you set it 
up?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Happy Holiday yule Cake - CakePHP 2.0-dev released

2010-12-26 Thread huoxito
great! really hope to get to completely understand how cake works to be able 
to be a part of that team

looking forward to work with 2.0

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Handing control over to another controller without redirect or requestAction.

2010-12-26 Thread huoxito
The controller class has a setAction() function which *Internally redirects 
one action to another. Does not perform another HTTP request unlike 
Controller::redirect()* but it I guess it only works within the same 
controller ...

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: saveAll and validation Error on associated Model

2010-12-26 Thread huoxito
ops, setting validate to true kind of lose the real purpose of saveAll 
method, stuck again ...

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: saveAll and validation Error on associated Model

2010-12-25 Thread huoxito
I just had a very similar problem, came here to find a solution, afterall i 
found it in the official doc itself, I just set the validate option to true, 
default is first which would validate all record before saving them and 
would lead to those validation errors.

saveAll($this->data,array('validate' => true))

So that, as the doc says, *validate each record before saving.**
*

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Please some explanations on persistModel attribute and perfomance issues

2010-12-25 Thread huoxito
thanks, 

I'll give a look at that tonight, never did something like that so far.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Please some explanations on persistModel attribute and perfomance issues

2010-12-25 Thread huoxito
thanks very much for your help cricket, I hadn't realized that cake wouldn't 
run those queries on production mode, guess that was a dumb questions. 
thanks!

I'm trying to set my database as good as possible. What do you mean by 
removing htaccess support? wouldn't my app lose pretty urls if I do that?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Please some explanations on persistModel attribute and perfomance issues

2010-12-24 Thread huoxito
I am trying to make cake not generate the kinds of queries below every 
minute or so. Reading the book I found the controller attribute 
persistModel. I set it true in one of my controllers but these show full 
columns queries still shows up every minute.

1SHOW FULL COLUMNS FROM `drg_aros`
771 2SELECT CHARACTER_SET_NAME FROM INFORMATION_SCHEMA.COLLATIONS WHERE 
COLLATION_NAME= 'utf8_general_ci';
110 3SHOW FULL COLUMNS FROM `drg_acos`
771 4SHOW FULL COLUMNS FROM `drg_aros_acos`
771 5SHOW FULL COLUMNS FROM `drg_usuarios`
12121 6SHOW FULL COLUMNS FROM `drg_sugestos`
660
Could anyone please explain if the persistModel attribute really make any 
improvements on performance and how? I found it strange that the book barely 
gives any info on it. 

And how do you set up your apps on cakephp to be as fast as possible?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: IDE

2010-12-22 Thread huoxito
I use Komodo Edit, free version, it has a nice plugin for cakephp with 
autocomplete, it get a little bit slow sometimes on ubuntu but it's great. 
Sometimes I try to use gedit but it lacks a lot of interesting stuff like 
'ctrl + y' to redo things, tabbing the code is not so good.

Also some good programmers I know have strongly encouraged me to use vim. I 
guess I need to take a huge look at it.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Best plugins presentation ever

2010-12-14 Thread huoxito
great!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Acl

2010-12-13 Thread huoxito
you could start with this one

http://net.tutsplus.com/tutorials/php/how-to-use-cakephps-access-control-lists/

On 13 dez, 08:07, Alexsandro  wrote:
> Good morning everyone!
>
> I'm very definitely a respoeito Acl in cake 1.3. I have not found a
> nice tutorial where I can study.
> I believe in the official documentation is a bit outdated version.
> Could anyone give me a good tutorial?
>
> Atenciosamente,
>
> Alexsandro André
> Joinville - SC
> 47-8825-0133

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Time Helper to show only the date and not the time

2010-12-12 Thread huoxito
I also like to modify some datetime fields on afterfind() callbacks
but I believe it's also good to create your own helper where you would
have methods to show dates any way you want. For example I created
this one which allows to output datetime fields in many different
ways.

class DataHelper extends AppHelper {

function formata($data, $formato = 'completa')
{
$hora = substr($data,11,8);
if(!empty($hora)){
list ($h,$m,$s) = explode (':', $hora);
$hora = $h.':'.$m;
}

$data = substr($data,0,10);
list ($ano,$mes,$dia) = explode ('-', $data);

$diaSemana = array();
$diaSemana["Sun"] = "Dom";
$diaSemana["Mon"] = "Seg";
$diaSemana["Tue"] = "Ter";
$diaSemana["Wed"] = "Qua";
$diaSemana["Thu"] = "Qui";
$diaSemana["Fri"] = "Sex";
$diaSemana["Sat"] = "Sáb";

$mesAno = array();
$mesAno['01'] = "Jan";
$mesAno['02'] = "Fev";
$mesAno['03'] = "Mar";
$mesAno['04'] = "Abr";
$mesAno['05'] = "Mai";
$mesAno['06'] = "Jun";
$mesAno['07'] = "Jul";
$mesAno['08'] = "Ago";
$mesAno['09'] = "Set";
$mesAno['10'] = "Out";
$mesAno['11'] = "Nov";
$mesAno['12'] = "Dez";

$mesLongo = array();
$mesLongo['01'] = "Janeiro";
$mesLongo['02'] = "Fevereiro";
$mesLongo['03'] = "Março";
$mesLongo['04'] = "Abril";
$mesLongo['05'] = "Maio";
$mesLongo['06'] = "Junho";
$mesLongo['07'] = "Julho";
$mesLongo['08'] = "Agosto";
$mesLongo['09'] = "Setembro";
$mesLongo['10'] = "Outubro";
$mesLongo['11'] = "Novembro";
$mesLongo['12'] = "Dezembro";

$diaDaSemanaTimeStamp = mktime(0,0,0,$mes,$dia,$ano);
$diaDaSemana = date('D',$diaDaSemanaTimeStamp);

if($formato === 'completa')
{
$dataFormatada = $dia.'-'.$mes.'-'.$ano.', '.$hora;
}
else if($formato === 'diamesano')
{
$dataFormatada = $dia.'-'.$mes.'-'.$ano;
}
else if($formato === 'porextenso')
{
$dataFormatada = $dia.'-'.$mesAno[$mes].'-'.$ano;

}else if ( $formato === 'mesextenso' ){
# data já esta no formato 'humano'
list ($dia,$mes,$ano) = explode ('-', $data);
$mesExtenso = $mesAno[$mes];
$dataFormatada = $dia.'-'.$mesExtenso.'-'.$ano;
}else if ( $formato === 'diadasemana' ){
$dataFormatada = $diaSemana[$diaDaSemana];
}else if ( $formato === 'longadescricao' ){
$dataFormatada = $diaSemana[$diaDaSemana].', '.$dia.' '.
$mesLongo[$mes].', '.$ano;
}

return $dataFormatada;
}

}

On 12 dez, 15:11, Somchok Sakjiraphong  wrote:
> I usually use the afterFind() technique described in the 
> Cookbookhttp://book.cakephp.org/view/1048/Callback-Methods
>
> On Dec 12, 12:02 am, cricket  wrote:
>
>
>
> > echo date('M j, Y', strtotime($post['Post']['created']));
>
> > What I've done in the past a couple of times is put code in
> > afterFind() to add something like this as
> > $data[$this->alias]['created_string'].
>
> > On Fri, Dec 10, 2010 at 11:41 AM, georgeman  
> > wrote:
> > > What if I want to only show the date and not the time, for example:
> > > December 10, 2010
>
> > > I have a solution that works but it seems to me there must be an
> > > easier way to do, something that I overlooked. Here is my solution:
>
> > > Time->fromString($post['Post']
> > > ['created']))); ?>
>
> > > Is there an easier way to do this?
>
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others 
> > > with their CakePHP related questions.
>
> > > You received this message because you are subscribed to the Google Groups 
> > > "CakePHP" group.
> > > To post to this group, send email to cake-php@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > > athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Media Plugin - How to set different instructions for differents kinds of images?

2010-12-11 Thread huoxito
this is the error i keep getting ...

Warning (512): GeneratorBehavior::make - Failed to make version `s` of
file `/var/www/optogrupo/app/webroot/media/transfer/img/
dsc02738_13.jpg`.  [APP/plugins/media/models/behaviors/generator.php,
line 167]

... when I try to set up Media filter instructions inside a model on a
beforeValdate method:

$l = array('convert' => 'image/jpeg', 'fit' => array(600,
450));
$m = array('convert' => 'image/jpeg', 'fitCrop' => array(318,
160));
$s = array('convert' => 'image/jpeg', 'fit' => array(200,
125));
Configure::write('Media.filter', array('image' =>
compact('m','l','s')));
return true;

On 11 dez, 16:38, huoxito  wrote:
> Could anybody post any examples on how I could have Media.filter
> instructions on the same upload?
>
> I want to upload two kind of images on the same form, For one of them
> I need only two copies, versions. And for the other one I need three
> copies I tried to do it on a beforeFilter but I was still getting some
> errors saying that the generator behavior couldn't created some
> versions. Now itm trying this code but I still don't feel that I got
> the plugin working idea right so far:
>
>     function beforeValidate(){
>
>         if(isset($this->data['AttachmentNoticias']['group'])){
>
>             if($this->data['AttachmentNoticias']['group'] ===
> 'imgFront'){
>                 $l = array('convert' => 'image/jpeg', 'fit' =>
> array(600, 450));
>                 $m = array('convert' => 'image/jpeg', 'fitCrop' =>
> array(318, 160));
>                 $s = array('convert' => 'image/jpeg', 'fit' =>
> array(200, 125));
>             }
>
>             if($this->data['AttachmentNoticias']['group'] ===
> 'imgText'){
>                 $l = array('convert' => 'image/jpeg', 'fit' =>
> array(600, 450));
>                 $m = array('convert' => 'image/jpeg', 'fitCrop' =>
> array(318, 160));
>                 $s = array('convert' => 'image/jpeg', 'fit' =>
> array(200, 125));
>             }
>
>             Configure::write('Media.filter', array('image' =>
> compact('m','l','s')));
>         }
>
>         return true;
>     }

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Media Plugin - How to set different instructions for differents kinds of images?

2010-12-11 Thread huoxito
Could anybody post any examples on how I could have Media.filter
instructions on the same upload?

I want to upload two kind of images on the same form, For one of them
I need only two copies, versions. And for the other one I need three
copies I tried to do it on a beforeFilter but I was still getting some
errors saying that the generator behavior couldn't created some
versions. Now itm trying this code but I still don't feel that I got
the plugin working idea right so far:

function beforeValidate(){

if(isset($this->data['AttachmentNoticias']['group'])){

if($this->data['AttachmentNoticias']['group'] ===
'imgFront'){
$l = array('convert' => 'image/jpeg', 'fit' =>
array(600, 450));
$m = array('convert' => 'image/jpeg', 'fitCrop' =>
array(318, 160));
$s = array('convert' => 'image/jpeg', 'fit' =>
array(200, 125));
}

if($this->data['AttachmentNoticias']['group'] ===
'imgText'){
$l = array('convert' => 'image/jpeg', 'fit' =>
array(600, 450));
$m = array('convert' => 'image/jpeg', 'fitCrop' =>
array(318, 160));
$s = array('convert' => 'image/jpeg', 'fit' =>
array(200, 125));
}

Configure::write('Media.filter', array('image' =>
compact('m','l','s')));
}

return true;
}

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: HABTM question

2010-12-08 Thread huoxito
I believe people_roles_summer_schools wouldn't be a nice table name
for a cakephp app. I once tried to bake something like that and it
didnt work, instead I used a single name for a table which has many
foreign keys.



On 8 dez, 07:42, Jens Dittrich  wrote:
> Hello,
>
> I have the following situation in which i need help:
> There are people, roles and lectures, summer_schools and
> presentations.
> People HABTM roles. Depending on their role people are associated to
> lectures or summer_schools or presentations. So I am planning on
> creating more HABTM-tables called lectures_people_roles,
> people_roles_summer_schools and so on.
>
> Is that supported by cakes ORM(bake)? Is ist configurable manually in
> the models or am I asking to much or just making it more complicated
> than necessary?
>
> thanks in advance,
> jens

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Media Plugin - Set Up Many Custom Settings example

2010-12-07 Thread huoxito
I've been struggling for two days to understand the Media Plugin.
Intend to use it to deal with all media files, mostly images and pdfs,
for this project I'm developing.

I still have doubts on how I'm gonna do a lot of stuff with the plugin
but so far I'd like to share an example with you and hear your
thoughts about it.

Here is a minified context of the app:

I have a News model which will need at least two different images with
different sizes attached to it.
There's also a Download model which will need an image, using size
settings different from the one on news model, and a pdf file.

To be able to have different validations settings and image size
settings I first changed the attachments element. When calling it I
added a group variable to it. For example:

echo $this->element('attachments',
array('plugin' => 'Media',
  'assocAlias' => 'Attachment.0',
  'model' => 'Download',
  'label' => 'Image',
  'group' => 'img'));
echo $this->element('attachments',
array('plugin' => 'Media',
  'assocAlias' => 'Attachment.1',
  'model' => 'Download',
  'label' => 'Pdf File',
  'group' => 'pdf'));

This way I am able to have custom validation rules on model for each
type of file and then give differents responses for the user on each
input instance.

On attachments model I added this beforeValidate function where I
intend to write custom settings for each upload case on the
application.

function beforeValidate(){

if($this->data['Attachment']['model'] === 'Download'){
$m = array('convert' => 'image/jpeg', 'fitCrop' => array(150,
210));
Configure::write('Media.filter', array('image' =>
compact('m')));
}

if($this->data['Attachment']['group'] === 'pdf'){
$this->validate = array(
'file' => array(
'size'   => array(
'rule' => array('checkSize', '2M'),
),
'extension'  => array(
'rule' => array('checkExtension', false,
array('pdf')),
),
'mimeType'   => array(
'rule' => array('checkMimeType', false,
array('application/pdf')),
)
),
);
$this->Behaviors->detach('Media.Generator');
}else{
$this->validate = array(
'file' => array(
'size'   => array(
'rule' => array('checkSize', '1M'),
),
'extension'  => array(
'rule' => array('checkExtension', false,
array('jpg', 'jpeg', 'png','gif')),
),
'pixels' => array(
'rule' => array('checkPixels', '1600x1600'),
),
'mimeType'   => array(
'rule' => array('checkMimeType', false,
array('image/jpeg', 'image/png',
'image/gif')),
)
),
);
$this->Behaviors->attach('Media.Generator');
}
return true;
}



I'd really like to hear what you guys think of the approach used
above. I made these conditions on a beforeValidate function because I
couldn't figure out a way to change input file names and still make
the plugin auto magically upload the files and save them on a
database. I'm also wondering that if this Attachments model get too
huge of conditions I'd better create one model for each attachment
related model to let validations and other settings more clear.

Also found the architecture the plugin really fantastic, it'd take a
life for a begginer cakephp developer and object stuff student to
develop something like that.

Hope my english was good enough to make my point.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Using or not using PHP framework

2010-12-02 Thread huoxito
I worked with standard, procedural php for a year, still do on the
company unfortunatly. But on the last three months I began to develop
in cakephp and mvc and it's being great, i'm stunned how far better
coded my projects can be with cakephp

On 2 dez, 03:20, Jeremy Burns | Class Outfit
 wrote:
> I would thoroughly recommend/encourage/endorse making a contribution though. 
> You'd normally pay for something this good, it'll be profitable for you and 
> it will help keep it growing.
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 2 Dec 2010, at 06:18, ambati kiran wrote:
>
> > no.
> > Its free of cost. its open source.
> > cakephp.org is where you can download cakephp and to get good information.
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups 
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Which upload plugin/behavior/component do YOU use? --psybear

2010-11-26 Thread huoxito
I tried only Meio Upload so far, but also found it a little bit buggy,
I'll give a try on Media Plugin said above

On 26 nov, 07:25, Amit Badkas  wrote:
> Hi,
>
> http://www.ad7six.com/entries/view/69/Generic-File-Upload-Behavioris still
> very useful for me 
> alongwithhttp://www.sanisoft.com/blog/2010/08/30/cakephp-how-to-re-size-images...
>
> Amit Badkas
>
> PHP Applications for E-Biz:http://www.sanisoft.com
>
> On Fri, Nov 26, 2010 at 2:30 PM, Joshua Muheim  wrote:
> > thanks, odd. Anyone else has an opinion on an upload thingie? :-)
>
> > On Thu, Nov 25, 2010 at 10:00 AM, odd
> >  wrote:
> > > I'm using David Perssons Media Plugin because it is very flexible,
> > > makes media modification/conversion (thumbnails, compression, type
> > > conversion, etc..) simple, is easy to extend, and is up to date. It
> > > just could need more documentation, examples, etc., and a little more
> > > automagic when it comes to updating records and managing versions.
>
> > >https://github.com/davidpersson/media
>
> > > Regards
>
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help
> > others with their CakePHP related questions.
>
> > > You received this message because you are subscribed to the Google Groups
> > "CakePHP" group.
> > > To post to this group, send email to cake-php@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > cake-php+unsubscr...@googlegroups.comFor
> > >  more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.comFor
> >  more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en
>
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Is there a way to generate schema with some rows on tables?

2010-11-25 Thread huoxito
i'll try to make it happen

On 25 nov, 04:42, Zaky Katalan-Ezra  wrote:
> Write a script that use the mysql/mysqldump command line tools to create the
> schema.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Is there a way to generate schema with some rows on tables?

2010-11-24 Thread huoxito
I was trying out cake schema generation and started to wonder if there
is a way to generate schemas files with the rows present at the
tables. So that every time i would run on console 'schema create' I
could go back to a point in my database where I would always have
already user's table with some users for example.

is there a way to do it? read the doc but it only says we can generate
schemas.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: JS helper

2010-11-24 Thread huoxito
Yes, Michael, that's it, maybe I was just a little bit lazy when I
said that, sorry

On 23 nov, 18:42, Michael T  wrote:
> Huoxito - are you referring to server side and client side validation?
> Generally, it's a good idea to do both anyway. That way you can
> guarantee that even if someone attempts to trick the server into
> saving something invalid, it will still be validated.
>
> On Nov 22, 7:22 pm, huoxito  wrote:
>
> > I just thought the section about the request method as weel as the
> > other,http://book.cakephp.org/view/1593/Methods, could have a better
> > example to make things clearer about it. Also I believe the way i
> > treat ajax calls on controller is a little bit messy, as for example
> > when trying to save some data I need to put conditions both on the
> > controller code and on the js view code in order to give a relevant
> > answer to the user. Wish I knew, if there is any, a way to make it in
> > only one part of the code.
>
> > and thanks for offering help here Mark
>
> > On 22 nov, 02:45, mark_story  wrote:
>
> > > Sorry to hear you aren't enjoying the JsHelper.  I've updated the
> > > documentation examples for Ajax Pagination to include the omissions
> > > you had trouble with (http://book.cakephp.org/view/1600/Ajax-
> > > Pagination).
>
> > > As for the complexity of making links, you could use JsHelper::link()
> > > to make those a bit easier.
>
> > > echo $this->Js->link(
> > >   $image,
> > >   array('controller' => 'characters', 'action' => 'display', $id),
> > >   array('update' => '#InfoBox1', 'before' => ''),
> > > );
>
> > > would create the  and the necessary javascript.  What else did you
> > > find lacking in the documentation for JsHelper?  Hopefully, I can add
> > > some more examples and clarify some of the missing information.  For
> > > some background on the helper,  it wasn't intended to solve every
> > > javascript need you could possibly have, as that's an impossible goal
> > > to try and achieve.  In the past there were numerous complaints about
> > > how AjaxHelper was too tightly coupled to Prototype and that it would
> > > be nice to have something that integrated with other libraries like
> > > jQuery.  JsHelper does solve that issue, and provides an extensible
> > > interface for you to plug in Javascript generating functions.  But it
> > > doesn't and can't prevent you from having to write Javascript. Sorry
> > > that it didn't meet your expectations on that front.
>
> > > -Mark
>
> > > On Sep 27, 3:56 am, "l...@poczta.fm"  wrote:
>
> > > > Hi,
>
> > > > I needed a simple Ajax feature to load box with additional info and
> > > > close it after reading. I am new to Ajax and seldom used JS scripts
> > > > till now. I need your opinion/help on optimizing following piece of
> > > > code. The JS helper documentation is terrible - I'll share my
> > > > experience on this at the end of this post for these interested.
> > > > Please advice on questions that follow the code.
>
> > > > 1. I have 'ajaxInfoBox' element that is called with an ID of the
> > > > object I want to display. I have a need of few on the page hence
> > > > element - to keep unique div ids.
> > > > 2. Element displays icons with arrows down (opens box when clicked)
> > > > and up (closes box when clicked). Additionally they hide/show
> > > > alternatively themselves. Also I have a hidden busy indicator on main
> > > > layout that is copied and displayed within the box while the box data
> > > > is being loaded.
> > > > 3. The content of the box comes (Ajax request) from another
> > > > controller, which prepares set of data and renders it through
> > > > dedicated HTML view. To makes things simple (I am not efficient in JS)
> > > > I prefer using HTML views rather then JSON and JQuery loaded by
> > > > inclusions functions.
>
> > > > Here is the 'ajaxInfoBox' element code (bare functionality, no
> > > > exceptions):
>
> > > >         echo '';
> > > >         echo ' > > > alt="Info">'.$this->Html->image('icons/Colored/PNG/arrow_down.png').'';
>
> > > >         echo $this->Js->get('

Re: JS helper

2010-11-21 Thread huoxito
I just thought the section about the request method as weel as the
other, http://book.cakephp.org/view/1593/Methods, could have a better
example to make things clearer about it. Also I believe the way i
treat ajax calls on controller is a little bit messy, as for example
when trying to save some data I need to put conditions both on the
controller code and on the js view code in order to give a relevant
answer to the user. Wish I knew, if there is any, a way to make it in
only one part of the code.

and thanks for offering help here Mark

On 22 nov, 02:45, mark_story  wrote:
> Sorry to hear you aren't enjoying the JsHelper.  I've updated the
> documentation examples for Ajax Pagination to include the omissions
> you had trouble with (http://book.cakephp.org/view/1600/Ajax-
> Pagination).
>
> As for the complexity of making links, you could use JsHelper::link()
> to make those a bit easier.
>
> echo $this->Js->link(
>   $image,
>   array('controller' => 'characters', 'action' => 'display', $id),
>   array('update' => '#InfoBox1', 'before' => ''),
> );
>
> would create the  and the necessary javascript.  What else did you
> find lacking in the documentation for JsHelper?  Hopefully, I can add
> some more examples and clarify some of the missing information.  For
> some background on the helper,  it wasn't intended to solve every
> javascript need you could possibly have, as that's an impossible goal
> to try and achieve.  In the past there were numerous complaints about
> how AjaxHelper was too tightly coupled to Prototype and that it would
> be nice to have something that integrated with other libraries like
> jQuery.  JsHelper does solve that issue, and provides an extensible
> interface for you to plug in Javascript generating functions.  But it
> doesn't and can't prevent you from having to write Javascript. Sorry
> that it didn't meet your expectations on that front.
>
> -Mark
>
> On Sep 27, 3:56 am, "l...@poczta.fm"  wrote:
>
> > Hi,
>
> > I needed a simple Ajax feature to load box with additional info and
> > close it after reading. I am new to Ajax and seldom used JS scripts
> > till now. I need your opinion/help on optimizing following piece of
> > code. The JS helper documentation is terrible - I'll share my
> > experience on this at the end of this post for these interested.
> > Please advice on questions that follow the code.
>
> > 1. I have 'ajaxInfoBox' element that is called with an ID of the
> > object I want to display. I have a need of few on the page hence
> > element - to keep unique div ids.
> > 2. Element displays icons with arrows down (opens box when clicked)
> > and up (closes box when clicked). Additionally they hide/show
> > alternatively themselves. Also I have a hidden busy indicator on main
> > layout that is copied and displayed within the box while the box data
> > is being loaded.
> > 3. The content of the box comes (Ajax request) from another
> > controller, which prepares set of data and renders it through
> > dedicated HTML view. To makes things simple (I am not efficient in JS)
> > I prefer using HTML views rather then JSON and JQuery loaded by
> > inclusions functions.
>
> > Here is the 'ajaxInfoBox' element code (bare functionality, no
> > exceptions):
>
> >         echo '';
> >         echo ' > alt="Info">'.$this->Html->image('icons/Colored/PNG/arrow_down.png').'';
>
> >         echo $this->Js->get('#OpenCommand'.$Id)->event('click',
> >                 $this->Js->request(array('controller' => 'Characters', 
> > 'action' =>
> > 'displayCharacter', $Id), array (
> >                         'update' => '#InfoBox'.$Id,
> >                         'before' 
> > =>'$("#busy-indicator").clone().appendTo("#InfoBox'.
> > $Id.'").show();'
> >                         . '$("#InfoBox'.$Id.'").show();',
> >                 ))
> >         );
> >         echo $this->Js->get('#OpenCommand'.$Id)->event('click', '$
> > ("#OpenCommand'.$Id.'").hide();');
> >         echo $this->Js->get('#OpenCommand'.$Id)->event('click', '$
> > ("#CloseCommand'.$Id.'").show();');
> >         echo ' > style="display: none">'.$this->Html->image('icons/Colored/PNG/
> > arrow_top.png').'';
> >         echo $this->Js->get('#CloseCommand'.$Id)->event('click', '$
> > ("#InfoBox'.$Id.'").empty();');
> >         echo $this->Js->get('#CloseCommand'.$Id)->event('click', '$
> > ("#CloseCommand'.$Id.'").hide();');
> >         echo $this->Js->get('#CloseCommand'.$Id)->event('click', '$
> > ("#InfoBox'.$Id.'").hide();');
> >         echo $this->Js->get('#CloseCommand'.$Id)->event('click', '$
> > ("#OpenCommand'.$Id.'").show();');
>
> >         echo '';
> >         echo '';
>
> > Few problems I faced with the above:
> > - I have not managed to deploy toggle() JQuery function through the JS
> > helper hence so many separate lines
> > - used many event JS helpers functions as concatenating actions after
> > one get() did not work as expected.
> > - did not use url attribute for HTML->img as id is tied to image not
> > the

Re: Undefined property: View::$Js

2010-11-21 Thread huoxito
check if you're not overwriting the helper in any other controller,
it's weird, never had this kind of problem.

On 22 nov, 01:18, rogwei  wrote:
> Yes, I did.
>
> On Nov 21, 6:58 pm, huoxito  wrote:
>
> > Hey rogwel did you declare this line
>
> > var $helpers = array('Js' => 'Jquery');
>
> > in your app_controller?
>
> > On 21 nov, 23:16, rogwei  wrote:
>
> > > Declare the helper in the controller:
> > > var $helpers = array('Js' => 'Jquery');
>
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Undefined property: View::$Js

2010-11-21 Thread huoxito
Hey rogwel did you declare this line

var $helpers = array('Js' => 'Jquery');

in your app_controller?

On 21 nov, 23:16, rogwei  wrote:
> This must be a very basic question, but I don't see the solution
> anywhere. One person raised the question on CakePHP Qs but it was not
> answered. I am trying to set up the Js helper but am getting the
> subject error after following the setup in the manual. The following
> summarizes my setup.
>
> Download library and install in webroot. Path to jquery library:
> /Users/user/Sites/MyAppName/js/jquery-1.4.4.js
>
> Link to library in default layout file. In the  tag of
> default.ctp:
> echo $this->Html->script('jquery-1.4.4');
>
> When I view source on the rendered home page view, I can see a link to
> the jquery library and click the link to load the jquery source, so I
> know the library is linked correctly.
>
> Write out buffered scripts. This is the line that causes the error.
> Immediately preceding the  tag in default.ctp:
> Js->writeBuffer(); ?>
>
> Declare the helper in the controller:
> var $helpers = array('Js' => 'Jquery');
>
> I get the error when visiting the home page of the app (http://
> localhost/~user/MyAppName/).
>
> Can someone please tell me what I am missing?
>
> 
> The complete notice and error messages follow.
>
> Notice (8): Undefined property: View::$Js [APP/views/layouts/
> default.ctp, line 47]
> Code | Context
>     Session->flash('email');?>
>
> Js->writeBuffer(); ?>
> $___viewFn      =       "/Users/user/cake/1.3.x/MyAppName/views/layouts/
> default.ctp"
> $___dataForView =       array(
>         "page" => "home",
>         "subpage" => null,
>         "title_for_layout" => "Home",
>         "content_for_layout" => "     id="MyAppNameForm" >
>         
>         
>     ",
>         "scripts_for_layout" => "",
>         "form" => FormHelper
> FormHelper::$helpers = array
> FormHelper::$fieldset = array
> FormHelper::$__options = array
> FormHelper::$fields = array
> FormHelper::$requestType = NULL
> FormHelper::$defaultModel = NULL
> FormHelper::$_inputDefaults = array
> FormHelper::$base = "/~user/MyAppName"
> FormHelper::$webroot = "/~user/MyAppName/"
> FormHelper::$theme = NULL
> FormHelper::$here = "/~user/MyAppName/"
> FormHelper::$params = array
> FormHelper::$action = "display"
> FormHelper::$plugin = NULL
> FormHelper::$data = NULL
> FormHelper::$namedArgs = NULL
> FormHelper::$argSeparator = NULL
> FormHelper::$validationErrors = NULL
> FormHelper::$tags = array
> FormHelper::$__tainted = NULL
> FormHelper::$__cleaned = NULL
> FormHelper::$Html = HtmlHelper object,
>         "session" => SessionHelper
> SessionHelper::$helpers = array
> SessionHelper::$__active = true
> SessionHelper::$valid = false
> SessionHelper::$error = false
> SessionHelper::$_userAgent = "eee529c539a2f1d37ce990348ba812dc"
> SessionHelper::$path = "/"
> SessionHelper::$lastError = NULL
> SessionHelper::$security = "medium"
> SessionHelper::$time = 1290386547
> SessionHelper::$sessionTime = 1290398547
> SessionHelper::$cookieLifeTime = false
> SessionHelper::$watchKeys = array
> SessionHelper::$id = NULL
> SessionHelper::$host = NULL
> SessionHelper::$timeout = NULL
> SessionHelper::$base = "/~user/MyAppName"
> SessionHelper::$webroot = "/~user/MyAppName/"
> SessionHelper::$here = "/~user/MyAppName/"
> SessionHelper::$params = array
> SessionHelper::$action = "display"
> SessionHelper::$data = NULL
> SessionHelper::$theme = NULL
> SessionHelper::$plugin = NULL,
>         "html" => HtmlHelper
> HtmlHelper::$tags = array
> HtmlHelper::$_crumbs = array
> HtmlHelper::$__includedScripts = array
> HtmlHelper::$_scriptBlockOptions = array
> HtmlHelper::$__docTypes = array
> HtmlHelper::$helpers = NULL
> HtmlHelper::$base = "/~user/MyAppName"
> HtmlHelper::$webroot = "/~user/MyAppName/"
> HtmlHelper::$theme = NULL
> HtmlHelper::$here = "/~user/MyAppName/"
> HtmlHelper::$params = array
> HtmlHelper::$action = "display"
> HtmlHelper::$plugin = NULL
> HtmlHelper::$data = NULL
> HtmlHelper::$namedArgs = NULL
> HtmlHelper::$argSeparator = NULL
> HtmlHelper::$validationErrors = NULL
> HtmlHelper::$__tainted = NULL
> HtmlHelper::$__cleaned = NULL
> )
> $loadHelpers    =       false
> $cached =       true
> $loadedHelpers  =       array()
> $page   =       "home"
> $subpage        =       null
> $title_for_layout       =       "Home"
> $content_for_layout     =       "     id="MyAppNameForm" >
>         
>         
>     "
> $scripts_for_layout     =       ""
> $form   =       FormHelper
> FormHelper::$helpers = array
> FormHelper::$fieldset = array
> FormHelper::$__options = array
> FormHelper::$fields = array
> FormHelper::$requestType = NULL
> FormHelper::$defaultModel = NULL
> FormHelper::$_inputDefaults = array
> FormHelper::$base = "/~user/MyAppName"
> FormHelper::$webroot = "/~user/MyAppName/"
> FormHelper::$theme = NULL
> FormHelper::$here = "/~user/MyAppName/"
> FormHelper::$params = array
> FormHelper::$action

Re: JS helper

2010-11-21 Thread huoxito
I've stopped one more time again to try to understand and use the Js
helper for ajax requests but it seems I just cant get it, and still
couldnt find a good example of its use with ajax on the web. Every
time I have to do one request I need to write all this bunch of code:

$.ajax({

url: 'url(array("controller" =>
"agendamentos","action" => "editResponse"));?>',
cache: false,
type: 'GET',
contentType: "application/x-www-form-urlencoded;
charset=utf-8",
data: ( {id : id, categoria: categoria, valor: valor,
vencimento: vencimento, observacoes: obs} ),
beforeSend: function(){
$('.submit img').remove();
$('.submit span').remove();
$('.submit').append('');
},
success: function(result){

if(result == 'error'){
$('.submit img').fadeOut('fast', function(){
$('.submit').append('Ocorreu um erro. Recarregue a página e
tente novamente.')
});
}else if(result == 'validacao'){
$('.submit img').fadeOut('fast', function(){
$('.submit').append('Preencha todos os campos corretamente.');
});
}else{

parent.$('#agend-' + id).html(result);
//var te=setTimeout("parent.$('#agend-'" + id
+").html("+ result +");",5000);
var
t=setTimeout("parent.jQuery.fn.colorbox.close()",100);
}

}

});


which doesnt seems practical at all. I'm really enjoying study and
work with cakephp but I guess its lack of builtin ajax functions is
what bothers me most so far. Hope to improve that myself by developing
a helper which would make things simpler, clearer and share it with
the community.


Just curious, Do you get to use much of Js helper on your projetcs ?
Or I'm the only one here who doesnt get along well with it?



On 28 set, 18:41, lyba  wrote:
> for the record:
> Seems that above function despite having additional class is still
> bound to the same event executing both open and close.
>
> Since I could not find solution to this in reasonable time I've
> implemented following workaround:
>
> $(function()
> {
>         $('div.Commands a.CmdOpen').click(function(ev)
>         {
>                 ev.preventDefault();
>                                 var target = 
> $(this).parent('div').next('div.Target');
>                                 if ($(this).is('.Active')) {
>                                         $(this).removeClass('Active');
>                                         target.slideUp().html('');
>                                 } else {
>                                         $(this).addClass('Active');
>                                         
> $("#busy-indicator").clone().appendTo(target).show();
>                                         $.ajax({
>                                                         url: 
> $(this).attr('href'),
>                                                         cache: false,
>                                                         success:
>                                                                         
> function(html)
>                                                                         {
>                                                                               
>           target.slideDown().html(html);
>                                                                         },
>                                                         error:
>                                                                         
> function (XMLHttpRequest, status, errorThrown)
>                                                                         {
>                                                                               
>           alert('error ...');
>                                                                         }
>                                         });
>                                 }
>         });
>
> });
>
> At present I only experience one problem - indicator is visible only
> on the first click, following clicks work but do not display busy
> indicator while awaiting ajax response.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Admin interface templates / themes for CakePHP

2010-11-14 Thread huoxito
hey i've been working on a theme for admin interfaces this week. It is
mostly based on this free template
http://www.netdreams.co.uk/index.php/blog/2010/02/18/free-admin-skin-available-for-download/
.

I already did some changes on the original html, css files, mainly
replaced unecessary table and images for divs and some css3. Called it
grey. I made it in a way that every time you bake a controller with
admin methods, the line $this->theme = "grey" is added on the admin
actions.

So far one can bake admin views and choose between the default cake
layout and grey, or any other already installed. Besides there is a
login page ready for use.

I created this repository on github where I intend to share all
templates I use for cake, https://github.com/huoxito/Cake-Themes .

I implemented the theme using cake 1.3.5, Still need to create a
readme file to explain it better and to make some more improvementes
on the theme, but I guess someone can already give it a try. Any help
on the theme improvement would be much aprecciated as well.


On 27 set, 12:46, Alex Bovey  wrote:
> On Thu, Sep 23, 2010 at 12:49 PM, Mike Karthauser
>
>  wrote:
>
> > I tend to build admin styles off the back of cake.generic.css which has
> > improved no end on the recent versions of cake 1.3.*
>
> > i'm also using jquery ui themeroller styles for the rest of it as they are
> > pretty easy to integrate and useful depending on how much ajax you are
> > using.
>
> Thanks Mike - gone down the jQuery UI route also - cheers for that tip.
>
> Alex
>
> --
> Alex Bovey
> Web Developer | Alex Bovey Consultancy Ltd
> Registered in England & Wales no. 6471391 | VAT no. 934 8959 65

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Doubt about admin routes / actions and Auth component

2010-11-14 Thread huoxito
I reversed the order
> var $components = array('Auth', 'Session');
but it's still not working as expected,


i'm running it on cake 1.3.5


On 13 nov, 17:28, cricket  wrote:
> On Fri, Nov 12, 2010 at 8:20 PM, huoxito  wrote:
> > I have this in my app_controller
>
> > var $components = array('Session', 'Auth');
>
> The order of those should be reversed:
>
> var $components = array('Auth', 'Session');
>
> At least, at one time that was important. I don't know if it's still 
> necessary.
>
>
>
> > function beforeFilter(){
> >        parent::beforeFilter();
>
> >        # thanks 
> > tohttp://padariadodenilson.wordpress.com/2010/10/04/criando-uma-area-ad...
> >        if (isset($this->params['admin'])) {
> >            $this->Auth->deny('*');
> >        } else {
> >            $this->Auth->allow('*');
> >        }
>
> >        $this->Auth->fields = array('username' => 'name', 'password'
> > => 'password');
> >        //$this->Auth->loginError = "No, you fool!  That's not the
> > right password!";
> >        //$this->Auth->loginAction = array('admin' => false,
> > 'controller' => 'users', 'action' => 'login');
> >        //$this->Auth->loginRedirect = array('controller' =>
> > 'usuarios', 'action' => 'afterLogin');
> >        $this->Auth->authError = "Você precisa estar logado para
> > entrar no sistema.";
> >    }
>
> > My routes config are:
>
> > Router::connect("/admin/:controller/:action/*", array('prefix' =>
> > 'admin', 'admin' => true));
>
> What version are you running? In 1.2.x you should have the following
> in core.php:
>
> Configure::write('Routing.admin', 'admin');
>
> For 1.3.x:
>
> Configure::write('Routing.prefixes', array('admin'));
>
>
>
> > this way admin methods are protected but if I take off that condition
> > e Auth allows really everything,
> > thanks for helping
>
> > On 12 nov, 15:50, cricket  wrote:
> >> On Thu, Nov 11, 2010 at 11:44 PM, huoxito  wrote:
> >> > Thats what I thought as well, but it doesnt happen,
>
> >> > If I just let $this->Auth->allow(‘*’) in my app_controller all actions
> >> > are accessible without being logged in, even my admin_* methods
>
> >> Perhaps Auth isn't properly configured in
> >> AppController::beforeFilter(). Could you post that?
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups 
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php?hl=en
>
> That's odd. On a lark, I just added:
>
> $this->Auth->allow('*');
>
> .. to my AppController::beforeFilter() and it still redirected me to
> login when trying to access an admin action. As it's supposed to work.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Doubt about admin routes / actions and Auth component

2010-11-12 Thread huoxito
I have this in my app_controller

var $components = array('Session', 'Auth');

function beforeFilter(){
parent::beforeFilter();


# thanks to 
http://padariadodenilson.wordpress.com/2010/10/04/criando-uma-area-administrativa-com-cakephp/
if (isset($this->params['admin'])) {
$this->Auth->deny('*');
} else {
$this->Auth->allow('*');
}

$this->Auth->fields = array('username' => 'name', 'password'
=> 'password');
//$this->Auth->loginError = "No, you fool!  That's not the
right password!";
//$this->Auth->loginAction = array('admin' => false,
'controller' => 'users', 'action' => 'login');
//$this->Auth->loginRedirect = array('controller' =>
'usuarios', 'action' => 'afterLogin');
$this->Auth->authError = "Você precisa estar logado para
entrar no sistema.";
}

My routes config are:

Router::connect("/admin/:controller/:action/*", array('prefix' =>
'admin', 'admin' => true));


this way admin methods are protected but if I take off that condition
e Auth allows really everything,
thanks for helping

On 12 nov, 15:50, cricket  wrote:
> On Thu, Nov 11, 2010 at 11:44 PM, huoxito  wrote:
> > Thats what I thought as well, but it doesnt happen,
>
> > If I just let $this->Auth->allow(‘*’) in my app_controller all actions
> > are accessible without being logged in, even my admin_* methods
>
> Perhaps Auth isn't properly configured in
> AppController::beforeFilter(). Could you post that?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Doubt about admin routes / actions and Auth component

2010-11-11 Thread huoxito
Thats what I thought as well, but it doesnt happen,

If I just let $this->Auth->allow(‘*’) in my app_controller all actions
are accessible without being logged in, even my admin_* methods

On 11 nov, 18:22, cricket  wrote:
> On Wed, Nov 10, 2010 at 10:26 PM, huoxito  wrote:
> > found what i was looking for, guess I just had to add this condition,
> > thanks to this 
> > posthttp://padariadodenilson.wordpress.com/2010/10/04/criando-uma-area-ad...
>
> > if (isset($this->params['admin'])) {
> > $this->Auth->deny(‘*’);
> > }
> > else {
> > $this->Auth->allow(‘*’);
> > }
>
> > Is there a simpler way to do it?
>
> You don't need the test. Having $this->Auth->allow(‘*’) should not
> cause your admin_* methods to be accessible without being logged in as
> an admin.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Doubt about admin routes / actions and Auth component

2010-11-10 Thread huoxito
found what i was looking for, guess I just had to add this condition,
thanks to this post 
http://padariadodenilson.wordpress.com/2010/10/04/criando-uma-area-administrativa-com-cakephp/

if (isset($this->params['admin'])) {
$this->Auth->deny(‘*’);
}
else {
$this->Auth->allow(‘*’);
}


Is there a simpler way to do it?



On 11 nov, 00:37, huoxito  wrote:
> I hadn't tried to use admin routes in cakephp yet. When i first read
> about I believed that I would get through it quickly but no 
>
> I cant figure out a way to let all my actions, without the admin
> prefix, be accessed without a user logged in, authenticated by the
> Auth component.
>
> I already added this config in core.php, routes.php and
> app_controller.php respectively
>
> Configure::write('Routing.prefixes', array('admin'));
> Router::connect("/admin/:controller/:action/*", array('prefix' =>
> 'admin', 'admin' => true));
> var $components = array('Session', 'Auth');
>
> And the official doc is not clear about how to config this situation,
> or maybe I'm really missing something. I'm kind of stuck again in
> cakephp

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Doubt about admin routes / actions and Auth component

2010-11-10 Thread huoxito
I hadn't tried to use admin routes in cakephp yet. When i first read
about I believed that I would get through it quickly but no 

I cant figure out a way to let all my actions, without the admin
prefix, be accessed without a user logged in, authenticated by the
Auth component.

I already added this config in core.php, routes.php and
app_controller.php respectively

Configure::write('Routing.prefixes', array('admin'));
Router::connect("/admin/:controller/:action/*", array('prefix' =>
'admin', 'admin' => true));
var $components = array('Session', 'Auth');


And the official doc is not clear about how to config this situation,
or maybe I'm really missing something. I'm kind of stuck again in
cakephp

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Error on test.php page, missing arguments.php on Simple Test

2010-11-02 Thread huoxito
Hey kadanis thanks for helping with those links, aprecciate it,I
downloaded the 1.0.1 version and after that the arguments.php file
itself and now the test.php page looks ok!

next time i get a problem i'll remind going to cakephp lighthouse
should be really helpful

http://mark-story.com/posts/view/cakephp-and-phpunit , he says that
cake is moving to Php Unit ... hope it will not bring more difficulty
for those who just started with Simple Test



On 2 nov, 12:47, "Mike Karthauser"  wrote:
> On Tue, November 2, 2010 1:41 pm, kadanis wrote:
> > A bit of further research and I've found a post on the CakePHP bug
> > reports regarding this.  The CakePHP dev team know about the issue,
> > it's to do with a change in SimpleTest from using $this->ClassName()
> > to $this->__construct(), among other things.
>
> > As the 1.1alpha version of SimpleTest is still not "entirely" stable,
> > Mark Story (from CakePHP dev team) said on the bug tracker that they
> > wouldn't be making changes to Cake core files until SimpleTest was in
> > stable release.  Which is fair enough.
>
> > See
> >http://cakephp.lighthouseapp.com/projects/42648/tickets/1250-support-...
> > for bug and Marks response
>
> > I've downloaded and run ST 1.0.1 from their site under the "Older
> > stable releases" section and it appears to work fine with CakePHP
> > 1.3.5
>
> i've done the same making sure i added the arguments.php file to that one
> as well.
>
> --
> Mike Karthauser
> Managing Director - Brightstorm Ltd
>
> Email: mi...@brightstorm.co.uk
> Web:http://www.brightstorm.co.uk
> Tel:  07939 252144 (mobile)
> Fax: 0870 1320560
>
> Address: 1 Brewery Court, North Street, Bristol, BS3 1JS

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Error on test.php page, missing arguments.php on Simple Test

2010-11-01 Thread huoxito
I just begun to study how to test my app on cake book, downloaded the
latest simple test package available but when I tried to browse myapp/
test,php , as the cakebook suggests, I got this error saying that
theres a missing file, arguments.php, which is really missing as it is
not in the simpletest directory, it did't came along with the
downloaded package.

Anyone had the same problem? already did some research on google but
got nothing so far...

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Acl and bindNode

2010-10-31 Thread huoxito
Guess I dont get your point.

Users still must de added on Aro's table, otherwise how would your
system know that an user A belongs to group ALFA ?

On 29 out, 08:23, Jeremy Burns | Class Outfit
 wrote:
> Anybody else got any more ideas on this? Anyone using it with success?
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.com
> (t) +44 (0) 208 123 3822
> (m) +44 (0) 7973 481949
> Skype: jeremy_burnshttp://www.classoutfit.com
>
> On 27 Oct 2010, at 17:10, Jeremy Burns | Class Outfit wrote:
>
>
>
> > I wish that were the case, but the guide then gives an example of the aros 
> > table, which only includes 
> > groups:http://book.cakephp.org/view/1547/Acts-As-a-Requester
>
> > Jeremy Burns
> > Class Outfit
>
> > jeremybu...@classoutfit.com
> >http://www.classoutfit.com
>
> > On 27 Oct 2010, at 13:41, cricket wrote:
>
> >> On Tue, Oct 26, 2010 at 4:40 PM, Jeremy Burns
> >>  wrote:
> >>> According to the online tutorial:
>
> >>> "
> >>> In case we want simplified per-group only permissions, we need to
> >>> implement bindNode() in User model.
> >>> Code View
>
> >>> function bindNode($user) {
> >>>    return array('Group' => array('id' => $user['User']['group_id']));
> >>> }
>
> >>>   function bindNode($user) {
> >>>      return array('Group' => array('id' => $user['User']
> >>> ['group_id']));
> >>>   }
>
> >>> This method will tell ACL to skip checking User Aro's and to check
> >>> only Group Aro's.
> >>> "
>
> >>> I've done this but I'm still getting users added to the aros table.
> >>> What am I missing?
>
> >> I believe that's normal. Users will still be present in aros but the
> >> point is that ACL won't /check/ User, but Group.
>
> >> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
> >> with their CakePHP related questions.
>
> >> You received this message because you are subscribed to the Google Groups 
> >> "CakePHP" group.
> >> To post to this group, send email to cake-php@googlegroups.com
> >> To unsubscribe from this group, send email to
> >> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> >> athttp://groups.google.com/group/cake-php?hl=en
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups 
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: CakePHP 1.3.4 Stable - Weird problem with sessions! HELP!

2010-10-13 Thread huoxito
Are you passing the $variable trough the url?

If so, Instead of using $variable try using this $this->params['pass']
[0] on the browser function:

It would be like:

function browse($variable) {
  $this->Session->write('mysession.variable', $this->params['pass']
[0]);
  $this->set('variable', $variable);
}

Also make sure that the param is passed through the url 


On 13 out, 03:22, dtemes  wrote:
> what backend are you using for your sessions? I had similar issues
> while working with database stored sessions, but using cake or php
> sessions works fine.
>
> On 12 oct, 20:52, cricket  wrote:
>
>
>
> > On Tue, Oct 12, 2010 at 9:19 AM, 浪漫様  wrote:
> > > no, i'm on HTTP only : )
> > > and the sessions works fine, the only problem is when using the
> > > $variable from the controller's function... then it turns to be empty.
> > > thanks
>
> > And you can see the variable from the browse view? Are you certain
> > that browse() is being passed a param?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Protect against XSS attacks but keep usual html

2010-10-10 Thread huoxito
that didnt help me much though

this http://github.com/josegonzalez/purifiable actually helped.

On 9 out, 07:42, euromark  wrote:
> you might want to type "XSS" in the little textbox up here besides
> "Search this group"
> and hit enter
>
> On 9 Okt., 04:47, huoxito  wrote:
>
> > I was wondering if every time I'd display some data I have to Sanatize
> > data against XSS attacks?
>
> > And also It seems to me that cakephp Sanitize Component can't sanatize
> > against XSS attacs and keep the sytles of a text
>
> > How do you clean your data against XSS and still keep styles in text?
>
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Protect against XSS attacks but keep usual html

2010-10-08 Thread huoxito
I was wondering if every time I'd display some data I have to Sanatize
data against XSS attacks?

And also It seems to me that cakephp Sanitize Component can't sanatize
against XSS attacs and keep the sytles of a text

How do you clean your data against XSS and still keep styles in text?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: save not working

2010-10-06 Thread huoxito
try this to see if its a valitation problem:

if ( $this->Host->save($this->data)  ){
 // it saved
}else{
echo $errors = $this->ModelName->invalidFields();
}

or maybe some wrong field name you got in your array



On 5 out, 10:15, james  wrote:
> I'm trying to run a save on certain fields from my model and for some
> reason it isnt working -
>
> similarly to an edit im calling
>
> $this->Host->save($this->data)
>
> and the array in $this->data looks like
>
> Array
> (
>     [Host] => Array
>         (
>             [web] => 25
>             [prev_cost_of_sale] =>
>             [extras] =>
>             [price_A4s] =>
>             [previous_price_A4s] =>
>             [previous_adverts] =>
>             [previous_appts] =>
>         )
>
> )
>
> can anyone see what im doing wrong?
>
> thanks

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


cacheAction doesn't work on 1.3

2010-08-27 Thread huoxito
I did exactly as on the cookbook but it just won't work.

I have this line line in my app controller var $helpers = array('Js'
=> array('Jquery'), 'Session', 'Time', 'Cache');

Then in another controller i wrote:

var $cacheAction = array(
'index' => '+1 hour'
);

I also uncommented the line about cache check on core.php

But it's not caching anything on my index action. It's only caching
actions I use inside elementes like these:
element('menu_lateral', array('cache' => '+1
hour')); ?>


Anybody has any idea on how i could get this working?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Email Component

2010-07-29 Thread huoxito
Yes i got that, but what i found strange is that the cakebook says we
have to create 'html' and 'text' in both views and elements
directory

besides why would i use both 'text' and 'html' if one of them is
enough to customize my emails...

and when we set the template using the Email Component it seems to
refer to the files in the views/elements/email directory and no the
ones in views/email directory




On 29 jul, 04:13, Louie Miranda  wrote:
> Try this..
>
> class AccountsController extends AppController
> {
>     var $name = "Accounts";
>     var $components = array('Email');
>
>     function email() {
>         $this->Email->from    = 'Somebody ';
>         $this->Email->to      = 'Louie Miranda ';
>         $this->Email->subject = 'Test / Developer Code PHP CAKEPHP';
>         $this->Email->send('Hello message body from LOUIE MIRANDA
> CAKEPHP!');
>     }
>
> }
>
> It's actually very simple. Just add the email component and create a
> function.
>
> --
> Louie Miranda
>  - Email: lmira...@gmail.com
>  - Web:http://www.louiemiranda.com
>
>
>
> On Thu, Jul 29, 2010 at 10:41 AM, huoxito  wrote:
> > Am I the only one who finds the Email Component doc,
> >http://book.cakephp.org/view/1286/Sending-a-basic-message, really
> > weird?
>
> > I mean i'll have to try out a lot of things here to understand how it
> > works...
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.comFor
> >  more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Email Component

2010-07-28 Thread huoxito
Am I the only one who finds the Email Component doc,
http://book.cakephp.org/view/1286/Sending-a-basic-message, really
weird?

I mean i'll have to try out a lot of things here to understand how it
works...

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: $validate Does not work as expected!

2010-07-21 Thread huoxito
I guess you should use cake convention flelds for this which are
'created' and 'modified' instead of 'mdate' in your case.

If you have those fields in your table you won't have to bother about
validating or saving manually that datetime of your records.

On 21 jul, 17:37, saidbakr  wrote:
> Hi,
>
> In the pages controller I've created an action called "contact" to
> allow receiving messages from visitors and then this messages are
> stored in the database. I have a field in the table contacts called
> "mdate" which is dedicated for storing the MySQL datetime of the
> message sent.
>
> The mdate has no any fields in the contact forms. The following is
> contact action code:
> function contact(){
>            $this->loadModel('Contact');
>            if (!empty($this->data)){
>            $this->Contact->create();
>            if ($this->Contact->save($this->data)){
>             $this->Session->setFlash(__('Contact Message has been
> received.',true));
>            }
>            else{
>             $this->Session->setFlash(__('Contact Message Could not be
> sent!.',true));
>            }
>            }
>
>         }
> In the Contact model I set validate property as following:
>
>  class Contact extends AppModel{
>     var $name = 'Contact';
>     var $validate = array(
>     'name' => array('notempty'),
>     'email' => array('notempty','email'),
>     'message' => array('notempty'),
>     'mdate' => array('rule' =>'notEmpty','message'=>'no')
>     );
>
> }
>
> You may notice at the last line mdate should be validated and it must
> be not empty. However, the above contact action does not supply any
> value for mdate and in-spite of this, records are added successfully
> and mdate field does not have datetime values it is just recorded as
> 00-00-00 00:00:00 in the database.
>
> My question is: Why Contact Model does not apply the validation rules
> on the mdate field and stop creating the new record?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Access in controller data modified in a Model on callback method beforeSave?

2010-07-21 Thread huoxito
Is is possible to access data modified in a Model on callback method
beforeSave?

I changed the value of a variable on beforeSave method in a model and
I need to retrieve that new value on my controller. I know i can use
the read method to get that value, but I was hoping if it's possible
to do that without any new requests to the database.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: CakePHP 1.3.3 rainbow icing edition released

2010-07-19 Thread huoxito
What does he mean by this: "Disclaimer: No rainbows were harmed in the
creation of this release."  ?

And when migrating from 1.3.2, all i have to do is substitute the cake
directory on my application, right?


On 19 jul, 04:37, Louie Miranda  wrote:
> Thanks everyone! Time to upgrade! :)
> --
> Louie Miranda
>  - Email: lmira...@gmail.com
>  - Web:http://www.louiemiranda.com
>
> On Mon, Jul 19, 2010 at 2:54 PM, Graham Weldon wrote:
>
> > Swt!
>
> > Thanks to all the contributors this time around, we have had a great
> > constant stream of submissions from users.
> > Cheers!!
>
> > Graham / Predominant
>
> > On Mon, Jul 19, 2010 at 1:11 PM, mark_story  wrote:
> > > The CakePHP development team is happy to announce the release of
> > > CakePHP 1.3.3[1]. 1.3.3 is a maintenance release for the 1.3 branch
> > > and contains bugfixes and optimizations for features found in 1.3.
>
> > > Since the release of CakePHP 1.3.0 last month, there have been more
> > > than 50 commits and 35 tickets resolved. There have been a few changes
> > > that may affect your application.
>
> > > - Component beforeRender triggers were moved to occur before the View
> > > class was constructed.
> > > - FormHelper::create() now calls $this->domId();
> > > - Calling bindModel/unbindModel multiple times now correctly resets
> > > associations.
> > > - TextHelper::autoLink() no longer strtolower()'s the urls, as this
> > > created issues with URL shorteners.
>
> > > Be sure to check the full changelog[2] for all changes that have
> > > occurred, and the related tickets. We'd like to give a big thanks to
> > > the ongoing community efforts around the documentation. There are now
> > > over 19,000 revisions in the cookbook! We'd also like to thank
> > > everyone who sent in a proposal for CakeFest 2010[3], as well to
> > > everyone who has already bought tickets. If you haven't already gotten
> > > your tickets, there is no time like the present to get in on the best
> > > CakePHP conference this year. Purchasing tickets before July 24th will
> > > let you take advantage of the early bird pricing.
>
> > > Disclaimer: No rainbows were harmed in the creation of this release.
>
> > > Download a packaged release [1]
> > > View the changelog[2]
>
> > > [1]http://github.com/cakephp/cakephp/downloads
> > > [2]http://cakephp.lighthouseapp.com/projects/42648/changelog-1-3-3
> > > [3]http://cakefest.org
>
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help
> > others with their CakePHP related questions.
>
> > > You received this message because you are subscribed to the Google Groups
> > "CakePHP" group.
> > > To post to this group, send email to cake-php@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > cake-php+unsubscr...@googlegroups.comFor
> > >  more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.comFor
> >  more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: should I know php in order to learn cakePHP

2010-06-13 Thread huoxito
I've been working with PHP for about 6 months and only recently
started studying cakephp. It's been interesting but not even close to
easy for me. Maybe because PHP is my first experience with programming
languages and i had no experience with OOP before start taking
cakephp.


On 13 jun, 20:16, Tomasz Brymora  wrote:
> If you plan on sticking with Cake (or any other framework for that
> matter) you won't be able to help but pick up on php. You can pick up on
> both at the same time and cake will make a lot more sense then as well.
> It will make life a lot easier.
>
> On 06/13/2010 05:46 PM, Chris Hanson wrote:
>
> > ye i would probably learn the basics and do some playing around with
> > PHP before jumping into a frameworkbut thats just my opinion. :D
> > welcome to CakePHP :D
>
> > On 13 June 2010 20:04, Jahongir Abdurahmonov  wrote:
>
> >> I wonder if one should know PHP in order to learn and use CakePHP?
> >> Should I first learn PHP and then CakePHP?
>
> >> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
> >> with their CakePHP related questions.
>
> >> You received this message because you are subscribed to the Google Groups 
> >> "CakePHP" group.
> >> To post to this group, send email to cake-php@googlegroups.com
> >> To unsubscribe from this group, send email to
> >> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> >> athttp://groups.google.com/group/cake-php?hl=en
>
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


editing *.po files - internationalization

2010-06-13 Thread huoxito
I've been trying to translate the commom messages and words inside
cakephp core to portuguese using the internationalization feature...

i generated the default.pot file, put it in the right directory "/app/
locale/por/LC_MESSAGES/default.po" and then start translating the
messages, with Poedit,  but it seems to have a problem when
translating words with plural form in the code for example:

#: /cake/libs/view/helpers/time.php:450;455;459
msgid "week"
msgid_plural "weeks"
msgstr[0] ""
msgstr[1] ""

When I translate the word 'week' on Poedit and save the document it
says it has a fatal error ... All other words work perfectly, except
words that have singular and plural on the file generated by the i18n
console task

has it happened to anyone here? any ideas how can I make theses words
translations work?


ps. hope i was clear enough on this issue

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Index from root

2010-05-17 Thread huoxito
You can fiigure that out on app/config/routes.php

On 16 maio, 13:50, Davor Ilic  wrote:
> Hi,
>
> im newbie with the cakePHP.
>
> I made the Tutorial "The 15 min Blog
> Tutorial"
> ok that was easy. But do not know how to make an index for the root, how
> does this work how i say to the controller if there are no params in url
> they have to took the index.ctp of "/posts/index.ctp"?
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
> their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en