[fw-general] Module view duplication

2008-09-23 Thread stav

I have three modules: admin, default, super.  My views (and helpers) are
duplicated under each module.  Is there a way to have Zend look at some
default views and helpers directory, and if a module wants to override them,
then they can be declared under that module directory.
-- 
View this message in context: 
http://www.nabble.com/Module-view-duplication-tp19622219p19622219.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend + Dojo Comboboxes and $form-populate

2008-09-23 Thread Themselves


Matthew Weier O'Phinney-3 wrote:
 
 -- Themselves [EMAIL PROTECTED] wrote
 (on Sunday, 21 September 2008, 10:17 PM -0700):
 Hi guys, I'm just playing with the new Dojo forms in 1.6, and so far
 they're
 great, I'm just trying to wrap my head around some of the combobox
 functionality... 
 
 One of the features of comboboxes is that you can provide a drop down
 list
 of options in addition to permitting the user to enter text directly in
 to
 the input. This is working fine for me, except for when I try to populate
 the form for editing a record. 
 
 Unless the value of the field is one of the options in the list, it seems
 you can't set populate a combobox. I've even tried
 $form-getElement('field')-setValue($array['key']); in the controller
 after
 calling the populate method, and still nothing. 
 
 Is this expected behaviour? I was under the impression that a combobox
 should cleanly handle values that aren't in the options list, which is
 kind
 of the point of them I thought. Or am I missing something here? 
 
 A few things to understand about ComboBox:
 
  * The label displayed is also the value submitted. Don't quite
understand why this is the case, but it is.
 
  * You can type in a value NOT in the list of values in the ComboBox,
and it will submit that value
 
  * On the server side, when creating the ComboBox, setting the value to
a value not in the list simply will not work; it operates as if it
were a multi-select list. This is partly due to limitations of the
Zend_Form implementation, and partly due to limitations of how to
present that information via markup to Dojo.
 
 -- 
 Matthew Weier O'Phinney
 Software Architect   | [EMAIL PROTECTED]
 Zend Framework   | http://framework.zend.com/
 
 

Thanks for that, Matthew. 

And for the sake of anyone else Googling their way through to this, the
solution is pretty simple. If you're in a situation like mine where you
mostly want users to use data in the dropdown options, but you want it to
support them typing in whatever they want, then in order to get around the
problem of values not populating as you would expect, you can simply go like
this:  


$form-getElement('element')-addMultiOption($option, $value);
$form-populate;


in your controller or wherever you're populating the form, and it'll add the
value to the option list, so the populate will work as expected. 
-- 
View this message in context: 
http://www.nabble.com/Zend-%2B-Dojo-Comboboxes-and-%24form-%3Epopulate-tp19602022p19622355.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Soundex

2008-09-23 Thread Jean-Marc Fontaine


Matthew Ratzloff wrote:
 
 No.  It would be nice to have a locale-aware version, however.
 
I totally agree with that!

Jean-Marc

-- 
View this message in context: 
http://www.nabble.com/Soundex-tp19619868p19622395.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Layout

2008-09-23 Thread dele454

Hi Mark,

Thanks for the response. So what you are saying is that as long as i keep
the  startMvc() empty  and specify my module paths, ZF will always look for
the layout.phtml files within the specified module directories?

In my scenario, i just have one module:admin module - where the cms apps
reside. But the main site just resides on the app root folder. For better
understanding here is my folder structure:

- webapp
  -- public_html
--- images
--- bla blah

  ---controllers
  ---views
   ---layouts
---layout.phtml
---layout-browse.phtml
  --modules
   ---admin
   ---controllers
   ---views
   ---layouts
---layout.phtml
---layout-edit-mode.phtml
  
Like i said before i simply want to keep the layout of my CMS separate from 
that of the main site. The main site isnt a module. So what would my
startMvc() look like then with my folder structure in mind.

In my bootstrap i have something like this at the moment:

Zend_Layout::startMvc(array( 
 'layoutPath' = $config-paths-data .
'/module/admin/views/layouts');

I need to include that path layout path for the main site.

Thanks
 


MarkDNA wrote:
 
 
 dele454 wrote:
 
 I just want to know if one can specify more than one layout path in the
 startMvc function? having something like this:
 
 Zend_Layout::startMvc(array(
  'layoutPath1' =
 $config-paths-data . '/module1/admin/views/layouts')
  'layoutPath2' =
 $config2-paths-data . '/module2/admin/views/layouts')
 );
 
 Am asking because since layout.phtml is the default layout to be used
 except if specified otherwise. What if i have the default rendering
 layout.phtml in both folders how then can i let the Front Controller know
 which layout i am referring to in what folder?
 
 
 
 Not sure if this is what you are asking, but if you have modules set up
 with something like:
 $front-addModuleDirectory('application/modules'); 
 where your module1/, module2/, etc directories are in the modules/ dir,
 then ZF uses the layout.phtml file within the views/scripts/ dir for each
 module. I.e. module1/views/scripts/layout.phtml will be used for the
 controllers within module1; module2/views/scripts/layout.phtml will be
 used for the controllers within module2; etc. Looks like you're using
 different paths, but if you have that worked out, it shouldn't be a
 problem. I'm doing that myself right now. I am passing no params to
 Zend_Layout::startMvc().
 
 -Mark
 
 


-
dee
-- 
View this message in context: 
http://www.nabble.com/Zend_Layout-tp19608818p19622879.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Skip action

2008-09-23 Thread Tagger

does anybody know the answer?
-- 
View this message in context: 
http://www.nabble.com/Skip-action-tp19612879p19623715.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Skip action

2008-09-23 Thread Ben Scholzen 'DASPRiD'
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Usually it's 42...

Honestly: to which question?

Tagger schrieb:
 does anybody know the answer?

- --
...
:  ___   _   ___ ___ ___ _ ___:
: |   \ /_\ / __| _ \ _ (_)   \   :
: | |) / _ \\__ \  _/   / | |) |  :
: |___/_/:\_\___/_| |_|_\_|___/   :
:::
: Web: http://www.dasprids.de :
: E-mail : [EMAIL PROTECTED]   :
: Jabber : [EMAIL PROTECTED] :
: ICQ: 105677955  :
:::
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFI2LMW0HfT5Ws789ARArFXAJ9jzo4x1/tnTxHN1ri9Vf+QPInWYQCfVe9n
qSQgvU1W2g04e+skJe80aCc=
=dkGC
-END PGP SIGNATURE-


Re: [fw-general] Skip action

2008-09-23 Thread Tagger

In  preDispath of Zend_Controller_Action verify the Cache. If the Cache is
available i don´t want to launch the action, is possible to do this?. 


DASPRiD wrote:
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Usually it's 42...
 
 Honestly: to which question?
 
 Tagger schrieb:
 does anybody know the answer?
 
 - --
 ...
 :  ___   _   ___ ___ ___ _ ___:
 : |   \ /_\ / __| _ \ _ (_)   \   :
 : | |) / _ \\__ \  _/   / | |) |  :
 : |___/_/:\_\___/_| |_|_\_|___/   :
 :::
 : Web: http://www.dasprids.de :
 : E-mail : [EMAIL PROTECTED]   :
 : Jabber : [EMAIL PROTECTED] :
 : ICQ: 105677955  :
 :::
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.6 (GNU/Linux)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
 iD8DBQFI2LMW0HfT5Ws789ARArFXAJ9jzo4x1/tnTxHN1ri9Vf+QPInWYQCfVe9n
 qSQgvU1W2g04e+skJe80aCc=
 =dkGC
 -END PGP SIGNATURE-
 
 

-- 
View this message in context: 
http://www.nabble.com/Skip-action-tp19612879p19624037.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Skip action

2008-09-23 Thread Ben Scholzen 'DASPRiD'
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Well what to do instead? You could simply just die;

Tagger schrieb:
 In  preDispath of Zend_Controller_Action verify the Cache. If the Cache is
 available i don´t want to launch the action, is possible to do this?. 
 
 
 DASPRiD wrote:
 Usually it's 42...
 
 Honestly: to which question?
 
 Tagger schrieb:
 does anybody know the answer?



- --
...
:  ___   _   ___ ___ ___ _ ___:
: |   \ /_\ / __| _ \ _ (_)   \   :
: | |) / _ \\__ \  _/   / | |) |  :
: |___/_/:\_\___/_| |_|_\_|___/   :
:::
: Web: http://www.dasprids.de :
: E-mail : [EMAIL PROTECTED]   :
: Jabber : [EMAIL PROTECTED] :
: ICQ: 105677955  :
:::
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFI2LQn0HfT5Ws789ARAm/fAJ9P2lniMDU87gVbdNiD0graH2wk+gCg1IPm
WXcGhNFK0d8j3lVUUrth9Kc=
=P+e8
-END PGP SIGNATURE-


Re: [fw-general] Skip action

2008-09-23 Thread Tagger

Die is not posibble, stops the execution. I need to redirec to another action
in the same controller, for example with forward, but something wrong with
it.


DASPRiD wrote:
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Well what to do instead? You could simply just die;
 
 Tagger schrieb:
 In  preDispath of Zend_Controller_Action verify the Cache. If the Cache
 is
 available i don´t want to launch the action, is possible to do this?. 
 
 
 DASPRiD wrote:
 Usually it's 42...
 
 Honestly: to which question?
 
 Tagger schrieb:
 does anybody know the answer?


 
 - --
 ...
 :  ___   _   ___ ___ ___ _ ___:
 : |   \ /_\ / __| _ \ _ (_)   \   :
 : | |) / _ \\__ \  _/   / | |) |  :
 : |___/_/:\_\___/_| |_|_\_|___/   :
 :::
 : Web: http://www.dasprids.de :
 : E-mail : [EMAIL PROTECTED]   :
 : Jabber : [EMAIL PROTECTED] :
 : ICQ: 105677955  :
 :::
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.6 (GNU/Linux)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
 iD8DBQFI2LQn0HfT5Ws789ARAm/fAJ9P2lniMDU87gVbdNiD0graH2wk+gCg1IPm
 WXcGhNFK0d8j3lVUUrth9Kc=
 =P+e8
 -END PGP SIGNATURE-
 
 

-- 
View this message in context: 
http://www.nabble.com/Skip-action-tp19612879p19624536.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Layout

2008-09-23 Thread dele454

My other option would be to move the layout folder from the admin module to
the webapp root - so I can the 'global' access - with lack of a better word

But am trying to avoid the CMS layouts all clustering up with the main site
layouts. I just want to keep both separate and manageable.


