[fw-general] Connect / Front End for MS Exchange Server

2009-05-05 Thread maxarbos

Is there any interface or component that will allow connection, sync'ing and
accessing a MS Exchange server?

We are looking for something that would allow full fledged email capability,
chat and messaging to then control through the ZF itself.

We built a prett good role listing - actions administrative interface and
want to continue to use this framework but dont want to have to reinvent the
wheel to email, chat, message.

thanks.


-- 
View this message in context: 
http://www.nabble.com/Connect---Front-End-for-MS-Exchange-Server-tp23394922p23394922.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Form Select Element

2009-02-19 Thread maxarbos

I guess this is impossible.


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



Re: [fw-general] Zebd_Form Select Element

2009-01-30 Thread maxarbos

Is it possible to send HTML to a zend form select element so that I can get
this to work?

How would you add blank / disabled rows to a list that is dynamically
generated?






maxarbos wrote:
 
 Hello,
 
 I am trying to create a select box that ends up lookign like this:
 
 option value=val1Top Level/option
 option value= disabled=disabled/option
 option value=val2* First Child/option
 option value=val3* * First Gandchild/option
 option value= disabled=disabled/option
 option value=val4* Second Child/option
 option value=val5* * First Second Gandchild/option
 
 

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



[fw-general] Zebd_Form Select Element

2009-01-29 Thread maxarbos

Hello,

I am trying to create a select box that ends up lookign like this:

option value=val1Top Level/option
option value= disabled=disabled/option
option value=val2* First Child/option
option value=val3* * First Gandchild/option
option value= disabled=disabled/option
option value=val4* Second Child/option
option value=val5* * First Second Gandchild/option

I have a recursive function that reads and can build the select elemtn with
html, but then how would I add it to the send_form that I am building.

If i just have the array ($this-_getTreeStrut()) sent to:

$this-addElement('select', 'parent_structure', array(
 'label' = 'Parent: ',
 'id' = 'parent_structure,
 'isArray' = false,
 'multiOptions' = $this-_getTreeStrut(),  // this get 
the values and
such for options.
) );

I loose all my values. Even if i add the val as the key, how would I add
blank records and disables ones specifically?

The '* ' in the menu labels are being generated by str_repeat iin the
recursive function, which i would like to keep int he final generated
znd_form element.


Is there a way to just send my generated html to an element that can be
included in the Z_form object i am creating?

Thanks.


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



Re: [fw-general] Zend_Form / Zend_File Upload to DB not working

2009-01-28 Thread maxarbos

Thank you. I am now able to get the file to upload, but now stuck as to how
to get it to display within ZF.

When I make the call to the code to show the image, I am just getting the
characters of the source of the image and not the image itself. I used to do
something like this when I was able to call a specific page that sent
headers and such, but with ZF and Ajax calls, it doesnt seem to work the
same.

Is there something I am missing/forgetting to get the image to display?

Thank you.



thomasW wrote:
 
 Look at my blog.
 There is an example for file uploads.
 http://www.thomasweidner.com/flatpress/2008/11/01/file-transfer-hashing-and-other-news/
 
 Greetings
 Thomas Weidner, I18N Team Leader, Zend Framework
 http://www.thomasweidner.com
 
 

-- 
View this message in context: 
http://www.nabble.com/Zend_Form---Zend_File-Upload-to-DB-not-working-tp21693984p21707673.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Zend_Form / Zend_File Upload to DB not working

2009-01-27 Thread maxarbos

Hello,

I am trying to use Zend_Form to upload a file and then store it in a DB.

Something doesnt seem to be working, and would like to know if there is a
simple test using MVC structure to see if a file is being uploaded?

I have tried a few things, but nothing seems to show the actual file info
trying to be uploaded.

Any tutorials would be greatly appreciated.

thank you.

-- 
View this message in context: 
http://www.nabble.com/Zend_Form---Zend_File-Upload-to-DB-not-working-tp21693984p21693984.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Zend_Form isXmlHttpRequest and Validation

2008-12-19 Thread maxarbos

Hello,

I am trying to submit a zend form, have it run through validation, and then
echo back any errors, etc that the validation finds.

The form is being pushed into the content area using isXmlHttpRequest check
and layout disabled for isXmlHttpRequest requests.



class FormsConroller extends CustomController
{
function preDispatch()
(
if($this-_request-isXmlHttpRequest())
{ $this-getHelper('layout')-disableLayout(); }
}


function myform()
{
// Build form
 $infoform = new My_Forms_InforequestForm(array(
'id' = addinfoForm,
'action' = '/main/forms/inforequest'
//  'onsubmit' = return false;
));
$infoform-_rec_array = $this-rec_array;
$infoform-buildForm();


   if ($infoform-isValid($this-_request-getPost()))
   {
  // process submitted info
   }
}

}



