Re: Model localisation question.

2009-03-02 Thread Tóth Imre
Wi didi this way, but for example if the locale was originally german, only
the controller applyes it, but the model sees that it's locale is us-eng.

tnx

2009/2/27 Braindead 

>
> http://book.cakephp.org/view/198/options-error
>
> This should answer your question. :-)
> >
>


-- 
Best Regards
Tóth Imre

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Model localisation question.

2009-02-27 Thread Tóth Imre
At the modell i have placed some mesagges in the case of wrong input datas,
ut I cannut reach the actula localisation propery-s from the model.

Any suggestion?

tnx


-- 
Best Regards
Tóth Imre

--~--~-~--~~~---~--~~
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: Issues with ajax and cakephp

2009-02-19 Thread Tóth Imre
I think ajax works fine, but i think it is not so tasty in the raw js way.
With GWT it makes no sense to write it, and fun, so I encourage everybody to
try it:)
Wors fine wih cake:)

2009/2/19 sal 

>
> Hello everyone,
>
> The age old question... I have a simple page with two select boxes and
> want the second one to populate according to what was selected in the
> first one. So, in steps the ajax helper within cake. I have searched
> and searched around the web and found several articles and tutorials
> on the subject but many of them are 1.1 and outdated. I feel like I am
> so close to getting it to work but can't figure out where I am going
> wrong. The first select box is populating but the second is not. So,
> I'm turning to the forums :) My setup is really simple, just two
> databases, three entries in each. So obviously two models and
> controllers and then the views. I'll include the necessary code
> snippets for analysis. Any help would be so so appreciated, thanks! It
> is worth noting that most of the code was taken off of the blog
>
> http://www.devmoz.com/blog/2007/04/04/cakephp-update-a-select-box-using-ajax/
>
> FIRST, THE TABLES
>
> --
> -- Table structure for table `facilities`
> --
>
> CREATE TABLE IF NOT EXISTS `facilities` (
>  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
>  `name` varchar(50) NOT NULL,
>  PRIMARY KEY (`id`)
> ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
>
> --
> -- Dumping data for table `facilities`
> --
>
> INSERT INTO `facilities` (`id`, `name`) VALUES
> (1, 'Atlanta'),
> (2, 'Nashville'),
> (3, 'Charlotte');
>
> --
> -- Table structure for table `trucks`
> --
>
> CREATE TABLE IF NOT EXISTS `trucks` (
>  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
>  `name` varchar(50) NOT NULL,
>  `facility_id` int(11) unsigned NOT NULL,
>  PRIMARY KEY (`id`),
>  KEY `facility_id` (`facility_id`)
> ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
>
> --
> -- Dumping data for table `trucks`
> --
>
> INSERT INTO `trucks` (`id`, `name`, `facility_id`) VALUES
> (1, 'atl', 1),
> (2, 'nsh', 2),
> (3, 'cnc', 3);
>
>
> 
> NOW THE MODELS
>
> 
>class Facility extends AppModel {
>
>var $name = 'Facility';
>
>}
>
> ?>
>
> 
>class Truck extends AppModel {
>
>var $name = 'Truck';
>var $belongsTo = array('Facility' => array('className' =>
> 'Facility', 'foreignKey' => 'facility_id'));
>
>}
>
> ?>
>
>
> 
> THE CONTROLLERS
>
> 
>class FacilitiesController extends AppController {
>
>var $name = 'Facilities';
>var $helpers = array('Html', 'Form', 'Javascript', 'Ajax');
>var $components = array('RequestHandler');
>
>}
>
> ?>
>
> 
>class TrucksController extends AppController {
>
>var $name = 'Trucks';
>var $helpers = array('Html', 'Form', 'Javascript', 'Ajax');
>var $components = array('RequestHandler');
>
>function index() {
>
>$this->set('facilities',
> $this->Truck->Facility->find('list'));
>
>}
>
>function update_select() {
>
>if (!empty($this->data['Facility']['id'])) {
>
>$fac_id = $this->data['Facility']['id'];
>$options = $this->Truck->find('list',
> array('conditions' => array
> ('Truck.facility_id' => $fac_id)));
>$this->set('options', $options);
>
>}
>
>}
>
>}
>
> ?>
>
>
> 
> FINALLY, THE VIEWS
>
> //trucks/index.ctp
> 
>echo $form->select('Facility.id', array('options' => $facilities),
> null, array('id' => 'facilities'))

Re: Issues with ajax and cakephp

2009-02-19 Thread Tóth Imre
I think ajax works fine, but i think it is not so tasty in the raw js way.
With GWT it makes no sense to write it, and fun, so I encourage everybody to
try it:)
Wors fine wih cake:)

2009/2/19 sal 

