cake flashing 2 different flash messages.

2010-09-05 Thread Ernesto
Hello.

i have a problem that can't resolve.

my app_controller::beforeFilter has a simple authorization script (ACL
is a total overkill in my case) that returns errors via a flash()
message.

my CRUD actions are defined in app_controller but one controller
doens't allow to delete items at all, so the Users::delete() flashes a
message like "Unable to delete a user".

if i try to load the Users::delete page, as user that doesn't have
even permissions to access that view, my app returns both flash
messages:

- Unable to access this page.
- Unable to delete user.

i just need the first one.
how to avoid this?

sry for my bad english.

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


Wowza Live Streaming and CakePHP

2010-09-05 Thread Azril Nazli
CakePHP really rocks, I've successfully integrate userdb , logs with
Wowza Media Server for live streaming

The story : 
http://azrilnazli.blogspot.com/2010/09/beta-test-stream-your-life.html

Azril Nazli
Putrajaya, Malaysia

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: liner array

2010-09-05 Thread butterCake
Sorry for not being clear. What I'm trying to do is making my Model to
be an array only. In otherwords I don't want my Model to be pointing
to a data table.

tks
Anton

On Sep 5, 1:30 am, Jeremy Burns | Class Outfit
 wrote:
> Can you explain this a bit more clearly? Do you mean that you want to do a 
> find that returns a data array ready for populating a select list (id + name 
> columns)? If so, check out 
> find('list'):http://book.cakephp.org/view/1022/find-list
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 4 Sep 2010, at 16:58, butterCake wrote:
>
> > I'm new to cakePHP. What if I want my model to contain only an array
> > of list. How to do this ?
>
> > 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: unlink function throws "permission denied" error

2010-09-05 Thread O.J. Tibi
Guys, I'm also thinking that this is an operating system issue,
probably one or more of the following:

1.) You tried to deploy your CakePHP application from Windows to a
*Nix platform (or vice-versa, but I'm not sure how this is done on
Windows)
2.) Your system administrator might have set different permissions on
directories on your production server, from your development machine
3.) Your web server process runs on a user account that is not allowed
to access that particular directory.

HTH,
OJ

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: Session get deleted with chrome browser

2010-09-05 Thread Kamal deol
hi i read your problem

my email is kamal.d...@gmail.com

try the
Configure::write('Security.level', 'low');
in the app/cofig/core.php

first try Configure::write('Security.level', 'medium'); if prob solved then
ok other wise try
low




On Sun, Sep 5, 2010 at 7:15 AM, Sanza  wrote:

> I have the same problem! Only with the cakephp 1.3.+
> With firefox works perfectly, but with Safari, Internet Explorer and
> Chrome don't work and lost the session or don't store the cookie.
>
> I did a little step setting a different Session.cookie (core.php) and
> setting the Cookie name on a component i28n wich use the session and
> cookie, but I have get others misterious errors like "array to string
> conversion" on session_start() and an other error on cookie system
> component.
>
> The strange this is that on firefox all work perfectly!
>
> Any suggestion will be appreciated
> Massimo
>
>
> On 3 Set, 13:18, Amjed  wrote:
> > Hi,
> > I have an application which works fine in Firefox.
> > But when I use chrome, session gets deleted/new session is created for
> > every page
> > it is not the the problem of security.level or "php" sessions. I have
> > check all forums.
> >
> > In one forum it says that chrome changes HTTP_REFERER, due to this
> > behaviour new sessions is created.
> > Any help in this regard will be appreciated.
> >
> > Thanks,
> > Amjed
>
> 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.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: CakePHP future

2010-09-05 Thread j.blotus
Wanted to mention that I think Lithium is aimed at a much different
class of programmer than CakePHP from what I can tell. Lithium looks
like it is good for someone who knows how to build all the
functionality they need from scratch and doesn't want anything else in
the code that won't be used. CakePHP has a lot of features that help
speed along common tasks facing most web developers, and it packs in a
lot of functionality out of the box. Just take a look at how much work
Mark Story and the gang are putting into these last few builds and you
start to get an idea of just how much work is going in to the project.
In reality CakePHP 2 is more of a step away from << PHP 5 and some of
CakPHP's legacy features and not so much a radical departure as
Cake3..ahem I mean Lithium.

The future of CakePHP looks more like improving on an already good
thing that tons of people already use and not necessarily reinventing
the wheel to design uber-apps with the hot new framework in town,
Lithium (of which I have yet to, and would like to try).

But the 5-6 Apps/Sites I have built this last 2 years will need to
stay with Cake as far as I am concerned.

On Sep 5, 11:46 pm, mark_story  wrote:
> Lithium is not the future of CakePHP.  It is a project that was
> started by a few cakephp alumni.  CakePHP's future is looking bright
> and development of 2.0 is progressing well.  If you are interested in
> the ongoing development you can keep track of the activity either on
> github or lighthouse.
>
> -Mark
>
> On Sep 3, 12:10 am, sambo  wrote:
>
>
>
> > Does Lithium framework is the future of CakePHP? And what is different
> > with CakePHP 2.0 and Cake3 (released under a new name: Lithium)?
>
> > You can see this link below for 
> > morehttp://www.phpframeworks.com/news/p/614/cakephp-is-dead-lithium-was-b..
>
> > Thanks,
> > Sambo

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 future