My Form looks like this:

class My_Forms_InforequestForm extends Zend_Form{

public $_rec_array;

public function init()
{
$this-addPrefixPath('My_Helper', 'My/Helper/', 'element');
}


public function buildForm()
{
$this-addElement('text', 'purpose', array(
'filters' = array('StringTrim'),
'validators' = array(
'Alpha',
array('StringLength', false, array(2, 50)),
),
'required' = true,
'label' = 'Purpose: ',
'size' = 45,
) );

$this-addElement('submit', 'Submit Request', array(
'required' = false,
'ignore' = true,
'label' = 'Submit Request',
'class' = 'button'
));

$this-setDecorators(array(
'FormElements',
array('HtmlTag', array('tag' = 'dl', 'class' = 'zend_form')),
array('Description', array('placement' = 'prepend')),
'Form'
), 'infoForm');
}
}





Problems are:

1) When i submit, it always makes it into the processing check ( if
($infoform-isValid($this-_request-getPost())) ) so it runs through the
insert/processing code i have in there

2) After submission, the form does not change. No error messages are shown,
BUT i can see them in firebug viewing the returned html.

Any help would be greatly appreciated as I think I may be branching too far
from the built in functionality of this and dont want to get into writing
custom form handling if ZF can do it built in.

Should I be using a regular POST for the form or something else?

Thank you.
-- 
View this message in context: 
http://www.nabble.com/Zend_Form-isXmlHttpRequest-and-Validation-tp21094592p21094592.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Zend Form Select Box, use array values as value=

2008-12-17 Thread maxarbos

Hello,

i am building a zend_form that has a select box in it.

The values for the select box come from an array such as:
array( 'a' = 'First', 'b' = 'Two');

I want the values and the visible label of the select box to be the values
of the array such as:

option value=FirstFirst/option
option value=TwoTwo/option

Is there an option or flag to set wen building the select box element to do
this, or do I need to iterate through the array and create a new one with
the values as the key?

Thanks.


-- 
View this message in context: 
http://www.nabble.com/Zend-Form-Select-Box%2C-use-array-values-as-value%3D%22%22-tp21054568p21054568.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend Form Select Box, use array values as value=

2008-12-17 Thread maxarbos

That worked like a champ!

Thanks.



Brenton Alker-3 wrote:
 
 maxarbos wrote:
 Hello,
 
 i am building a zend_form that has a select box in it.
 
 The values for the select box come from an array such as:
 array( 'a' = 'First', 'b' = 'Two');
 
 I want the values and the visible label of the select box to be the
 values
 of the array such as:
 
 option value=FirstFirst/option
 option value=TwoTwo/option
 
 Is there an option or flag to set wen building the select box element to
 do
 this, or do I need to iterate through the array and create a new one with
 the values as the key?
 
 Thanks.
 
 
 
 
 No need to iterate through the array, you can get the array you want by:
 
 $arr = array('a' = 'First', 'b' = 'Second');
 
 $arr2 = array_combine($arr, $arr);
 
 But no, I don't think there is an option on the select box.
 
 
 
  
 

-- 
View this message in context: 
http://www.nabble.com/Zend-Form-Select-Box%2C-use-array-values-as-value%3D%22%22-tp21054568p21062065.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] How to set name= on form

2008-12-16 Thread maxarbos

Have you gotten any answers on this?
I am having the same issue and cannot get the name attribute to be set.

I am using 1.5 of the framework.


notmessenger wrote:
 
 I know I've seen this answer somewhere before on this list, but I cannot
 find it anywhere (archives or my own copies of the emails).
 I have this code:
 

-- 
View this message in context: 
http://www.nabble.com/How-to-set-name%3D%22%22-on-form-tp19422464p21044857.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] How to set name= on form

2008-12-16 Thread maxarbos

Thanks, but unfortunately no.
That changes the name of the ID to what i want my form name to be, but still
does not set a 'name' attribute.

Thank you.


Themselves wrote:
 
 $form-addAttribs(array('name' = 'formname')); ?
 
 On Wed, Dec 17, 2008 at 9:24 AM, maxarbos maxar...@yahoo.com wrote:
 

 Have you gotten any answers on this?
 I am having the same issue and cannot get the name attribute to be set.

 I am using 1.5 of the framework.


 notmessenger wrote:
 
  I know I've seen this answer somewhere before on this list, but I
 cannot
  find it anywhere (archives or my own copies of the emails).
  I have this code:
 

 --
 View this message in context:
 http://www.nabble.com/How-to-set-name%3D%22%22-on-form-tp19422464p21044857.html
 Sent from the Zend Framework mailing list archive at Nabble.com.


 
 

