Well incase anyone else ever runs into this problem I have found a simple
autoParse function that can be pluged into the Acl Resource system....of
course youl need to change the $this->zendAcl to your own object reference (
but it works like a charm:) )

public function parseResourceList($list, $parent = null)
        {
                if (is_array($list))
                {
                        foreach ($list as $key => $val)
                        {
                                if ( !is_array($val) )
                                {
                                        if( $parent != null )
                                        {
                                                if($this->zendAcl->has($parent))
                                                {
                                                        // Add child resource 
from parent
                                                        $this->zendAcl->add( 
new Zend_Acl_Resource($val), $parent);
                                                }
                                                else
                                                {
                                                        // Add parent then 
resource
                                                        $this->zendAcl->add( 
new Zend_Acl_Resource($parent));
                                                        $this->zendAcl->add( 
new Zend_Acl_Resource($val), $parent);
                                                }
                                        }
                                        else
                                        {
                                                // Add parent resource
                                                $this->zendAcl->add( new 
Zend_Acl_Resource($val));

                                        }
                                }
                                else
                                {
                                        $this->parseResourceList($val, $key);
                                }
                        }
                }
                else
                {
                        $this->zendAcl->add( new Zend_Acl_Resource($list));
                }
        }

-----
Nickolas Whiting 

Developer 

http://xstudiosinc.com Xstudios 
-- 
View this message in context: 
http://www.nabble.com/Zend_Acl_Resource-MultiDimensional-Array-tp20137968p20140236.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to