2010-09-05 Thread mark_story
Lithium is not the future of CakePHP.  It is a project that was
started by a few cakephp alumni.  CakePHP's future is looking bright
and development of 2.0 is progressing well.  If you are interested in
the ongoing development you can keep track of the activity either on
github or lighthouse.

-Mark

On Sep 3, 12:10 am, sambo  wrote:
> Does Lithium framework is the future of CakePHP? And what is different
> with CakePHP 2.0 and Cake3 (released under a new name: Lithium)?
>
> You can see this link below for 
> morehttp://www.phpframeworks.com/news/p/614/cakephp-is-dead-lithium-was-bornhttp://debuggable.com/posts/Cake_3_interview_with_Nate_Abele:4a665a5e...
>
> Thanks,
> Sambo

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: passing array as parameters of redirect function

2010-09-05 Thread j.blotus
No array to string conversion errors? What kind of E_NOTICE error are
you getting.

On Sep 5, 3:27 pm, "Mariano C."  wrote:
> I haven't error message, line 106 and 107 are just the line of
> collection() function with debug instructions.
>
> On 5 Set, 21:04, "j.blotus"  wrote:
>
>
>
> > what is the specific error message you are getting. check lines 106
> > and 107 of your users_controller.php
>
> > On Sep 5, 12:38 pm, "Mariano C."  wrote:
>
> > > Then I've a method called collection
>
> > > function collection($username = null,
> > >                            $page = 1,
> > >                            $sort = array('Artist.name',
> > > 'Album.year'),
> > >                            $direction = array('ASC', 'ASC')
> > >                            )
> > > {
> > >         debug(is_array($sort));
> > >         debug($sort);
>
> > > }
>
> > > it's fully working, matter of fact:
> > > app/controllers/users_controller.php (line 106)
> > > 1
>
> > > app/controllers/users_controller.php (line 107)
> > > Array
> > > (
> > >     [0] => Artist.name
> > >     [1] => Album.year
> > > )
>
> > > Now I've remove() function, something like that:
> > > function removeFromCollection($album_user_id = null)
> > > {
> > >         $this->redirect(array(
> > >                           'controller'=>'users',
> > >                           'action'=>'collection',
> > >                           $param['username'],
> > >                           $param['page'],
> > >                           array('Album.year', 'Artist.name'),
> > >                           array('ASC', 'ASC')
> > >        ));
>
> > > }
>
> > > but when I call removeFromCollection() and redirect to collection is
> > > performed debug() output is:
> > > app/controllers/users_controller.php (line 106)
>
> > > app/controllers/users_controller.php (line 107)
> > > Array
>
> > > How can resolve this issue? How can I send array of element as
> > > parameter?

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: unlink function throws "permission denied" error

2010-09-05 Thread j.blotus
I am looking at your code and one thing I noticed is you aren't using
anything that is specific to CakePHP. When I do file and folder
operations I usually usally CakePHP's native File or Folder Class.

http://api.cakephp.org/class/folder

http://api.cakephp.org/class/file

http://cakebaker.42dh.com/2006/09/20/how-to-use-the-file-class-from-the-core/

I am suprised that you wouldn't know how to find file permissions.
What OS are you using?

On Sep 5, 3:12 pm, Tomfox Wiranata  wrote:
> but why does it work with a different syntax? that does not make sense
> to me.
>
> where can i find the permissions?
>
> thx
>
> On 5 Sep., 21:07, "j.blotus"  wrote:
>
>
>
> > permission denied is an operation system issue, not a cakephp issue.
> > The process that is running your php (depends on your environment)
> > trying to remove the folder does not have the authority to delete that
> > folder. check your permissions and you will find your answer.
>
> > On Sep 5, 12:41 pm, Tomfox Wiranata  wrote:
>
> > > hi,
>
> > > this permission denied thing seems ridiculous to me...since i use it
> > > in different code and it works.
> > > it works here, when i use this code to copy files.
>
> > >                 $biguploaddir = "linkables/".$folderName; // the /big/ 
> > > directory
> > >                 if(!is_dir($biguploaddir)) mkdir($biguploaddir,true);
>
> > >                 $bigsource = "link/tmp/".$folderName."/".$filename_big;
> > >                 $bigdestination = "link/".$folderName."/".$filename_big;
>
> > >                 //first copy image from temp to real location then delete 
> > > all
> > > directories and files in temp
> > >                 if (!copy($bigsource, $bigdestination)){
> > >                         print "Dein Flyer konnte nicht gespeichert 
> > > werden";
> > >                 }else{
> > >                         unlink($bigsource);
> > >                 }
>
> > > now i need to copy whole directories and i had to use different code
> > > for that:
>
> > >                 $source = "link/tmp/".$folderName."/attachments";
> > >                 $destination = "link/".$folderName."/attachments";
>
> > >                 if ( is_dir( $source ) ) {
> > >                 @mkdir( $destination );
> > >                 $directory = dir( $source );
> > >                 while ( FALSE !== ( $readdirectory = $directory->read() ) 
> > > ) {
> > >                         if ( $readdirectory == '.' || $readdirectory == 
> > > '..' ) {
> > >                                 continue;
> > >                         }
> > >                         $PathDir = $source . '/' . $readdirectory;
> > >                         if ( is_dir( $PathDir ) ) {
> > >                                 copy_directory( $PathDir, $destination . 
> > > '/' . $readdirectory );
> > >                                 continue;
> > >                         }
> > >                         copy( $PathDir, $destination . '/' . 
> > > $readdirectory );
> > >                 }
>
> > >                 //$directory->close();
> > >                 }else {
> > >                         copy( $source, $destination );
> > >                 }
>
> > >                 unlink($source);
>
> > > were talking about the same path here...but cakephp wont unlink my
> > > source folder...the copying works fine...just the files in the folder
> > > wont get deleted...
>
> > > how does that make sense?
>
> > > thx

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