-- 
View this message in context: 
http://www.nabble.com/How-to-set-name%3D%22%22-on-form-tp19422464p21045007.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Ajax and direct access to controller deny

2008-10-10 Thread maxarbos

Hello,

we have a site that is heavily using ajax calls. The layout is to remain
constant but just the info that is being called should be the only content
refreshing or changing on the page.

In each controller we have:

public function preDispatch() {
$this-getHelper('layout')-disableLayout();
}

to stop the entire page from being refreshed when a request is made.

Wht I want to do is be able to stop direct requests to those pages if the
main page template is not loaded already.

So the page should come up normally when you go to:
www.mysite.com/module1

but if someone requests www.mysite.com/module1/controller1/action2 
directly, it will not allow them to do so and bounce them to some main login
or landing page.

Thanks.


-- 
View this message in context: 
http://www.nabble.com/Ajax-and-direct-access-to-controller-deny-tp19917087p19917087.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Ajax and direct access to controller deny

2008-10-10 Thread maxarbos

Well this seems pretty simple enough.
Dont understadn why i couldnt find it earlier. (yes i looked :)

You can check if the request is an ajax call or not by:

if($this-_request-isXmlHttpRequest())
{ $this-getHelper('layout')-disableLayout(); }

and then determine what to do.






maxarbos wrote:
 
 I am not sure how that would work.
 
 We are using the ACL to control who can go where, but in order for userA
 to be able to access www.mysite.com/module1/controller1/action2  through
 an ajax request, the acl would have to allow access to it anyway. 
 
 What I need is some check or method that, maybe on postDispatch, checks if
 the template layout is already loaded and if not bounce out.
 
 How would I do that? Ho wdo I check to see if the layout is already
 loaded?
 
 thanks.
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Ajax-and-direct-access-to-controller-deny-tp19917087p19917951.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Ajax and direct access to controller deny

2008-10-10 Thread maxarbos

I am not sure how that would work.

We are using the ACL to control who can go where, but in order for userA to
be able to access www.mysite.com/module1/controller1/action2  through an
ajax request, the acl would have to allow access to it anyway. 

What I need is some check or method that, maybe on postDispatch, checks if
the template layout is already loaded and if not bounce out.

How would I do that? Ho wdo I check to see if the layout is already loaded?

thanks.




keith Pope-4 wrote:
 
 Sounds like maybe ACL could do that for you??
 
 2008/10/10 maxarbos [EMAIL PROTECTED]:

 Hello,

 we have a site that is heavily using ajax calls. The layout is to remain
 constant but just the info that is being called should be the only
 content
 refreshing or changing on the page.

 In each controller we have:

public function preDispatch() {
$this-getHelper('layout')-disableLayout();
}

 to stop the entire page from being refreshed when a request is made.

 Wht I want to do is be able to stop direct requests to those pages if the
 main page template is not loaded already.

 So the page should come up normally when you go to:
 www.mysite.com/module1

 but if someone requests www.mysite.com/module1/controller1/action2
 directly, it will not allow them to do so and bounce them to some main
 login
 or landing page.

 Thanks.


 --
 View this message in context:
 http://www.nabble.com/Ajax-and-direct-access-to-controller-deny-tp19917087p19917087.html
 Sent from the Zend Framework mailing list archive at Nabble.com.


 
 
 
 -- 
 --
 [MuTe]
 --
 
 

-- 
View this message in context: 
http://www.nabble.com/Ajax-and-direct-access-to-controller-deny-tp19917087p19917366.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Action Helper

2008-09-30 Thread maxarbos

But if there is more than one method in that helper, how does it know which
method to call?

The code I have within my helper class for the direct method is this:

public function direct($method){
return $this-$method();
}






Matthew Lurz wrote:
 
 The documentation is correct. The direct method, if implemented in the
 action helper, will call a specific, default method in the helper. In the
 case of the FlashMessenger this is the addMessage method. So, calling
 $this-_helper-FlashMessenger('Some Message') will execute the direct
 method of the action helper. The direct method then calls addMessage().
 
 Hope that helps.
 
 
 maxarbos wrote:
 
 Hello,
 
 I would like to pass a value to to a specific property inside of a helper
 when I use it.
 
 On page:
 http://framework.zend.com/manual/en/zend.controller.actionhelpers.html
 
 In the documentation is says this:
 
 #Finally, most action helpers implement the method direct() which will
 call a specific, default method in the helper. In the example of the
 FlashMessenger, it calls addMessage():
 
 $this-_helper-FlashMessenger('We did something in the last request');
 
 // shouldnt this last line be:
 $this-_helper-FlashMessenger('addMessage');  ? 
 
 How do you get the message you want to add to 'addMessage' to that
 method?  It would be great to be able to send a valu that is read into
 the constructor.
 
 
 
 
 
 
 

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



