[fw-general] Checkbox and Dojo_foRM validation, please help

2008-09-16 Thread vladimirn

Hello all,
is anyone here able to help about form validation please?
After pressing submit button expected behaviour is stopping form submission
if checkbox is not checked.

I have a bunch of stuffs in my form.
So far, checkbox validation wont work. 
$agreements-addElement ( 'CheckBox', 'ages', array ('required' = true,
'label' = 'I\'m Over 18 years old') )

Submit button:
$footer-addElement ( 'SubmitButton', 'submit', array ('label' =
'Submit!','style'='clear:both' ) );

view script:
? $this-dojo()-javascriptCaptureStart() ?
function validateForm() {
var form = dijit.byId(signup);
if (!form.validate()) {
alert(Invalid form);
return false;
}
return true;
}
? $this-dojo()-javascriptCaptureEnd() ?
? $this-dojo()-onLoadCaptureStart() ?
function () {
dojo.connect(dijit.byId(signup), onSubmit, validateForm);
}
? $this-dojo()-onLoadCaptureEnd() ?
div class=signupForm

?= $this-form ?
/div
-- 
View this message in context: 
http://www.nabble.com/Checkbox-and-Dojo_foRM-validation%2C-please-help-tp19512338p19512338.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Calling another controller from within a controller

2008-09-16 Thread monk.e.boy

http://teethgrinder.co.uk/perm.php?a=Zend-Framework-Menus-Navigation

does that help?

monk.e.boy




rcastley wrote:
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Calling-another-controller-from-within-a-controller-tp19508590p19512321.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Re: Passing an array from PHP to Javascript

2008-09-16 Thread Colin Guthrie

dele454 wrote:

WHat exactly am i doing wrong??? currently my URL reads as
Code:

http://mainevent.com/admin/galleries/delete-pics/pid/delete[]/type/event/id/313

I think the main hassle is from posting the form getting all the checkboxes
in array delete[] to the js and then to the controller that then initiates
the delete by reading the parameter from the URL, iterating over the array
variable etc.

Pls help!!



As a general bit of advice, I would never do any destructive with GET 
requests (e.g. manipulating the URL and redirecting via window.location).


If you need to do it fully in javascript, look at some kind of AJAX call 
that can do POSTs (my preference is jquery, but dojo may be preferred 
with ZF...)



But, really this is over engineered and you should look at a different 
approach.. here is my hint:


1. Just use a normal form. Have all the checkboxes and the Delete 
Selected button on the same form.

2. POST said form (do not use GET).
3. If you want to give the user a chance to backout with a javascript 
confirmation, define an onsubmit handler for the form. Depending on what 
this handler returns, the browser will either process or cancel the form 
submission. So you in it's most basic form:
form method=post action=myurl onsubmit=return confirm('Are you 
sure?');


That should be better!

Oh, and just for future reference if you want to pass arrays or generic 
classes to javascript from php, you want to look into JSON and 
specifically the json_encode() function (although there may be a ZF 
wrapped up version - not sure!)


Col

--

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]



Re: [fw-general] Infrastructural problems? Issuetracker, apidocs etc.

2008-09-16 Thread mbneto
Hi Patrick,

I suppose (hope) things will be back to normal as soon as ZendCon ends.  The
ZF/Zend guys were probably focused on finishing the necessary
talks/tools/goals etc.

On Tue, Sep 16, 2008 at 5:35 AM, Patrick Schulz [EMAIL PROTECTED] wrote:

 Hi,

 I'm not sure if there are any infrastructural problems at Zend, but I
 noticed that there are some things not going well.
 I.e. there are no apidocs downloadable right now. Until the last 1.5
 release they were available.
 The other thing is, that I cannot report any issues. I have two accounts
 (one for my company one for myself) and I cannot create new issues with both
 of them.
 I created one issue with my business account, but some days later the
 permission to report new issues was dropped.
 Yes, I was logged in and I also tried to get it working by cleaning the
 cache and cookies - nothing helped.
 If I'm logged in, I also experience problems when I want to browse the
 wiki. I always get Not permitted errors/messages until I log out and
 browse it anonymously.

 I sent two or more emails to the Jira administrators and reported the
 problems, but I neither got any response nor the stuff is working.

 Sorry for that, but this is not the best way to manage a community...

 We at our company are also Zend partners but none of our requests are heard
 anyway.
 It is all a bit annoying...
 ...especially for ZF itself.





 -- Patrick Schulz



Re: [fw-general] Passing an array from PHP to Javascript

2008-09-16 Thread dele454

Thanks for the tips. But i CAN'T apply any of them now. The design has been
approved and i need to i implement things as they are. 'Over engineered' - I
dont care. As long my code works as expected. I simply want to pass my PHP
array into my javascript function. - very simple code i dont see why i need
to implement a library just for that.