Autocomplete with Ajax doesn't work in Chrome/Chromium

2010-09-05 Thread DerBjörn
Hi,

I want to use an autocomplete of states and cities with Ajax in a
form. It works perfectly in Firefox and Opera, but not in Chromium.
Which can be the reasons or how/what i have to check to get an idea of
its malfunction?!?
What i already checked is the fact that JavaScript is activated.

Thanks a lot :)

--- CODE 
echo $this->Form->input('country_id' , array('id' => 'countries',
'type' => 'select', 'label' => 'Please select a country', 'options' =>
array('' => '-',$countries)));
echo $this->Form->input('state_id' , array('id' => 'states', 'type' =>
'select', 'label' => 'Please select a state', 'options' => array('' =>
'-',$states)));
echo $this->Form->input('city_id' , array('id' => 'cities', 'type' =>
'select', 'label' => 'Please select a city', 'options' => array('' =>
'-',$cities)));

echo $javascript->link('/js/scriptaculous183/lib/prototype');
echo $javascript->link('/js/scriptaculous183/src/scriptaculous');
...
echo $ajax-
>observeField('countries',array('url'=>'update_state_select','update'=>'states'));
echo $ajax-
>observeField('states',array('url'=>'update_city_select','update'=>'cities'));

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: Validation doesn't give me errors

2010-09-05 Thread philn
Hey,

I had this problem too and I found out that the validation is only
activated when you call save().
You can also do it manually by calling validates() as mentioned here:
http://book.cakephp.org/view/410/Validating-Data-from-the-Controller

Kind regards,
philn