Re: [fw-general] Action Helper

2008-09-30 Thread maxarbos

Oh, i see.
No matter how many times I read it, I must have missed 'which will call a
specific, default method in the helper'

I guess with the method that I have:
'   public function direct($method){
return $this-$method();
}
'
I could just change it to include a second variable that gets passed to a
method.

public function direct($method, $var=NULL){
return $this-$method($var);
}


Thanks again.





Matthew Lurz wrote:
 
 Perhaps an example will help: http://www.paste2.org/p/80416
 
 As you can see, generatePassword is called in the direct method and so if
 I want to generate a new password I can simply call:
 
 $pw = $this-_helper-passwordGenerator();
 
 If there were other methods in this helper that I wanted to access I would
 first need to get an instance of the helper with:
 
 $pwGen = $this-_helper-getHelper('PasswordGenerator');
 
 And then I could call any other method of the helper.
 
 $pwGen-someOtherMethod();
 
 Hope that makes more sense.
 
 

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



[fw-general] Action Helper

2008-09-29 Thread maxarbos

Hello,

I would like to pass a value to to a specific property inside of a helper
when I use it.

On page:
http://framework.zend.com/manual/en/zend.controller.actionhelpers.html

In the documentation is says this:

#Finally, most action helpers implement the method direct() which will call
a specific, default method in the helper. In the example of the
FlashMessenger, it calls addMessage():

$this-_helper-FlashMessenger('We did something in the last request');

// shouldnt this last line be: $this-_helper-FlashMessenger('addMessage'); 
? 

How do you get the message you want to add to 'addMessage' to that method?



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



Re: [fw-general] Modules and Shared functionality

2008-08-13 Thread maxarbos

any Best Practices suggestions?



maxarbos wrote:
 
 hello,
 
 I am trying to figure out the best practice for a situation where there
 will be different modules, controlled by ACL where certain portions of it
 will be very similar from module to module.
 
 ex:
 
 site.com/admin
 site.com/user
 
 both of these modules will have functionality to edit the users name and
 address.
 
 site.com/admin/person/contact/edit
 site.com/user/person/contact/edit
 
 Should I move all the processing code to the Person model and thin out the
 controllers?
 
 Thanks.
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Modules-and-Shared-functionality-tp18952739p18969688.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Modules and Shared functionality

2008-08-13 Thread maxarbos

OK, so it seems like i am on the right track, thanks.

BUT after reading this article:
http://phpimpact.wordpress.com/2008/07/28/zend-framework-architecture/

The section under: Criticism  Design : 'Also, Zend_Controller doesn’t allow
modular systems to load model files from within its own module as well as
outside modules.'  .
I read through the link in that paagraph and there are some interesting
suggestions, so I wanted to know if there was any update on the suggested
best way of doing such.

So it seems Thin Controller / Fat Model may be the best solution for this.

Does Matthew agree ? :)





tfk wrote:
 
 On Wed, Aug 13, 2008 at 3:32 PM, maxarbos [EMAIL PROTECTED] wrote:

 any Best Practices suggestions?



 maxarbos wrote:

 hello,

 I am trying to figure out the best practice for a situation where there
 will be different modules, controlled by ACL where certain portions of
 it
 will be very similar from module to module.

 ex:

 site.com/admin
 site.com/user

 both of these modules will have functionality to edit the users name and
 address.

 site.com/admin/person/contact/edit
 site.com/user/person/contact/edit

 Should I move all the processing code to the Person model and thin out
 the
 controllers?
 
 I follow the fat model, skinny controller concept. So I guess that
 means yes, however, I try to be careful about creating dependencies
 from module a to module b. I'd rather use the libraries and write
 model wrappers for them.
 
 Till
 
 

-- 
View this message in context: 
http://www.nabble.com/Modules-and-Shared-functionality-tp18952739p18971391.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Modules and Shared functionality

2008-08-12 Thread maxarbos

hello,

I am trying to figure out the best practice for a situation where there will
be different modules, controlled by ACL where certain portions of it will be
very similar from module to module.

ex:

site.com/admin
site.com/user

both of these modules will have functionality to edit the users name and
address.

site.com/admin/person/contact/edit
site.com/user/person/contact/edit


The only real difference between the two will be the use of the id for the
user who is to be edited.