Ralph Schindler-2 wrote:
 
 For a bit more background: why do you have site wide layouts inside
 specific
 modules?  Shouldn't modules share the same global layout?
 
 -ralph
 
 
 On 9/22/08 9:15 AM, dele454 [EMAIL PROTECTED] wrote:
 
 
 I just want to know if one can specify more than one layout path in the
 startMvc function? having something like this:
 
 Zend_Layout::startMvc(array(
  'layoutPath1' =
 $config-paths-data .
 '/module1/admin/views/layouts')
  'layoutPath2' =
 $config2-paths-data
 . '/module2/admin/views/layouts')
 );
 
 Am asking because since layout.phtml is the default layout to be used
 except
 if specified otherwise. What if i have the default rendering layout.phtml
 in
 both folders how then can i let the Front Controller know which layout i
 am
 referring to in what folder?
 
 Another question is using different layouts in any of the paths
 specified.
 Would i have to include a path to the layout i want to use in my
 controller
 like:
 
 $this-_helper-layout-setLayout('layoutPath2/layout-edit-mode') ???
 
 Thanks in advance.
 
 N.B i just have one path specified at the moment for the module i just
 finished in my bootstrap. I want to use a different layout folder for the
 new module i developing now hence my quest.
 
 
 
 -
 dee
 
 -- 
 Ralph Schindler
 Software Engineer | [EMAIL PROTECTED]
 Zend Framework| http://framework.zend.com/
 
 
 
 


-
dee
-- 
View this message in context: 
http://www.nabble.com/Zend_Layout-tp19608818p19624607.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Skip action

2008-09-23 Thread Tom Graham

Could it be you need to _forward(); then return; ?

Tom

On 23 Sep 2008, at 10:54, Tagger wrote:



Die is not posibble, stops the execution. I need to redirec to  
another action
in the same controller, for example with forward, but something  
wrong with

it.


DASPRiD wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Well what to do instead? You could simply just die;

Tagger schrieb:
In  preDispath of Zend_Controller_Action verify the Cache. If the  
Cache

is
available i don´t want to launch the action, is possible to do  
this?.



DASPRiD wrote:
Usually it's 42...

Honestly: to which question?

Tagger schrieb:

does anybody know the answer?





- --
...
:  ___   _   ___ ___ ___ _ ___:
: |   \ /_\ / __| _ \ _ (_)   \   :
: | |) / _ \\__ \  _/   / | |) |  :
: |___/_/:\_\___/_| |_|_\_|___/   :
:::
: Web: http://www.dasprids.de :
: E-mail : [EMAIL PROTECTED]   :
: Jabber : [EMAIL PROTECTED] :
: ICQ: 105677955  :
:::
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFI2LQn0HfT5Ws789ARAm/fAJ9P2lniMDU87gVbdNiD0graH2wk+gCg1IPm
WXcGhNFK0d8j3lVUUrth9Kc=
=P+e8
-END PGP SIGNATURE-




--
View this message in context: 
http://www.nabble.com/Skip-action-tp19612879p19624536.html
Sent from the Zend Framework mailing list archive at Nabble.com.






Re: [fw-general] Soundex

2008-09-23 Thread José de Menezes Soares Neto
Sorry, I am from Brasil... but I think yes, its what I need

2008/9/22 Matthew Ratzloff [EMAIL PROTECTED]

 No.  It would be nice to have a locale-aware version, however.  I assume
 that's what you're getting at?
 -Matt


 On Mon, Sep 22, 2008 at 6:52 PM, José de Menezes Soares Neto 
 [EMAIL PROTECTED] wrote:

 I know that.

 But ZF have anything to help like this?

 2008/9/22 Bill Karwin [EMAIL PROTECTED]




 José de Menezes Soares Neto wrote:
 
  There is a way to find similar queries?
 

 http://php.net/soundex

 Regards,
 Bill Karwin
 --
 View this message in context:
 http://www.nabble.com/Soundex-tp19619868p19619905.html
 Sent from the Zend Framework mailing list archive at Nabble.com.






[fw-general] charset little problem

2008-09-23 Thread José de Menezes Soares Neto
Hi friends,

When I try:
*
print $this-_request-getParam('query');*

The browser prints:

*programação*

The correct need to be:

*programação*

And when I try:

*print programação;*

It prints correctly!

What it would be?


Re: [fw-general] multiple models with same name (m1/models/pages.php and m2/models/pages.php)

2008-09-23 Thread chrisweb

Hello,

Thx for telling me your thoughts, its good to have different opinions about
how to solve that problem, i still don't know what way is best, but as you
said i think it depends on what you want to achieve ... 

the idea of having a folder for models where you put all your models is a
good one, but i for example wanted to seperate delete-stuff-methods in admin
from output-stuff-methods in front ...

the idea of using modules is also a good one, but then you have the problem
that you must use different names for your models or just load the model you
need.

Of course there are some more things to consider ... i will try to download
applications created with zend framework to see what kind of solution they
choose and try to understand why a solution is perhaps better then another
one.

thx for your help

Chris



DASPRiD wrote:
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Your last statement is not completly correct, Bill. The sence behind
 modules is, to logically seperate your code. As in your example, an
 admin interface and the frontend for the user.
 
 Bill Karwin schrieb:
 
 
 Edward Haber wrote:
 Another problem with the proposed solution is that it only makes one  
 module's models path active at a time. I think the ideal when working  
 with multiple modules is to have the option of using model code from  
 more than one module models directory at a time, especially in cases  
 of interdependency.

 
 No, that's not ideal, that's actually what I was recommending to
 _prevent_.
 
 A module has its own controllers and views, and should have its own set
 of
 models as well.  One module should not be allowed to reference another
 module's controllers, views, or models.  If you follow this rule, then it
 solves all the problems of ambiguity and collision.
 
 Don't separate your application into modules if the modules aren't
 separate. 
 If you want to share model classes among all your controllers, then don't
 create modules.
 
 
 Edward Haber wrote:
 If however it is a must that you remain encapsulation and that these  
 modules are dropped into other apps and need to work this way, then I  
 would change the names of your models entirely. 

 
 This doesn't work in general, if you drop third-party modules into your
 app,
 or drop your module into someone else's app.  Only if you have control
 over
 the class naming of all modules in an app does your recommendation work. 
 If
 you're the author of all the modules in the app, then why are you using
 modules at all?
 
 The purpose of modules is to provide isolation between sets of classes. 
 Many people seem to use modules to create friendly URL's like
 /myapp/admin/controller/action but you can do this by creating custom
 router rules.  You don't have to use modules simply to define URL's.
 
 Regards,
 Bill Karwin
 
 - --
 ...
 :  ___   _   ___ ___ ___ _ ___:
 : |   \ /_\ / __| _ \ _ (_)   \   :
 : | |) / _ \\__ \  _/   / | |) |  :
 : |___/_/:\_\___/_| |_|_\_|___/   :
 :::
 : Web: http://www.dasprids.de :
 : E-mail : [EMAIL PROTECTED]   :
 : Jabber : [EMAIL PROTECTED] :
 : ICQ: 105677955  :
 :::
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.6 (GNU/Linux)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
 iD8DBQFI2D1O0HfT5Ws789ARAhn0AJ4j6ozeUnA1D77gyiJEUAuAQ8fP/gCgoIcH
 tIjgzWA/JRe1HGb9XBqztFs=
 =1qnX
 -END PGP SIGNATURE-
 
 

-- 
View this message in context: 
http://www.nabble.com/multiple-models-with-same-name-%28m1-models-pages.php-and-m2-models-pages.php%29-tp19607614p19625354.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Skip action

2008-09-23 Thread Tagger

With _forward(); enters in a loop infinity.



Tom Graham-2 wrote:
 
 Could it be you need to _forward(); then return; ?
 
 Tom
 
 On 23 Sep 2008, at 10:54, Tagger wrote:
 

 Die is not posibble, stops the execution. I need to redirec to  
 another action
 in the same controller, for example with forward, but something  
 wrong with
 it.


 DASPRiD wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Well what to do instead? You could simply just die;

 Tagger schrieb:
 In  preDispath of Zend_Controller_Action verify the Cache. If the  
 Cache
 is
 available i don´t want to launch the action, is possible to do  
 this?.


 DASPRiD wrote:
 Usually it's 42...

 Honestly: to which question?

 Tagger schrieb:
 does anybody know the answer?



 - --
 ...
 :  ___   _   ___ ___ ___ _ ___:
 : |   \ /_\ / __| _ \ _ (_)   \   :
 : | |) / _ \\__ \  _/   / | |) |  :
 : |___/_/:\_\___/_| |_|_\_|___/   :
 :::
 : Web: http://www.dasprids.de :
 : E-mail : [EMAIL PROTECTED]   :
 : Jabber : [EMAIL PROTECTED] :
 : ICQ: 105677955  :
 :::
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.6 (GNU/Linux)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iD8DBQFI2LQn0HfT5Ws789ARAm/fAJ9P2lniMDU87gVbdNiD0graH2wk+gCg1IPm
 WXcGhNFK0d8j3lVUUrth9Kc=
 =P+e8
 -END PGP SIGNATURE-



 -- 
 View this message in context:
 http://www.nabble.com/Skip-action-tp19612879p19624536.html
 Sent from the Zend Framework mailing list archive at Nabble.com.


 
 
 

-- 
View this message in context: 
http://www.nabble.com/Skip-action-tp19612879p19625385.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] DojoComboBox and large data set.

2008-09-23 Thread Paweł Chuchmała
Hi.

How is the best method to use DojoComboBox with large data set? For
example i want to do suggest for users.
I have about 10 records. I want for example query server with 3
first letters filled in combobox.
How can i do that? It is possible to use DojoData with this method?

regards,

-- 
Paweł Chuchmała
pawel.chuchmala at gmail dot com


[fw-general] Problem with aliased getDecorator/setDecorator

2008-09-23 Thread alexvvv

I want to  insert div between fieldset and dl:
form ...
   dl ...
 dtlabel ...Label1:/label/dt
 ddinput type=text .../dd
 dt/dt
 dd
   fieldset ...
 div ...
   dl ...
   dtlabel ...Label1:/label/dt
   ddinput type=text .../dd
 /div  
   /fieldset   
 /dd
   /dl 
/form

...
$myForm- addDisplayGroup(array('name','year','country'),'group');

