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

2011-02-12 Thread parallel32
Chris,

I had a similar problem with my swfuploader component which was losing
the session on IE only.  Turns out it was a simple change in the
cakephp core configuration that fixed it.

Change Configure::write('Session.checkAgent', true);  in core.php to
false.

Hope this helps,
Mike

On Feb 8, 10:01 pm, "chris...@yahoo.com"  wrote:
> Hi guys,
>
> need help with UPLOAD...
> I have SWF Uploader originaly setup on a script for photos.
> And its uploading greate on photos,... however I have created groups
> and group photos seperated from original one.
> Now with this when I'm trying to upload I'm loosing session_id() when
> I try to set it up to::: post_params: {"PHPSESSID": " session_id(); ?>"},
>
> HERE IS THE ORIGINAL for PHOTOS
>
>     var swfu;
>
>     window.onload = function() {
>       var settings = {
>         flash_url : "webroot ?>swf/swfupload.swf",
>         upload_url: "url('/photos/upload?
> PHPSESSID=' . session_id(), true) ?>",  // Relative to the SWF file
>         post_params: {},
>
> HERE IS THE ONE for GROUP PHOTOS when its lossing session_id()
>
>     var swfu;
>
>     window.onload = function() {
>       var settings = {
>         flash_url : "webroot ?>swf/swfupload.swf",
>         upload_url: "url('/groups/upload/' .
> $group['Group']['id'], true) ?>",       // Relative to the SWF file
>         post_params: {"PHPSESSID": ""},
>
> AND HERE IS THE ONE for GROUP PHOTOS when I'm having with group ID ...
> $group['Group']['id'] in there,... BUT THIS ONE GIVES ME AN ERROR. I
> CAN'T FIGURE OUT WHAT'S WRONG IN IT...
>
> CAN ANYONE HELP... ???
>
>     var swfu;
>
>     window.onload = function() {
>       var settings = {
>         flash_url : "webroot ?>swf/swfupload.swf",
>         upload_url: "url('/groups/upload/ .
> $group['Group']['id']?PHPSESSID=' . session_id(), true) ?>",    //
> Relative to the SWF file
>         post_params: {"PHPSESSID": ""},
>
> or can anyone suggest good uploader,... so it can upload
> all: .jpg, .bmp, .gif, .pdf. ect... this SWF uploader is good, it can
> upload multiple files. any ohter good once out there...???
>
> THANK YOU AL !!!
> chris

-- 
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: Any chance to get the $_SERVER variable or Configure::write Settings into a shell?

2011-02-06 Thread parallel32
DD, I just had this same issue and resolved it (for me).

There's a couple ways to solve this.  On my servers (centos 5) the env
variables retrieved from _SERVER are available from the cli but they
are a subset of the ones available from http.  And cronjobs are even
fewer than cli env variables as I have come to find.  So it  really
just all depends on what user crontab runs as.  I like the idea of
setting a php.ini variable to find your environment but if php.ini
changes and sometimes it does with php version updates, this could
break.  I chose to use the HOSTNAME env variable.  You can set this in
your .bash_profile for whichever user crontab runs as.  Or you can set
it globally in /etc/profile.  Or you can just set it in your crontab
entry like so:

*  *  *   *   *   HOSTNAME=dev.domain.com;export
HOSTNAME;/path/to/execute/your/cakeshell/script

You can set any env variable using anyone of those ways.

Hope this helps

-- 
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: Optimize ACL database

2010-11-27 Thread parallel32
Thanks for that.  Really helped me shore up my indexes.  Major
performance increase too.

On Nov 25, 8:45 am, Jeremy Burns | Class Outfit
 wrote:
> http://articles.classoutfit.com/2010/02/cakephp-basic-database-table-...
>
> 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 25 Nov 2010, at 12:16, parallel32 wrote:
>
>
>
>
>
>
>
> > Thanks for the reply but I don't see a link to the article?
>
> > On Nov 24, 5:51 pm, Jeremy Burns | Class Outfit
> >  wrote:
> >> This article has some general database tuning tips, and also includes 
> >> specific advice on ACL.
>
> >> Jeremy Burns
> >> Class Outfit
>
> >> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> >> On 24 Nov 2010, at 14:34, parallel32 wrote:> Does anyone have any 
> >> recommendations on how to best optimize the aros,
> >>> acos and aros_acos tables?
>
> >>> I've created a few indexes but would like to get some other ideas
> >>> also!
>
> >>> Thanks,
> >>> Mike
>
> >>> 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 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: migrating from 1.2.6 to 1.3.6 and acl broke

2010-11-27 Thread parallel32
In case someone stumbles upon this I found a fix for it and posted it
in a thread that seemed to have the same problem.

http://groups.google.com/group/cake-php/browse_thread/thread/1a758f5511091d9d/6aab14de73886424#6aab14de73886424

On Nov 20, 8:31 pm, parallel32  wrote:
> Hi,
>
> I have acl working perfectly in 1.2.6.  I'm trying to update my code
> base to 1.3.6 and I've found the following problem, which I cannot
> solve.
>
> I have aros, acos, and aros_acos tables set up perfectly to work with
> users and groups for auth and acl.  In the aros_acos table I only have
> group level permissions set.  (no user level permissions).  So for
> example:  I have a group called administrators, and a user called
> admin, who is a part of the group.  I have set up the ACL (aros_acos
> table) to allow the administrators group access to all the
> controllers.
>
> Now in 1.2.6, after you've properly authenticated, if you watch the
> sql you will see that there are 2 sql statements that check the
> permissions when you attempt to access a controller's action.  One
> that checks if the user has permissions to access that action and one
> that checks if that user's group has permissions.  In 1.3.6 only one
> statement executes and that is the one that checks if the user has
> permission.  It does not check if the group the user belongs to has
> permission as it does in 1.2.6.  So in the 1.3.6 aros_acos table If I
> manually put in a line for that specific user I've logged in as and
> give him permission to that controller it works.
>
> so is there any reason why 1.2.6 automatically checks both group and
> user permissions on actions and 1.3.6 only check user permission on
> actions?
>
> Is there a fix so that 1.3.6 or 1.3.x performs that group check?
>
> Help would be greatly appreciated I've completely run out of options
> and I've gone as far as I can trying to debug the core cake code.
>
> 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: Acl and bindNode

2010-11-27 Thread parallel32
A very minor change to the core, but you're right nutesco it would
break upgrades.  So far the fix is holding steady on my deployments so
I'm going to submit it as a bug and perhaps they can permanently fix
it for the next release.

If anyone has a userland fix that would be even better in case it
takes a while to fix the core.

On Nov 23, 4:38 pm, netusco  wrote:
> I just had the same problem, it really looks like a bug on cakephp...
>
> It was working when ids of groups where the same as ids of aros, but
> not working when different.
>
> I agree with parallel 32 but I would prefer not to use his approach as
> it would break in any upgrading...
>
> Is there anyone who could get a light on this issue?
>
> thanks
>
> On Nov 22, 8:37 pm, Jeremy Burns | Class Outfit
>
>
>
>
>
>
>
>  wrote:
> > See the previous reply in this thread that arrived yesterday - haven't 
> > followed it through yet.
>
> > Jeremy Burns
> > Class Outfit
>
> > jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> > On 21 Nov 2010, at 22:49, Rajat wrote:
>
> > > i m also facing this issue.
> > > did u get any official updates on this?
>
> > > On Nov 4, 1:34 am, Jeremy Burns | Class Outfit
> > >  wrote:
> > >> I'm still really hoping that someone with some inside knowledge can shed 
> > >> a light on this for me.
>
> > >> Jeremy Burns
> > >> Class Outfit
>
> > >> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> > >> On 1 Nov 2010, at 07:24, Jeremy Burns | Class Outfit wrote:> Because the 
> > >> users table has a group_id on it.
>
> > >>> Jeremy Burns
> > >>> Class Outfit
>
> > >>> jeremybu...@classoutfit.com
> > >>>http://www.classoutfit.com
>
> > >>> On 31 Oct 2010, at 14:48, huoxito wrote:
>
> >  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.organdhelpotherswith 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.organdhelpotherswith 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.organdhelpothers 
> >  with their CakePHP related questions.
>
> >  You received this message because you are subscribed to the Google 
> >  

Re: Optimize ACL database

2010-11-25 Thread parallel32
Thanks for the reply but I don't see a link to the article?

On Nov 24, 5:51 pm, Jeremy Burns | Class Outfit
 wrote:
> This article has some general database tuning tips, and also includes 
> specific advice on ACL.
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 24 Nov 2010, at 14:34, parallel32 wrote:> Does anyone have any 
> recommendations on how to best optimize the aros,
> > acos and aros_acos tables?
>
> > I've created a few indexes but would like to get some other ideas
> > also!
>
> > Thanks,
> > Mike
>
> > 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


Optimize ACL database

2010-11-24 Thread parallel32
Does anyone have any recommendations on how to best optimize the aros,
acos and aros_acos tables?

I've created a few indexes but would like to get some other ideas
also!

Thanks,
Mike

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-11-21 Thread parallel32
I believe I've found the problem.  I've also figured out a work
around.  I'm running cake 1.3.6

If you include bindNode in the user model:

function bindNode($user) {
return array('Group' => array('id' => $user['User']
['group_id']));
}

a certain stanza of code is executed in /cake/libs/model/db_acl.php
starting at line 151 (if line number is wrong look for the actual
code) beginning with:

if (method_exists($model, 'bindNode')) {

This part of the code executes your bindNode you defined in user.php
model.  all fine and well until you reach here:

foreach ($ref as $key => $val) {
if (strpos($key, $type) !== 0 && strpos($key, 
'.') === false) {
unset($ref[$key]);
$ref["{$type}0.{$key}"] = $val;
}
}

the $val that is assigned to the $ref["{$type}0.{$key}"] is the
group_id of your user  instead of the id of the Aros record, which is
what it should be.

upon entering the foreach above $ref looks like this:

Array
(
[Group] => Array
(
[id] => 7
)

)

upon exiting $ref looks like this:

Array
(
[Aro0.id] => 7
)

In my database the aros.id for group 7 is really 26 and looks like
this:

id:26parent_id:NULL  model:Groupforeign_key:7   alias:  lft:37  
  rgt:
40

My ACL is set up as group based, which means I don't care about
individuals permissions only about the permissions of the group
they're in.  So I set up my ACL for my Group "7" like this:

$group->id = 7;
$this->Acl->allow($group, 'controllers');
$this->Acl->revoke($group, 'controllers/Albums');

which produced aros_acos records like this:

id aro_id aco_id _create _read _update _delete
35  26  10451   1   1   1
37  26  1383-1  -1  -1  -1

Notice the number 26 which is the aro_id.  aco_id 1045 is the
controllers and 1383 is the Albums .. all looks accurate.

So I fixed this problem by looking up the correct aro.id for my group
id and updated the $ref array.  Doing this allowed me to leave the
foreach loop above as-is and So now when $ref enters the foreach I
describe above it looks like this:

Array
(
[Group] => Array
(
[id] => 26
)

)

And upon exit $ref looks like this:

Array
(
[Aro0.id] => 26
)

I did it by replacing:

$ref = $tmpRef;

with:

$queryData = array(
'conditions' => 
array('model'=>'Group','foreign_key'=>
$tmpRef['Group']['id']),
'fields' => array('id')
);
$result = $db->read($this, $queryData, -1);
$tmpRef['Group']['id'] = 
$result['0']['Aro']['id'];
$ref = $tmpRef;


if you do a text search for $ref = $tmpRef; in db_acl.php you'll find
only one occurrence .. and it should be inside the function node..  I
would give the exact line number but I have so much debug code it
wouldn't be accurate..

You can leave all the rest of the code as-is.  Just make this one
change in db_acl.php.

Anyone know how to verify if this is indeed a bug in the core?  And if
so submit it as one?  .. Never found and / or submitted a bug before.

Hope this helps someone because it literally destroyed 3 days of my
life when I was trying to figure out why my ACL system broke migrating
from 1.2.6 to 1.3.6

-Mike

On Nov 4, 6:14 am, Marc Divins  wrote:
> Same here, I tried to do itbe cause I always use permissions thinking
> on groups/roles. Despite doing same as example, users are still added
> to AROs table.
> I hope we got something soon :)
>
> On 3 nov, 21:34, Jeremy Burns | Class Outfit
>
>
>
>
>
>
>
>  wrote:
> > I'm still really hoping that someone with some inside knowledge can shed a 
> > light on this for me.
>
> > Jeremy Burns
> > Class Outfit
>
> > jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> > On 1 Nov 2010, at 07:24, Jeremy Burns | Class Outfit wrote:
>
> > > Because the users table has a group_id on it.
>
> > > Jeremy Burns
> > > Class Outfit
>
> > > jeremybu...@classoutfit.com
> > >http://www.classoutfit.com
>
> > > On 31 Oct 2010, at 14:48, huoxito wrote:
>
> > >> 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 t

migrating from 1.2.6 to 1.3.6 and acl broke

2010-11-20 Thread parallel32
Hi,

I have acl working perfectly in 1.2.6.  I'm trying to update my code
base to 1.3.6 and I've found the following problem, which I cannot
solve.

I have aros, acos, and aros_acos tables set up perfectly to work with
users and groups for auth and acl.  In the aros_acos table I only have
group level permissions set.  (no user level permissions).  So for
example:  I have a group called administrators, and a user called
admin, who is a part of the group.  I have set up the ACL (aros_acos
table) to allow the administrators group access to all the
controllers.

Now in 1.2.6, after you've properly authenticated, if you watch the
sql you will see that there are 2 sql statements that check the
permissions when you attempt to access a controller's action.  One
that checks if the user has permissions to access that action and one
that checks if that user's group has permissions.  In 1.3.6 only one
statement executes and that is the one that checks if the user has
permission.  It does not check if the group the user belongs to has
permission as it does in 1.2.6.  So in the 1.3.6 aros_acos table If I
manually put in a line for that specific user I've logged in as and
give him permission to that controller it works.

so is there any reason why 1.2.6 automatically checks both group and
user permissions on actions and 1.3.6 only check user permission on
actions?

Is there a fix so that 1.3.6 or 1.3.x performs that group check?

Help would be greatly appreciated I've completely run out of options
and I've gone as far as I can trying to debug the core cake code.

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: Paginate Multiple Models in the same view

2010-11-15 Thread parallel32
On a certain project I ran into the same problem with Cake and
couldn't find an elegant solution in the time I had..so what I did was
paginate the different models on the same page using ajax.  Probably
not the answer you are looking for but it keeps things real simple!

On Nov 13, 10:46 pm, "Arak Tai'Roth"  wrote:
> This can't be the first time this has been tried?
>
> On Nov 12, 5:12 pm, "Arak Tai'Roth"  wrote:
>
>
>
>
>
>
>
> > Anyone have any other ideas?
>
> > On Nov 12, 12:56 am, "Arak Tai'Roth"  wrote:
>
> > > That doesn't work, it actually disabled the working pagination on the
> > > Image model.
>
> > > I know there is a model option that can be set in the Paginator
> > > options, I'm wondering if it can be used for this purpose. But I have
> > > been unable to find anything that lists how it's used and what exactly
> > > it does or is used for.
>
> > > On Nov 11, 9:39 pm, Amit Badkas  wrote:
>
> > > > Hi,
>
> > > > Just like you set different options for $paginate in controller's 
> > > > action, I
> > > > think you need to do it for helper too, something like
>
> > > > $this->Paginator->options(array(
> > > >                'Image' => array('update' => .),
> > > >                'Floorplan' => array('update' => .)
> > > >        ));
>
> > > > should work.
>
> > > > Amit
>
> > > > PHP Applications for E-Biz:http://www.sanisoft.com
>
> > > > On Fri, Nov 12, 2010 at 8:00 AM, Arak Tai'Roth 
> > > > wrote:
>
> > > > > Hey everyone,
>
> > > > > I have what I thought was a simple problem, but haven't been able to
> > > > > find anything regarding it. Everything I can find is based off of
> > > > > paginating different sets of data but all from the same model.
>
> > > > > I have two models that are related to the model that the view is based
> > > > > off of. So I have a view that shows a single product, in that
> > > > > controller each product can have multiple images and multiple
> > > > > floorplans, as such:
>
> > > > > var $hasMany = array(
> > > > >        'Image' => array(
> > > > >                'className' => 'Image',
> > > > >                'dependant' => true,
> > > > >                'exclusive' => true
> > > > >        ),
> > > > >        'Floorplan' => array(
> > > > >                'className' => 'Floorplan',
> > > > >                'dependant' => true,
> > > > >                'exclusive' => true
> > > > >        )
> > > > > );
>
> > > > > Now I am getting the data alright with the following code in my
> > > > > Products controller:
>
> > > > > var $paginate = array(
> > > > >        'Image' => array(
> > > > >                'fields' => array(
> > > > >                        'Image.filename', 'Image.caption'
> > > > >                ),
> > > > >                'limit' => 3,
> > > > >                'order' => array(
> > > > >                        'Image.id' => 'asc'
> > > > >                )
> > > > >        ),
> > > > >        'Floorplan' => array(
> > > > >                'fields' => array(
> > > > >                        'Floorplan.filename', 
> > > > > 'Floorplan.floorplan_name',
> > > > > 'Floorplan.floorplan_price'
> > > > >                ),
> > > > >                'limit' => 1,
> > > > >                'order' => array(
> > > > >                        'Floorplan.id' => 'asc'
> > > > >                )
> > > > >        )
> > > > > );
>
> > > > > $dbImages = $this->paginate('Image', array('product_id' =>
> > > > > $dbProduct['Product']['id']));
> > > > > $dbFloorplans = $this->paginate('Floorplan', array('product_id' =>
> > > > > $dbProduct['Product']['id']));
>
> > > > > However the problem becomes apparent when I go to implement the
> > > > > pagination in the view, I have to set the options for the paginator,
> > > > > so it knows what div to update and what to do on before and complete
> > > > > callbacks.
>
> > > > >  > > > >        $this->Paginator->options(array(
> > > > >                'update' => '#showProducts',
> > > > >                'evalScripts' => true,
> > > > >                'before' => 
> > > > > $this->Js->get('#image_box')->effect('fadeOut'),
> > > > >                'complete' => 
> > > > > $this->Js->get('#image_box')->effect('fadeIn',
> > > > > array('speed' => 'slow'))
> > > > >        ));
> > > > > ?>
>
> > > > > However, this only works for the Image model, because I need to update
> > > > > a different div for the Floorplans model and use different before and
> > > > > complete callbacks.
>
> > > > > Is there anyway to do this?
>
> > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpothers
> > > > > 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 > > > >  om>For more options, visit this group at
> > > >

Re: 2 database, 1 models and controllers, many views

2010-10-30 Thread parallel32
Assuming both sites are on the same server you could bootstrap your
controller and model paths so that you only need to maintain one
version of your logic:

for cake 1.2.x by using $controllerPaths and $modelPaths settings
for cake 1.3.x by using
App::build(array(
'models' =>  array('/full/path/to/models/', '/next/full/path/to/
models/'),
'controllers' => array('/full/path/to/controllers/', '/next/full/
path/to/controllers/')
));


You should probably also keep your cake core files in one location for
both sites by updating your CAKE_CORE_INCLUDE_PATH constant in webroot/
index.php see the advanced installation docs:
http://book.cakephp.org/view/915/Advanced-Installation

hope this helps

On Oct 29, 4:06 am, Zaky Katalan-Ezra  wrote:
> 1. Use themes for two different designs
> 2. Use some sync software like rsync to update one of the sites controllers,
> models.
> 2.1 if both sites on the same server you can use symlink/hardlink (in linux)
> for controller and models in on of the sites
> 3. Set each site with its default theme.
>
> Another idea is to use some prefix for one of the sites like admin prefix.
> In the controller call in each prefix action for the default action .
> function site2_edit()
> {
>    edit();
>
> }
>
> I am not sure but I think you can change the domain name for each prefix in
> the apache level.

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