I dont want to have to maintain two controllers: one in the
/admin/controller and one in the /user/controller locations.

What would be the best way to set something like this up as?

I have a shared model of person.php to get the info about the userID, but it
seems that there is still a large amount of code that deal with
inserting/editing in the PersonController.php  file in each dir.

Should I move all the processing code to the Person model and thin out the
controllers?

Thanks.



-- 
View this message in context: 
http://www.nabble.com/Modules-and-Shared-functionality-tp18952739p18952739.html
Sent from the Zend Framework mailing list archive at Nabble.com.



RE: [fw-general] Multiple Controller Directories

2008-08-08 Thread maxarbos

thank you for yoru reply.

going through this, it seems as though it will be only using one dir/app
rather than checking both.
I want all requests to go through /applicaion/commonground and if the
controller is not found there, to check in the /application/xxx depending on
the subdomain.

so when I go to:  sub1.domain.com/sayhi  
it will first look in /application/commonground/controllers for tha
controller, but since it doesnt exist in there, it will also then check in
the /application/sub1/controllers dir  for SayhiController.php

I am trying to set this up per the documentation, but it doesnt seem to be
working.



Keith Pope-3 wrote:
 
  
 Sorry I didnt read your email fully, its early :)
 
 You could try using the router to eliminate the modules problem you 
 have, checkout the docs 
 http://framework.zend.com/manual/en/zend.controller.router.html section 
 7.5.6.1.3. Hostname routing
 
 Keith Pope
 Web Developer
 
 

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



Re: [fw-general] Subdomains and Zend Framework

2008-08-08 Thread maxarbos

I am trying to do something similar and any advice would be great.


I have the following structure

/application
--/commonground
/bootstrap.php
/controllers
--/AclController.php
--/sub1
/controllers
--/HelloController.php
--/sub2
/controllers
--/SecretController.php 


I have sub1.domain.com and sub2.domain.com
Controllers in the /commonground module, should be accessible for all
requests (ACL and Custom functions are here as well as shared code between
sub1 and sub2)

I want to be able to call: sub1.domain.com/hello and have the
HelloController properly process as well as any in the /commonground if
needed (such as ACL)

Is this possible?

Thank you.




Jerry McG wrote:
 
 Hi All,
 
 I have a file system layout similar to the recommendation at
 http://framework.zend.com/manual/en/zend.controller.html#zend.controller.quickstart.go.directory
 I would like to work with subdomains such as http://chicago.example.com
 and http://newyork.example.com. I have added these subdomains in my Apache
 virtual hosts file as well as in the Windows hosts file. Now, how can I
 make subdomains work in Zend Framework. Should I create folders called
 Chicago and Newyork and repeat the recommended layout within these
 folders?
 
 Please guide me.
 
 Thanks!
 
 Jerry.
 

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



[fw-general] Zend_Form retain select value=0 on invalid submission

2008-08-08 Thread maxarbos

I have a form that has a select field with two values: 1 and 0.

select name=testfield
option value=1Yes/option
option value=0No/option
/select

When I submit the form and it is invalid, this select box does not remember
the value of this field. It always defaults to '1'. There is no default
value listed in the form builder file.

All other fields of the form, including the other select fields retain their
values when there is no '0' value choosen.

Any advice would be great.

Thanks.

-- 
View this message in context: 
http://www.nabble.com/Zend_Form-retain-select-value%3D%220%22-on-invalid-submission-tp18712028p18712028.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Multiple Controller Directories

2008-08-07 Thread maxarbos

Hello,

I want to know if it is possible to have multiple controller directories
without having to use the module name in the url?

What I am looking to do is have sub1.domain.com point to /application/sub1 
and sub2.domain.com point to /application/sub2

within the /application dir, there is one main dir (the default one, named:
commonground)  that runs the ACL and custom conrollers.

So the dir structire looks like this:

/application
--/commonground
/controllers
--/AclController.php
--/sub1
/controllers
--/HelloController.php
--/sub2
/controllers
--/SecretController.php

I want to call one bootstrap with all subX.domains.com  and have the
--/commonground dir process stuff like the ACL, but then when
sub2.domain.com/secret is called, it checks in the /commonground first and
then into the /sub2 dir.

I tried addControllerDirectory  but without a module name, it overwrites the
default controller dir.

I dont want to use sub2.domain.com/sub2/secret but instead want the
subdomain to control which dir it has access to. I am doing this by
SEVER_NAME.

Any advice would be great, thanks.


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



Re: [fw-general] Zend_Form retain select value=0 on invalid submission

2008-07-29 Thread maxarbos

For a weird reason, I tried rearranging the order of the array of options
from