Colin Guthrie-6 wrote:
 
 dele454 wrote:
 WHat exactly am i doing wrong??? currently my URL reads as
 Code:
 
 http://mainevent.com/admin/galleries/delete-pics/pid/delete[]/type/event/id/313
 
 I think the main hassle is from posting the form getting all the
 checkboxes
 in array delete[] to the js and then to the controller that then
 initiates
 the delete by reading the parameter from the URL, iterating over the
 array
 variable etc.
 
 Pls help!!
 
 
 As a general bit of advice, I would never do any destructive with GET 
 requests (e.g. manipulating the URL and redirecting via window.location).
 
 If you need to do it fully in javascript, look at some kind of AJAX call 
 that can do POSTs (my preference is jquery, but dojo may be preferred 
 with ZF...)
 
 
 But, really this is over engineered and you should look at a different 
 approach.. here is my hint:
 
 1. Just use a normal form. Have all the checkboxes and the Delete 
 Selected button on the same form.
 2. POST said form (do not use GET).
 3. If you want to give the user a chance to backout with a javascript 
 confirmation, define an onsubmit handler for the form. Depending on what 
 this handler returns, the browser will either process or cancel the form 
 submission. So you in it's most basic form:
 form method=post action=myurl onsubmit=return confirm('Are you 
 sure?');
 
 That should be better!
 
 Oh, and just for future reference if you want to pass arrays or generic 
 classes to javascript from php, you want to look into JSON and 
 specifically the json_encode() function (although there may be a ZF 
 wrapped up version - not sure!)
 
 Col
 
 -- 
 
 Colin Guthrie
 gmane(at)colin.guthr.ie
 http://colin.guthr.ie/
 
 Day Job:
Tribalogic Limited [http://www.tribalogic.net/]
 Open Source:
Mandriva Linux Contributor [http://www.mandriva.com/]
PulseAudio Hacker [http://www.pulseaudio.org/]
Trac Hacker [http://trac.edgewall.org/]
 
 
 


-
dee
-- 
View this message in context: 
http://www.nabble.com/Passing-an-array-from-PHP-to-Javascript-tp19511848p19514015.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] zend dojo text area- how that work?

2008-09-16 Thread Themodem

Howdy, it appears to be a bug with Firefox 3 and the dd tag

http://dojotoolkit.org/forum/dijit-dijit-0-9/dijit-support/dijit-form-textarea-firefox3-enter-key-does-not-work
http://dojotoolkit.org/forum/dijit-dijit-0-9/dijit-support/dijit-form-textarea-firefox3-enter-key-does-not-work
 


vladimirn wrote:
 
 I need just a simple text area where you can type :
 First row in text area (i would like to press Enter here and to type in
 next row)
 Next row here[Enter]
 And so on..
 
 Well when i press Enter key within Zend Dojo textarea field, nothing
 happens, and you can type forever, no way to make a new row pressing
 Enter.. I cant find the way to have a simple textarea field.
 
 How to make this?
 
 Thanks,
 V
 

-- 
View this message in context: 
http://www.nabble.com/zend-dojo-text-area--how-that-work--tp19498776p19514458.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Pdf::load($pdf), Exception - Unsupported PDF Version

2008-09-16 Thread Kevin McArthur
That comment is a code todo. It means that new php code will have to be 
added to Zend_Pdf to support.


Currently, in order to get your PDF to work with Zend_Pdf, you'll have 
to save it to PDF version 1.6.


Kevin

Jonathan wrote:

This is the code that is in Zend/Pdf/Parser.php

if ($pdfVersion  0.9 || $pdfVersion = 1.61) {
/**
* @todo
* To support PDF versions 1.5 (Acrobat 6) and PDF version 1.7 (Acrobat 
7)
* Stream compression filter must be implemented (for compressed object 
streams).

* Cross reference streams must be implemented
*/
throw new Zend_Pdf_Exception(sprintf('Unsupported PDF version. Zend_Pdf 
supports PDF 1.0-1.4. Current version - \'%f\'', $pdfVersion));

}


I have a form that is version 1.7, created with Acrobat 8.  Can anyone 
explain how to implement the Stream Compression Filter that the doc says 
to above?




Thank you kindly for any assistance.





  


--

Kevin McArthur

StormTide Digital Studios Inc.
Author of the recently published book, Pro PHP
http://www.stormtide.ca



smime.p7s
Description: S/MIME Cryptographic Signature


Re: [fw-general] Passing an array from PHP to Javascript

2008-09-16 Thread Matthew Ratzloff

 Thanks for the tips. But i CAN'T apply any of them now. The design has
 been approved


There are several things wrong with this statement...

In any event, if you want to share data between PHP and JavaScript, look at
Zend_Json and JSON in general.

-Matt


On Tue, Sep 16, 2008 at 8:16 AM, dele454 [EMAIL PROTECTED] wrote:


 Thanks for the tips. But i CAN'T apply any of them now. The design has been
 approved and i need to i implement things as they are. 'Over engineered' -
 I
 dont care. As long my code works as expected. I simply want to pass my PHP
 array into my javascript function. - very simple code i dont see why i need
 to implement a library just for that.



 Colin Guthrie-6 wrote:
 
  dele454 wrote:
  WHat exactly am i doing wrong??? currently my URL reads as
  Code:
 
 
 http://mainevent.com/admin/galleries/delete-pics/pid/delete[]/type/event/id/313
 
  I think the main hassle is from posting the form getting all the
  checkboxes
  in array delete[] to the js and then to the controller that then
  initiates
  the delete by reading the parameter from the URL, iterating over the
  array
  variable etc.
 
  Pls help!!
 
 
  As a general bit of advice, I would never do any destructive with GET
  requests (e.g. manipulating the URL and redirecting via window.location).
 
  If you need to do it fully in javascript, look at some kind of AJAX call
  that can do POSTs (my preference is jquery, but dojo may be preferred
  with ZF...)
 
 
  But, really this is over engineered and you should look at a different
  approach.. here is my hint:
 
  1. Just use a normal form. Have all the checkboxes and the Delete
  Selected button on the same form.
  2. POST said form (do not use GET).
  3. If you want to give the user a chance to backout with a javascript
  confirmation, define an onsubmit handler for the form. Depending on what
  this handler returns, the browser will either process or cancel the form
  submission. So you in it's most basic form:
  form method=post action=myurl onsubmit=return confirm('Are you
  sure?');
 
  That should be better!
 
  Oh, and just for future reference if you want to pass arrays or generic
  classes to javascript from php, you want to look into JSON and
  specifically the json_encode() function (although there may be a ZF
  wrapped up version - not sure!)
 
  Col
 
  --
 
  Colin Guthrie
  gmane(at)colin.guthr.ie
  http://colin.guthr.ie/
 
  Day Job:
 Tribalogic Limited [http://www.tribalogic.net/]
  Open Source:
 Mandriva Linux Contributor [http://www.mandriva.com/]
 PulseAudio Hacker [http://www.pulseaudio.org/]
 Trac Hacker [http://trac.edgewall.org/]
 
 
 


 -
 dee
 --
 View this message in context:
 http://www.nabble.com/Passing-an-array-from-PHP-to-Javascript-tp19511848p19514015.html
 Sent from the Zend Framework mailing list archive at Nabble.com.




[fw-general] Re: Passing an array from PHP to Javascript

2008-09-16 Thread Colin Guthrie

dele454 wrote:

Thanks for the tips. But i CAN'T apply any of them now. The design has been
approved and i need to i implement things as they are. 'Over engineered' - I
dont care. As long my code works as expected. I simply want to pass my PHP
array into my javascript function. - very simple code i dont see why i need
to implement a library just for that.


I wasn't suggesting you change the visual design, or do you mean a 
different kind of design?


Do you allow the user to select some pictures and not others? If so your 
delete multiple button does not work as you pass the *gallery* id, not 
the list of selected picture ids.


If you do not allow the user to select some and not others, then there 
is no point in producing the individual checkboxes next to the pictures, 
just use a Delete gallery button and be done with it.


I've explained how you would implement a form that could happily accept 
an array of selected picture ids so there is little more help I can give 
you are not going to follow that route.


I have explained also how to pass a PHP array into JS, but as I said 
before, this is almost certainly not what you want to do to achieve this 
kind of interface.


What you actually have is a list of selected items in javascript and you 
want to pass that back to PHP as an array! it's precisely the other way 
around. This is easily possible and by naming the checkboxes as you have 
you are very much on the right route, but you should allow the form to 
be submitted naturally, do not try to force it via a window.location = 
'blah' hack. If you insist on doing this then you will have to cycle 
through the elements of the form with the specific name and append 
delete[]=ID multiple times to your URL (or /delete/ID multiple times 
if you've wrapped up the URL parsing in a ZF route appropriately).


But trust me. Use a form. Use POST, submit it normally with an onsubmit 
confirmation function. (you could also submit the form by calling the 
submit() method on the form itself, but this will prevent your interface 
working on browsers which have JS disabled - my recommended way would 
work just find without javascript, albeit sans a warning).


Col


Col

--

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]



[fw-general] Re: [fw-announce] Zend Framework 1.6.1 is now available!

2008-09-16 Thread Matthew Ratzloff
A number of minor Zend_Paginator fixes have been made in this release, so
it's recommended that users of that component upgrade.
ZF-3804 Don't assume a fetch mode in the DbSelect adapter
ZF-3822 Paginator Control Example error
ZF-4037 Default scrolling style not honored
ZF-4151 Iterator with zero items throws OutOfBoundsException
ZF-4153 The PaginationControl view helper should check for paginator, if
possible
ZF-4154 Change a code example in the documentation to better reflect
recommended usage
ZF-4193 Filter / Validate The Page Number on setCurrentPageNumber()
ZF-4207 Zend_Paginator should only force adapter results to implement
Traversable

There are also a handful of Zend_Paginator_Adapter_DbSelect bugs that will
most likely be fixed for 1.6.2, along with support for modules in the
PaginationControl view helper.

-Matt

On Mon, Sep 15, 2008 at 10:00 PM, Wil Sinclair [EMAIL PROTECTED] wrote:

 Hi all,

 It is my pleasure to announce the release of Zend Framework 1.6.1! You
 can download this new mini release from the ZF download site:

 http://framework.zend.com/download/current/

 A list of all issues resolved in this release can be found at:

 http://framework.zend.com/issues/secure/IssueNavigator.jspa?requestId=10
 852

 At the risk of sounding like a broken record, we'd like to thank our
 generous Zend Framework community for the time and effort they have
 invested to make this release possible. Enjoy!

 ,Wil



Re: [fw-general] Why Dojo of All???

2008-09-16 Thread Matthew Weier O'Phinney
-- valugi [EMAIL PROTECTED] wrote
(on Tuesday, 16 September 2008, 02:41 AM -0700):
 Since now I was also using jQuery and decided to give a try to Dojo since
 it's part of the ZF. 
 Doing simple things like an ajax request and fill some data into a table are
 incredible complex in Dojo. 

I beg to differ here. dojo.data via Zend_Dojo_Data is two lines of code,
and the view script to handle it is approximately 10 lines of primarily
HTML using dojox.Grid.

 Also the vocabulary changes pretty much. 

Which vocabulary? jquery vs Dojo? Of course -- they're different
frameworks. There will always be a learning curve when you switch
frameworks.

 I guess with all this complexity come a lot of other goodies... or
 maybe I am wrong.  But for now is experimenting time for me.

Dojo can be as simple or as complex as you want. However, there were
many reasons we chose to use Dojo; for more information, please see 

http://framework.zend.com/announcements/2008-09-03-dojo

for more details. Basically, when it comes down to all the points of
integration we wanted to be able to offer, Dojo was the only toolkit
that offerred benefits in all areas. The ability to have rapid modular
development, yet still have scalable approaches for production
environments, the breadth of offering in Dojo, the development process
and community surrounding Dojo, the support and driving of web
standards, etc. were simply unparalleled elsewhere.

The fact of the matter is this is a done deal. But we're also saying
that we realize that choice in JS toolkits is similar to choice in PHP
frameworks -- and we are encouraging contributors to provide additional
layers via the Extras repository. A jQuery component is already well
underway, and checked in to the Extras incubator.

Let's stop these threads, please.

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


RE: [fw-general] Why Dojo of All???

2008-09-16 Thread S. Alexandre M. Lemaire
When we last used Dojo, it would load things 'on demand'; meaning that if
you were to request a certain dojo.* package during usage, it would
dynamically load the package into the mix.  The result was a LARGE number of
IO calls solely for loading, this caused great startup delays, and very a
high amount of overhead during routine instantiation (during the
initialization process).

Does Dojo still behave this way?  Does it offer any kind of 'roll your own'
like Ext does with JSBuilder so that you can foresee inclusions and reduce
during-operation IO overhead?

Not that I would ever convert back to Dojo from ExtJS (which by all means, I
am a zealous fanatic of), but I am curious to read about Dojo's progress.

How is CometD shaping up?


-Original Message-
From: Matthew Weier O'Phinney [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 16, 2008 12:10 PM
To: fw-general@lists.zend.com
Subject: Re: [fw-general] Why Dojo of All???

-- valugi [EMAIL PROTECTED] wrote
(on Tuesday, 16 September 2008, 02:41 AM -0700):
 Since now I was also using jQuery and decided to give a try to Dojo since
 it's part of the ZF. 
 Doing simple things like an ajax request and fill some data into a table
are
 incredible complex in Dojo. 

I beg to differ here. dojo.data via Zend_Dojo_Data is two lines of code,
and the view script to handle it is approximately 10 lines of primarily
HTML using dojox.Grid.

 Also the vocabulary changes pretty much. 

Which vocabulary? jquery vs Dojo? Of course -- they're different
frameworks. There will always be a learning curve when you switch
frameworks.

 I guess with all this complexity come a lot of other goodies... or
 maybe I am wrong.  But for now is experimenting time for me.

Dojo can be as simple or as complex as you want. However, there were
many reasons we chose to use Dojo; for more information, please see 

http://framework.zend.com/announcements/2008-09-03-dojo

for more details. Basically, when it comes down to all the points of
integration we wanted to be able to offer, Dojo was the only toolkit
that offerred benefits in all areas. The ability to have rapid modular
development, yet still have scalable approaches for production
environments, the breadth of offering in Dojo, the development process
and community surrounding Dojo, the support and driving of web
standards, etc. were simply unparalleled elsewhere.

The fact of the matter is this is a done deal. But we're also saying
that we realize that choice in JS toolkits is similar to choice in PHP
frameworks -- and we are encouraging contributors to provide additional
layers via the Extras repository. A jQuery component is already well
underway, and checked in to the Extras incubator.

Let's stop these threads, please.

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



[fw-general] Question about Quickstart tutorial

2008-09-16 Thread springgrass

Hi,

I have a couple of issues following the steps in the tutorial due to the
fact that I am using Plesk 8.4 and have limited permission.

I followed steps in the tutorial and it was great up until the database
portion.  Is there a way for me to create the database table without go thru
the command lines?  I am using Plesk 8.4 and do not have access to the
shell.

I'm new with Zend Framework and new with PHP as well. Any help is greatly
appreciated.

Thanks,
springgrass
 
-- 
View this message in context: 
http://www.nabble.com/Question-about-Quickstart-tutorial-tp19286689p19516412.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Question about Quickstart tutorial

2008-09-16 Thread Ralph Schindler
While I have not tried it, you should be able to load the sql files located
in the scripts directory into mysql via the phpmyadmin in the plesk control
panel.

You will also have to alter the config script to be able to connect to this
database, and it would look something like this:

database.adapter = PDO_MYSQL
database.params.dbname = your_db_name
database.params.username = your_db_username
database.params.password = your_db_password

I will add some notes on this somewhere within the application by the end of
the week.

-ralph


On 9/16/08 10:37 AM, springgrass [EMAIL PROTECTED] wrote:

 
 Hi,
 
 I have a couple of issues following the steps in the tutorial due to the
 fact that I am using Plesk 8.4 and have limited permission.
 
 I followed steps in the tutorial and it was great up until the database
 portion.  Is there a way for me to create the database table without go thru
 the command lines?  I am using Plesk 8.4 and do not have access to the
 shell.
 
 I'm new with Zend Framework and new with PHP as well. Any help is greatly
 appreciated.
 
 Thanks,
 springgrass
  

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




Re: [fw-general] Why Dojo of All???

2008-09-16 Thread Tobias Gies
Hey Alexandre,

2008/9/16 S. Alexandre M. Lemaire [EMAIL PROTECTED]

 [...snip...]

 Does Dojo still behave this way?  Does it offer any kind of 'roll your own'
 like Ext does with JSBuilder so that you can foresee inclusions and reduce
 during-operation IO overhead?

There is a tool in dojo that allows you to create custom builds Those are
single javascript files that contain all the dojo modules you use, plus
their internal requirements. a few 100k of minifed JavaScript are the
result, making dojo lightning-fast.

Best regards,
Tobias


Re: [fw-general] Why Dojo of All???

2008-09-16 Thread mothmenace

Just wanted to add another vote for jQuery, I started JS frameworks with
Prototype, found jQuery a little hard to get my head around at first but now
it's clearly the leading js-f. Not sure exactly how jQuery would be
integrated with zf, it's more a case of writing some specific jQuery plugins
I think, like giving js access to request / baseUrl.
-- 
View this message in context: 
http://www.nabble.com/Why-Dojo-of-Alltp19504841p19519311.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Passing an array from PHP to Javascript

2008-09-16 Thread dele454

hi Colin,

My apologies if i came out as been naive and ungrateful. I was just under a
lot of presssure here and just wanted a quick fix - my apologies sincerely.
After taking a break off the work load and having my mind cleared i feel so
stupid for such a reply from me.

So i retract my initial comment. Thanks for taking the time to elaborate on
the possible way of going about this. I will take some time to implement
something - based on your suggestions and let you know the outcome.

Thanks once again and my apologies



Colin Guthrie-6 wrote:
 
 dele454 wrote:
 Thanks for the tips. But i CAN'T apply any of them now. The design has
 been
 approved and i need to i implement things as they are. 'Over engineered'
 - I
 dont care. As long my code works as expected. I simply want to pass my
 PHP
 array into my javascript function. - very simple code i dont see why i
 need
 to implement a library just for that.
 
 I wasn't suggesting you change the visual design, or do you mean a 
 different kind of design?
 
 Do you allow the user to select some pictures and not others? If so your 
 delete multiple button does not work as you pass the *gallery* id, not 
 the list of selected picture ids.
 
 If you do not allow the user to select some and not others, then there 
 is no point in producing the individual checkboxes next to the pictures, 
 just use a Delete gallery button and be done with it.
 
 I've explained how you would implement a form that could happily accept 
 an array of selected picture ids so there is little more help I can give 
 you are not going to follow that route.
 
 I have explained also how to pass a PHP array into JS, but as I said 
 before, this is almost certainly not what you want to do to achieve this 
 kind of interface.
 
 What you actually have is a list of selected items in javascript and you 
 want to pass that back to PHP as an array! it's precisely the other way 
 around. This is easily possible and by naming the checkboxes as you have 
 you are very much on the right route, but you should allow the form to 
 be submitted naturally, do not try to force it via a window.location = 
 'blah' hack. If you insist on doing this then you will have to cycle 
 through the elements of the form with the specific name and append 
 delete[]=ID multiple times to your URL (or /delete/ID multiple times 
 if you've wrapped up the URL parsing in a ZF route appropriately).
 
 But trust me. Use a form. Use POST, submit it normally with an onsubmit 
 confirmation function. (you could also submit the form by calling the 
 submit() method on the form itself, but this will prevent your interface 
 working on browsers which have JS disabled - my recommended way would 
 work just find without javascript, albeit sans a warning).
 
 Col
 
 
 Col
 
 -- 
 
 Colin Guthrie
 gmane(at)colin.guthr.ie
 http://colin.guthr.ie/
 
 Day Job:
Tribalogic Limited [http://www.tribalogic.net/]
 Open Source:
Mandriva Linux Contributor [http://www.mandriva.com/]
PulseAudio Hacker [http://www.pulseaudio.org/]
Trac Hacker [http://trac.edgewall.org/]
 
 
 


-
dee
-- 
View this message in context: 
http://www.nabble.com/Passing-an-array-from-PHP-to-Javascript-tp19511848p19520162.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Passing an array from PHP to Javascript

2008-09-16 Thread dele454

I see exactly what you have been saying - again my mind was too saturated to
see clearly! :(

Anyway, just to reply one some of the questions you asked.

The intention is that the user can either delete the picture indivually
using the delete button next to each picture or select all and delete all. -
but at the same time the user could deselect some pics - the intention is
such that the user can delete a lot of pics at once.

The reason my URL looks like am using a GET method is because the delete
button is not a button but a link. the full view of my design is this just
to explain a bit more:

http://www.nabble.com/file/p19520252/untitled-2.gif 

I see what am doing wrong now - just to butress on your suggestions, i need
to make that 'delete' button an actual button not a link - so the form can
actually get submitted naturally via the POST method. From my controller
retrieve the delete[] and iterate for deletion.

I see clearly now. I think i got confused along the line while coding. 



Colin Guthrie-6 wrote:
 
 dele454 wrote:
 Thanks for the tips. But i CAN'T apply any of them now. The design has
 been
 approved and i need to i implement things as they are. 'Over engineered'
 - I
 dont care. As long my code works as expected. I simply want to pass my
 PHP
 array into my javascript function. - very simple code i dont see why i
 need
 to implement a library just for that.
 
 I wasn't suggesting you change the visual design, or do you mean a 
 different kind of design?
 
 Do you allow the user to select some pictures and not others? If so your 
 delete multiple button does not work as you pass the *gallery* id, not 
 the list of selected picture ids.
 
 If you do not allow the user to select some and not others, then there 
 is no point in producing the individual checkboxes next to the pictures, 
 just use a Delete gallery button and be done with it.
 
 I've explained how you would implement a form that could happily accept 
 an array of selected picture ids so there is little more help I can give 
 you are not going to follow that route.
 
 I have explained also how to pass a PHP array into JS, but as I said 
 before, this is almost certainly not what you want to do to achieve this 
 kind of interface.
 
 What you actually have is a list of selected items in javascript and you 
 want to pass that back to PHP as an array! it's precisely the other way 
 around. This is easily possible and by naming the checkboxes as you have 
 you are very much on the right route, but you should allow the form to 
 be submitted naturally, do not try to force it via a window.location = 
 'blah' hack. If you insist on doing this then you will have to cycle 
 through the elements of the form with the specific name and append 
 delete[]=ID multiple times to your URL (or /delete/ID multiple times 
 if you've wrapped up the URL parsing in a ZF route appropriately).
 
 But trust me. Use a form. Use POST, submit it normally with an onsubmit 
 confirmation function. (you could also submit the form by calling the 
 submit() method on the form itself, but this will prevent your interface 
 working on browsers which have JS disabled - my recommended way would 
 work just find without javascript, albeit sans a warning).
 
 Col
 
 
 Col
 
 -- 
 
 Colin Guthrie
 gmane(at)colin.guthr.ie
 http://colin.guthr.ie/
 
 Day Job:
Tribalogic Limited [http://www.tribalogic.net/]
 Open Source:
Mandriva Linux Contributor [http://www.mandriva.com/]
PulseAudio Hacker [http://www.pulseaudio.org/]
Trac Hacker [http://trac.edgewall.org/]
 
 
 


-
dee
-- 
View this message in context: 
http://www.nabble.com/Passing-an-array-from-PHP-to-Javascript-tp19511848p19520252.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Why Dojo of All???

2008-09-16 Thread Bart McLeod

Hello Benjamin,

Thanks a lot for pointing this out - and Matthew, sorry for not stopping 
the thread. It's just freaking hard to keep up with all the development 
going on :-) .


I will take a look at it for sure. However, the links you provide are dead:

www.beberlei.de/jquery/demo/
www.beberlei.de/jquery/demo/formdemo.php

that is, right now they are offline. I would like to take a look at your 
demo's before anything else!


Regards,

Bart McLeod

Benjamin Eberlei schreef:

Hello Bart,

i have already put together two proposal concerning jQuery support, one for a 
generic helper that takes care of loading jQuery from CDN or local path and 
takes care of a document ready (on load) execution stack.


http://framework.zend.com/wiki/display/ZFPROP/ZendX_JQuery_View_Helper_JQuery+-+Benjamin+Eberlei

then a jQuery UI proposal, which allows integration of some of the jQuery UI 
widgets as part of view helpers and form elements into your ZF app.


http://framework.zend.com/wiki/display/ZFPROP/ZendX_JQuery+UI+Widgets+Extension+-+Benjamin+Eberlei

personally i think, jQuery is frikking easy, so its probably good to just 
write the code yourself, but some of the helpers i put together really take 
some work from you and help you to build an application using jQuery fast. 
they also group all the jQuery code together so that you don't have little js 
snippets layign around your views everywhere.


you might want to have a look at:
www.beberlei.de/jquery/demo/
www.beberlei.de/jquery/demo/formdemo.php

which shows two examples of how the jQuery view helpers work.

any feedback is appreciated, although the components have reached final status 
and are finished and checked into zend framework extras incubator already:


http://framework.zend.com/svn/framework/extras/incubator/library/ZendX/

the documentation is also finished, if you want to get some hints at how it 
all works.


greetings,
Benjamin

On Tuesday 16 September 2008 11:33:57 Bart McLeod wrote:
  

I have used jquery with Zend_Form, before Dojo was integrated and I
still use jquery. I would welcome integration of jquery too. However, I
must admit that I did not even try Dojo, because I found the interface
intimidating, the way it is described in the online reference guide. I
will try it though and then decide if I still want to use jquery. I do
not like the idea of having two different Ajax libraries in use in one
system and I do like the idea of out-of-the-box Ajax functionality. If I
read through jquery documentation, I understand it immediately. I think
it's idea of simplicity matches that of ZF, which cannot be said of the
list of functions available in Dojo. But there's no use crying over
spilled water, if any. Wil is right of course, if we like jquery that
much, let's put together a decent proposal.

Bart McLeod

Wil Sinclair schreef:


There are lots of reasons that Zend chose to partner with the Dojo
Foundation. But we realize that some developers prefer other JavaScript
toolkits, and that's why we'd never force our users to work with any
particular toolkit. Zend has chosen Dojo to contribute out-of-the-box
AJAX functionality to Zend, while at the same time making it clear that
we will welcome contributions from the community to support other
toolkits. In fact, there are a couple of proposals for JQuery
integration that are pretty far along now:

http://framework.zend.com/wiki/display/ZFPROP/ZendX_JQuery_View_Helper_J
Query+-+Benjamin+Eberlei
http://framework.zend.com/wiki/display/ZFPROP/ZendX_JQuery+UI+Widgets+Ex
tension+-+Benjamin+Eberlei

If there is a JS Toolkit that you prefer to Dojo, I wholeheartedly and
sincerely recommend that you look in to creating your own proposal.

,Wil

  

-Original Message-
From: zuhair.naqvi [mailto:[EMAIL PROTECTED]
Sent: Monday, September 15, 2008 8:46 PM
To: fw-general@lists.zend.com
Subject: [fw-general] Why Dojo of All???


Why dojo of all? Whats wrong with an MIT license? To be frank Dojo is
the
shittest JS framework i've ever worked with. Both its code and design
philosophy are no match for competition like jQuery or Prototype.

I've moved from Symfony to ZF and prefer ZF even over ROR and was very
excited to hear about a client library integration but I am shocked to
see
Dojo instead of others which are miles ahead of it.

Please explain...
--
View this message in context:


http://www.nabble.com/Why-Dojo-of-All

  

tp19504841p19504841.html
Sent from the Zend Framework mailing list archive at Nabble.com.





  


[fw-general] programmers fyi

2008-09-16 Thread Terre Porter
Hey all,

Just thought I'd pass on this observation though not related directly to the
framework but this happens to be the only list I'm on anymore.

Anyways, I've been monitoring a large influx of code injection attempts by
inserting php code in the server variables, HTTP_USER_AGENT mostly. These
sometimes are included with a URL Injection attempt but not always. 

Also for those out there who have some CF or ASP (I think) there are a lot
of the following being appended to page requests. Trimmed but should make
the point...
[EMAIL PROTECTED](4000);[EMAIL PROTECTED](0x4445...%20AS%20CHAR(4000));EXEC(@S
); 

Just as a reminder to everyone to write more secure code. 

Here are some numbers from a smaller site I'm logging, avg 2500 visitors a
day. 

Date..#

01/Sep/2008   86
02/Sep/2008  119
03/Sep/2008   56
04/Sep/2008   31
05/Sep/2008   93
06/Sep/2008   84
07/Sep/2008  129
08/Sep/2008  141
09/Sep/2008   47
10/Sep/2008  136
11/Sep/2008   96
12/Sep/2008  140
13/Sep/2008  200
14/Sep/2008  250
15/Sep/2008  130
16/Sep/2008   36

URL Injection attempts from 1773 unique ip addresses. (that's a few infected
machines)

These numbers don't count all the HTTP_USER_AGENT code injection attempts as
those are getting blocked but .htaccess currently.

Just wanted to let people know the script-kiddy scanners are out playing.

Terre



Re: [fw-general] Slimming library to classes used on project

2008-09-16 Thread Giuliano Riccio

I think you should try inclued.
It makes a  http://talks.php.net/show/drupal08/14 graph  of the include
hierarchy so it can help you somehow.
You can find it here:  http://pecl.php.net/package/inclued
http://pecl.php.net/package/inclued 
I never used it personally so I cannot help you more than this :p

Giuliano Riccio

mothmenace wrote:
 
 Hello, I was curious if it's possible to deduce what library classes (and
 their dependencies) are actually used by a project?
 
 Ul'ing The entire 16mb of the ZF is pretty slow going at least on my
 connection ... it would be cool to slim it down to the bare essentials.
 
 best!
 

-- 
View this message in context: 
http://www.nabble.com/Slimming-library-to-classes-used-on-project-tp19519380p19522480.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] programmers fyi

2008-09-16 Thread Matthew Ratzloff
OK, I can see how this would be a problem if you logged user agents in the
database, someone sent an SQL injection attempt, and you didn't use prepared
statements or escape those values.  But... uh... how is PHP injection
supposed to do anything?  Is someone eval-ing the user agent or what?  Maybe
I'm missing something.
-Matt

On Tue, Sep 16, 2008 at 2:39 PM, Terre Porter
[EMAIL PROTECTED]wrote:

 Hey all,

 Just thought I'd pass on this observation though not related directly to
 the
 framework but this happens to be the only list I'm on anymore.

 Anyways, I've been monitoring a large influx of code injection attempts by
 inserting php code in the server variables, HTTP_USER_AGENT mostly. These
 sometimes are included with a URL Injection attempt but not always.

 Also for those out there who have some CF or ASP (I think) there are a lot
 of the following being appended to page requests. Trimmed but should make
 the point...
 [EMAIL PROTECTED](4000);[EMAIL PROTECTED]
 =CAST(0x4445...%20AS%20CHAR(4000));EXEC(@S
 );

 Just as a reminder to everyone to write more secure code.

 Here are some numbers from a smaller site I'm logging, avg 2500 visitors a
 day.

 Date..#

 01/Sep/2008   86
 02/Sep/2008  119
 03/Sep/2008   56
 04/Sep/2008   31
 05/Sep/2008   93
 06/Sep/2008   84
 07/Sep/2008  129
 08/Sep/2008  141
 09/Sep/2008   47
 10/Sep/2008  136
 11/Sep/2008   96
 12/Sep/2008  140
 13/Sep/2008  200
 14/Sep/2008  250
 15/Sep/2008  130
 16/Sep/2008   36

 URL Injection attempts from 1773 unique ip addresses. (that's a few
 infected
 machines)

 These numbers don't count all the HTTP_USER_AGENT code injection attempts
 as
 those are getting blocked but .htaccess currently.

 Just wanted to let people know the script-kiddy scanners are out playing.

 Terre




RE: [fw-general] programmers fyi

2008-09-16 Thread Terre Porter
The code was encoded, and after decoding it, all it does is echo a statement
back. 
 
Some searching online, I found a write up on it -
http://hphosts.blogspot.com/2008/09/alas-another-exploit-attempt-rfiphp.htm
l
http://hphosts.blogspot.com/2008/09/alas-another-exploit-attempt-rfiphp.html
- if your interested.
 
As to the why use the HTTP_USER_AGENT field.. Got me. I don't know of any
exploits using it... 
 
A quick search online, I did find a older version of AWStats that had a bug
using the http_referr. Could be related. See
http://labs.idefense.com/intelligence/vulnerabilities/display.php?id=290
http://labs.idefense.com/intelligence/vulnerabilities/display.php?id=290 
 
Btw, you would be surprised at how many hosting places there are where you
can use commands like - 'exec', 'shell_exec', 'system', passthru'. 
 
An URL Injection example:  http://osvdb.org/show/osvdb/37816
http://osvdb.org/show/osvdb/37816  The code this injection exploits is :
require_once($languagePath . 'common.lang.php');
 
If your really curious and want more info, try some searchs for PHP remote
file inclusion or url injection. 
 
Terre

  _  

From: Matthew Ratzloff [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 16, 2008 7:21 PM
To: Terre Porter
Cc: fw-general@lists.zend.com
Subject: Re: [fw-general] programmers fyi


OK, I can see how this would be a problem if you logged user agents in the
database, someone sent an SQL injection attempt, and you didn't use prepared
statements or escape those values.  But... uh... how is PHP injection
supposed to do anything?  Is someone eval-ing the user agent or what?  Maybe
I'm missing something. 

-Matt


On Tue, Sep 16, 2008 at 2:39 PM, Terre Porter [EMAIL PROTECTED]
wrote:


Hey all,

Just thought I'd pass on this observation though not related directly to the
framework but this happens to be the only list I'm on anymore.

Anyways, I've been monitoring a large influx of code injection attempts by
inserting php code in the server variables, HTTP_USER_AGENT mostly. These
sometimes are included with a URL Injection attempt but not always.

Also for those out there who have some CF or ASP (I think) there are a lot
of the following being appended to page requests. Trimmed but should make
the point...
[EMAIL PROTECTED](4000);[EMAIL PROTECTED](0x4445...%20AS%20CHAR(4000));EXEC(@S
);

Just as a reminder to everyone to write more secure code.

Here are some numbers from a smaller site I'm logging, avg 2500 visitors a
day.

Date..#

01/Sep/2008   86
02/Sep/2008  119
03/Sep/2008   56
04/Sep/2008   31
05/Sep/2008   93
06/Sep/2008   84
07/Sep/2008  129
08/Sep/2008  141
09/Sep/2008   47
10/Sep/2008  136
11/Sep/2008   96
12/Sep/2008  140
13/Sep/2008  200
14/Sep/2008  250
15/Sep/2008  130
16/Sep/2008   36

URL Injection attempts from 1773 unique ip addresses. (that's a few infected
machines)

These numbers don't count all the HTTP_USER_AGENT code injection attempts as
those are getting blocked but .htaccess currently.

Just wanted to let people know the script-kiddy scanners are out playing.

Terre






Re: [fw-general] Slimming library to classes used on project

2008-09-16 Thread mothmenace

Heheh, sweet!

I guess you could subtract the found files from the total list of files
found under zf/library/, and that would give you what can be successfully
removed from the lib. I'll give it a try as soon as work is less hectic.

Thanks again Riccio!
-- 
View this message in context: 
http://www.nabble.com/Slimming-library-to-classes-used-on-project-tp19519380p19524194.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Passing an array from PHP to Javascript

2008-09-16 Thread dele454

Hi Colin,

Am not really bent of having the form process on GET. My forms use the POST
method and i am changing it to GET. I simply used the URL path i posted
earlier as a way of idenitfying which of the pics need to be deleted as a
parameter.





Colin Guthrie-6 wrote:
 
 dele454 wrote:
 I see exactly what you have been saying - again my mind was too saturated
 to
 see clearly! :(
 
 Anyway, just to reply one some of the questions you asked.
 
 The intention is that the user can either delete the picture indivually
 using the delete button next to each picture or select all and delete
 all. -
 but at the same time the user could deselect some pics - the intention is
 such that the user can delete a lot of pics at once.
 
 The reason my URL looks like am using a GET method is because the delete
 button is not a button but a link. the full view of my design is this
 just
 to explain a bit more:
 
 http://www.nabble.com/file/p19520252/untitled-2.gif 
 
 I see what am doing wrong now - just to butress on your suggestions, i
 need
 to make that 'delete' button an actual button not a link - so the form
 can
 actually get submitted naturally via the POST method. From my controller
 retrieve the delete[] and iterate for deletion.
 
 I see clearly now. I think i got confused along the line while coding. 
 
 
 That's OK, and don't worry about the initial reply, it happens to us all 
 from time to time.
 
 You could still keep you delete button as a link if you like.
 
 If you have the form, you can just do something like
 
 form id=myform method=get action=/my/url/handler
   input type=checkbox name=delete[] value=123 /
   input type=checkbox name=delete[] value=456 /
   input type=checkbox name=delete[] value=789 /
   etc.
 /form
 
  # Delete 
 Selected 
 
 That should then post your form to the following URL:
 /my/url/handler?delete[]=123delete[]=456
 
 (assuming the first two checkboxes are selected and the third is not).
 
 This value will appear in PHP's $_GET array and in the ZendFrameworks 
 request object as an array containing two numbers, 123 and 456.
 
 This is pretty much exactly what you want I believe and shouldn't 
 require much in the way of reengineering.
 
 All that said, it's still a good general rule not to do anything 
 destructive with GET requests and links, the reason being that some 
 browsers could (for example) preload links (it wouldn't happen here as 
 there is javascript involved).
 
 If, however you use simple GET links to delete the individual images in 
 your gallery, of the form:
 
  /my/url/handler?delete[]=123 Delete this image 
 
 Then it is *very* possible a browser could try and preload that URL when 
 you visit the page (remember that the AVG antivirus tool used to preload 
 all the links on a page!)
 
 This is why anything destructive should only be done via a POST.
 
 Hope this helps.
 
 Col
 
 
 -- 
 
 Colin Guthrie
 gmane(at)colin.guthr.ie
 http://colin.guthr.ie/
 
 Day Job:
Tribalogic Limited [http://www.tribalogic.net/]
 Open Source:
Mandriva Linux Contributor [http://www.mandriva.com/]
PulseAudio Hacker [http://www.pulseaudio.org/]
Trac Hacker [http://trac.edgewall.org/]
 
 
 


-
dee
-- 
View this message in context: 
http://www.nabble.com/Passing-an-array-from-PHP-to-Javascript-tp19511848p19525409.html
Sent from the Zend Framework mailing list archive at Nabble.com.