//here I add aliased decorator
$myForm-getDisplayGroup('group')-addDecorator(array('test' = 'HtmlTag'),
array('tag' = 'div','class'='scrolable'));
//I save decorators
$saveDecorators=$myForm-getDisplayGroup('group')-getDecorators();
$saveDecorator=$saveDecorators['Zend_Form_Decorator_DtDdWrapper'];
unset($saveDecorators['Zend_Form_Decorator_DtDdWrapper']);
$saveDecorators['Zend_Form_Decorator_DtDdWrapper']=$saveDecorator;  
//I restore decorators
$myForm-getDisplayGroup('group')-setDecorators($saveDecorators);
... 
After this line decorator with alias test replaces default decorator
(Zend_Form_Decorator_HtmlTag).
Help me to resolve this problem.
-- 
View this message in context: 
http://www.nabble.com/Problem-with-aliased-getDecorator-setDecorator-tp19625575p19625575.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] charset little problem

2008-09-23 Thread till
On Tue, Sep 23, 2008 at 12:46 PM, José de Menezes Soares Neto
[EMAIL PROTECTED] wrote:
 Hi friends,

 When I try:

 print $this-_request-getParam('query');

 The browser prints:

 programação

 The correct need to be:

 programação

 And when I try:

 print programação;

 It prints correctly!

 What it would be?


This should be encoding related.

Make sure you send the correct encoding in Content-Type and also in
the browser (meta tag, etc.).

Till


[fw-general] M$ Isa proxy incompatability when http-tunneling?

2008-09-23 Thread Dan Ballance
Hi folks,

I have been battling this problem for a while now. Until recently, I thought
I had network issues, but in the end I wrote my email migration code in
python and managed to connect to the google services with no problems, so
before I write my own client in PHP, I thought I would run this issue past
your good selves to see if what I am saying makes sense and if there might
be a solution / workaround...

To the best of my knowledge, it appears that in order for M$ Isa Server to
pass an https connection through http-tunneling, it requires the address to
be sent in the following format:

www.google.com/accounts/ClientLogin:443

The Isa proxy seems to see this address and then allow an https
connection through an http-tunnel. However, if I have understood the zend
code correctly, the zend libraries use the protocol prefix to decide in what
manner to treat the connection, forcing me to try:

https://www.google.com/accounts/ClientLogin:443

or

https://www.google.com*/accounts/ClientLoginhttps://www.google.com/accounts/ClientLogin
*

Neither of these uris seem to work for making an http-tunneled connection
with the Isa proxy server. I think the problem code is in
Zend/Http/Client.php) :

/**
 * Set the URI for the next request
 *
 * @param  Zend_Uri_Http|string $uri
 * @return Zend_Http_Client
 * @throws Zend_Http_Client_Exception
 */
public function setUri($uri)
{
if (is_string($uri)) {
$uri = Zend_Uri::factory($uri);
}
if (!$uri instanceof Zend_Uri_Http) {
throw new Zend_Http_Client_Exception('Passed parameter is not a
valid HTTP URI.');
}
// We have no ports, set the defaults
if (! $uri-getPort()) {
$uri-setPort(($uri-getScheme() == 'https' ? 443 : 80));
}
$this-uri = $uri;
return $this;
}

The uri constructor method determines the scheme via the protocol prefix.
This is later used to set the port number to 443. See this routine in the
factory method of Zend/Uri.php:

$uri = explode(':', $uri, 2);
$scheme = strtolower($uri[0]);
$schemeSpecific = isset($uri[1]) ? $uri[1] : '';
if (!strlen($scheme)) {
throw new Zend_Uri_Exception('An empty string was supplied for
the scheme');
}
// Security check: $scheme is used to load a class file, so only
alphanumerics are allowed.
if (!ctype_alnum($scheme)) {
throw new Zend_Uri_Exception('Illegal scheme supplied, only
alphanumeric characters are permitted');
}
/**
 * Create a new Zend_Uri object for the $uri. If a subclass of
Zend_Uri exists for the
 * scheme, return an instance of that class. Otherwise, a
Zend_Uri_Exception is thrown.
 */
switch ($scheme) {
case 'http':
case 'https':
$className = 'Zend_Uri_Http';
break;
case 'mailto':
// @todo
default:
throw new Zend_Uri_Exception(Scheme \$scheme\ is not
supported);
}


If anyone could spare 10mins to look at this I would really appreciate it.
Is there anyone else managing to connect via an Isa proxy? Is there any way
round this? I have tried hacking the code in various ways but it is not
working and I am thinking of writing my own client code in php to solve the
problem, but before I do that - can anybody help me?

Many thanks in advance,

dan :-)


Re: [fw-general] charset little problem

2008-09-23 Thread José de Menezes Soares Neto
the problem is inside getParam. Because when i print the char inside the
html, or inside the php, it shows fine

any ideas?

2008/9/23 till [EMAIL PROTECTED]

 On Tue, Sep 23, 2008 at 12:46 PM, José de Menezes Soares Neto
 [EMAIL PROTECTED] wrote:
  Hi friends,
 
  When I try:
 
  print $this-_request-getParam('query');
 
  The browser prints:
 
  programação
 
  The correct need to be:
 
  programação
 
  And when I try:
 
  print programação;
 
  It prints correctly!
 
  What it would be?
 

 This should be encoding related.

 Make sure you send the correct encoding in Content-Type and also in
 the browser (meta tag, etc.).

 Till



Re: [fw-general] Skip action

2008-09-23 Thread Bart McLeod
you probably forward to the same action then. I suggest you just let it 
die() since you echo out the desired output anyway.


Bart

Tagger schreef:

With _forward(); enters in a loop infinity.



Tom Graham-2 wrote:
  

Could it be you need to _forward(); then return; ?

Tom

On 23 Sep 2008, at 10:54, Tagger wrote:


Die is not posibble, stops the execution. I need to redirec to  
another action
in the same controller, for example with forward, but something  
wrong with

it.


DASPRiD wrote:
  

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Well what to do instead? You could simply just die;

Tagger schrieb:

In  preDispath of Zend_Controller_Action verify the Cache. If the  
Cache

is
available i don´t want to launch the action, is possible to do  
this?.



DASPRiD wrote:
Usually it's 42...

Honestly: to which question?

Tagger schrieb:
  

does anybody know the answer?



- --
...
:  ___   _   ___ ___ ___ _ ___:
: |   \ /_\ / __| _ \ _ (_)   \   :
: | |) / _ \\__ \  _/   / | |) |  :
: |___/_/:\_\___/_| |_|_\_|___/   :
:::
: Web: http://www.dasprids.de :
: E-mail : [EMAIL PROTECTED]   :
: Jabber : [EMAIL PROTECTED] :
: ICQ: 105677955  :
:::
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFI2LQn0HfT5Ws789ARAm/fAJ9P2lniMDU87gVbdNiD0graH2wk+gCg1IPm
WXcGhNFK0d8j3lVUUrth9Kc=
=P+e8
-END PGP SIGNATURE-




--
View this message in context:
http://www.nabble.com/Skip-action-tp19612879p19624536.html
Sent from the Zend Framework mailing list archive at Nabble.com.


  





  


Re: [fw-general] Zend_Filter_Input and Arrays

2008-09-23 Thread Bryce Lohr




Glad to help! Incidentally, I already have a few implementations of
such validator decorators in the Laboratory here:

http://framework.zend.com/svn/framework/laboratory/library/Zend/Validate/

See the file Array.php, which does exactly what I had mentioned.

Regards,
Bryce Lohr


cvogt wrote:

  Hej Bryce,

  
  
Another, perhaps simpler, approach would be to create an array-aware 
decorator that decorates a validator object with the ability to validate 
arrays. That might be the easiest way to let a scalar-only validator 
automatically validate each element of a given array.

  
  
you are right, decorators seem to be the way to go. I implemented it this
way and added it as a feature request including code to the issue tracker.

http://framework.zend.com/issues/browse/ZF-4354

Best Regards

Christopher
  





[fw-general] Help in zend_auth instances

2008-09-23 Thread amithasija

i want to create multiple instances of zend_auth class 

as i have two modules 

Admin
Front

wats happening is when i login into admin it automatically get logins into
front or vice-versa.


so wat i want is the i can work on both modules separately after
simultaneous authentication.


 regards amit
-- 
View this message in context: 
http://www.nabble.com/Help-in-zend_auth-instances-tp19626894p19626894.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] charset little problem

2008-09-23 Thread José de Menezes Soares Neto
i am using utf8_encode(); for this problem.
thanks everybody!

2008/9/23 José de Menezes Soares Neto [EMAIL PROTECTED]

 the problem is inside getParam. Because when i print the char inside the
 html, or inside the php, it shows fine

 any ideas?

 2008/9/23 till [EMAIL PROTECTED]

 On Tue, Sep 23, 2008 at 12:46 PM, José de Menezes Soares Neto
 [EMAIL PROTECTED] wrote:
  Hi friends,
 
  When I try:
 
  print $this-_request-getParam('query');
 
  The browser prints:
 
  programação
 
  The correct need to be:
 
  programação
 
  And when I try:
 
  print programação;
 
  It prints correctly!
 
  What it would be?
 

 This should be encoding related.

 Make sure you send the correct encoding in Content-Type and also in
 the browser (meta tag, etc.).

 Till





Re: [fw-general] Help in zend_auth instances

2008-09-23 Thread Giorgio Sironi
2008/9/23 amithasija [EMAIL PROTECTED]:
 wats happening is when i login into admin it automatically get logins into
 front or vice-versa.

If you want that, why are you creating two instances where one would
be sufficient?

-- 
Giorgio Sironi
Piccolo Principe  Ossigeno Scripter
http://www.sourceforge.net/projects/ossigeno


Re: [fw-general] DojoComboBox and large data set.

2008-09-23 Thread MarkDNA

Well, someone might have a better way, but I would take this a s a two step
process. FIrst, have a three-character wide filed (maxlength=3) thath you
have an onchange JS trigger associated with. When the three are entered, set
of an xhrGet request to pull back the FiltertingSelect or ComboBox field
with it's associated list of possible responses. JM2C

-Mark



Paweł Chuchmała wrote:
 
 Hi.
 
 How is the best method to use DojoComboBox with large data set? For
 example i want to do suggest for users.
 I have about 10 records. I want for example query server with 3
 first letters filled in combobox.
 How can i do that? It is possible to use DojoData with this method?
 
 regards,
 
 -- 
 Paweł Chuchmała
 pawel.chuchmala at gmail dot com
 
 