array_vals=array('1' = 'Active', '0'='Inactive');

TO:
array_vals=array('0' = 'Inactive', '1='Active');

and added the default value to the element instance and it works fine.

I wanted to make the 'Active' option show first, that's why i was listing it
first.
So I guess the order of the values array options is important on 0/1 values.





maxarbos wrote:
 
 I have a form that has a select field with two values: 1 and 0.
 
 select name=testfield
 option value=1Yes/option
 option value=0No/option
 /select
 
 When I submit the form and it is invalid, this select box does not
 remember the value of this field. It always defaults to '1'. There is no
 default value listed in the form builder file.
 
 All other fields of the form, including the other select fields retain
 their values when there is no '0' value choosen.
 
 Any advice would be great.
 
 Thanks.
 
 

-- 
View this message in context: 
http://www.nabble.com/Zend_Form-retain-select-value%3D%220%22-on-invalid-submission-tp18712028p18712988.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Form retain select value=0 on invalid submission

2008-07-29 Thread maxarbos

originally, when I had the values array set to; array_vals=array('0' =
'Inactive', '1='Active');
I had the default val set to 1 and if 'Inactive' was chosen, and then form
was invalid, when the from was rerendered, the value of that field was
always set to 'Active' (1).

Viewing the posted values, the testfield value was showing as '0', but it
never took.
soon as i changed the order, everything worked.
So does the numberical order of the keys in the array make a difference?




Micah Gersten wrote:
 
 In a select dropdown, the default if none is specified is the first
 option regardless of value.
 
 Thank you,
 Micah Gersten
 onShore Networks
 Internal Developer
 http://www.onshore.com
 
 
 
 maxarbos wrote:
 For a weird reason, I tried rearranging the order of the array of options
 from

 array_vals=array('1' = 'Active', '0'='Inactive');

 TO:
 array_vals=array('0' = 'Inactive', '1='Active');

 and added the default value to the element instance and it works fine.

 I wanted to make the 'Active' option show first, that's why i was listing
 it
 first.
 So I guess the order of the values array options is important on 0/1
 values.





 maxarbos wrote:
   
 I have a form that has a select field with two values: 1 and 0.

 select name=testfield
 option value=1Yes/option
 option value=0No/option
 /select

 When I submit the form and it is invalid, this select box does not
 remember the value of this field. It always defaults to '1'. There is no
 default value listed in the form builder file.

 All other fields of the form, including the other select fields retain
 their values when there is no '0' value choosen.

 Any advice would be great.

 Thanks.


 

   
 
 

-- 
View this message in context: 
http://www.nabble.com/Zend_Form-retain-select-value%3D%220%22-on-invalid-submission-tp18712028p18717435.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Is it possible to use Zend_ACL without MVC

2008-07-15 Thread maxarbos

i have been away the past few days, thank you all for your help.

I guess if a whole class is locked out, couldn't I include:

if (!$this-acl-isAllowed($this-user, __CLASS__)) {
throw new Exception('Access denied');
}

in the __construct then if things need finer grained control, to add that
check to each method?




Matthew Weier O'Phinney-3 wrote:
 
 
 The other possibility is to make those methods protected and prefix them
 with a '_', and add proxying via __call():
 
 protected function _echoHello()
 {
 echo 'Hello!';
 }
 
 public function __call($method, $args)
 {
 if (method_exists($this, '_' . $method)) {
 if (!$this-acl-isAllowed($this-user, __CLASS__, $method)) {
 throw new Exception('Access denied');
 }
 return call_user_func_array(array($this, '_' . $method),
 $args);
 }
 
 throw new Exception(sprintf('Invalid method %s', $method));
 }
 
 Any method that doesn't need ACL checks can then simply be declared
 public.
 
 This _will_ have a performance hit (both from overloading and from using
 call_user_func_array()), but it will automate things.
 
 
 -- 
 Matthew Weier O'Phinney
 Software Architect   | [EMAIL PROTECTED]
 Zend Framework   | http://framework.zend.com/
 
 

-- 
View this message in context: 
http://www.nabble.com/Is-it-possible-to-use-Zend_ACL-without-MVC-tp18385583p18468080.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Is it possible to use Zend_ACL without MVC

2008-07-10 Thread maxarbos

Hello,

Is ti possible to run Zend_ACL without the MVC portion?
I also need it to work with a pretty much all ajax type site.

Any feedback would be great.
Thanks.

-- 
View this message in context: 
http://www.nabble.com/Is-it-possible-to-use-Zend_ACL-without-MVC-tp18385583p18385583.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Is it possible to use Zend_ACL without MVC

2008-07-10 Thread maxarbos

yeah, that was what I was thinking, but now how do you implelemnt it?

When we were using the MVC, the controller and action where declared in the
url and the mvc took care of breaking that up and the acl determined which
resource had which priv.

So when I have a class 'User.php' with methods such as: 'editAccount',
'addNumber', etc...  do I just need to now include Zend_ACL_Resoure in the
construct and assign a name to the class like :

__construct($resource) {
   new Zend_Acl_Resource-getResourceId('user');
}


Do the methods still need to be named 'editAction', 'addnumberAction'?

I'm just a little unclear how to register the classes as resources I guess.

thanks.




Matthew Weier O'Phinney-3 wrote:
 
 -- maxarbos [EMAIL PROTECTED] wrote
 (on Thursday, 10 July 2008, 09:05 AM -0700):
 Is ti possible to run Zend_ACL without the MVC portion?
 I also need it to work with a pretty much all ajax type site.
 
 Zend_Acl is a standalone component and has no ties to the MVC. Use it
 however you desire. :)
 
 -- 
 Matthew Weier O'Phinney
 Software Architect   | [EMAIL PROTECTED]
 Zend Framework   | http://framework.zend.com/
 
 

-- 
View this message in context: 
http://www.nabble.com/Is-it-possible-to-use-Zend_ACL-without-MVC-tp18385583p18388057.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Is it possible to use Zend_ACL without MVC

2008-07-10 Thread maxarbos

I feel like I understand but dont seem o get thsi to work.

Here is my main page:

require_once 'Zend/Acl.php';
$acl=new Zend_Acl();

require_once 'Test.php';
$test = new Test($acl);

require_once('Zend/Acl/Role.php');
$acl-addRole(new Zend_Acl_Role('guest'))
-addRole(new Zend_Acl_Role('member'));

require_once('Zend/Acl/Resource.php');
$acl-add(new Zend_Acl_Resource('test'));

$acl-deny('guest', 'test');
$acl-allow('member', 'test');

echo $acl-isAllowed('guest', 'test') ? 'allowed' : 'denied';

echo $test-echoHello();


I am trying to deny the echoHello from happening.

Here is my Test.php class

require_once 'Zend/Acl/Resource/Interface.php';
class Test implements Zend_Acl_Resource_Interface
{

public function __construct(Zend_Acl $acl) {
$this-_acl = $acl;
}


public function getResourceId()
{
return 'test';
}

public function echoHello(){

if (!$this-_acl-isAllowed('guest', __CLASS__, __FUNCTION__)) {
throw new Exception('ACCESS DENIED!');
}

return 'hello';
}

}

-- 
View this message in context: 
http://www.nabble.com/Is-it-possible-to-use-Zend_ACL-without-MVC-tp18385583p18389571.html
Sent from the Zend Framework mailing list archive at Nabble.com.



RE: [fw-general] Is it possible to use Zend_ACL without MVC

2008-07-10 Thread maxarbos

still getting the same error:

denied
Fatal error: Uncaught exception 'Zend_Acl_Exception' with message 'Resource
'Test' not found' 
in /xxx/Zend/Acl.php:297 
Stack trace: 
#0 /xxx/Zend/Acl.php(691): Zend_Acl-get('Test') 
#1 //admin/Test.php(24): 
Zend_Acl-isAllowed('guest', 'Test', 'echoHello') 
#2 /xxx/admin/index.php(50): Test-echoHello() 
#3 {main} thrown in /xxx/Zend/Acl.php on line 297



vRandom wrote:
 
 Move this 
 
 require_once 'Test.php';
 $test = new Test($acl);
 
 under
 
 $acl-allow('member', 'test');
 
 Terre
 
 

-- 
View this message in context: 
http://www.nabble.com/Is-it-possible-to-use-Zend_ACL-without-MVC-tp18385583p18390278.html
Sent from the Zend Framework mailing list archive at Nabble.com.



RE: [fw-general] Is it possible to use Zend_ACL without MVC

2008-07-10 Thread maxarbos

I think I got it.

I needed to change the resource name to caplital 'Test'

So I just need to add the check within every method?
Seems a bit susceptible to errors.




maxarbos wrote:
 
 still getting the same error:
 
 denied
 Fatal error: Uncaught exception 'Zend_Acl_Exception' with message
 'Resource 'Test' not found' 
 in /xxx/Zend/Acl.php:297 
 Stack trace: 
 #0 /xxx/Zend/Acl.php(691): Zend_Acl-get('Test') 
 #1 //admin/Test.php(24): 
 Zend_Acl-isAllowed('guest', 'Test', 'echoHello') 
 #2 /xxx/admin/index.php(50): Test-echoHello() 
 #3 {main} thrown in /xxx/Zend/Acl.php on line 297
 
 
 
 vRandom wrote:
 
 Move this 
 
 require_once 'Test.php';
 $test = new Test($acl);
 
 under
 
 $acl-allow('member', 'test');
 
 Terre
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Is-it-possible-to-use-Zend_ACL-without-MVC-tp18385583p18390545.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Zend_Form_Storage ... what is this about

2008-07-08 Thread maxarbos

Hello,

I have seen a little info about Zend_Form_Storage.

What is the status of this?

Thanks.
-- 
View this message in context: 
http://www.nabble.com/Zend_Form_Storage-...-what-is-this-about-tp18344854p18344854.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Is this possible: Zend_SubForm with user added records?

2008-07-07 Thread maxarbos



Bart McLeod wrote:
 
 Hi Jamie,
 
 2. Do 'add' and 'submit' need to perform different actions? I managed to 
 use subforms (0-N) to add records. Every time a new record is added by 
 pressing 'save' or [Enter], a new empty subform is added to allow for 
 the addition of a new record.  
 
 


How are you doing this? 
i am looking to do the same thing and having a hard time.

Thanks.

-- 
View this message in context: 
http://www.nabble.com/Is-this-possible%3A-Zend_SubForm-with-user-added-records--tp17542503p18322416.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Form : Subforms, dynamic element creation and best practices

2008-07-03 Thread maxarbos



Matthew Weier O'Phinney-3 wrote:
 
 Matthew Weier O'Phinney-3 wrote:
  
  Yes. Create an element for each child, and attach each with a different
  form element name:
  
  foreach ($children as $key = $child) {
  $form-addElement('text', 'child' . $key, array('value' =
  $child'));
  }
  
  
 


So since all of my elements are being created in the init() method and that
seems to run even before the __construct , how to I get the value to
$children ?

If i call $renderform = new TestForm() from my Controller, the form is
already built by the time I try to set the $children by
$renderform-children = array('aaa', 'bbb', 'ccc');

I have been following the tutorials at:
http://blog.astrumfutura.com/archives/360-Example-Zend-Framework-Blog-Application-Tutorial-Part-6-Introduction-to-Zend_Form-and-Authentication-with-Zend_Auth.html

Is this still the recommended way to create a form with my needs?

-- 
View this message in context: 
http://www.nabble.com/Zend_Form-%3A-Subforms%2C-dynamic-element-creation-and-best-practices-tp18203896p18263554.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Form : Subforms, dynamic element creation and best practices

2008-07-01 Thread maxarbos



Matthew Weier O'Phinney-3 wrote:
 
 
 The TestingForm.php is built as such:
 TestForm extends Zend_Form {
public function __construct($options=null) {
   parent::__construct($options);
 
  $this-setAttrib('accept-charset', 'UTF-8');
 }
 
 I'd place the above in setAttrib() call as the first call in your init()
 method below, and get rid of __construct() entirely.
 
public function init() {
  $name = $this-addElement('text', 'name', array().);
 }
 
 }
 
 
 

I left out that we are also including :

$this-setDecorators(array(
'FormElements',
array('HtmlTag', array('tag' = 'dl', 'class' = 'zend_form')),
array('Description', array('placement' = 'prepend')),
'Form'
));

in the __construct, but moving this all to the init() doesnt seem to load
the decorators in time.



Matthew Weier O'Phinney-3 wrote:
 
 2)  I want to be able to add elements dynamically to the form depending
 on a
 result set of data from the db.
 
 Say a person has 4 children, I want to dynamically add four text elements
 to
 the form, one for each record retrieved from the db.
 
 How can I do this with my setup?
 
 Yes. Create an element for each child, and attach each with a different
 form element name:
 
 foreach ($children as $key = $child) {
 $form-addElement('text', 'child' . $key, array('value' =
 $child'));
 }
 
 

I was pretty much doing the same things, but included 
foreach($children as $key=$val){
$field.$key = $this-addElement('text', 'fieldname'.$key, etc)

$group[]='fieldname'.$key;
}

$this-addDisplayGroup(
$number_group, 'groupname' )


and ended up getting error of:

'No valid elements specified for display group'


So once I got rid of the '$field.$key ='   it all worked correctly.


Do you have any other updated resources for best practices or structure of a
large site using this framework?

thanks.

-- 
View this message in context: 
http://www.nabble.com/Zend_Form-%3A-Subforms%2C-dynamic-element-creation-and-best-practices-tp18203896p18220883.html
Sent from the Zend Framework mailing list archive at Nabble.com.