Re: Generating KML pages

2012-07-04 Thread Jaime
Try this function beforeFilter() { $this->RequestHandler->setContent('kml', 'text/xml'); // $this->RequestHandler->setContent('kml', 'application/vnd.google-earth.kml+xml'); } On Thursday, September 24, 2009 7:01:18 AM UTC+2, Kyle Decot wrote: > > I am attempting to create KML pages for my site

How to search inside http://code.cakephp.org/tickets ?

2009-11-01 Thread Jaime
Hi all, Am I crazy, or it is impossible to search inside the new ticket system at http://code.cakephp.org/tickets? Wanted to report an issue, but I'm unable to filter the ticket list to check whether it has been already reported or not. Of course it's possible to google "site:http://code.cakephp

Re: Translate Behavior Question ! ?

2009-09-03 Thread Jaime Dominguez
I'm struggling with translate too but I'll try to help. Every line in the i18n table it should have the model, the locale, the foreign key to the model item id and the translated content. If you want to translate only one field per item only one row should be added to the i18n table so what I se

AfterFind and associations

2009-06-20 Thread Jaime
This happens to me quite frequently: I define on my Post model a nifty afterFind method which alters in somewhay the results. And it works nice when I do a $this->Post->find (). Then I want to, say, find all posts from an author (Author hasMany Post): $conditions = array('Author.id =' => 123);

Re: Plugin architecture and plugin limitations

2009-04-16 Thread Jaime
A *VERY interesting* reading on the subject: http://blog.fedecarg.com/2008/06/28/a-modular-approach-to-web-development/ "MVC is about loose-coupling, and Modular Programming takes that concept to the extreme. A modular application can dynamically load and unload modules at runtime, completely se

Re: Plugin architecture and plugin limitations

2009-04-16 Thread Jaime
is can be done with PHP and Cake. Or at least that's what I have came up to. I find this is very interesting because such a plugin architecture can be later applied to many other applications and scenarios. Feel free to share your thoughts or experiences here in this

Re: Plugin architecture and plugin limitations

2009-04-16 Thread Jaime
> Our lame but necessarily practical/quick solution was to give up on > plugins. [...] I'm afraid we will do the same. This application will have *a lot* of Javascript which also needs to be modular and extensible. I think there won't be any problems making pluggable components for the client par

Plugin architecture and plugin limitations

2009-04-15 Thread Jaime
Hi all, Consider a big Cake application which could be divided into a small core and many plugins providing extended funcionality. Pretty much as Wordpress is built: tiny, efficent core, and pluggable extensions connected by hooks. The same applies to MediaWiki, to cite just another wide known ex

Re: Feature suggestion: "title"s and "label"s defaults in the model

2009-04-07 Thread Jaime
I forgot to add that this proposal is consistent with the way the validation errors are currently defined in the models and not in the views (despite they can be overriden in the view too). --~--~-~--~~~---~--~~ You received this message because you are subscribed t

Feature suggestion: "title"s and "label"s defaults in the model

2009-04-07 Thread Jaime
Hi all, Almost every input field in a app comes with a tag and a "title" attribute (hint). Therefore this structure is pretty common: echo $form->input('login', array('label' => 'Your login', 'title' => 'No spaces; only alphanumeric characters')); echo $form->input('name', array('label' => 'Ful

Re: Edit multiple models in the same page: possible?

2009-01-04 Thread Jaime
On 4 ene, 02:13, thatsgreat2345 wrote: > Use Ajax? That's the alternative I have been thinking about, but I'm trying to avoid AJAX because of WCAG/WAI accessibility guidelines. > On Jan 3, 4:07 pm, Jaime wrote: > > > Hi all, > > > I wonder if it's possi

Edit multiple models in the same page: possible?

2009-01-03 Thread Jaime
Hi all, I wonder if it's possible to have two different forms for two different (but related) models in the same page. Imagine a page where the logged in user can edit his profile (model Profile) as well as to add a photo into his gallery (model Image). create('Profile'); ?> ... create('Image'

Is it possible to redefine Inflector::slug()?

2008-12-19 Thread Jaime
Hi all, I did a nice app which makes heavy use of Inflector::slug() to convert "My Strings" inoto "my_strings". However, now I find that the core slug() function is not working with my uppercase accentuated wovels (Á, É...). Of course I can patch inflector.php, but I DON'T like to touch Cake's c

Re: repair ACL acos tree cakephp

2008-10-01 Thread Jaime
Check /cake/libs/model/behaviors/tree.php for method recover(): /** * Recover a corrupted tree * * The mode parameter is used to specify the source of info that is valid/correct. The opposite source of data * will be populated based upon that source of info. E.g. if the MPTT fields are corrup

Log to DB: Custom model, custom component or custom class?

2008-09-13 Thread Jaime
Hi all, I would like to recieve a daily diggest of what has happened in my app, as well as to display it on the admin interface. So I decided to implement a custom log function, because the core one (CakeLog) can't log to database. Then a problem arise: 1.- If I do it with a model/controller pa

Re: Some articles by Nate Abele aka _nate_

2008-09-08 Thread Jaime
I didn't knew these. 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 [EMAIL PROTECT

Re: Database optimisation (all comments in one table)

2008-09-06 Thread Jaime
Interesting topic Luigi7up. I achieved exactly this in a very simple way with AD7six' Polymorphic behavior: http://bakery.cakephp.org/articles/view/polymorphic-behavior I successfully use it for tagging many models in my app and for geolocalization. In the first case, I can tag different models

Re: Suggestion: Custom paginate() method ...in a Behavior

2008-09-05 Thread Jaime
Another workaround for this: class AppModel extends Model { function paginate($params) { return $this->Behaviors->Mybehaviour->paginate($this, $params); } function paginateCount($conditions) { return $this->Behaviors->Mybehaviour->paginateCount($this, $conditions); } } I don't

Re: Suggestion: Custom paginate() method ...in a Behavior

2008-09-05 Thread Jaime
Of course I can but, shouldn't be this in the core? --~--~-~--~~~---~--~~ 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

Suggestion: Custom paginate() method ...in a Behavior

2008-09-05 Thread Jaime
It is possible to define custom paginate() and paginateCount() methods in a model. But sometimes many models can share that same pagination methods, and therefore they could be defined in a single behavior. However, the core paginate() method in Cake's core (default) controller only calls the cu

Re: Components and Helpers route wrong

2008-09-04 Thread Jaime
Try disabling all your routes in /config/routes.php. Also, check the value of 'Routing.admin' in /config/core.php. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to

Re: reverse routing won't work

2008-09-04 Thread Jaime
I'm afraid I don't understand your question. I tried your example and I got a link to /neue_anzeige, as expected. If you want to pass a parameter to the controller, try: Router::connect( '/neue_anzeige/:day', arr

Re: Paginator helper not appending url query (/page:2/?param1=value1...)

2008-09-04 Thread Jaime
Thank you Michael. Your approach seems valid, but after having a look at the paginator helper too I found the undocumented ['?'] index in the $options['url'] array: $paginator->options['url']['?'] = 'param1=value1;param2=value2' That appends the query string to the pagination links of my search

Re: before filter problem

2008-09-04 Thread Jaime
Welcome to the club: http://groups.google.com/group/cake-php/browse_thread/thread/81241ffe0ddb4c4c/c5581fd8cd6a194a?lnk=gst&q=session#c5581fd8cd6a194a http://groups.google.com/group/cake-php/browse_thread/thread/a6abc82e0b317b68/73e8bffdf0beb9cd?lnk=gst&q=session#73e8bffdf0beb9cd --~--~-~

Re: How do i remove the query results

2008-09-03 Thread Jaime
class AppController extends Controller { var $components = array(..., 'RequestHandler'); function beforeRender() { if ($this->params['isAjax']) Configure::write('debug', 0); } } --~--~-~--~~~---~--~~ You received this message because you are subsc

Re: pass info from controller methodA to methodB

2008-09-03 Thread Jaime
I'm not sure if I'm understanding you correctly, because seems to be trivial: class my_controller extends AppController { var $data; function MethodA() { $this->data = 'hello world'; } function MethodB() { die($this->data); // hello world. } } Or even: class my_controller extends AppContro

Re: Paginator helper not appending url query (/page:2/?param1=value1...)

2008-09-03 Thread Jaime
Thanks schneimi, but I'm already familiar with named parameters. The problem is that after submiting a HTML form where data is passed by GET, you are driven to a new url with the query string (/? param=value) instead of a nice named-params one (/param:value). Of course I can force a redirect to

Re: searching habtm when using paginate

2008-09-03 Thread Jaime
- but that's only my point of view. Give some feedback if you implement a different solution. Cheers, Jaime. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, se

Paginator helper not appending url query (/page:2/?param1=value1...)

2008-09-03 Thread Jaime
Hi there, I've built a search engine for my app and defined a route for it: Router::connect('/search/companies/*', array('controller' => 'companies', 'action' => 'search')); The search box is a HTML form sent via GET method. So url are like this: /search/companies?where=london;name=bla Notice

Re: session in beforeFilter

2008-09-02 Thread Jaime
I posted the same problem just three days ago, whichs still remains unresolved: http://groups.google.com/group/cake-php/browse_thread/thread/a6abc82e0b317b68/73e8bffdf0beb9cd --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: routing sluggable urls - additional parameters

2008-09-01 Thread Jaime
Try named parameters. Something like: Router::connect('/webstats/:vhost/:type', array('controller' => 'yourcontroller', 'action' => 'youraction'), array('type' => 'foo|bar| bla')); The last array is optional, just in case you want to restrict your chart type to "foo", "bar" and "bla". Then you

Re: Is there a way I can have find('all') return an array that is indexed by the value of one of the fields?

2008-09-01 Thread Jaime
It is not possible, but you can always extend the find() method in your Appmodel if you require that funcionality often: class AppModel extends Model { function find($type, $params) switch ($type) { case 'indexed' : return Set::combine($this->find(...), '...'); default: return parent::

Re: Unable to read $this->session() in AppController when using Admin Routes

2008-08-29 Thread Jaime
Weird: it only happens when Routing.admin is set to 'admin'. When I change it, everything works perfectlly. On 29 ago, 13:13, Jaime <[EMAIL PROTECTED]> wrote: > I've been dealing with this for two days; hope it's not a lame > question. On 1.2.0.7296 (RC2) I set

Re: Prefix routing and html->link()

2008-08-29 Thread Jaime
The solution is to use $html->link('anchor', array(..., 'admin' => true'), but unfortunatelly it isn't working neither (http:// groups.google.com/group/cake-php/browse_thread/thread/ a6abc82e0b317b68#). Anyway, I wonder why is 'admin' an special prefix. I mean, why there isthe possibility to set

Unable to read $this->session() in AppController when using Admin Routes

2008-08-29 Thread Jaime
I've been dealing with this for two days; hope it's not a lame question. On 1.2.0.7296 (RC2) I set "Configure::write('Routing.admin', 'admin')" in core.php, and my app_controller.php looks like this: class AppController extends Controller { function beforeFilter() { die(pr($this->Session->r

Prefix routing and html->link()

2008-08-28 Thread Jaime
Hi all, I can't find out how to correctly link my actions when using prefix routing. I have two actions: index() for public users, and admin_index() for the admin, which dumps extra data: core.php: Configure::write('Routing.admin', 'admin'); news_controller.php: class NewsController extends App

Include Cake core libraries in non-Cake app

2008-08-26 Thread Jaime
Hi all, I'd love to use some Cake core functions (like Set::extract or Inflector::slug) in a non-cake app (command line script). Is there a preferred way to do this, or should I include one by one all the affected files and their dependences? --~--~-~--~~~---~--~~

Re: Reverse Image Cropper Thing

2008-07-02 Thread Jaime
Try this: http://www.defusion.org.uk/demos/060519/cropper.php Requires the Prototype js library. -- Jaime. On 2 jul, 03:10, Kyle Decot <[EMAIL PROTECTED]> wrote: > I am attempting to find a image cropper but cannot find something like > the following: > > you have a predefin

Re: Cakephp for Commercial application development

2008-06-30 Thread Jaime
> We are planning to build a new eCommerce application in cakephp... There is an interesting e-Commerce project driven by CakePHP in which I have participated: Bakesale (http://bakesalehq.com). They are planning to release version 1.2 these days. I love it and it's very well designed. Maybe you c

Re: Paginator links are not being constructed according to route.php

2008-06-29 Thread Jaime
I have to THANK YOU Christian... I tried everything that came to my mind regarding the $paginator- >options['url'], but I didn't found that the error was in the route and was so simple to solve. So, for anybody having the same problem in the future... be sure to append the trailing asterisk like

Paginator links are not being constructed according to route.php

2008-06-29 Thread Jaime
Hi all, It seems that Paginator helper is not correctly constructing the links. Doing this: $paginator->options(array( 'url' => array( 'controller' => 'posts', 'action' => 'index', ))); Results into a nice /posts/view/page:1 link, as expected. Now assume a route like this is assigned:

Paginator links not

2008-06-29 Thread Jaime
It seems that Paginator helper $paginator->options(array( 'url' => array( 'controller' => 'posts', 'action' => 'view', ))); /posts/view/page:1 Now assign a route link Router::connect('/pagina/*', array('controller' => 'pages', 'action' => 'display')); --~--~-~--~~

Re: Routing: "/recipe-your_slug_here" instead of "/recipe/your_slug_here"

2008-06-28 Thread Jaime
Thank you very much for those two valuable links. The first one is just what I was looking for! And the second a very interesting reading. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to th

Re: Validation of input field

2008-06-28 Thread Jaime
> I am new in cakephp. It provides me a easy tool to validate from sever > side the fields of any form. I want to provide clientside validation > also using javascript. Is there any easy solution? You can do it with Prototype [1] (demo available at [2]). But anyway, why would you like to validat

ACL: Record level access. No magic?

2008-06-28 Thread Jaime
Hi all, I have a working setup of ACL + Auth (CRUD mode) in top of my (let's say) Roles, Users and Post models. When somebody requests a Post, access is granted or denied depending on the user's role. That's great! I added *no new logic* to my controllers to do that. Cake automagically asks the

Routing: "/recipe-your_slug_here" instead of "/recipe/your_slug_here"

2008-06-27 Thread Jaime
Hi all, For certain routes it could be useful to have "-" or any other separator instead of "/". So something like /jobs/london could become /jobs-london or even /jobs- in-london (using "-in-" as separator), which usually ranks better in search engines (as it's thought to be a main page, not a s

Re: reset Session variables without any visible cause

2008-06-23 Thread Jaime
Same for me (1.2.0.7125 RC1). I (apparently) solved id by setting Session.checkAgent = false and Security.level = medium in config.php. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to thi

Re: Can Cake save extra fields in HABTM join tables?

2008-06-18 Thread Jaime
nd it should work fine. :) A model for the join table? Why? It's not necessary, beacause it becomes auto-modelized for you, so it can be accesed like this: $this- >Post->PostsTag->findAll(); Cheers, Jaime. --~--~-~--~~~---~--~~ You received this messag

Re: SaveAll does not save HABTM (with example)

2008-06-18 Thread Jaime
On 17 jun, 16:44, davidpersson <[EMAIL PROTECTED]> wrote: > I've got exactly the same problem and only came up with the same > workaround.. > Hope anyone out there knows a solution for this. I can't believe nobody has run into this before and found a better solution! Cheers, J. --~--~-~

Re: Can Cake save extra fields in HABTM join tables?

2008-06-17 Thread Jaime
On 17 jun, 23:05, Joel Perras <[EMAIL PROTECTED]> wrote: > Read: tinyurl.com/4kbe9q Thank you Joel. So all the problem was that I didn't set a 'id' field in the join table. I thought that an 'id' was only required to modelized tables, not to join tables. At least, I've never set id's before on

SaveAll does not save HABTM (with example)

2008-06-17 Thread Jaime
Yet Another HABTM Question (sorry, but I've read the fine manual and found nothing on this). To stick on the traditional example: Post belongsTo User Post HABTM Tag $this->data = array( 'Post' => array( 'id' => 1, ), 'User' => array( 'name' => 'John Doe', ), 'Tag' => array(

Can Cake save extra fields in HABTM join tables?

2008-06-17 Thread Jaime
Buah, sorry to bother the Group with YAHABTMQ (Yet Another HABTM Question), but I'm really stuck with this. I guess Cake can not save extra fields in HABTM join tables. I haven't seen nothing related to this in the nice book. To stick on the "Post HABTM Tag" example, this is not working: $this->

Re: SaveAll() and 'validate' => 'first' is not working

2008-06-15 Thread Jaime
Thanks francky06l, But "atomic" is set to true by default (according to the documentation), and I have already traced the DB calls, as you can read above. The ROLLBACK is being called, but it's not affecting the INSERT operation, because a SELECT is being made after. Is that a bug? --~--~---

Re: SaveAll() and 'validate' => 'first' is not working

2008-06-14 Thread Jaime
BTW I'm using Cake 1.2.0.7125 RC1 (model.php revision 7118) --~--~-~--~~~---~--~~ 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 grou

SaveAll() and 'validate' => 'first' is not working

2008-06-14 Thread Jaime
Hi group, I'm not sure if I'm misunderstoonding something or if I've found a bug in /libs/model/model.php. It happens when I use saveAll() to save a bunch of records of the same model: $this->Mymodel->saveAll($this->data['Mymodel'], array('validate' => 'first')) This should do two things: 1.-

Re: changing language of date helper, better in core or other?

2008-06-12 Thread Jaime
On 31 mayo, 16:12, Alessio <[EMAIL PROTECTED]> wrote: > I need to use themonthsin italian... > What do you suggest? Try this in yout /app/config/bootstrap.php: setlocale(LC_ALL, 'it_IT.utf8'); Run 'locale -a' in your server's box to test which locales are available. --~--~-~--~~-

Re: Different roles / different views / one model ?

2008-06-02 Thread Jaime
On 2 jun, 15:21, mbavio <[EMAIL PROTECTED]> wrote: > Have you heard of something called ACL? Yes, I have. But ACL does not solve this problem. ACL is a way to define how priviledges are assigned to roles and users. The question here is which is the best design for a multi-role application built

Re: Different roles / different views / one model ?

2008-06-02 Thread Jaime
On 4 mayo, 17:02, baur79 <[EMAIL PROTECTED]> wrote: > Hi every one !! > > i have model "contract" and > 3 types of users manager / lawyer / broker > > each of them have different privileges on this model > > for example: > manager can only edit several fields > lawyer can do everything on model

Re: One app, many roles and priviledges. How?

2008-06-02 Thread Jaime
On 2 jun, 14:20, Jaime <[EMAIL PROTECTED]> wrote: > Cake's admin routes are nice, but are designed for a simpler scenario > (Users vs. Admins), so won't help here. Since CakePHP 1.2 there is the possibility to define custom prefix routing, so it can be possible to do s

One app, many roles and priviledges. How?

2008-06-02 Thread Jaime
Hello everybody, This topic is quite similar to http://groups.google.com/group/cake-php/browse_thread/thread/35900a65ab04ab05/92b6e71a451c35d0?lnk=gst&q=roles which remains still unresolved. It's just about a common scenario while building a corporate Intranet. There is a fine DB and many model

Re: Different roles / different views / one model ?

2008-06-02 Thread Jaime
On 4 mayo, 17:02, baur79 <[EMAIL PROTECTED]> wrote: > i have model "contract" and > 3 types of users manager / lawyer / broker > > each of them have different privileges on this model > > for example: > manager can only edit several fields > lawyer can do everything on model > broker can only see

Re: Only one register within a given set can be flagged: possible?

2008-01-19 Thread Jaime
Thank you for the feedback. The beforeSave() trick could be one possibilty, but in this particular case it seems that the defaultPhotoId suggested by Goranche is the easiest. On 18 ene, 15:27, Jaime <[EMAIL PROTECTED]> wrote: > Hello bakers! > > Imagine this (common) scenario: a p

Only one register within a given set can be flagged: possible?

2008-01-18 Thread Jaime
Hello bakers! Imagine this (common) scenario: a photo album that HasMany photos. A user may select one of them as a "cover" or "default" photo to illustrate the cover of the album. So a boolean field called "default" is set in the Photo model. Of course one and only one photo within that album sh