I want to upgrade my cakephp to the newest version
Hi, I want to upgrade my cakephp to the newest version, I only change the folder of cake_1.2.1.8004\cake_1.2.1.8004\cake Is it the succeed for the upgrade? every one how to upgrade? Thank you very much rimoe --~--~-~--~~~---~--~~ 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: Help me with forum based on CakePHP
A forum is not a hard task really. Take a look at this: http://code.google.com/p/expertforum On 30 май, 10:40, thethanghn wrote: > HI everyone, > > I'd like to build a website by CakePHP and it needs a reliable forum > and it's surely a hard task. Could anyone tell me whether there is a > good forum coded by CakePHP or how I can integrate cakePHP with other > CMS such as Drupal, Joomla? > > thank you --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to add some condition for Auth Magic? Thank you!
Miles J, Thank you for your answer! now, I can add some conditions. by the way, in your example the $this->Auth->loginError has been set in the beforefilter, so, the error will be show anytime, when you have no login. maybe I have use it wrong. how to show the loginerror, do you know, and can you tell me? Thank you very much. rimoe 2009/6/1 Miles J > > This might help. > > http://www.milesj.me/blog/read/5/using-cakephps-auth-component > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to add some condition for Auth Magic? Thank you!
This might help. http://www.milesj.me/blog/read/5/using-cakephps-auth-component --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
How to add some condition for Auth Magic? Thank you!
hi, everyone! I used the Auth Magic login method. so, I don't need do anything, anyone can login in by the example of login for example the method function login() { } but now I want to add some condition for the login, what should I do? Thank you! rimoe --~--~-~--~~~---~--~~ 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: Relationship confusion
Yes exactly the same thing...user can only have one role/groupjust saying user can only have one group sounds wrong...whereas user belongs to a group sounds right (as in English language sounds right) and confusing myself further.. Basic ideas is user has 1 one role/group but I need a separate profile for each user based on the role/group they have. What is the best way to set that up? Dave -Original Message- From: brian [mailto:bally.z...@gmail.com] Sent: May-31-09 11:02 PM To: cake-php@googlegroups.com Subject: Re: Relationship confusion role, group ... pretty much the same thing, no? On Sun, May 31, 2009 at 8:45 PM, Dave Maharaj :: WidePixels.com wrote: > This is fairly simple question but I think saying it in my head and > hearing it sounds wrong and confusing me further. > > "User" signs up and selects the "Group" they are going to belong to as > they can only belong to one group...sounds fine when you say it out > load "Group" has many "Users".sounds fine when you say it out load > > User belongsTo Group > Group hasMany Users > > -- OR -- > > "User" signs up and selects the "Role" they are going to have as they > can have only 1 role sounds fine when you say it out load "Role" has > many "Users' sounds wrong > > User hasOne Role > Role hasMany Users > > > So my question is how should this go? > > Dave > > > --~--~-~--~~~---~--~~ 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: Relationship confusion
role, group ... pretty much the same thing, no? On Sun, May 31, 2009 at 8:45 PM, Dave Maharaj :: WidePixels.com wrote: > This is fairly simple question but I think saying it in my head and hearing > it sounds wrong and confusing me further. > > "User" signs up and selects the "Group" they are going to belong to as they > can only belong to one group...sounds fine when you say it out load > "Group" has many "Users".sounds fine when you say it out load > > User belongsTo Group > Group hasMany Users > > -- OR -- > > "User" signs up and selects the "Role" they are going to have as they can > have only 1 role sounds fine when you say it out load > "Role" has many "Users' sounds wrong > > User hasOne Role > Role hasMany Users > > > So my question is how should this go? > > Dave > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Relationship confusion
This is fairly simple question but I think saying it in my head and hearing it sounds wrong and confusing me further. "User" signs up and selects the "Group" they are going to belong to as they can only belong to one group...sounds fine when you say it out load "Group" has many "Users".sounds fine when you say it out load User belongsTo Group Group hasMany Users -- OR -- "User" signs up and selects the "Role" they are going to have as they can have only 1 role sounds fine when you say it out load "Role" has many "Users' sounds wrong User hasOne Role Role hasMany Users So my question is how should this go? Dave --~--~-~--~~~---~--~~ 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: Persistent model to true -> Fatal error
It wont work, so set it to false. $persistModel only works in some instances and not in others. It will cause model conflicts with other controllers, hence the error you are getting. Nothing you can really do about it. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
HABTM - problem when reading data for non-unique keys
Here's my problem: If the foreign key in the HABTM join table isn't unique and could therefore return multiple matching records, all the records should be part of the returned dataset. The way it works now, only the first record is returned and the others are skipped. Simple example: Model "pallet" HABTM "product" with join table "pallets_products" Example pallets_products data: pallet_id, product_id, quantity 1, 1, 10 1, 2, 10 1, 2, 15 Here pallet_id 1 has three lines in the join table although two of the lines are actually the same product_id but with a different quantity. This causes the following problem: $pallet = $this->Pallet->find('all', array('conditions'=>array ('Pallet.id'=>$id))) The code above produces the following (correct) SQL: SELECT `Product`.`id`, `Product`.`description`, `PalletsProduct`.`id`, `PalletsProduct`.`pallet_id`, `PalletsProduct`.`product_id`, `PalletsProduct`.`quantity` FROM `products` AS `Product` JOIN `pallets_products` AS `PalletsProduct` ON (`PalletsProduct`.`pallet_id` = 1 AND `PalletsProduct`.`product_id` = `Product`.`id`) WHERE 1 = 1 The above SQL statement correctly returns THREE lines - one for every matched line in the join table. However, the $pallet array produced only contains TWO matched lines from the join table. It skips the subsequent line which has product_id of 2. What gives here? Some say I have bad DB design (I don't believe so), others say this is how it should be (I also don't believe so). Interestingly the same issue has been raised as a ticket some 10 months ago but from reading the ticket I feel that the cake team didn't bother to understand what it meant and preferred just to close it (https://trac.cakephp.org/ticket/5128). I even discussed this briefly with mark story but he didn't seem interested in actually understanding the problem preferring instead to just tell me that I was "doing something wrong". Ho hum. --~--~-~--~~~---~--~~ 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: Not able to save HTML tags to mysql database.
maybe because you sanitize input ? http://book.cakephp.org/view/462/html -- pietro --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem Uploading Flash
MeioUpload is made for images.. If you have modified it, to handle all kinds of files, check to see if you can upload other kind of files. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Persistent model to true -> Fatal error
Hi all, when i activate persistent model to true in my application, it breaks my models, I'm getting the following fatal errors: Fatal error: PhotosController::index() [photoscontroller.index]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "Albuns" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in /Volumes/Data/paulogomes/www/pg/controllers/ photos_controller.php on line 32 --- Fatal error: BehaviorCollection::trigger() [behaviorcollection.trigger]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "ExtendAssociationsBehavior" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in /Volumes/Data/ paulogomes/www/cake/libs/model/behavior.php on line 456 --- Fatal error: ResourcesController::index() [resourcescontroller.index]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "Types" of the object you are trying to operate on was loaded _before_ unserialize () gets called or provide a __autoload() function to load the class definition in /Volumes/Data/paulogomes/www/pg/controllers/ resources_controller.php on line 29 the error only occurs on second call of controller, after persistent cache files created on tmp. I'm using cakephp 1.2 running on leopard with php 5.2.6. Any ideas? Thanks. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Not able to save HTML tags to mysql database.
Hi, I have form where the site admin create articles. While creating the article for links he is using google , But this is not getting saved in my database. When i click on save, it is not throwing any error also. Normal text is getting saved. database filed's type is "TEXT" in mysql db. Please let me know what needs to be done for this Thanks & Regards Sridhar k N --~--~-~--~~~---~--~~ 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 & jQuery - Update multiple selects?
If you want to use code like you had before, check the livequery plugin. It reattached applicable events as new elements are added to the DOM (ie. Your change event to a new select box) On May 30, 2:47 pm, DigitalDude wrote: > Hey, > > THX for the response. I already changed my approach to the problem and > set up ID's for the elements and use .append to replace the options of > the elements. This works just finde, i encode my results to JSON and > jQuery rebuilds the list oft options for my selects the way it should. > > A question related to jQuery in general, are there any good sites or > tutorials or what I would call a function-overview for such purposes? > This would be great because it took a LOT of time to gather all > required information to my topic before I could solve it. > > Regards > > On 30 Mai, 18:43, brian wrote: > > > This is solely due to jQuery (in fact, probably the source of most > > questions on its mailing list). > > > The problem is that you're completely replacing each of the selects, > > rather than just the options. So, the event handlers you set up on the > > selects are no longer once the selects have been replaced. See here: > > >http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_st... > > > Also, it doesn't appear that you have several sets of these 5 selects > > on a page because you're setting the event handlers using the element > > IDs (eg. '#BookingCountryId'). So, you might want to consider using an > > element id, rather than a class (eg. '.ajax_shop_id'), for the target > > to be updated. > > > Or, don't bother and let jQuery find it using the select element itself: > > > $('.ajax_page #BookingCountryId').change(function(){ > > var self = this; > > var selected = $(this).val(); > > ajax_loading_image('.ajax_loading_image'); > > > $.ajax({ > > type: "POST", > > url: '/bookings/getLocations', > > data: "ajax=true&id="+selected, > > success: function(msg){ > > $(self).parent('div').html(msg); > > ajax_remove_loading_image('.ajax_loading_image'); > > } > > }); > > > }); > > > However, I recommend that you simply replace the options rather than > > the entire select element. > > > On Sat, May 30, 2009 at 9:06 AM, DigitalDude > > > wrote: > > > > Hi, > > > > I'm trying to deal with jQuery in CakePHP and basically I want to do > > > the following: > > > > I have 5 select-boxes in which the user should chose some values, and > > > when a value changes the other selects should be updated with the > > > corresponding data. > > > I figured out how to update selects, that's not a big problem and it > > > works fine. But when I chose a value from a select box that has been > > > populated with jQuery, the change(function()) in my jQuery script does > > > not register the changing of the value, even though the div-id's are > > > set correct. > > > The part of my js-script where the second selectbox should be checked > > > for changed calues is not triggered, I tried many combinations of the > > > element-id but it won't start any function in that part. > > > > Here's what I'm dealing with: > > > > > > Main-View: > > > > > > create('Booking',array('class'=>'ajax_page'));?> > > > > > > Ajax Test 1.2 > > > > > > > > echo $form->input('country_id',array( > > > 'label'=>'Country', > > > 'empty' => 'Choose country' > > > )); > > > echo $form->input('location_id',array( > > > 'label'=>'Location', > > > 'type' => 'select', > > > 'empty' => 'Choose location', > > > 'div'=>'input select ajax_location_id' > > > )); > > > echo $form->input('shop_id',array( > > > 'label'=>'Shop', > > > 'type' => 'select', > > > 'empty' => 'Choose shop', > > > 'div'=>'input select ajax_shop_id' > > > )); > > > ?> > > > end();?> > > > > > > > The controller- part(s): > > > > > > function getLocations() { > > > $country_id = $this->params['form']['id']; > > > $locations = array(); > > > $this->layout = null; > > > > if($country_id > 0) { > > > $locations = $this->Booking->Shop->Location->find('list', > > > array( > > > 'contain' => array('Country'), > > > 'conditions' => array( > > > 'Location.country_id' => $country_id > > > ))); > > > } > > > $t
Re: can't get data from multiple databases
If you want a 1-n relantionship, use $belongaTo, and not $hasOne, like you've done. But, i dont think that will correct your problem. Could you put the error's message, please? --~--~-~--~~~---~--~~ 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: Test table creation failing
In your model EventAdmin is there any relationship with some model matched with test_event_admins's table? --~--~-~--~~~---~--~~ 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: A problem with a DISTINCT
Try debug($clon) and you'll see. On Sun, May 31, 2009 at 9:06 AM, Unaxillo wrote: > > Hey guys, i'm trying to do this, but i can't get to work: > > function verclones($id){ > > $this->layout = "limpio"; > > $clones=$this->Visitante->query("SELECT DISTINCT usuario_id > FROM > visitantes WHERE ip=(SELECT ip FROM visitantes WHERE usuario_id=$id > ORDER BY ip DESC LIMIT 1)"); > > $this->set("clones",$clones); > } > > > In the view file i put this: > > > > > > > > But it returns the word "Array". > > What i'm doing wrong? Can somebody help me? Thank u! Love this group. > > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Help: Capture the ID of a Field from the autocomplete function
Hi! I'm trying to capture the ID of an autocomplete Field, but I didn't get notring... :S I'm using the prototype autocomplete function in cake, someone told me to utilize jquery, but I didn't find some helpfull example... can someone help me? Best Regards Franco Tampieri --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem Uploading Flash
I will try those things and get back to you. About the perms though, they are correct, as those are the perms on my images directories that I upload to as well and that works fine, so I'm pretty sure the perms are correct. On May 30, 2:13 pm, brian wrote: > On Sat, May 30, 2009 at 3:07 PM, Arak Tai'Roth > wrote: > > > As far as I'm aware if the extension is .flv, then shouldn't the > > mimetype be video/x-flv? > > The behavior depends upon the whatever the browser says is the MIME > type. You can see it in the data array. If you're not familiar with > the data sent in the case of uploads, do this: > > if (!empty($this->data)) > { > die(debug($this->data)); > > > The file size is way less then the maximum file size that's allowed, > > it's only a 6 second flash video that I'm just using to test this. > > Again, look in the data array to be sure. > > > However I'm not sure how to log the error key or anything as it's > > being uploaded. > > $this->log($this->data['the_array_key']); > > See here for the error explanations: > > http://ca3.php.net/manual/en/features.file-upload.errors.php > > > The permissions are fine, that's one of the first things I checked, > > the folders that are being written to are all set at 775. > > Who owns the dir, though? That's only open for the owner & group. If > the apache user isn't one of those, the file cannot be saved. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
A problem with a DISTINCT
Hey guys, i'm trying to do this, but i can't get to work: function verclones($id){ $this->layout = "limpio"; $clones=$this->Visitante->query("SELECT DISTINCT usuario_id FROM visitantes WHERE ip=(SELECT ip FROM visitantes WHERE usuario_id=$id ORDER BY ip DESC LIMIT 1)"); $this->set("clones",$clones); } In the view file i put this: But it returns the word "Array". What i'm doing wrong? Can somebody help me? Thank u! Love this group. --~--~-~--~~~---~--~~ 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: List leafs in Tree Behavior
Thanks It works great!. 2009/5/31 delocalizer > > or: > TreeModel->query('SELECT * FROM model_things WHERE model_things + 1 = > model_things.rght'). > 'TreeModel' is obviously the name of your model that behaves as Tree > and 'model_things' is its db table. > > On May 31, 8:42 am, Jorge Horacio Cué Cantú > wrote: > > Hello, > > > > I have a system with a Model behaving as Tree, the question is. > > I need to get a list of rows with out children meaning records that are > > leafs in the tree. > > Is there a way to accomplish that? > > > > Of course It is the "brute force method", but since the tree might be > very > > large, I rather have a most efficient way. > > > > Thanks. > > > > --~--~-~--~~~---~--~~ 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: Help me with forum based on CakePHP
Personally, I don't think using an integrated cake-Joomla approach is such a great idea. What do you gain? Creating article management capabilities is trivial in cake. Do you really want all of Joomla code for that? Perhaps you are enticed by all the Joomla extensions? I can understand that, but most of them are not useful in a production environment anyways without serious improvement. In the end, you are stuck supporting loads of Joomla code. Honestly, the only benefit I can see to integrating with Joomla is the one click install of their plethora of available templates. They do have some very nice commercial ones. You will still need to integrate the templates with your custom component, though. If you only want a one-time "quick and dirty" site with a custom cake- component, try Jake. If it's a forum you want, you might want to just put it on a subdomain, ie. forum.mydomain.com? On May 31, 10:37 am, Miles J wrote: > Because Joomla/Drupal are CMS and CakePHP is a framework. Perhaps you > should read a bit more on the difference. --~--~-~--~~~---~--~~ 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: List leafs in Tree Behavior
or: TreeModel->query('SELECT * FROM model_things WHERE model_things + 1 = model_things.rght'). 'TreeModel' is obviously the name of your model that behaves as Tree and 'model_things' is its db table. On May 31, 8:42 am, Jorge Horacio Cué Cantú wrote: > Hello, > > I have a system with a Model behaving as Tree, the question is. > I need to get a list of rows with out children meaning records that are > leafs in the tree. > Is there a way to accomplish that? > > Of course It is the "brute force method", but since the tree might be very > large, I rather have a most efficient way. > > Thanks. --~--~-~--~~~---~--~~ 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: List leafs in Tree Behavior
Hi Jorge; Easiest way is to do a find with condition that TreeModel.lft+1 = TreeModel.rght On May 31, 8:42 am, Jorge Horacio Cué Cantú wrote: > Hello, > > I have a system with a Model behaving as Tree, the question is. > I need to get a list of rows with out children meaning records that are > leafs in the tree. > Is there a way to accomplish that? > > Of course It is the "brute force method", but since the tree might be very > large, I rather have a most efficient way. > > Thanks. --~--~-~--~~~---~--~~ 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: Feedback from TranslateBehavior creator needed
In AppModel::beforeFind() would be useful to check $this->Behaviors->attached('Translate') && $this->Behaviors->enabled('Translate') --~--~-~--~~~---~--~~ 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: Feedback from TranslateBehavior creator needed
Instead of AppModel contructor, I would vote for AppModel::beforeFind () - and one thing to keep in mind: locale for translation you're looking for should be first in locale array. --~--~-~--~~~---~--~~ 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: Feedback from TranslateBehavior creator needed
> > > There's ArticleVersion model, which have this fields: id, name: > > > varchar, introduction:text, created:datetime. > > > > I've defined to name and introduction fields to be translatable: > > > var $actsAs = array('Translate' => array('name', 'introduction')); > > > Table for ArticleVersion model should not contain fields 'name' and > > 'introduction', these fields are virtual. > > I'd love too. But I'm not creating new App with i18n, I'm trying to > make existing App to be i18n'ed, > So I need to leave this fields because they suppose to be my default > translation as long, as translations are not present. I can imagine some solution where you will name these virtual fields like 'tr_name', but it will require to go through whole app and alter all find's called with option 'fields'... But it is Hic Sunt Leones area - TranslateBehavior was not supposed to work that way. Good news for you is that features lists for CakePHP 1.3 and 2.0 are not closed yet, so everyone is welcome open enhancement ticket at thechaw.com or express himself at http://groups.google.com/group/cake-php/browse_thread/thread/134b180ce477b9ef/12f97d91695be484 :-) Migration of existing data to i18n table is easy in shell, like var $uses = array('ArticleVersion'); function main() { if ($this->ArticleVersion->hasField('name') && $this- >ArticleVersion->hasField('introduction')) { $I18n =& $this->ArticleVersion->translateModel(); $this->ArticleVersion->unbindTranslation(); $data = $this->ArticleVersion->find('all', array('fields' => array('id', 'name', 'introduction'))); //use either foreach, or saveAll() somehow to save data through $I18n model //drop name and introduction fields in schema and clear tmp/ cache/models content } $this->out('Done.'); } > > Fastest possible way is save introduction as empty string in Quick add > > operation. > > I wanted to avoid that. When I add another field to be translatable - > need to update the Quick add operation, and > supply those translations to all elements (like I described in comment > above). Real problem is that in 1.2, behaviors are still pretty limited in sense what they can do with model, like changes in schema property. So handling default values for virtual fields, if can not be generalized in behavior to satisfy everyone, is still work for some simple beforeSave() implementation in model or AppModel. > > From controller, $this->ArticleVersion->locale = array('pol') should > > do the trick, > > I think my question should have been "But I don't know how to make > $locale variable an array globally?" ;) > > Yes, It seems to be the only way. > But It's rather $this->ArticleVersion->locale = array( Configure::read > ('Config.language') ); No, that's wrong. a) 'Config.language' in Configure singleton or session is not supposed to hold locale, it is for language (see maps in L10n class). b) 'Config.language' has to be string, it is used by i18n functions __* () > Do you think overriding the constructor in AppModel like this: >function __construct($id=null, $table=null, $ds=null) { > parent::__construct($id, $table, $ds); > $this->locale = array( Configure::read('Config.language') ); >} > Is save? Yes, but see my previous note. Call Configure::write('App.locales', array('pol', 'eng')); in bootstrap.php and use 'App.locales' in AppModel constructor. > and as a bonus: it reads those original > fields (that which should be virtual, but can't be in my case) when > there's no translation. But I don't feel comfortable when messing with > modules Ii don't completely understand :S I am just saying how is 'default translation' supposed to work currently. Usage by some way not covered in test cases is on your own risc now, and for future too :-) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
I need help to build a ACL with habtm
For my application I need a ACL with habtm. In my book "Webentwicklung mit CakePHP" there´s only an example with a hasMany relation. I can't find anything I the web belonging to ACL and habtm (with the ACL of cakePHP and no custom solutions). For testing purposes I only have a simple aco tree: ROOT Fileuploads index Building the aco tree: cake acl create aco / ROOT cake acl create aco ROOT Fileuploads cake acl create aco Fileuploads index And a simple aro tree: [1] Gruppen Building the aro tree: cake acl create aro / Gruppen So I have 3 tabels: users usergroups usergroups_users Can anyone help? --~--~-~--~~~---~--~~ 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: Feedback from TranslateBehavior creator needed
Hello Jitka :) I remember You from our discussion about my performance trick in cake.1.1 ;) On 30 Maj, 03:41, "jitka (poLK)" wrote: > > There's ArticleVersion model, which have this fields: id, name: > > varchar, introduction:text, created:datetime. > > > I've defined to name and introduction fields to be translatable: > > var $actsAs = array('Translate' => array('name', 'introduction')); > > Table for ArticleVersion model should not contain fields 'name' and > 'introduction', these fields are virtual. I'd love too. But I'm not creating new App with i18n, I'm trying to make existing App to be i18n'ed, So I need to leave this fields because they suppose to be my default translation as long, as translations are not present. > > > Quick adding a new ArticleVersion is made by filling just name field > > and submitting, and introduction doesn't need to be fulfilled. > > ... > > It returns no rows, because there's `I18n__introduction`.`locale` = > > 'pol' in where statement, and the introtuction field is't saved in > > Quick add operation. > > Fastest possible way is save introduction as empty string in Quick add > operation. I wanted to avoid that. When I add another field to be translatable - need to update the Quick add operation, and supply those translations to all elements (like I described in comment above). It's not the really my favourite dont-need-to-do-too-much-when- stuff-changes-because-cake-takes-care-of-that way ;) > > > But I don't know how to make $locale variable an array? > > From controller, $this->ArticleVersion->locale = array('pol') should > do the trick, I think my question should have been "But I don't know how to make $locale variable an array globally?" ;) Yes, It seems to be the only way. But It's rather $this->ArticleVersion->locale = array( Configure::read ('Config.language') ); But I'm quite lazy, and don't want to travel through all my Controllers and Models, see where I have {anyModelWithTranslateBehavior}->find(); and supply this code before. Do you think overriding the constructor in AppModel like this: function __construct($id=null, $table=null, $ds=null) { parent::__construct($id, $table, $ds); $this->locale = array( Configure::read('Config.language') ); } Is save? It seems to work for me: it finds rows with translation supplied just for one field and as a bonus: it reads those original fields (that which should be virtual, but can't be in my case) when there's no translation. But I don't feel comfortable when messing with modules Ii don't completely understand :S --~--~-~--~~~---~--~~ 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: Help me with forum based on CakePHP
Because Joomla/Drupal are CMS and CakePHP is a framework. Perhaps you should read a bit more on the difference. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---