-
Mark Garrett
DailyDNA
Arkadelphia, AR
(Telecommuting to: Rogue River, OR)
-- 
View this message in context: 
http://www.nabble.com/DojoComboBox-and-large-data-set.-tp19625601p19628026.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] multiple models with same name (m1/models/pages.php and m2/models/pages.php)

2008-09-23 Thread Edward Haber
First of all, had I known you were a Zend engineer I probably wouldn't  
have opened my big mouth. I'm new to the list. :-) But since it's  
already open, i'll just offer a few points of view from my perspective.


On Sep 22, 2008, at 12:55 PM, Bill Karwin wrote:

Edward Haber wrote:


Another problem with the proposed solution is that it only makes one
module's models path active at a time. I think the ideal when working
with multiple modules is to have the option of using model code from
more than one module models directory at a time, especially in cases
of interdependency.


No, that's not ideal, that's actually what I was recommending to  
_prevent_.


I see your point that having all the models directories of all modules  
in the include path leads to namespace collision in a modular  
framework like Joomla. I was under the impression you were making a  
modular application where the code is grouped by functionality rather  
than a third-party-capable modular framework.


A module has its own controllers and views, and should have its own  
set of

models as well.  One module should not be allowed to reference another
module's controllers, views, or models.  If you follow this rule,  
then it

solves all the problems of ambiguity and collision.


In my opinion, if you have three modules implementing a Pages model  
that has a duplicate fetchMyPages() method (say with differing  
parameters per module) then it seems anti-DRY to repeat the same file/ 
class/method three times (then keep them sync'd when making bug fixes,  
then write three sets of test classes, etc.). It comes down to (for  
me) if the class in question is used in the exact same context in  
multiple modules. If it's three unrelated types of pages that has one  
solution. If it's three versions of basically the same class and  
methods then it seems anti-DRY to me.


Don't separate your application into modules if the modules aren't  
separate.
If you want to share model classes among all your controllers, then  
don't

create modules.


In my case, It was a lot easier to manage the front-end (controllers  
and views) within modules but just use a single model directory. This  
particular organizational method helped the front-end developers find  
code more easily and allowed for teams to work more independently.  
These solutions are unique to the needs of each application. If it  
best suited your application, there's no reason you couldn't have  
fifty front-ends (of controllers/views) connected to one set of models.


It also suited the application well, which has three front-end areas  
(which I made modules) where users of one area never are users in  
another area. I agree I would approach a Drupal/Joomla-like  
architecture differently, but this architecture is clear, obvious, and  
breaks no MVC conventions.



If however it is a must that you remain encapsulation and that these
modules are dropped into other apps and need to work this way, then I
would change the names of your models entirely.


This doesn't work in general, if you drop third-party modules into  
your app,
or drop your module into someone else's app.  Only if you have  
control over
the class naming of all modules in an app does your recommendation  
work.  If
you're the author of all the modules in the app, then why are you  
using

modules at all?

The purpose of modules is to provide isolation between sets of  
classes.

Many people seem to use modules to create friendly URL's like
/myapp/admin/controller/action but you can do this by creating  
custom

router rules.  You don't have to use modules simply to define URL's.


This seems unnecessarily strict. In my opinion, modules can be *more*  
than this or *less* than this depending on the requirements of the  
application. Part of the beauty of the Zend Framework (and PHP) is  
that it is so flexible to different architecture requirements. I agree  
it's really not that hard to write a route. I'm using plenty of them  
in the app. But why not, if it suits the grouping of your code, and  
makes the urls work, take advantage of built-in features of the  
framework?


Thanks for your notes. I hope to learn a lot from the members of the  
list.


Eddie


Regards,
Bill Karwin
--
View this message in context: 
http://www.nabble.com/multiple-models-with-same-name-%28m1-models-pages.php-and-m2-models-pages.php%29-tp19607614p19612115.html
Sent from the Zend Framework mailing list archive at Nabble.com.





Re: [fw-general] Using Zend_Cache with backend memcached and frontend page

2008-09-23 Thread till
On Fri, Sep 12, 2008 at 11:23 PM, ryanw [EMAIL PROTECTED] wrote:

 I am trying to use the Zend_Cache engine with the frontend page and backend
 memcached but I am getting an error. The pages cache works properly when
 using the file backend I figured I could just change the backend out and it
 should work. Here is the error that I get:


 Fatal error: Uncaught exception 'Zend_Cache_Exception' with message
 'Incorrect option name : 0' in .../lib/Zend/Cache.php:141 Stack trace: #0
 .../lib/Zend/Cache/Backend.php(108): Zend_Cache::throwException('Incorrect
 optio...') #1 .../lib/Zend/Cache/Backend.php(69):
 Zend_Cache_Backend-setOption(0, Array) #2
 .../lib/Zend/Cache/Backend/Memcached.php(99):
 Zend_Cache_Backend-__construct(Array) #3 .../lib/Zend/Cache.php(124):
 Zend_Cache_Backend_Memcached-__construct(Array) #4
 .../websites/pornomovies.com/index.php(49): Zend_Cache::factory('Page',
 'Memcached', Array, Array) #5 {main} thrown in .../lib/Zend/Cache.php on
 line 141

 And here is my contructor:

 $frontendOptions = array(
   'lifetime' = 1200,
   'debug_header' = true, // for debugging
'automatic_cleaning_factor' = 0,
   'regexps' = array(
   // cache the whole IndexController
   '^/$' = array('cache' = true),
   )
 );

 $backendOptions = array(
array('host' = 'localhost','port' = 11211, 'persistent' = true)
 );

 // getting a Zend_Cache_Frontend_Page object
 $cache = Zend_Cache::factory('Page',
 'File',
 $frontendOptions,
 $backendOptions);

 $cache-start();

You are using File, not Memcache(d).


Re: [fw-general] Zend_Layout

2008-09-23 Thread Graham Anderson
On Monday 22 September 2008 18:34:06 Ralph Schindler wrote:
 For a bit more background: why do you have site wide layouts inside
 specific modules?  Shouldn't modules share the same global layout?

 -ralph

Layouts need not be specifically site wide, they may be applicable to a 
certain list of modules. Module's should not be restricted to the same batch 
of global layouts for reasons of re-use and re-distribution.

$layout-setLayout() caters for this to an extent; but like other aspects of 
the MVC I would like to see more options for being module aware.

Graham


Re: [fw-general] Help in zend_auth instances

2008-09-23 Thread Graham Anderson
On Tuesday 23 September 2008 14:44:31 amithasija wrote:
 i want to create multiple instances of zend_auth class

 as i have two modules

 Admin
 Front

 wats happening is when i login into admin it automatically get logins into
 front or vice-versa.


 so wat i want is the i can work on both modules separately after
 simultaneous authentication.

Surely you should authenticate you user only once ( or twice for comparison 
when using admin features ) and use an appropriate set of access controls to 
specify which sections of your site the user is allowed access to. Zend_Acl 
would allow for this type of per resource control.

Graham


RE: [fw-general] multiple models with same name (m1/models/pages.php and m2/models/pages.php)

2008-09-23 Thread chrisweb

Hello,

Yes your right, if you don't want to have a fetch_all_pages method in your
backend model, and the same method in your frontend model (which would
make it more difficult to update), then one folder for all the models is
probably the best way, for now i don't know if there is any disadvantage,
but this kind of structure seems to be less MVC-ish ;) it's why i thought
this is perhaps not so good.

I don't know right now if this is really the best way, i need to think more
about it and try different scenarios, for example i want to be sure that
every module i create will be kinda free, afterwards i want to be able to
take a module from my application, put it into another application without
having to change anything ...

Chris



notmessenger wrote:
 
 Chris
 
 I use modules as a way of separating out functionality, such as /default
 and /manage.  All of my models are in a /models folder at the /application
 level (alongside /modules).  I do this because of the following:  in a
 site where you have/need an administration section, most if not all of the
 dynamic content and functionality on the front-end will be represented in
 the back-end.  Let's say you have a Products model.  You may have a method
 to retrieve all the products, view the images larger, etc.  You can still
 use the retrieve all products method in the back-end in order to list
 products to select for editing, etc.  There will be more methods in your
 model than your front-end uses, but most of the ones the front-end uses
 can be used by the backend.
 
 Hope this helps you along your path as well.
 
 
 
 Jeremy Brown
 Senior Web Developer
 Spear One
 972.661.6038
 www.spearone.com
 
 -Original Message-
 From: chrisweb [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, September 23, 2008 5:59 AM
 To: fw-general@lists.zend.com
 Subject: Re: [fw-general] multiple models with same name
 (m1/models/pages.php and m2/models/pages.php)
 
 
 Hello,
 
 Thx for telling me your thoughts, its good to have different opinions
 about
 how to solve that problem, i still don't know what way is best, but as you
 said i think it depends on what you want to achieve ...
 
 the idea of having a folder for models where you put all your models is a
 good one, but i for example wanted to seperate delete-stuff-methods in
 admin
 from output-stuff-methods in front ...
 
 the idea of using modules is also a good one, but then you have the
 problem
 that you must use different names for your models or just load the model
 you
 need.
 
 Of course there are some more things to consider ... i will try to
 download
 applications created with zend framework to see what kind of solution they
 choose and try to understand why a solution is perhaps better then another
 one.
 
 thx for your help
 
 Chris
 
 
 
 DASPRiD wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Your last statement is not completly correct, Bill. The sence behind
 modules is, to logically seperate your code. As in your example, an
 admin interface and the frontend for the user.

 Bill Karwin schrieb:


 Edward Haber wrote:
 Another problem with the proposed solution is that it only makes one
 module's models path active at a time. I think the ideal when working
 with multiple modules is to have the option of using model code from
 more than one module models directory at a time, especially in cases
 of interdependency.


 No, that's not ideal, that's actually what I was recommending to
 _prevent_.

 A module has its own controllers and views, and should have its own set
 of
 models as well.  One module should not be allowed to reference another
 module's controllers, views, or models.  If you follow this rule, then
 it
 solves all the problems of ambiguity and collision.

 Don't separate your application into modules if the modules aren't
 separate.
 If you want to share model classes among all your controllers, then
 don't
 create modules.


 Edward Haber wrote:
 If however it is a must that you remain encapsulation and that these
 modules are dropped into other apps and need to work this way, then I
 would change the names of your models entirely.


 This doesn't work in general, if you drop third-party modules into your
 app,
 or drop your module into someone else's app.  Only if you have control
 over
 the class naming of all modules in an app does your recommendation work.
 If
 you're the author of all the modules in the app, then why are you using
 modules at all?

 The purpose of modules is to provide isolation between sets of classes.
 Many people seem to use modules to create friendly URL's like
 /myapp/admin/controller/action but you can do this by creating custom
 router rules.  You don't have to use modules simply to define URL's.

 Regards,
 Bill Karwin

 
 - --
 ...
 :  ___   _   ___ ___ ___ _ ___:
 : |   \ /_\ / __| _ \ _ (_)   \   :
 : | |) / _ \\__ \  _/   / | |) |  :
 : |___/_/:\_\___/_| |_|_\_|___/   :
 

