Set layout based on admin routing in app_error?

2010-01-18 Thread oleonav
Hello, I'm trying to change the layout based on the admin routing param within a custom 404 error function in app_error.php. 1. I can check for the existence of the admin routing param. It is available via $this->controller->params['admin'] 2. Can change it, for example: $this->controller->layout

Re: Pass variables to Javascript

2009-11-23 Thread oleonav
Hi, You could always first include a short inline javascript defining your variables and after that include the external scripts. Something like this codeblock(" var someJsArr = " . $someArraySetByCake . " "); ?> link('someExternalJsScript.js'); ?> This way you can use you variables inside

Re: Using translated content

2009-05-07 Thread oleonav
gt; 0 && array_key_exists('Page',$results[0])) { //assign all Translation results to named keys foreach($results as $key => $page) { $translations

Using translated content

2009-05-06 Thread oleonav
In response of Karim's request... The standard way of implementing translations in the default cake core is, to my opinion, very resource intensive. It uses a lot of sub- queries when a lot of fields in a table need translations. At this stage I'm using the following setup in my solutions: Exam

Re: Using Configure class in custom AppError

2009-02-09 Thread oleonav
hey wasn't set. > > On Feb 6, 8:54 pm, oleonav wrote: > > > Hi there, > > > I have some variables set using the Configure class in the > > beforeFunction of the main AppController. I use for multiple things, > > for example to set the title of the

Using Configure class in custom AppError

2009-02-06 Thread oleonav
Hi there, I have some variables set using the Configure class in the beforeFunction of the main AppController. I use for multiple things, for example to set the title of the page. I need a custom 404 error page, so I made a custom AppError class containing the function error404, which overrides

Re: Index libraries for Word, Pdf, Rtf, etc... files

2008-10-17 Thread oleonav
Oct 16, 6:06 pm, [EMAIL PROTECTED] wrote: > Good luck finding that your request is hard to handel concidering the > compatibility issue. But i suppose that we could look around and get > back to you. Why does it have to be on linux.. what is the problem > with wxp? > > On 1

Index libraries for Word, Pdf, Rtf, etc... files

2008-10-16 Thread oleonav
Hi there, In my development setup I am using some shell programs to index different kind of files via the exec command in php/cake. for example: - Word files -> using antiword - Pdf files -> using pdftotext This works fine. But now we have to move the app to a production environment which does n

Re: Move existing app to Subversion

2008-10-15 Thread oleonav
Hi there, I am also using subversion to mamage development of apps. My setup is: - Central subversion server; Manages all project under development - Multiple development clients; Check in/out updated files to the central server. This setup works just fine. Question; I want to be able to get th

Re: help with 'updated' and 'created' fields: Do I need to manually unset these fields in the data array?

2008-08-27 Thread oleonav
One thing I came across was the fact that the columns for created & updated should be of the type datetime and Null should be set to 'null' and not 'not null' Hope this helps. Olav On Aug 27, 11:02 am, "Marc Schuetze" <[EMAIL PROTECTED]> wrote: > According to the docs 'modified' and 'updated' a

Using Html::addCrumb in a controller action

2008-06-16 Thread oleonav
I need to populate the breadcrumbs array from one or more controller actions. How can I do this? Any help? thanks, Olav Verhoef --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group

Howto: Cache external xml data in model

2008-06-03 Thread oleonav
I have a model which loads a external xml file. It would be nice if the raw results or better the parsed array holding the data would be cached for a couple of hours. So far i tried the following: children[0]->children[2]->children[0]->children; . Stuff to p

Debugging console / collecting output?

2008-04-05 Thread oleonav
Hello everyone, I'm looking for a simple solution or plugin that collects all debug messages in for example a hovering div or external window without messing up layouts etc... Anyone something like this floating around? Thanks! --~--~-~--~~~---~--~~ You received

Multiple inserts of the same model, how to display validation error messages?

2007-07-25 Thread oleonav
I have a form which gives the ability to add 3 records of the same model in one go. -- create('Content');?> //First record input('Content.use',array('type' => 'hidden','value'=>'yes')); echo $form->input('Content.title',array('error' => array( 'VALID_NOT_EMPTY'

Re: i18n translation in db tables - how to do this like Symfony?

2007-07-24 Thread oleonav
s at > the same time (mostly in the admin area for defining name, > description, etc... of an item). Has anyone found a method for editing > multiple languages at the sameview? > Yes, I did find this out to. Not very useful. > Oleonav, did you manage to get any closer to a satisfying so

Re: Software Design Dilemma -- getting data from Model to View

2007-07-20 Thread oleonav
Maybe a suggestion which does not infects performance; 1. Add a collumn to the photoset table containing the number of photos in the set. You can use this in your users/view action with no loss of performance 2. When adding or deleting photos to a set this collumn in the photoset model needs to b

Re: i18n translation in db tables - how to do this like Symfony?

2007-07-20 Thread oleonav
have for example VALID_NOT_EMPTY defined for my title column in > the Post model, and I leave the input field for title empty in the add > view a standard message is echoed. > How can I alter the error message in cake 1.2? With cake 1.1 you could > use the HtmlHelper and its "tagErr

Re: i18n translation in db tables - how to do this like Symfony?

2007-07-20 Thread oleonav
y, but this seems not to be the most elegant solution. Not very 'Cake' like. Also in the controller function we have to parse things back again. On Jul 19, 9:37 am, zwobot <[EMAIL PROTECTED]> wrote: > Good question oleonav. I wondered how this works too. > In general I want to

Re: i18n translation in db tables - how to do this like Symfony?

2007-07-17 Thread oleonav
> I wonder how you got this data into your database: > > > INSERTed manually by yourself I suppose. Yes, I did. > There are some tings in your edit function I do not understand > oleonav. > In my edit function I just use $this->Post->save($this->data)

Re: Problem with afterFind in model - ~Undefined index ...

2007-07-14 Thread oleonav
Yes, I did. Even in my views the new var fullname is shown. The warning is only given in a list/index view. A view or edit view does not have a problem. On Jul 13, 7:48 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > On 7/13/07, oleonav <[EMAIL PROTECTED]> wrote: >

Problem with afterFind in model - ~Undefined index ...

2007-07-13 Thread oleonav
Following examples in the group I added a afterFind function in my Contacts model like this: function afterFind($result){ $result = parent::afterFind($result); foreach($result as $key => $val) { $result[$key]['Contact']['fullname'] = str_replace(' ',' ', $val['Co

Re: i18n translation in db tables - how to do this like Symfony?

2007-07-11 Thread oleonav
On Jul 11, 8:14 am, zwobot <[EMAIL PROTECTED]> wrote: > I have done everything you said but I still did not manage to add a > different language to an existing Post or Article. > > Maybe you could send me a working code example and a dump of your > database? Hi there, I've tried the TranslationI

Re: i18n translation in db tables - how to do this like Symfony?

2007-07-10 Thread oleonav
population of the translationsXXX arrays do not depend on setting the locale config or something like this. They will always be populated with all translations. I think??? Success. On Jul 10, 10:12 pm, zwobot <[EMAIL PROTECTED]> wrote: > Thanks for your answer oleonav, unfortunately my array

Re: i18n translation in db tables - how to do this like Symfony?

2007-07-10 Thread oleonav
Hi zwobot, > My Model: > class Post extends AppModel { > > var $name = 'Post'; > > var $actsAs = array('Translate' => array('title' => > 'TranslationsAbstract', 'body' => 'TranslationsAbstract')); > > } > > ?> I'm also still figuring out how to use translation in add & edit act

How to use translated db data in edit and add forms / actions

2007-07-09 Thread oleonav
Hi there, In my Article model two translated fields are used, title & content.The Translation behavior is used. The Article model looks like this: class Article extends AppModel { var $name = 'Article'; var $actsAs = array('Translate' => array('title' => 'TransTitle','content' => 'TransCon

findAllTranslated() generic AppModel function for translations ( i18n - Translate behavior)

2007-06-27 Thread oleonav
Hi there, I wile ago I asked help getting i18n working in Cake 1.2. See post http://groups.google.com/group/cake-php/browse_thread/thread/889c63d32cfdf69 Thanks to a lot of comments I did get it working. I like to contribute something back to you all: The following function in app_model.php wi

Re: Mystery, Edit action changes to Add action when validation fails...

2007-06-24 Thread oleonav
Ok, that makes sense. On Jun 23, 1:05 pm, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote: > On 6/23/07, oleonav <[EMAIL PROTECTED]> wrote: > > > > > Nevertheless one would expect that Cake should output the right form > > tag when a validation er

Re: Mystery, Edit action changes to Add action when validation fails...

2007-06-23 Thread oleonav
Hi there Tarique, I have added your suggestion to the edit template and it worked. Nevertheless one would expect that Cake should output the right form tag when a validation error is found. Thanks, On Jun 22, 2:42 pm, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote: > On 6/22/

Mystery, Edit action changes to Add action when validation fails...

2007-06-22 Thread oleonav
I have posted this questions earlier on but no replies so I'll ask you again; --- Strange things happen when using multiple validations rules in cake 1.2. in combination with an edit action When requesting a edit action for example admin/pages/edit/3 - in the view admin_edit.ctp the helper $form

Edit changes to add function when validation errors are found

2007-06-16 Thread oleonav
Strange things happen when using multiple validations rules in cake 1.2. in combination with an edit action When requesting a edit action for example admin/pages/edit/3 - in the view admin_edit.ctp the helper $form->create('Page'); does output the required form tag Then the magic happens. If va

Re: i18n translation in db tables - how to do this like Symfony?

2007-06-02 Thread oleonav
Hi there, On Jun 2, 5:41 am, jitka <[EMAIL PROTECTED]> wrote: > Well, it seems like deadline of your project doesn't allow wait for > cake's solution for reading records with fallback to default locale ;) > Ok, I can live with it. So I'll not comment your own solution at all - > I assume that you

Re: i18n translation in db tables - how to do this like Symfony?

2007-06-01 Thread oleonav
Worked out a solution for; > The following issues need to be resolved for my project; > - The ability to fetch default data when the data is not available in > the database in the requested language. For example a news article is > not available in French so the English version would be fetched

Re: i18n translation in db tables - how to do this like Symfony?

2007-06-01 Thread oleonav
Thanks jitka, In the aspect of using Cake to develop sites I'm a beginner. So in that respect I don't know every method of every class in the api. I did not have time for that. >> You get the complete tree with all available translations. >Sure. What you expected? Sorry for that, as stated befo

Re: i18n translation in db tables - how to do this like Symfony?

2007-06-01 Thread oleonav
4 languages This makes 10 X 3 X 4 = 120 !!! This would not be a good solution to retrieve translations. ... On Jun 1, 4:23 pm, oleonav <[EMAIL PROTECTED]> wrote: > Thank you all, I have successfully implemented translations. > > The implementation to help other facing the sa

Re: i18n translation in db tables - how to do this like Symfony?

2007-06-01 Thread oleonav
Thank you all, I have successfully implemented translations. The implementation to help other facing the same situation: 1. Create the i18n tables from the sql file /config/sql/i18n.sql 2. Create the news_articles table id (int8) prim key, auto incr. other fields like created_

Re: i18n translation in db tables - how to do this like Symfony?

2007-06-01 Thread oleonav
that field > that can be accessed in the data like any other hasMany relation, but > you can also just set the Fields like array('title' ,'abstract', > 'text'). The field values will then just be set without extra > relations. Well even with the relations

Re: i18n translation in db tables - how to do this like Symfony?

2007-05-31 Thread oleonav
the given msgid, > else it wil display the msgid given > o use __("button_submit", true) to return the value as > opposed to echoing it > * you can specify different languages as such: > > $this->L10n = new L10n(); > $this->L10n->get('eng

i18n translation in db tables - how to do this like Symfony?

2007-05-30 Thread oleonav
Hi there, For an upcomming project, a mutilangual site, I need the ability to store different versions of the same content in a database. I've been evaluating both Cake & Symfony as basis for this site. Although I do like Cake for it's low footprint and simplicity to make things work I need some