On Sep 4, 7:09 pm, Simon  wrote:
> Hello everyone,
>
> I try to get validation working on a register-form in my application.
> Because it did not work at all, I tried it on a very simple form with
> only a username field (it's called 'gebruikersnaam' in the code
> because i'm belgian).
> I allready did var_dump on $this->data and $this->Member->invalidFields(). 
> $this->data does contain input after a submit.
>
> invalidFields() does contain nothing if I submit a blank form.
> I also don't get any errors.
>
> Is it maybe necessary to call save() in the function to activate
> validation?
>
> In my members_controller.php i have this empty function:
>
>         public function registreren()
>         {
>         }
>
> In my model I have:
>
>          var $validate = array(
>                 'gebruikersnaam' => array(
>                         'rule' => 'notEmpty',
>                         'message' => 'Kies een gebruikersnaam.'
>                 )
>         );
>
> and in the view I do:
>
> echo $form->create( 'Member', array('action' => 'registreren',
> 'inputDefaults' => array('div' => false)) );
>
> echo $form->input( 'gebruikersnaam' );
>
> echo $form->end('Registreer!');

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


Out of office reply

2010-09-05 Thread jim
Hi,

I am out the office until 13th September. I will still be picking up email for 
the whole period but if it is urgent please call me on 07711 918164.

Thanks

Jim


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


isAuthorized seems not to be called

2010-09-05 Thread Simon
I have a isAuthorized function in my controller because $this->Auth-
>authorize is set to 'controller'.

This is my function (the comments explains everything):
function isAuthorized()
{
parent::isAuthorized();

//if the user is logged in. He cannot access the register and login
function
if( ($this->action == 'registreren') || ($this->action ==
'login') )
{
if( $this->Auth->user() )
{
   return false;
}
else
{
   return true;
}
}

//other actions are available for everyone
return true;
}

The problem is that it seems that this function is not called because
when I'm logged in, I still can access the registreren action.

Is there something I'm doing wrong. Or have I misunderstood the
meaning of this function?

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


password field gets md5-hashed values

2010-09-05 Thread Simon
In my register-form I have a passwordfield and i use Auth-component.
If I fill in an incorrrect form and press 'submit', there are some
validation errors who are nicely shown. That's perfectly great but my
passwordfield gets the value of the hashed string who was filled in.
It looks like Auth hashes the field and then puts this data back into
the value-atribute. Is there some way to prevent 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: passing array as parameters of redirect function

2010-09-05 Thread Mariano C.
I haven't error message, line 106 and 107 are just the line of
collection() function with debug instructions.

On 5 Set, 21:04, "j.blotus"  wrote:
> what is the specific error message you are getting. check lines 106
> and 107 of your users_controller.php
>
> On Sep 5, 12:38 pm, "Mariano C."  wrote:
>
>
>
> > Then I've a method called collection
>
> > function collection($username = null,
> >                            $page = 1,
> >                            $sort = array('Artist.name',
> > 'Album.year'),
> >                            $direction = array('ASC', 'ASC')
> >                            )
> > {
> >         debug(is_array($sort));
> >         debug($sort);
>
> > }
>
> > it's fully working, matter of fact:
> > app/controllers/users_controller.php (line 106)
> > 1
>
> > app/controllers/users_controller.php (line 107)
> > Array
> > (
> >     [0] => Artist.name
> >     [1] => Album.year
> > )
>
> > Now I've remove() function, something like that:
> > function removeFromCollection($album_user_id = null)
> > {
> >         $this->redirect(array(
> >                           'controller'=>'users',
> >                           'action'=>'collection',
> >                           $param['username'],
> >                           $param['page'],
> >                           array('Album.year', 'Artist.name'),
> >                           array('ASC', 'ASC')
> >        ));
>
> > }
>
> > but when I call removeFromCollection() and redirect to collection is
> > performed debug() output is:
> > app/controllers/users_controller.php (line 106)
>
> > app/controllers/users_controller.php (line 107)
> > Array
>
> > How can resolve this issue? How can I send array of element as
> > parameter?

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: unlink function throws "permission denied" error

2010-09-05 Thread Tomfox Wiranata
but why does it work with a different syntax? that does not make sense
to me.

where can i find the permissions?

thx

On 5 Sep., 21:07, "j.blotus"  wrote:
> permission denied is an operation system issue, not a cakephp issue.
> The process that is running your php (depends on your environment)
> trying to remove the folder does not have the authority to delete that
> folder. check your permissions and you will find your answer.
>
> On Sep 5, 12:41 pm, Tomfox Wiranata  wrote:
>
> > hi,
>
> > this permission denied thing seems ridiculous to me...since i use it
> > in different code and it works.
> > it works here, when i use this code to copy files.
>
> >                 $biguploaddir = "linkables/".$folderName; // the /big/ 
> > directory
> >                 if(!is_dir($biguploaddir)) mkdir($biguploaddir,true);
>
> >                 $bigsource = "link/tmp/".$folderName."/".$filename_big;
> >                 $bigdestination = "link/".$folderName."/".$filename_big;
>
> >                 //first copy image from temp to real location then delete 
> > all
> > directories and files in temp
> >                 if (!copy($bigsource, $bigdestination)){
> >                         print "Dein Flyer konnte nicht gespeichert werden";
> >                 }else{
> >                         unlink($bigsource);
> >                 }
>
> > now i need to copy whole directories and i had to use different code
> > for that:
>
> >                 $source = "link/tmp/".$folderName."/attachments";
> >                 $destination = "link/".$folderName."/attachments";
>
> >                 if ( is_dir( $source ) ) {
> >                 @mkdir( $destination );
> >                 $directory = dir( $source );
> >                 while ( FALSE !== ( $readdirectory = $directory->read() ) ) 
> > {
> >                         if ( $readdirectory == '.' || $readdirectory == 
> > '..' ) {
> >                                 continue;
> >                         }
> >                         $PathDir = $source . '/' . $readdirectory;
> >                         if ( is_dir( $PathDir ) ) {
> >                                 copy_directory( $PathDir, $destination . 
> > '/' . $readdirectory );
> >                                 continue;
> >                         }
> >                         copy( $PathDir, $destination . '/' . $readdirectory 
> > );
> >                 }
>
> >                 //$directory->close();
> >                 }else {
> >                         copy( $source, $destination );
> >                 }
>
> >                 unlink($source);
>
> > were talking about the same path here...but cakephp wont unlink my
> > source folder...the copying works fine...just the files in the folder
> > wont get deleted...
>
> > how does that make sense?
>
> > thx

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: unlink function throws "permission denied" error

2010-09-05 Thread j.blotus
permission denied is an operation system issue, not a cakephp issue.
The process that is running your php (depends on your environment)
trying to remove the folder does not have the authority to delete that
folder. check your permissions and you will find your answer.

On Sep 5, 12:41 pm, Tomfox Wiranata  wrote:
> hi,
>
> this permission denied thing seems ridiculous to me...since i use it
> in different code and it works.
> it works here, when i use this code to copy files.
>
>                 $biguploaddir = "linkables/".$folderName; // the /big/ 
> directory
>                 if(!is_dir($biguploaddir)) mkdir($biguploaddir,true);
>
>                 $bigsource = "link/tmp/".$folderName."/".$filename_big;
>                 $bigdestination = "link/".$folderName."/".$filename_big;
>
>                 //first copy image from temp to real location then delete all
> directories and files in temp
>                 if (!copy($bigsource, $bigdestination)){
>                         print "Dein Flyer konnte nicht gespeichert werden";
>                 }else{
>                         unlink($bigsource);
>                 }
>
> now i need to copy whole directories and i had to use different code
> for that:
>
>                 $source = "link/tmp/".$folderName."/attachments";
>                 $destination = "link/".$folderName."/attachments";
>
>                 if ( is_dir( $source ) ) {
>                 @mkdir( $destination );
>                 $directory = dir( $source );
>                 while ( FALSE !== ( $readdirectory = $directory->read() ) ) {
>                         if ( $readdirectory == '.' || $readdirectory == '..' 
> ) {
>                                 continue;
>                         }
>                         $PathDir = $source . '/' . $readdirectory;
>                         if ( is_dir( $PathDir ) ) {
>                                 copy_directory( $PathDir, $destination . '/' 
> . $readdirectory );
>                                 continue;
>                         }
>                         copy( $PathDir, $destination . '/' . $readdirectory );
>                 }
>
>                 //$directory->close();
>                 }else {
>                         copy( $source, $destination );
>                 }
>
>                 unlink($source);
>
> were talking about the same path here...but cakephp wont unlink my
> source folder...the copying works fine...just the files in the folder
> wont get deleted...
>
> how does that make sense?
>
> thx

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: passing array as parameters of redirect function

2010-09-05 Thread j.blotus
what is the specific error message you are getting. check lines 106
and 107 of your users_controller.php


On Sep 5, 12:38 pm, "Mariano C."  wrote:
> Then I've a method called collection
>
> function collection($username = null,
>                            $page = 1,
>                            $sort = array('Artist.name',
> 'Album.year'),
>                            $direction = array('ASC', 'ASC')
>                            )
> {
>         debug(is_array($sort));
>         debug($sort);
>
> }
>
> it's fully working, matter of fact:
> app/controllers/users_controller.php (line 106)
> 1
>
> app/controllers/users_controller.php (line 107)
> Array
> (
>     [0] => Artist.name
>     [1] => Album.year
> )
>
> Now I've remove() function, something like that:
> function removeFromCollection($album_user_id = null)
> {
>         $this->redirect(array(
>                           'controller'=>'users',
>                           'action'=>'collection',
>                           $param['username'],
>                           $param['page'],
>                           array('Album.year', 'Artist.name'),
>                           array('ASC', 'ASC')
>        ));
>
> }
>
> but when I call removeFromCollection() and redirect to collection is
> performed debug() output is:
> app/controllers/users_controller.php (line 106)
>
> app/controllers/users_controller.php (line 107)
> Array
>
> How can resolve this issue? How can I send array of element as
> parameter?

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 it possible to format the standard php file upload form?

2010-09-05 Thread Tomfox Wiranata
ok i panicked.i had to switch the submit to file...now it works

thx :)