Re: [fw-general] multiple models with same name (m1/models/pages.php and m2/models/pages.php)

2008-09-23 Thread chrisweb



Edward Haber wrote:
 
 First of all, had I known you were a Zend engineer I probably wouldn't  
 have opened my big mouth. I'm new to the list. :-) But since it's  
 already open, i'll just offer a few points of view from my perspective.
 
 On Sep 22, 2008, at 12:55 PM, Bill Karwin wrote:
 Edward Haber wrote:

 Another problem with the proposed solution is that it only makes one
 module's models path active at a time. I think the ideal when working
 with multiple modules is to have the option of using model code from
 more than one module models directory at a time, especially in cases
 of interdependency.

 No, that's not ideal, that's actually what I was recommending to  
 _prevent_.
 
 I see your point that having all the models directories of all modules  
 in the include path leads to namespace collision in a modular  
 framework like Joomla. I was under the impression you were making a  
 modular application where the code is grouped by functionality rather  
 than a third-party-capable modular framework.
 


hmmm yes your right this is a really good question, lets say i have a module
called users, if the module images wants to make a list of users, they
won't be able to use the users-model because the bootstrap did not load
it, the bootstrap only loaded the images-model ..? but do i really need a
simple users list in my images-controller ... if i do a query i would
probably use left join, for example:

table images:
id
image-path
user-id

table users:
id
name

if i now show the last 5 images that were published, and i want to add the
users name under it, i would make a query SELECT images.path, users.name
FROM images LEFT JOIN users LIMIT 5, so i wouldnt need to access the users
model

phew was hard to explain this with my bad english ;)
-- 
View this message in context: 
http://www.nabble.com/multiple-models-with-same-name-%28m1-models-pages.php-and-m2-models-pages.php%29-tp19607614p19630559.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Pagination + Smarty

2008-09-23 Thread Matthew Ratzloff
Hi José,

http://framework.zend.com/wiki/pages/viewpage.action?pageId=43560focusedCommentId=6324388#comment-6324388

This might be a good addition to the documentation...

Hope that helped,

-Matt

On Tue, Sep 23, 2008 at 9:10 AM, José de Menezes Soares Neto 
[EMAIL PROTECTED] wrote:

 Hi friends,

 I have no idea how to work with both... Zend_Pagination + Smarty

 Any suggestions?

 Regards,

 José



Re: [fw-general] Zend_Layout

2008-09-23 Thread dele454

Hi Mark,

Thanks for the response. Am not confusing views with layouts. The files in
the structure i specfied are just for illustrative purposes.  I have both my
partials and layouts in different folders - just for less confusion for me.
What i decided to do is to move the layout folder to the root and have all
my layouts for both the CMS and Main site in there. so the structure now
becomes:

- webapp
  -- public_html
--- images
--- bla blah

  ---controllers
  ---views
   ---layouts
---layout.phtml
---layout-browse.phtml
  ---partials

  --modules
   ---admin
   ---controllers
   ---views
  


MarkDNA wrote:
 
 I have something similar to that, but I'm not using the layout paths - I'm
 just dropping the layout into the views/scripts/ dir for each module, and
 for the main site (login screen in my case). You might just have to give
 it a try to see what your results are. You can set layouts in the
 controllers with:
 
 $this-_helper-layout-setLayout('foobaz');
 
 Looking at the names for your layouts, I hope you aren't confusing layouts
 with views. A view for your browse action and one for your edit action can
 use the same layout if you want. In a layout file you use
 $this-layout()-content to display the view for your controller action.
 So if you have an editAction() in you controller, $this-layout()-content
 will display edit.phtml where you place it in the layout. You use the
 views to include headers, navs, and footers mostly. Sorry if I'm off-base
 and you know this already!
 
 -Mark
 
 
 dele454 wrote:
 
 Hi Mark,
 
 Thanks for the response. So what you are saying is that as long as i keep
 the  startMvc() empty  and specify my module paths, ZF will always look
 for the layout.phtml files within the specified module directories?
 
 In my scenario, i just have one module:admin module - where the cms apps
 reside. But the main site just resides on the app root folder. For better
 understanding here is my folder structure:
 
 - webapp
   -- public_html
 --- images
 --- bla blah
 
   ---controllers
   ---views
---layouts
 ---layout.phtml
 ---layout-browse.phtml
   --modules
---admin
---controllers
---views
---layouts
 ---layout.phtml
 ---layout-edit-mode.phtml
   
 Like i said before i simply want to keep the layout of my CMS separate
 from  that of the main site. The main site isnt a module. So what would
 my startMvc() look like then with my folder structure in mind.
 
 In my bootstrap i have something like this at the moment:
 
 Zend_Layout::startMvc(array( 
  'layoutPath' = $config-paths-data
 . '/module/admin/views/layouts');
 
 I need to include that path layout path for the main site.
 
 Thanks
 
 
 


-
dee
-- 
View this message in context: 
http://www.nabble.com/Zend_Layout-tp19608818p19631518.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Form_Element_File value

2008-09-23 Thread Thomas Weidner

There is only one problem:
The file element in Http does not define a value.
And the component will be changed to reflect this. A related issue was 
already attached.


But I have already told you this in your issue.

Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com

- Original Message - 
From: gerardroche [EMAIL PROTECTED]

To: fw-general@lists.zend.com
Sent: Tuesday, September 09, 2008 10:05 AM
Subject: [fw-general] Zend_Form_Element_File value




If a file is submitted via Zend_Form_Element_File it returns the files
location,

i.e. $location = $form-foo-getValue();

but if no file is submitted it returns the the destination directory, i.e.
if by default, the system temp directory.

Is this expected behavior? Wouldn't it be better to have it return null if
no file was uploaded?

--
View this message in context: 
http://www.nabble.com/Zend_Form_Element_File-value-tp19386018p19386018.html
Sent from the Zend Framework mailing list archive at Nabble.com. 




Re: [fw-general] Zend_Layout

2008-09-23 Thread dele454

I think i would have been more reusable for me if one could specifya series
of layout paths for possible use. and on setlayout() the ZF would look into
all the paths to render the specified layout choice.

I just implemented a naming convention for the layout files so i can
differentiate between those for the CMS from those for the main site.

Thanks Graham


Graham Anderson wrote:
 
 On Monday 22 September 2008 18:34:06 Ralph Schindler wrote:
 For a bit more background: why do you have site wide layouts inside
 specific modules?  Shouldn't modules share the same global layout?

 -ralph
 
 Layouts need not be specifically site wide, they may be applicable to a 
 certain list of modules. Module's should not be restricted to the same
 batch 
 of global layouts for reasons of re-use and re-distribution.
 
 $layout-setLayout() caters for this to an extent; but like other aspects
 of 
 the MVC I would like to see more options for being module aware.
 
 Graham
 
 


-
dee
-- 
View this message in context: 
http://www.nabble.com/Zend_Layout-tp19608818p19631566.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Form_Element_File value

2008-09-23 Thread Matthew Weier O'Phinney
-- gerardroche [EMAIL PROTECTED] wrote
(on Monday, 08 September 2008, 10:17 PM -0700):
 If a file is submitted via Zend_Form_Element_File it returns the files
 location,
 
 i.e. $location = $form-foo-getValue();
 
 but if no file is submitted it returns the the destination directory, i.e.
 if by default, the system temp directory.
 
 Is this expected behavior? Wouldn't it be better to have it return null if
 no file was uploaded?

Please look at current trunk, where I believe this behavior has changed.

-- 
Matthew Weier O'Phinney
Software Architect   | [EMAIL PROTECTED]
Zend Framework   | http://framework.zend.com/


Re: [fw-general] Zend_Form

2008-09-23 Thread Matthew Weier O'Phinney
-- [EMAIL PROTECTED] [EMAIL PROTECTED] wrote
(on Saturday, 13 September 2008, 01:38 AM -0400):
 Can someone explain to me why the first snippet of code works while the  
 second one throws an error? Other form elements work fine when written  
 in the same way as the second snippet of code. Why not  
 Zend_Form_Element_Captcha?
 Thanks.

 DOES WORK
 $captcha = new Zend_Form_Element_Captcha('captcha', array(
   'captcha' = array(
   'captcha' = 'Figlet',
   ),
 ));
 $captcha-setLabel('Captcha:');

 DOES NOT WORK
 $captcha = new Zend_Form_Element_Captcha('captcha');
 $captcha-setLabel('Captcha:')
   -setCaptcha(new Zend_Captcha_Figlet());

In order to ensure that all operations within the captcha element work,
we need a captcha adapter to be passed to the element on instantiation.
This can be done, as you have in the first example, by passing data to
use in the factory, or by passing a concrete instance.

We are considering refactoring to allow setting the captcha late -- but
there are a number of places that would be affected, and it would
introduce complexity that we're not sure is warranted.

-- 
Matthew Weier O'Phinney
Software Architect   | [EMAIL PROTECTED]
Zend Framework   | http://framework.zend.com/


Re: [fw-general] DojoComboBox and large data set.

2008-09-23 Thread Matthew Weier O'Phinney
-- Paweł Chuchmała [EMAIL PROTECTED] wrote
(on Tuesday, 23 September 2008, 01:18 PM +0200):
 How is the best method to use DojoComboBox with large data set? For
 example i want to do suggest for users.
 I have about 10 records. I want for example query server with 3
 first letters filled in combobox.
 How can i do that? It is possible to use DojoData with this method?

Yes. Use a QueryReadStore for the combo box data store, and do
pagination on the server side to return smaller data sets. You can see
an example of this with grids in my pastebin application, which uses the
technique with a grid -- but it's the same basic idea:

http://weierophinney.net/matthew/uploads/pastebin-1.0.0.tar.gz

-- 
Matthew Weier O'Phinney
Software Architect   | [EMAIL PROTECTED]
Zend Framework   | http://framework.zend.com/


Re: [fw-general] Zend Form: span tag in fieldset legend

2008-09-23 Thread Matthew Weier O'Phinney
-- Bernd Matzner [EMAIL PROTECTED] wrote
(on Wednesday, 10 September 2008, 04:26 AM -0700):
 Hi, I want to add wrap the legend text of a subform in a span tag. Text when
 using setLegend(''.$value.'') - the HTML is converted to html entities. Even
 tried creating a custom fieldset decorator, but I keep getting printed out in
 plaintext... Any hints greatly appreciated. Bernd

You may want to look at setting the escape option on the fieldset
decorator to a boolean false.

-- 
Matthew Weier O'Phinney
Software Architect   | [EMAIL PROTECTED]
Zend Framework   | http://framework.zend.com/


Re: [fw-general] Router little problem

2008-09-23 Thread Matthew Weier O'Phinney
-- José de Menezes Soares Neto [EMAIL PROTECTED] wrote
(on Tuesday, 23 September 2008, 10:41 AM -0300):
 Hi,
 
 I get a Config.ini with a router:
 
 routes.tag.route = tag/:word/:page
 routes.tag.defaults.module = default
 routes.tag.defaults.controller = index
 routes.tag.defaults.action  = tag
 
 And it is working like that:
 
 http://localhost/app/tag/word/123
 
 But I would like to have this working too:
 
 http://localhost/app/tag/word
 
 But it is not working, how to make it work?

You need a default value for the page variable:

route.tag.defaults.page = 1

-- 
Matthew Weier O'Phinney
Software Architect   | [EMAIL PROTECTED]
Zend Framework   | http://framework.zend.com/


Re: [fw-general] Router little problem

2008-09-23 Thread Ben Scholzen 'DASPRiD'
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

routes.tag.route = tag/:word/:page
routes.tag.defaults.module = default
routes.tag.defaults.controller = index
routes.tag.defaults.action = tag
routes.tag.defaults.page   = 1

José de Menezes Soares Neto schrieb:
 Hi,
 
 I get a Config.ini with a router:
 
 routes.tag.route = tag/:word/:page
 routes.tag.defaults.module = default
 routes.tag.defaults.controller = index
 routes.tag.defaults.action  = tag
 
 And it is working like that:
 
 http://localhost/app/tag/word/123
 
 But I would like to have this working too:
 
 http://localhost/app/tag/word
 
 But it is not working, how to make it work?
 
 Regards,
 
 José
 

- --
...
:  ___   _   ___ ___ ___ _ ___:
: |   \ /_\ / __| _ \ _ (_)   \   :
: | |) / _ \\__ \  _/   / | |) |  :
: |___/_/:\_\___/_| |_|_\_|___/   :
:::
: Web: http://www.dasprids.de :
: E-mail : [EMAIL PROTECTED]   :
: Jabber : [EMAIL PROTECTED] :
: ICQ: 105677955  :
:::
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFI2Rtx0HfT5Ws789ARAtnIAKCUOybSeAUcVLWmpVPGSJlWPbejbQCg0W/S
u/WaPDLn3OpoDW6nbhx3NDI=
=jF3U
-END PGP SIGNATURE-


