Re: Security Component; custom form (rich editor)

2010-07-30 Thread Tomatosoup
A bit late though, but thanks!

On 11 jul, 03:48, nurvzy  wrote:
> Set the security component to not validate that field.
>
> http://book.cakephp.org/view/1297/Configuration
>
> Hope that helps,
> Nick
>
> On Jul 10, 1:28 pm, Tomatosoup  wrote:
>
>
>
> > Hello,
>
> > I use the Security component, but one (kind of custom) form gets
> > invalidated.
>
> > Is there some way to validate an invalidated (because of the token the
> > Security component generates) form?
>
> > Because I have an edit page in which I have a DIV that acts as a Rich
> > Text Editor. Whenever one clicks the submit button the HTML content of
> > the DIV is transferred into a hidden form field.
>
> > Much thanks in advance for any advice.

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: generatetreelist; similar function for retrieving depth

2010-07-30 Thread Tomatosoup
Yes, that would work too.
Thanks :)

(for some reason this message didn't get posted earlier)

On 30 jul, 13:55, Jon Bennett  wrote:
> you could use getpath, eg:
>
> count($this->Model->getpath($id, array('id')));
>
> hth
>
> Jon

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: generatetreelist; similar function for retrieving depth

2010-07-30 Thread Tomatosoup
Yes, that would work too.
Thanks :)

On 30 jul, 13:55, Jon Bennett  wrote:
> you could use getpath, eg:
>
> count($this->Model->getpath($id, array('id')));
>
> hth
>
> Jon
>
> On 30 July 2010 12:45, Tomatosoup  wrote:
>
>
>
>
>
> > Hello,
>
> > Does anybody know of a function likegeneratetreelistthat seperates
> > the depth from the value. Instead of counting the spacer chars.
>
> > I saw an SQL query in the explanation page of MySQL.
> > It's this 
> > page:http://dev.mysql.com/tech-resources/articles/hierarchical-data.html
>
> > This is the query:
> > SELECT node.name, (COUNT(parent.name) - 1) AS depth
> > FROM nested_category AS node,
> > nested_category AS parent
> > WHERE node.lft BETWEEN parent.lft AND parent.rgt
> > GROUP BY node.name
> > ORDER BY node.lft;
>
> > I don't know how I would use this query with find.
> > Though I could use the custom-query-function.
>
> > The thing is; I would like to seperate depth and the value of my tree
> > (categories). Then I can filter it withhtmlentities(the category
> > names), without usinghtmlentitieson the spacer.
>
> > So if anybody can point me in the right direction I would be very
> > pleased.
>
> > 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
>
> --
> jon bennett -www.jben.net- blog.jben.net

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: generatetreelist; similar function for retrieving depth

2010-07-30 Thread Tomatosoup
Thanks :)

I'll look into that.

On 30 jul, 14:28, cricket  wrote:
> On Fri, Jul 30, 2010 at 7:45 AM, Tomatosoup  
> wrote:
> > Hello,
>
> > Does anybody know of a function likegeneratetreelistthat seperates
> > the depth from the value. Instead of counting the spacer chars.
>
> > I saw an SQL query in the explanation page of MySQL.
> > It's this 
> > page:http://dev.mysql.com/tech-resources/articles/hierarchical-data.html
>
> > This is the query:
> > SELECT node.name, (COUNT(parent.name) - 1) AS depth
> > FROM nested_category AS node,
> > nested_category AS parent
> > WHERE node.lft BETWEEN parent.lft AND parent.rgt
> > GROUP BY node.name
> > ORDER BY node.lft;
>
> > I don't know how I would use this query with find.
> > Though I could use the custom-query-function.
>
> > The thing is; I would like to seperate depth and the value of my tree
> > (categories). Then I can filter it withhtmlentities(the category
> > names), without usinghtmlentitieson the spacer.
>
> If what you want to do is to display the entries differently based on
> their depth, you could do this with TreeHelper.
>
> http://bakery.cakephp.org/articles/view/tree-helper-1
>
> Note the last part of the article, "Variables available in your
> element". You use these like:
>
> if ($depth == 0)
> {
>         $tree->addItemAttribute('class', 'Section');
>
> }
>
> if ($hasChildren)
> {
>         $tree->addItemAttribute('class', 'Parent');
>
> }
>
> In this case, a node at top (depth == 0) gets a Section class. If it
> has children, it also gets Parent class. This code is inside an
> element named "nav_nodes". It's loaded from within another element
> called "nav":
>
> echo $tree->generate(
>         $section_nodes,
>         array(
>                 'element' => 'sections/nav_node',
>                 'model' => 'Section'
>         )
> );

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


generatetreelist; similar function for retrieving depth

2010-07-30 Thread Tomatosoup
Hello,

Does anybody know of a function like generatetreelist that seperates
the depth from the value. Instead of counting the spacer chars.

I saw an SQL query in the explanation page of MySQL.
It's this page: 
http://dev.mysql.com/tech-resources/articles/hierarchical-data.html

This is the query:
SELECT node.name, (COUNT(parent.name) - 1) AS depth
FROM nested_category AS node,
nested_category AS parent
WHERE node.lft BETWEEN parent.lft AND parent.rgt
GROUP BY node.name
ORDER BY node.lft;


I don't know how I would use this query with find.
Though I could use the custom-query-function.

The thing is; I would like to seperate depth and the value of my tree
(categories). Then I can filter it with htmlentities (the category
names), without using htmlentities on the spacer.

So if anybody can point me in the right direction I would be very
pleased.

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


Security Component; custom form (rich editor)

2010-07-10 Thread Tomatosoup
Hello,

I use the Security component, but one (kind of custom) form gets
invalidated.

Is there some way to validate an invalidated (because of the token the
Security component generates) form?

Because I have an edit page in which I have a DIV that acts as a Rich
Text Editor. Whenever one clicks the submit button the HTML content of
the DIV is transferred into a hidden form field.

Much thanks in advance for any advice.

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


Including a controller action

2010-04-07 Thread Tomatosoup
Hello,

I have a website which I'm working on. I have one part of a page I'd
like to use more than once, only with different parameters. I've used
the elements feature of CakePHP. But that becomes too complex, because
the page I want to reuse has all kinds of references to one controller
(and I'd like to use it also in another controller).

Now, I've tried requestAction, but that only imports data from a
controller action, and not the view.

App:import also doesn't seem right, because views still get approached
by a different controller than the references point to.

So I thought, maybe I should use the 'good old' PHP include
function :) But that doesn't seem to work, because of mod_rewrite.

Does anyone know of a way how to solve this or point me in the right
direction? Could there be a way for the include function to work?

Thanks in advance for any advice.

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

To unsubscribe, reply using "remove me" as the subject.