On 5 Sep., 20:04, Tomfox Wiranata  wrote:
> thx dave...that makes sense
>
> but it wont work.
>
> On 5 Sep., 19:57, "Dave Maharaj"  wrote:
>
> > CSS
>
> > #uploadAttachmentsForm input[type=submit] {
>
> > whatever you like
>
> > }
> > -Original Message-
> > From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com]
> > Sent: September-05-10 3:20 PM
> > To: CakePHP
> > Subject: is it possible to format the standard php file upload form?
>
> > hi,
>
> > when using
>
> >                 
> >                          > echo $form->create('Link',
> > array('name'=>'uploadAttachmentsForm','id'=>'uploadAttachmentsForm','type'=>
> > 'file'));
>
> >                         
>
> > i get a working but awful big form with a huge button...is there any
> > way to take influence on the size of the button?
>
> > big thx :)
>
> > 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: is it possible to format the standard php file upload form?

2010-09-05 Thread Tomfox Wiranata
thx dave...that makes sense

but it wont work.

On 5 Sep., 19:57, "Dave Maharaj"  wrote:
> CSS
>
> #uploadAttachmentsForm input[type=submit] {
>
> whatever you like
>
> }
> -Original Message-
> From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com]
> Sent: September-05-10 3:20 PM
> To: CakePHP
> Subject: is it possible to format the standard php file upload form?
>
> hi,
>
> when using
>
>                 
>                          echo $form->create('Link',
> array('name'=>'uploadAttachmentsForm','id'=>'uploadAttachmentsForm','type'=>
> 'file'));
>
>                         
>
> i get a working but awful big form with a huge button...is there any
> way to take influence on the size of the button?
>
> big thx :)
>
> 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: is it possible to format the standard php file upload form?

2010-09-05 Thread Dave Maharaj
CSS

#uploadAttachmentsForm input[type=submit] {

whatever you like

}

-Original Message-
From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] 
Sent: September-05-10 3:20 PM
To: CakePHP
Subject: is it possible to format the standard php file upload form?

hi,

when using


create('Link',
array('name'=>'uploadAttachmentsForm','id'=>'uploadAttachmentsForm','type'=>
'file'));




i get a working but awful big form with a huge button...is there any
way to take influence on the size of the button?

big thx :)

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

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 it possible to format the standard php file upload form?

2010-09-05 Thread Tomfox Wiranata
hi,

when using


create('Link',
array('name'=>'uploadAttachmentsForm','id'=>'uploadAttachmentsForm','type'=>'file'));




i get a working but awful big form with a huge button...is there any
way to take influence on the size of the button?

big thx :)

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 it possible to format the standard php file upload form?

2010-09-05 Thread Tomfox Wiranata
hi,

when using


create('Link',
array('name'=>'uploadAttachmentsForm','id'=>'uploadAttachmentsForm','type'=>'file'));




i get a working but awful big form with a huge button...is there any
way to take influence on the size of the button?

big thx :)

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


unlink function throws "permission denied" error

2010-09-05 Thread Tomfox Wiranata
hi,

this permission denied thing seems ridiculous to me...since i use it
in different code and it works.
it works here, when i use this code to copy files.

$biguploaddir = "linkables/".$folderName; // the /big/ directory
if(!is_dir($biguploaddir)) mkdir($biguploaddir,true);

$bigsource = "link/tmp/".$folderName."/".$filename_big;
$bigdestination = "link/".$folderName."/".$filename_big;


//first copy image from temp to real location then delete all
directories and files in temp
if (!copy($bigsource, $bigdestination)){
print "Dein Flyer konnte nicht gespeichert werden";
}else{
unlink($bigsource);
}


now i need to copy whole directories and i had to use different code
for that:

$source = "link/tmp/".$folderName."/attachments";
$destination = "link/".$folderName."/attachments";