Re: [fw-general] multiple models with same name (m1/models/pages.php and m2/models/pages.php)

2008-09-23 Thread Bill Karwin



Edward Haber wrote:
 
 First of all, had I known you were a Zend engineer...
 

Former Zend engineer.  I worked on the project 9/2006-10/2007, mostly on
Zend_Db and PM stuff.  I'm no longer contributing the project, but I like
answering questions on mailing lists.


Edward Haber wrote:
 
 It comes down to (for me) if the class in question is used in the exact
 same context in  
 multiple modules. If it's three unrelated types of pages that has one  
 solution. If it's three versions of basically the same class and  
 methods then it seems anti-DRY to me.
 

Yes, I agree.  If the split seems to create an anti-DRY solution, it's a
clue that you're actually splitting functionality that belongs in one
module.

In a modular application, there should be no need to duplicate code in an
anti-DRY manner, because each module has completely separate functionality. 
I mean, you might have two classes that are both called Pages by
coincidence, but they do completely different things, probably even
accessing different database tables.  This is not a violation of DRY, but
also it's pretty unlikely that both classes would be needed during a given
request.


Edward Haber wrote:
 
 In my case, It was a lot easier to manage the front-end (controllers  
 and views) within modules but just use a single model directory. 
 

I didn't say you had to have a single model directory.  I would create a
model _hierarchy_.  You can organize your model classes in multiple
subdirectories under that hierarchy, and then reference the top of the
hierarchy in your include_path.  Of course your class names should conform
to PEAR naming.

app/models/Admin/User.php:
  class Admin_User extends Zend_Controller_Action_Abstract { ... }

app/models/FrontEnd/User.php:
  class FrontEnd_User extends Zend_Controller_Action_Abstract { ... }

Actually it's likely that one class is an extension of the other, to add
functionality.  That way if you fix a bug in the base, it applies to the
other.

app/models/Admin/User.php:
  class Admin_User extends FrontEnd_User { ... }


Edward Haber wrote:
 
 But why not, if it suits the grouping of your code, and  
 makes the urls work, take advantage of built-in features of the  
 framework?
 

Because it's simpler to group code using directories, for example.  You
don't need the complexity of modules in most circumstances.  Only when you
have the possibility of class name conflicts because you're dropping in
multiple modules potentially from different sources.  In those cases, it's
very unlikely that you would need to support inter-module class references.


Edward Haber wrote:
 
 Thanks for your notes. I hope to learn a lot from the members of the list.
 

Thanks to you too.  These are just my views, the way I would approach a
problem.  By the way, though I tend to write in an unequivocal style, I do
realize there's more than one way to do it, and I support you organizing
your project the way it makes sense to you.  It's just not the way I'd do
it.  :-)

Regards,
Bill Karwin
-- 
View this message in context: 
http://www.nabble.com/multiple-models-with-same-name-%28m1-models-pages.php-and-m2-models-pages.php%29-tp19607614p19632344.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] [off-topic] meaning of a contemporaneous word

2008-09-23 Thread José de Menezes Soares Neto
People, what blogoscoped means? What that owner wants to pass?


Re: [fw-general] How to use sections with Zend_Config and PHP Arrays

2008-09-23 Thread Ralf Eggert
Hi,

has anyone any idea about this (see forwarded message)? Thanks for
clarification.

Best regards,

Ralf

Ralf Eggert schrieb am 19.09.2008 23:01:
 Hi,
 
 I know that both Zend_Config_Ini and Zend_Config_Xml support sections
 and extending sections for config data definitions. In the manual I read
 that Zend_Config also supports sections when used with PHP arrays. If
 this is right, how can this be achieved?
 
 If not, I think this passage of the manual is a little unclear:
 
 The Zend_Config family of classes enables configuration data to be 
 organized into sections. Zend_Config adapter objects may be loaded 
 with a single specified section, multiple specified sections, or 
 all sections (if none are specified).
 
 http://framework.zend.com/manual/en/zend.config.theory_of_operation.html
 
 Thanks for clarification.
 
 Best regards,
 
 Ralf
 



[fw-general] Zend_Tool for modular applications

2008-09-23 Thread Rustin

Hello,

I've searched about Zend_Tool for modular applications but haven't found
anything yet. There's some reference with the supported commands or
something like this? The standard structure don't contain module
directories...


Best regards.
-- 
View this message in context: 
http://www.nabble.com/Zend_Tool-for-modular-applications-tp19633531p19633531.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Imageoutput problems with Zend_Cache

2008-09-23 Thread Fabien MARTY
Hi,

You made an error. With Output frontend, you have to use the start()
method, not the load() one

If you comment your header() call, you will see error messages.

Following code works perfectly for me :

?php

require_once 'Zend/Cache.php';
require_once 'Zend/Http/Client.php';

$frontend = 'Output';
$frontendOpts = array(
   'caching' = true,
   'lifetime' = 3600
);

$backend  = 'File';
$backendOpts = array(
   'cache_dir' = '/tmp/'
);

$cache = Zend_Cache::factory($frontend, $backend, $frontendOpts, $backendOpts);

header('Content-Type: image/gif');

$url='http://static.php.net/www.php.net/images/php.gif';
$cacheID='picture';

if (!($cache-start($cacheID))) {

   $http = new Zend_Http_Client($url);
   $http-setHeaders('User-Agent', $_SERVER['HTTP_USER_AGENT']);
   $http-setHeaders('Referer','http://' .
$http-getUri()-getHost() . '/');
   $res = $http-request('GET');
   $img = $res-getRawBody();

   imagegif(imagecreatefromstring($img));

   $cache-end();
}

?

Regards

2008/9/20 Kai Meder [EMAIL PROTECTED]:
 Hello,

 I am trying to create an Image-proxy which caches image-urls on disk and
 outputs these jpegs to the browser.
 The following code wont work. On the first Cache Miss, the image is properly
 shown. On each following Cache Hit, the image is not displayed (invalid
 data). The cache file on disk contains the proper jpeg-image, at least
 irfanview recognizes it being jpeg...
 Any hint? Thanks!
 Kai

 $frontend = 'Output';
 $frontendOpts = array(
'caching' = true,
'cache_id_prefix' = 'ImageServiceProxy_',
'lifetime' = NULL,
'ignore_user_abort' = true
 );

 $backend  = 'File';
 $backendOpts = array(
'cache_dir' = CACHEDIR,
'read_control' = false,
'hashed_directory_level' = 3,
 );

 $cache = Zend_Cache::factory($frontend, $backend, $frontendOpts,
 $backendOpts);

 header('Content-Type: image/jpeg');

 if (!$cache-load($cacheID)) {

$http = new Zend_Http_Client($url);
$http-setHeaders('User-Agent', $_SERVER['HTTP_USER_AGENT']);
$http-setHeaders('Referer','http://' .
 $http-getUri()-getHost() . '/');
$res = $http-request('GET');
$img = $res-getRawBody();

imagejpeg(imagecreatefromstring($img));

$cache-end();
 }
 exit;




-- 
Fabien MARTY
[EMAIL PROTECTED]


Re: [fw-general] How to use sections with Zend_Config and PHP Arrays

2008-09-23 Thread Matthew Ratzloff
I don't know, but the easiest way to find out is create an example INI, then
output the array that is generated from it for the format.
-Matt