>
> Hello everyone,
>
> The age old question... I have a simple page with two select boxes and
> want the second one to populate according to what was selected in the
> first one. So, in steps the ajax helper within cake. I have searched
> and searched around the web and found several articles and tutorials
> on the subject but many of them are 1.1 and outdated. I feel like I am
> so close to getting it to work but can't figure out where I am going
> wrong. The first select box is populating but the second is not. So,
> I'm turning to the forums :) My setup is really simple, just two
> databases, three entries in each. So obviously two models and
> controllers and then the views. I'll include the necessary code
> snippets for analysis. Any help would be so so appreciated, thanks! It
> is worth noting that most of the code was taken off of the blog
>
> http://www.devmoz.com/blog/2007/04/04/cakephp-update-a-select-box-using-ajax/
>
> FIRST, THE TABLES
>
> --
> -- Table structure for table `facilities`
> --
>
> CREATE TABLE IF NOT EXISTS `facilities` (
>  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
>  `name` varchar(50) NOT NULL,
>  PRIMARY KEY (`id`)
> ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
>
> --
> -- Dumping data for table `facilities`
> --
>
> INSERT INTO `facilities` (`id`, `name`) VALUES
> (1, 'Atlanta'),
> (2, 'Nashville'),
> (3, 'Charlotte');
>
> --
> -- Table structure for table `trucks`
> --
>
> CREATE TABLE IF NOT EXISTS `trucks` (
>  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
>  `name` varchar(50) NOT NULL,
>  `facility_id` int(11) unsigned NOT NULL,
>  PRIMARY KEY (`id`),
>  KEY `facility_id` (`facility_id`)
> ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
>
> --
> -- Dumping data for table `trucks`
> --
>
> INSERT INTO `trucks` (`id`, `name`, `facility_id`) VALUES
> (1, 'atl', 1),
> (2, 'nsh', 2),
> (3, 'cnc', 3);
>
>
> 
> NOW THE MODELS
>
> 
>class Facility extends AppModel {
>
>var $name = 'Facility';
>
>}
>
> ?>
>
> 
>class Truck extends AppModel {
>
>var $name = 'Truck';
>var $belongsTo = array('Facility' => array('className' =>
> 'Facility', 'foreignKey' => 'facility_id'));
>
>}
>
> ?>
>
>
> 
> THE CONTROLLERS
>
> 
>class FacilitiesController extends AppController {
>
>var $name = 'Facilities';
>var $helpers = array('Html', 'Form', 'Javascript', 'Ajax');
>var $components = array('RequestHandler');
>
>}
>
> ?>
>
> 
>class TrucksController extends AppController {
>
>var $name = 'Trucks';
>var $helpers = array('Html', 'Form', 'Javascript', 'Ajax');
>var $components = array('RequestHandler');
>
>function index() {
>
>$this->set('facilities',
> $this->Truck->Facility->find('list'));
>
>}
>
>function update_select() {
>
>if (!empty($this->data['Facility']['id'])) {
>
>$fac_id = $this->data['Facility']['id'];
>$options = $this->Truck->find('list',
> array('conditions' => array
> ('Truck.facility_id' => $fac_id)));
>$this->set('options', $options);
>
>}
>
>}
>
>}
>
> ?>
>
>
> 
> FINALLY, THE VIEWS
>
> //trucks/index.ctp
> 
>echo $form->select('Facility.id', array('options' => $facilities),
> null, array('id' => 'facilities'))

Re: Scaffolding template for controllers ... ??

2009-02-15 Thread Tóth Imre
2009/2/15 p...@otaqui.com 

>
> I haven't done, or tested, this - but a quick peak inside the "cake/"
> directory shows the file:
>
> cake/console/libs/tasks/controller.php

the original files are at:
cake\console\libs\templates\views\
We have  customized it and works fine, we left the original files as
*.orig... if anyone knows a more sophisticated way please let me know!

>
> which is what I think you will want to customise.
>
> Messing with Cake's core files is usually best avoided if at all
> possible.  I would guess that you should try *copying* this file into
> "app/vendors/shells/tasks" but I really don't knowif that is exactly
> right, or if having the file anywhere else is even possible.
>
> All else failing, just make sure that you have a pristine back up of
> the original "controller.php" task file before you start editing it in
> place.
>
> Best,
>
> Pete
>
> On Feb 15, 12:32 am, DrGaston  wrote:
> > The CakePHP manual already explains how to change the scaffolding
> > template for the views, but how can you change the way controller
> > functions are scaffolded? I would need to change some of the logic
> > there.
> >
> > Thanks.
> >
>


-- 
Best Regards
Tóth Imre

--~--~-~--~~~---~--~~
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: Getting all the acos a aro can access?

2008-12-02 Thread Tóth Imre
I did it in a brue force way:), so i am intersted in a smooth solution
too.:)

2008/12/1 dr. Hannibal Lecter <[EMAIL PROTECTED]>

>
> I'd like to know this too.. I didn't get the time to look into it in
> detail, but when I do and if I manage to find a solution I'll post it
> here.
>
> On Nov 29, 11:35 am, gk <[EMAIL PROTECTED]> wrote:
> > Hi there
> >
> > I'm trying to work out how to get all the access control objects an
> > access request object can access - for example all the blog posts a
> > user can edit. Can anybody point me in the right direction on how to
> > do this? Thanks very much.
> >
>


-- 
Best Regards
Tóth Imre

--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---