if ( is_dir( $source ) ) {
@mkdir( $destination );
$directory = dir( $source );
while ( FALSE !== ( $readdirectory = $directory->read() ) ) {
if ( $readdirectory == '.' || $readdirectory == '..' ) {
continue;
}
$PathDir = $source . '/' . $readdirectory;
if ( is_dir( $PathDir ) ) {
copy_directory( $PathDir, $destination . '/' . 
$readdirectory );
continue;
}
copy( $PathDir, $destination . '/' . $readdirectory );
}

//$directory->close();
}else {
copy( $source, $destination );
}

unlink($source);

were talking about the same path here...but cakephp wont unlink my
source folder...the copying works fine...just the files in the folder
wont get deleted...

how does that make sense?

thx

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


passing array as parameters of redirect function

2010-09-05 Thread Mariano C.
Then I've a method called collection

function collection($username = null,
   $page = 1,
   $sort = array('Artist.name',
'Album.year'),
   $direction = array('ASC', 'ASC')
   )
{
debug(is_array($sort));
debug($sort);
}

it's fully working, matter of fact:
app/controllers/users_controller.php (line 106)
1

app/controllers/users_controller.php (line 107)
Array
(
[0] => Artist.name
[1] => Album.year
)



Now I've remove() function, something like that:
function removeFromCollection($album_user_id = null)
{
$this->redirect(array(
  'controller'=>'users',
  'action'=>'collection',
  $param['username'],
  $param['page'],
  array('Album.year', 'Artist.name'),
  array('ASC', 'ASC')
   ));
}

but when I call removeFromCollection() and redirect to collection is
performed debug() output is:
app/controllers/users_controller.php (line 106)


app/controllers/users_controller.php (line 107)
Array

How can resolve this issue? How can I send array of element as
parameter?

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


Paging Layout Question

2010-09-05 Thread Dave Maharaj
So I built my alphabetical paging setup so users can now click each letter
to sort thru .all fine and dandy. Now moving onto the view I have a question

 

I want it layed out in rows and cols

 

So for example

 

A___

 

$first_A | $second_A | $third_A

 

B

$first_B

 

 

C_

No records found (if none)

 

 

You get the picture.so Heading A, then spit out all A records, B Heading and
all B records How can this be done. The index pagination with no letter
passed in the URL is simply ordered alphabetical.

 

Thoughts to get me started here?

 

Thanks

 

Dave

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


Numbers to Words

2010-09-05 Thread andres amaya diaz
Hi, i was wondering if any one has done a numbers to words implementation in
cakePHP?

Thanks ... aad

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: Session get deleted with chrome browser

2010-09-05 Thread Sanza
I have the same problem! Only with the cakephp 1.3.+
With firefox works perfectly, but with Safari, Internet Explorer and
Chrome don't work and lost the session or don't store the cookie.

I did a little step setting a different Session.cookie (core.php) and
setting the Cookie name on a component i28n wich use the session and
cookie, but I have get others misterious errors like "array to string
conversion" on session_start() and an other error on cookie system
component.

The strange this is that on firefox all work perfectly!

Any suggestion will be appreciated
Massimo



On 3 Set, 13:18, Amjed  wrote:
> Hi,
> I have an application which works fine in Firefox.
> But when I use chrome, session gets deleted/new session is created for
> every page
> it is not the the problem of security.level or "php" sessions. I have
> check all forums.
>
> In one forum it says that chrome changes HTTP_REFERER, due to this
> behaviour new sessions is created.
> Any help in this regard will be appreciated.
>
> Thanks,
> Amjed

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: Session get deleted with chrome browser

2010-09-05 Thread Sanza
I have the same problem! Only with the cakephp 1.3.+
With firefox works perfectly, but with Safari, Internet Explorer and
Chrome don't work and lost the session or don't store the cookie.

I did a little step setting a different Session.cookie (core.php) and
setting the Cookie name on a component i28n wich use the session and
cookie, but I have get others misterious errors like "array to string
conversion" on session_start() and an other error on cookie system
component.

The strange this is that on firefox all work perfectly!

Any suggestion will be appreciated
Massimo


On 3 Set, 13:18, Amjed  wrote:
> Hi,
> I have an application which works fine in Firefox.
> But when I use chrome, session gets deleted/new session is created for
> every page
> it is not the the problem of security.level or "php" sessions. I have
> check all forums.
>
> In one forum it says that chrome changes HTTP_REFERER, due to this
> behaviour new sessions is created.
> Any help in this regard will be appreciated.
>
> Thanks,
> Amjed

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 future

2010-09-05 Thread Jeremy Burns | Class Outfit
Yup. The Lithium project is the child of a couple of the core Cake developers 
who left the project around a year ago to do their own thing. If I was Cake and 
wanted to get all corporatey I could ask them to stop referring to Cake when 
they mention their project.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 5 Sep 2010, at 05:06, Jamie wrote:

> The Lithium framework is a completely separate project from CakePHP.
> It doesn't represent its "future" or anything like that. It has its
> roots in the now-defunct "Cake 3", but that's as far as it goes...
> it's totally separate. CakePHP is not affiliated with Lithium. The
> articles you quote - especially the second one on debuggable.com - are
> out of date.
> 
> The main difference between Lithium and CakePHP, aside from being two
> completely separate frameworks, is that Lithium requires PHP 5.3 since
> it uses namespaces. CakePHP supports 5.3, but doesn't use any 5.3-only
> features.
> 
> - Jamie
> 
> On Sep 2, 9:10 pm, sambo  wrote:
>> Does Lithium framework is the future of CakePHP? And what is different
>> with CakePHP 2.0 and Cake3 (released under a new name: Lithium)?
>> 
>> You can see this link below for 
>> morehttp://www.phpframeworks.com/news/p/614/cakephp-is-dead-lithium-was-bornhttp://debuggable.com/posts/Cake_3_interview_with_Nate_Abele:4a665a5e...
>> 
>> Thanks,
>> Sambo
> 
> 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

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: Auth Component Login Hook?

2010-09-05 Thread Jeremy Burns | Class Outfit
See previous rely to your other post. autoRedirect.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 3 Sep 2010, at 15:47, MrDarren wrote:

> Hi all, I want to do an action to my database everytime someone logs
> in via the Auth component. Is this possible and what method would I go
> about doing this? I have thought about extending the component but
> then what method in the component would I use?
> 
> Thanks,
> Darren
> 
> 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

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: Preserving value in dependent select list after validation

2010-09-05 Thread Jeremy Burns | Class Outfit
You're doing a redirect, which effectively clears down the values in the 
$this->data array, which the form will look for to get previously entered data. 
Set $this->data to $this->Session->read('applicantdata') before you go back to 
the form. Should work.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 3 Sep 2010, at 05:14, aveev wrote:

> Hi, I'm new to cakephp
> I'm trying to create an applicant add form with validation..
> If validation fails, it should return to the add page with previously
> entered values.
> Here's the code snippet
> //applicant controller
> function add() {
> 
>   $docTypes = $this->DocumentType->find('list');
>   $states = $this->State->find('list', array ('fields' => array
> ('name',
> 'name')));
>   $this->set('states',$states);
>   $this->set(compact('docTypes','states'));
> 
>   if (!empty($this->data)) {
>   $this->Applicant->set($this->data);
>   if($this->Applicant->validates()) {
> 
>   
> $this->Session->write('applicantdata',$this->data);
>   
> $this->redirect(array('controller'=>'uploads','action' =>
> 'add'));
>   } else {
>   //grab options for select list with 
> application id
>   $this->set('errors', 
> $this->Applicant->validationErrors);
>   }
>   }
>   }
> 
> //applicant model
> class Applicant extends AppModel {
> 
>   var $name = 'Applicant';
>var $validate = array('name'=>array('rule'=>'alphaNumeric',
> 'allowEmpty'=>false,'message'=>'This field is required'));
> }
> 
> //applicant view
>   $javascript->link('jquery/jquery-1.4.1', false);
>   $javascript->link('jquery/applicants_ajax', false);
> 
>   echo $form->create('Applicant');
> echo $form-
>> select('document_type_id',array($docTypes),null,array('id'=>'document'),true);
> echo $form->select('application_type_id', array(),null,
> array('id'=>'application'),true );
>   echo $form->input('name');
>   echo $form->input('pob');
> 
> 
>   echo $form->end('Save');
> 
> 
> //jquery
> //if validation fails create options for select list with id =
> application, and select value based
> //on previously entered one
> 
> $('#document').change( function () {
>$.post('http://localhost/doc_apps/documents/
> ajax_search_app_type', {app_type_select: $(this).val()},function(data)
> {
>   
> $('#application').find('option').remove().end().append(' option>');
>   var obj = jQuery.parseJSON(data);
>   $.each(obj, function(key, value)
>   {
>$('#application').
> 
> append($("").
> attr("value",key).
> text(value));
>   });
> 
>   $.each(obj, function(key, value)
>   {
>   var strToAdd = " type='hidden' value='helo'/>" ;
>   $('form').append(strToAdd);
>   });
> 
>});
>   });
> 
>   });
> 
> 
> In the form, there are 2 select lists where 1 select list depends on
> another select list (dependent select list).
> The problem is I cannot preserve the options and selected value of
> dependent select list if validation fails. The options in dependent
> select list is created using java script  (jquery)
> What comes to my mind is that in jquery, I should check if validation
> fails or not. If it does, I'll make an ajax call to grab values for
> dependent select list options and select an option based on previously
> selected value.
> Or maybe anyone have another idea to solve this problem ?
> Any help would be greatly appreciated
> 
> Thanks...
> CakePHP 1.2
> 
> 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

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 th

Re: How to make it so I can perform an action right after user has logged in with auth component?

2010-09-05 Thread Jeremy Burns | Class Outfit
Check out the autoRedirect setting of the Auth controller: 
http://book.cakephp.org/view/1274/autoRedirect

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 4 Sep 2010, at 05:40, MrDarren wrote:

> Hi, how would I make it so I can update database information right
> after a user has logged in with the auth component? I want to perform
> this in the login action.
> 
> Thanks,
> Darren
> 
> 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

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: call model validation for multiple actions

2010-09-05 Thread Jeremy Burns | Class Outfit
If you have your validation rules set up in the model, they will automatically 
be triggered each time you do any save action against the model - that is, 
unless you have changed something to prevent it. You don't need to call the 
validate method at all. You can, however, do if ($this->ModelName->validates()) 
as a test before doing the actual save, but that is rarely necessary.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 3 Sep 2010, at 13:15, amin wrote:

> Hi,
> 
> Can u plz help me out, how to call validation for multiple actions of
> a controller
> 
> E.g. a user controller, in user controller add, signup, forgot
> password .. etc are actions
> 
> now in model class User extends AppModel{
> 
> }
> 
> how to validate mentioned actions validation in User model 
> 
> I have tried $validate method but it only allow for only one action
> 
> so plz help me out.
> 
> thnks in advance
> 
> 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

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: liner array

2010-09-05 Thread Jeremy Burns | Class Outfit
Can you explain this a bit more clearly? Do you mean that you want to do a find 
that returns a data array ready for populating a select list (id + name 
columns)? If so, check out find('list'): 
http://book.cakephp.org/view/1022/find-list


Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 4 Sep 2010, at 16:58, butterCake wrote:

> I'm new to cakePHP. What if I want my model to contain only an array
> of list. How to do this ?
> 
> 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

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: config.php debug =2 But no debug data

2010-09-05 Thread Jeremy Burns | Class Outfit
Have you moved from 1.2 to 1.3? If so, you no longer get the SQL dump by 
default. See here: 
http://book.cakephp.org/view/1567/Model-Databases-and-Datasources. You need to 
add element('sql_dump'); ?> to your view (ideally in the 
layout so it's always available).

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 2 Sep 2010, at 17:51, hvannia wrote:

> Hi,
> Here comes a very basic question, but here it goes..
> I had a fresh cake installation and I added some files data from
> another (backup) cake app.
> Did not mess around with baked controllers, models and views, but
> added default.ctp, a Css file and as far as I can recall that's it.
> 
> Now i dont see any debig data a at the bottom of the screen.
> Checked the confg file and debug=2, also added Config write debug 2 on
> the app_controller but still no data.
> 
> Im having a hard time developing w/o looking at the queries, any
> ideas??
> 
> 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

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: saving HABTM from other controller

2010-09-05 Thread Jeremy Burns | Class Outfit
Is there a reason why you are doing two separate saves? COuld you not create a 
well formed data array and do a saveAll?

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 2 Sep 2010, at 18:26, hvannia wrote:

> Hi,
> Basically I Have a HATBM between "A" and "B" tables,
> at the "A" controller, once the data for "A" has been entered I want
> to save "A" and "A_B" tables .
> 
> I read  the " How to add item using HABTM relation " disussion but
> still cant get it done.
> 
> This is what i got so far:
> 
> // within "A" controller:
> 
> function add() {
>   if (!empty($this->data)) {
>   $BId=$this->Session->read('BId');
>   $this->A->create();
>   if ($this->A->save($this->data)) {
>  $lastCreated=$this->A->find('first',
> array('conditions' => array('A.name' => $this->data['A']['name']),
> 'fields'=>'id'));
>$this->set('Bid',$BId);
>   $this->set('Aid',$lastCreated['A']['id']);
>   }
> 
> // within "A" view
> 
> echo $this->Form->input('A_B.A_id', array('type'=>'hidden' , 'value'=>
> $AId));
> echo $this->Form->input('A_B.B_id', array('type'=>'hidden' , 'value'=>
> $BId));
> 
> ...
> 
> 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

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 this even possible?

2010-09-05 Thread Jeremy Burns | Class Outfit
I'm sure it's possible, even if it means manipulating the resulting array after 
you've done the find. Can you post a sample array?

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 3 Sep 2010, at 02:34, MDavis wrote:

> I have a table containing basic post data, including id, category_id,
> title, and description. I also have a table containing custom field
> data, so that I may create custom form fields on a per category basis,
> and I have a third table that contains the answers associated with
> particular posts, which contains a record for every custom form field
> each time a post is submitted that utilizes custom form fields. Each
> record in the answer table has a post_id and a field_id, and a value.
> 
> Now, lets say I want to display all the posts for a particular
> category on a page. I can use cake's find method to pull the data and
> filter it to only select the posts with a certain category_id, that's
> easy. I have setup a HABTM relationship between the field model and
> the post model (not sure if that's what needs to be done, but it seems
> to be selecting the data I need at this time). On the page that is
> displaying the post data, I am also displaying select custom field
> names as additional columns.
> 
> By the way, I'm selecting all this data inside the posts controller
> 
> For instance:
> ID   |Title|   Manufacturer   |   Age   |   Condition
> -
> 
> The first 2 columns are from the post table and the last 3 are labels
> that I selected from the field table. Then, I am able to select the
> data from the post table and the associated answer data from the
> answer table.
> 
> For istance (these values are just for demonstration, I'm really using
> IDs to represent data that's repeated)::
> ID  |Title   |   Manufacturer   |   Age |   Condition
> -
> 1   |Test 1|   Company 1 |   2 years|  Very Good
> 2   |Test 2|   Company 2 |   5 years|  Good
> 3   |Test 3|   Company 3 |   12 years  |  Fair
> 
> I know how to order the results by a field inside the posts table,
> such as id or title, but I cannot for the life of me figure out how to
> order these results by a field inside the field tableand I may be
> completely crazy by thinking it can be done..maybe I'm missing
> something obvious, dunno. For instance, I would like to be able to
> sort these results by manufacturer, by age, or by condition. I think
> I'm just forgetting something but since I can't seem to rack my brain
> around it, can anyone out there point me in the wrong direction or let
> me know if something like this is even possible, or if it is possible
> but not with the database structure I'm using?
> 
> 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

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