On Fri, Sep 19, 2008 at 2:01 PM, Ralf Eggert [EMAIL PROTECTED] wrote:

 Hi,

 I know that both Zend_Config_Ini and Zend_Config_Xml support sections
 and extending sections for config data definitions. In the manual I read
 that Zend_Config also supports sections when used with PHP arrays. If
 this is right, how can this be achieved?

 If not, I think this passage of the manual is a little unclear:

  The Zend_Config family of classes enables configuration data to be
  organized into sections. Zend_Config adapter objects may be loaded
  with a single specified section, multiple specified sections, or
  all sections (if none are specified).

 http://framework.zend.com/manual/en/zend.config.theory_of_operation.html

 Thanks for clarification.

 Best regards,

 Ralf



Re: [fw-general] Use Zend without MVC

2008-09-23 Thread Alexander Johannesen
On 23/09/2008, Alomon [EMAIL PROTECTED] wrote:
 Actually, after the day of today, I am really asking myself about the
 advantages of using Zend without MVC instead of Smarty for such a little
 website (only 5 pages with 4 little tables in a database)... You have an
 answer to this, don't you?

Well, tell us what the appication is all about, what it does and so
forth. The answer should follow from the spec, I reckon.


Alex
-- 
---
 Project Wrangler, SOA, Information Alchemist, UX, RESTafarian, Topic Maps
-- http://shelter.nu/blog/ 


[fw-general] Modelling application structure

2008-09-23 Thread hukkas

Hi there

I'm in the process of designing a security model for my Zend Framework
applications.  Essentially what I plan to do, is have a master config on a
module-controller-action basis, which defines whether login is required,
possibly groups who are granted access, and what parameters are allowed
(Allow Known Good) - maybe even define how the parameters should be filtered
(sanitized) here, as well.  I'll then integrate this into a custom request /
router to enforce these rules.

I'll probably have something like an XML file which mirrors the application
structure; that is, a hierarchical list of modules, controllers and actions.

Now - it would help enormously if I can analyse an exiting project, and
generate this list to create / validate such a configuration file.

I've had a look at Zend Tool, and it *seems* that it might be able to help
me do this; can anyone point me in the right direction?  Otherwise I'll have
to do something like; check every directory under 'application' for a
controllers directory, parse each controller directory and then extact a
list of xxxAction function declarations.  Ideally, I'd also like to extract
all calls to GetParam() etc...  But surely there's a cleaner way of doing
this?

Thanks in advance


-- 
View this message in context: 
http://www.nabble.com/Modelling-application-structure-tp19634235p19634235.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] a different Zend_Form Directory ?

2008-09-23 Thread Guillaume BABIK
Hi all,

 

I have many Zend_Form in different applications.

 

Many of theses forms are identical.

 

So, how can I set a different form directory for an application?

 

I do the same thing with my helpers (method: addHelperPath) but I don't find
the method with Zend_Form

 

Many thanks,

Guillaume BABIK

INTERNIM

45, rue Aristide Briand

92300 LEVALLOIS

Tel/Fax : 01.40.87.11.20

Mobile : 06.80.21.90.29

 BLOCKED::http://www.internim.com/ http://www.internim.com

 



Re: [fw-general] Zend_Tool for modular applications

2008-09-23 Thread Ralph Schindler
Hey Rustin,

Still working out the details with the modular structure inside the
generated projects.  TO solve that, we need to understand how modules
interact with bootstrap files (Both issues have proposals).

In the mean time, you should check out the zf-tool yahoo group.

http://tech.groups.yahoo.com/group/zf-tool/

Thanks!
ralph


On 9/23/08 1:03 PM, Rustin [EMAIL PROTECTED] wrote:

 
 Hello,
 
 I've searched about Zend_Tool for modular applications but haven't found
 anything yet. There's some reference with the supported commands or
 something like this? The standard structure don't contain module
 directories...
 
 
 Best regards.

-- 
Ralph Schindler
Software Engineer | [EMAIL PROTECTED]
Zend Framework| http://framework.zend.com/




Re: [fw-general] Skip action

2008-09-23 Thread Giuliano Riccio

He cannot let it die()... if he is using a layout the rest of the page will
not be sent.
Maybe you should make an empty action where you disable the view and forward
to it when the cached action is available.
If you are not using a layout then you should probably cache the action with
a 'Page' frontend.

Giuliano

Bart McLeod wrote:
 
 you probably forward to the same action then. I suggest you just let it 
 die() since you echo out the desired output anyway.
 
 Bart
 
 Tagger schreef:
 With _forward(); enters in a loop infinity.



 Tom Graham-2 wrote:
   
 Could it be you need to _forward(); then return; ?

 Tom

 On 23 Sep 2008, at 10:54, Tagger wrote:

 
 Die is not posibble, stops the execution. I need to redirec to  
 another action
 in the same controller, for example with forward, but something  
 wrong with
 it.


 DASPRiD wrote:
   
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Well what to do instead? You could simply just die;

 Tagger schrieb:
 
 In  preDispath of Zend_Controller_Action verify the Cache. If the  
 Cache
 is
 available i don´t want to launch the action, is possible to do  
 this?.


 DASPRiD wrote:
 Usually it's 42...

 Honestly: to which question?

 Tagger schrieb:
   
 does anybody know the answer?
 
 
 - --
 ...
 :  ___   _   ___ ___ ___ _ ___:
 : |   \ /_\ / __| _ \ _ (_)   \   :
 : | |) / _ \\__ \  _/   / | |) |  :
 : |___/_/:\_\___/_| |_|_\_|___/   :
 :::
 : Web: http://www.dasprids.de :
 : E-mail : [EMAIL PROTECTED]   :
 : Jabber : [EMAIL PROTECTED] :
 : ICQ: 105677955  :
 :::
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.6 (GNU/Linux)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iD8DBQFI2LQn0HfT5Ws789ARAm/fAJ9P2lniMDU87gVbdNiD0graH2wk+gCg1IPm
 WXcGhNFK0d8j3lVUUrth9Kc=
 =P+e8
 -END PGP SIGNATURE-


 
 -- 
 View this message in context:
 http://www.nabble.com/Skip-action-tp19612879p19624536.html
 Sent from the Zend Framework mailing list archive at Nabble.com.


   

 

   
 
 

-- 
View this message in context: 
http://www.nabble.com/Skip-action-tp19612879p19636683.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Use Zend without MVC

2008-09-23 Thread Matthew Ratzloff
Unless I'm writing a simple console application, I always use an MVC
pattern, regardless of the language.  Like object-oriented design, it seems
to be the right solution in virtually every scenario I've encountered,
except perhaps in cases where additional performance is necessary.
As for Smarty, I occasionally have to interact with it as part of my job and
I am not terribly fond of it.

-Matt

On Tue, Sep 23, 2008 at 11:32 AM, Alomon [EMAIL PROTECTED] wrote:



 Matthew Ratzloff wrote:
 
  You should listen to your boss.  :-)
 
  -Matt
 

 Actually, after the day of today, I am really asking myself about the
 advantages of using Zend without MVC instead of Smarty for such a little
 website (only 5 pages with 4 little tables in a database)... You have an
 answer to this, don't you?

 Thanks ;)
 --
 View this message in context:
 http://www.nabble.com/Use-Zend-without-MVC-tp19607442p19634038.html
 Sent from the Zend Framework mailing list archive at Nabble.com.




Re: [fw-general] Use Zend without MVC

2008-09-23 Thread Alomon


Alexander Johannesen wrote:
 
 Well, tell us what the appication is all about, what it does and so
 forth. The answer should follow from the spec, I reckon.
 
 
 Alex
 

OK, let's go ;)

The homepage contains only one form. One of the table of the DB is a 'user'
table, with 3 users + 2 admin accounts. Each user can access to *one* page
; one of the admin to all 3 pages + another one ; and the other admin to
this 'another page'.

So we have 5 pages and 5 accounts.

Each of the 3 user pages contains a form in order to send some data to the
database, which are finally used to generate draws, displayed on the
'another page'.

And that's all. The website is used only where I work (soit is used mainly
by 5 people over the world :thinking:) and is not made to be dispatched
anywhere else.

I think you have all details to answer me; if not, do not hesitate to ask me
what is missing ;)
-- 
View this message in context: 
http://www.nabble.com/Use-Zend-without-MVC-tp19607442p19637138.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Db_Select: nested joins

2008-09-23 Thread Bill Karwin


You don't need a parenthesized join in your example.  Do this instead:

$select = $db-select()-from(array('outer'='firstTable'));
$select-joinLeft(array('t2'='someOtherTable'), 't2.foo = `outer`.foo');
$select-join(array('t1'='someTable'), 't1.id = t2.id');

Generates the following valid SQL:

SELECT `outer`.*, `t2`.*, `t1`.* 
FROM `firstTable` AS `outer`
 LEFT JOIN `someOtherTable` AS `t2` ON t2.foo = `outer`.foo
 INNER JOIN `someTable` AS `t1` ON t1.id = t2.id

This works like the parenthesized join you showed, because t1.id = t2.id is
not true where t2.id is NULL.

Using parenthesized join expressions is not in the intended usage of
Zend_Db_Select.  Another option might be to use a derived table in a full
subquery:

$subselect = $db-select()-from(array('t1'='someTable'))
  -join(array('t2'='someOtherTable'), 't1.id = t2.id', array());
$select = $db-select()-from(array('outer'='firstTable'))
  -joinLeft(array('t3'=new Zend_Db_Expr(({$subselect}))), 't3.foo =
outer.foo');

Generates the following SQL:

SELECT `outer`.*, `t3`.* FROM `firstTable` AS `outer`
 LEFT JOIN (SELECT `t1`.* FROM `someTable` AS `t1`
 INNER JOIN `someOtherTable` AS `t2` ON t1.id = t2.id) AS `t3` ON t3.foo =
outer.foo

Note I had to suppress columns from t2, or else the derived table would have
duplicate columns.

Regards,
Bill Karwin
-- 
View this message in context: 
http://www.nabble.com/Zend_Db_Select%3A-nested-joins-tp19636627p19637378.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Is the Dojo Checkbox code correct ?

2008-09-23 Thread Apsy
No, i've reported it on irc, but i don't know if i'm doing something 
wrong or not...
And the bug in the tracker ( 
http://framework.zend.com/issues/browse/ZF-4274 ) is different from my 
issue i think.
This issue is when you create your element with the addElement method 
of the form, you'll have the unchecked value for the checked value 
in the html


My issue is on the 'setCheckedValue' and 'setUncheckedValue' methods. It 
puts 0 for the 2 HTML values...
I think the issue is surely linked, but not the same (the result HTML is 
differenet).


Matthew Weier O'Phinney a écrit :

-- Apsy [EMAIL PROTECTED] wrote
(on Tuesday, 23 September 2008, 10:55 PM +0200):
  
I would like to know if for you my code is correct, because is so,  
there's a bug in the Dojo Checkbox Component :p



Didn't you report this on the tracker already? If not you, somebody else
has...

  

$cgu_accept = new Zend_Dojo_Form_Element_CheckBox('cgu_accept');
$cgu_accept-setDijitParam('invalidMessage', 'You must validate the cgu');
$cgu_accept-setCheckedValue('checked');
$cgu_accept-setUncheckedValue('unchecked');
$cgu_accept-setLabel('blablabla')
   -addValidator(new  
Zend_Validate_Identical($cgu_accept-getCheckedValue()))

   -setIgnore(true);

produces HTML code :

dd
   input type=hidden value=0 name=cgu_accept/
   div wairole=presentation class=dijitReset dijitInline  
dijitCheckBox role=presentation widgetid=cgu_accept

   input
   type=checkbox

dojoattachevent=onmouseover:_onMouse,onmouseout:_onMouse,onclick:_onClick

   dojoattachpoint=focusNode
   class=dijitReset dijitCheckBoxInput
   name=cgu_accept
   id=cgu_accept
   value=0
   tabindex=0
   style=-moz-user-select: none;/
   /div
/dd

As you can see here, i've defined the checked' and 'unchecked value  
but i have a 0 in the input value for the both...


Any Help ?




  




Re: [fw-general] Zend_Db_Select: nested joins

2008-09-23 Thread Jaka Jančar

On 23. Sep 2008, at 23:26, Bill Karwin wrote:

SELECT `outer`.*, `t2`.*, `t1`.*
FROM `firstTable` AS `outer`
LEFT JOIN `someOtherTable` AS `t2` ON t2.foo = `outer`.foo
INNER JOIN `someTable` AS `t1` ON t1.id = t2.id

This works like the parenthesized join you showed, because t1.id =  
t2.id is

not true where t2.id is NULL.


Sorry, but these are not at all equivalent.

Simplest example: if both someTable is empty, my query will return all  
rows from the outer table and NULLs for the other two, while yours  
will return nothing.


Generally, to the best of my knowledge, LEFT JOINs with INNER JOINed  
right tables and RIGHT JOINs with INNER JOINed left tables can't  
simply be rewritten without nested joins.


 Jaka


Re: [fw-general] Zend_Db_Select: nested joins

2008-09-23 Thread Jaka Jančar

Sorry to reply twice, I forgot something :)

On 23. Sep 2008, at 23:26, Bill Karwin wrote:

Another option might be to use a derived table in a full subquery


AFAIK, MySQL, which is what I use, will always materialize subqueries  
in FROM, which is not something I want.



The hackish solution I've used currently is:

My_Db_Select:
--
protected function _getQuotedTable($tableName, $correlationName =  
null)

{
$correlationName = is_object($tableName)  @$tableName- 
noAutoCorrelationName ? null : $correlationName;

return parent::_getQuotedTable($tableName, $correlationName);
}
--

And then I set $expr-noAutoCorrelation=true on the Zend_Db_Expr when  
passing it to join();



Jaka


Re: [fw-general] Is the Dojo Checkbox code correct ?

2008-09-23 Thread Apsy
The CheckBox Component is unusable in this state, i think i'll have a 
look into the zend dojo tests to know how to make it work.


Matthew Weier O'Phinney a écrit :

-- Apsy [EMAIL PROTECTED] wrote
(on Tuesday, 23 September 2008, 10:55 PM +0200):
  
I would like to know if for you my code is correct, because is so,  
there's a bug in the Dojo Checkbox Component :p



Didn't you report this on the tracker already? If not you, somebody else
has...

  

$cgu_accept = new Zend_Dojo_Form_Element_CheckBox('cgu_accept');
$cgu_accept-setDijitParam('invalidMessage', 'You must validate the cgu');
$cgu_accept-setCheckedValue('checked');
$cgu_accept-setUncheckedValue('unchecked');
$cgu_accept-setLabel('blablabla')
   -addValidator(new  
Zend_Validate_Identical($cgu_accept-getCheckedValue()))

   -setIgnore(true);

produces HTML code :

dd
   input type=hidden value=0 name=cgu_accept/
   div wairole=presentation class=dijitReset dijitInline  
dijitCheckBox role=presentation widgetid=cgu_accept

   input
   type=checkbox

dojoattachevent=onmouseover:_onMouse,onmouseout:_onMouse,onclick:_onClick

   dojoattachpoint=focusNode
   class=dijitReset dijitCheckBoxInput
   name=cgu_accept
   id=cgu_accept
   value=0
   tabindex=0
   style=-moz-user-select: none;/
   /div
/dd

As you can see here, i've defined the checked' and 'unchecked value  
but i have a 0 in the input value for the both...


Any Help ?




  




Re: [fw-general] Zend_Db_Select: nested joins

2008-09-23 Thread Bill Karwin



Jaka Jančar wrote:
 
 Sorry, but these are not at all equivalent.
 
 Simplest example: if both someTable is empty, my query will return all  
 rows from the outer table and NULLs for the other two, while yours  
 will return nothing.
 

D'ohh!  You're right.  Nothing to see here, move along.  :-)

Regards,
Bill Karwin
-- 
View this message in context: 
http://www.nabble.com/Zend_Db_Select%3A-nested-joins-tp19636627p19638152.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] dojoType not being added to div

2008-09-23 Thread jmolins

Hi,
Using the tabContainer or borderContainer in programmatic way, I do not get
the dojoType values in the divs when the page is generated.
I have seen other posts about rendering the dojo at the end. I think that is
what I do.
I add the containers in the corresponding view script.
And then on the layout template I just render the dojo and in the body the
layout content.
The divs for the containers are generated but they are not filled with the
dojoTypes.
And also I get the correct dojo.require for the containers added in the
final rendering. 
Is there any other thing that I should consider?
Thanks a lot
Jose


In bootstrap.php

Zend_Dojo::enableView($view);
$view-dojo()-setLocalPath('/js/dojo/dojo.js')
   -disable();


In sponsor.phtml

$this-dojo()-enable();
$this-tabContainer()-captureStart('layout1', array('design' =
'headline'));
echo $this-contentPane('tab1', '', array('title' = 'tab1', 'class' =
'tab'));
echo $this-contentPane('tab2', '', array('title' = 'tab2', 'class' =
'tab'));
echo $this-contentPane('tab3', '', array('title' = 'tab3', 'class' =
'tab'));
echo $this-tabContainer()-captureEnd('layout1');


And then in layout.phtml

head
...
?php $this-dojo() ?
...
/head
...
body class=tundra
..
?php echo $this-layout()-content ?
..
-- 
View this message in context: 
http://www.nabble.com/dojoType-not-being-added-to-div-tp19639532p19639532.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Zend_File_Transfer questions

2008-09-23 Thread Juan Felipe Alvarez Saldarriaga
Hey!

I'm trying to upload some files using the Zend_File_Transfer, so I have this 
form:

form id=test name=test action=/test/save method=post 
enctype=multipart/form-data
?= $this-formFile(
single_file
);
?
?= $this-formFile(
multiple_files[]
);
?
/form

So, multiple_files[] is an array of files, I create every input file using js, 
like gmail's attachments, so, in my action how to add validators just for 
multiple_files[] ? and validators just fomr single_file ? I mean I need to 
validate that single_file must be a gif image, and multiple_files must be just 
jpg images , how to set validators for a specific input file ?

Thx for any help.


Re: [fw-general] How to use sections with Zend_Config and PHP Arrays

2008-09-23 Thread Ralf Eggert
Hi Matthew,

thanks, well the question aimed at the constructor of Zend_Config (for
PHP arrays) and Zend_Config_Ini or Zend_Config_Xml. Both Ini and Xml
classes take a parameter $section to just take this section out of the
configuration file.

But I did some thinking and I should have done that before. When I use a
PHP array and I only want to create a Zend_Config object for my whatever
section, I simply do:

$config = new Zend_Config($configArray['whatever']);

I don't know if this is the best practice way but at least it solves the
issue and answers my question. I probably should do this thinking stuff
more often. Didn't hurt at all and even was fun ;-)

Thanks and best regards,

Ralf


Re: [fw-general] DojoComboBox and large data set.

2008-09-23 Thread Paweł Chuchmała
On Tue, Sep 23, 2008 at 17:28, Matthew Weier O'Phinney [EMAIL PROTECTED] 
wrote:
 Yes. Use a QueryReadStore for the combo box data store, and do
 pagination on the server side to return smaller data sets. You can see
 an example of this with grids in my pastebin application, which uses the
 technique with a grid -- but it's the same basic idea:

http://weierophinney.net/matthew/uploads/pastebin-1.0.0.tar.gz

QueryReadStore sounds good.

But with your application I have a little problem:

[24-Sep-2008 07:48:27] PHP Fatal error: Uncaught exception
'Zend_Dojo_View_Exception' with message 'Lock already exists for id
layout' in 
D:\www\lib\ZendFramework-1.6.1\library\Zend\Dojo\View\Helper\DijitContainer.php:61
Stack trace:
#0 D:\www\pastebin-1.0.0\application\layouts\scripts\_layout.phtml(1):
Zend_Dojo_View_Helper_DijitContainer-captureStart('layout', Array)
#1 D:\www\lib\ZendFramework-1.6.1\library\Zend\View.php(107):
include('D:\www\pastebin...')
#2 D:\www\lib\ZendFramework-1.6.1\library\Zend\View\Abstract.php(787):
Zend_View-_run('D:\www\pastebin...')
#3 D:\www\pastebin-1.0.0\application\layouts\scripts\layout.phtml(2):
Zend_View_Abstract-render('_layout.phtml')
#4 D:\www\lib\ZendFramework-1.6.1\library\Zend\View.php(107):
include('D:\www\pastebin...')
#5 D:\www\lib\ZendFramework-1.6.1\library\Zend\View\Abstract.php(787):
Zend_View-_run('D:\www\pastebin...')
#6 D:\www\lib\ZendFramework-1.6.1\library\Zend\Layout.php(785):
Zend_View_Abstract-render('layout.phtml')
#7 D:\www\lib\ZendFramework-1.6.1\library\Zend\Layout\Controller\P in
D:\www\lib\ZendFramework-1.6.1\library\Zend\Dojo\View\Helper\DijitContainer.php
on line 61

regards,

-- 
Paweł Chuchmała
pawel.chuchmala at gmail dot com