Re: [fw-general] dojo editor not working in ie invalid pointer
I think you have to use decorators around it, to make it inside a div or something along those lines. To be honest, it really put me off of dojo, so I've moved onto Jquery. I find it much easier. Spent days trying to work this one out, and I set the same thing up with jquery in around 10 mins rswarthout wrote: Paul, Did you ever get this issue figured out. I am experiencing the same issue. Thanks in advance, Robert - http://www.acewebdesign.com.au Web Design Adelaide -- View this message in context: http://www.nabble.com/dojo-editor-not-working-in-ie-invalid-pointer-tp20998650p22238821.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Session arrays
PHPScriptor. thanks very much. I had finally found out what I was doing wrong, but they way that you set it out, is much simpler than the method i was using. Brilliant. thank you. PHPScriptor wrote: $session = new Zend_Session_Namespace('postfields'); $fields = $session-results; // get the previous postfields array_push($fields,$this-_request-getPost()); // add the new postfields $session-results = $fields; // assign the new postfields session_write_close(); so you get a 2 dimension array $fields[0]['accommodation_id'] $fields[0]['accommodation_name'] ... $fields[1]... Ace Paul wrote: I'm trying to work out how to set up an array in a session with zend framework. I've managed to get simple values into sessions without array, but just can't work this part out. I would like to submit a form which adds the following to a session array. accommodation_id, accommodation_name, accommodation_price, accommodation_type. I would like for people to be able to add multiple amount of these into the session, and then loop through it on the view page, however I'm unsure of how to add an array in a session with zend framework. Any help would be great. thanks - http://www.acewebdesign.com.au Web Design Adelaide -- View this message in context: http://www.nabble.com/Session-arrays-tp21365392p21373886.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] Session arrays
I'm trying to work out how to set up an array in a session with zend framework. I've managed to get simple values into sessions without array, but just can't work this part out. I would like to submit a form which adds the following to a session array. accommodation_id, accommodation_name, accommodation_price, accommodation_type. I would like for people to be able to add multiple amount of these into the session, and then loop through it on the view page, however I'm unsure of how to add an array in a session with zend framework. Any help would be great. thanks - http://www.acewebdesign.com.au Web Design Adelaide -- View this message in context: http://www.nabble.com/Session-arrays-tp21365392p21365392.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] pass a variable into a partialloop
i have this set up so that in my controller i have set up the variable $racepackage_id = $this-_request-getParam('racepackage_id'); i then make the cityaccomm object $this-view-cityaccomm = $accomm-getCityAccommodation($city_id);// assign accommodation to view I would like to also have the $racepackage_id passed to the loop, so i can include a url within the loop on each record based upon the $racepackage_id variable. is there a way that I can do this? -- View this message in context: http://www.nabble.com/pass-a-variable-into-a-partialloop-tp21286263p21286263.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] dojo editor not working in ie invalid pointer
works ok in firefox but giving this error in firebug RichText should not be used with the TEXTAREA tag. See dijit._editor.RichText docs. In ie7 none of the dojo elements work though, and i get the error: Invalid Pointer. does any one know how to fix this? thanks for any help this is what i have in my bootstrap Zend_Dojo::enableView($view); Zend_Dojo_View_Helper_Dojo::setUseDeclarative(); $view-addHelperPath('Zend/Dojo/View/Helper/', 'Zend_Dojo_View_Helper'); $view-dojo()-disable(); $view-dojo()-setLocalPath('/externals/dojo/dojo/dojo.js') -addStyleSheetModule('dijit.themes.tundra'); this is from the form. i have 4 editors for the one form $this-addElement('editor', 'race_description', array( 'plugins'= array('undo', '|', 'bold', 'italic'), 'height' = '150px', 'inheritWidth' = true, 'label' = 'RaceDescription:', 'required' = false, )); and in the controller i have this. $this-view-addHelperPath('Zend/Dojo/View/Helper/', 'Zend_Dojo_View_Helper'); -- View this message in context: http://www.nabble.com/dojo-editor-not-working-in-ie-invalid-pointer-tp20998650p20998650.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] How to set up dependant dropdowns in form
thanks for your help on this. I'm trying to get this going, but not having any luck at all, especially seeing as I haven't used json with zend yet. I'm getting this error in my controller file. Method encodeJson does not exist and was not trapped in __call() public function _prepareautocompletion($data) { $items = array(); foreach ($data as $key = $value) { $items[] = array('label' = $value, 'name' = $value, 'key' = $key); } $final = array( 'identifier' = 'key', 'items' = $items, ); return $this-encodeJson($final); } this is my autocompleteAction in CategoryController.php function autocompleteAction () { $this-getHelper('viewRenderer')-setNoRender(); $request = $this-getRequest(); $category_id = (int)$this-_request-getParam('category_id'); $race = new Race(); $races = $race-getCategoryRaces($category_id); // function to output all races $this-view-races = $this-_prepareautocompletion($races); } Ok, now theres a couple things here i'm unsure of. Firstly because this is setup with the first select box not populated because it is expecting data from a data store, how am I to pass this info into the json request. I'm sure I'm way off track with this one. And Second, why am I getting the json error. Do I need to set something up before hand for this to work. thanks Paul Themselves wrote: I have spent WAY too much time getting this exact scenario working using Zend Dojo forms and an MVC environment, and I plan on building an extensive article explaining it all soon, but for now, here's the really quick and dirty version. I haven't gotten my version perfect yet, I'm still not happy with the URLs I'm calling to retrieve the data, but that's not a huge deal. Anyway, on with the show. First of all, here's your two form elements. $this-addElement('FilteringSelect', 'fk_client_id', array( 'label'= 'Client:', 'storeId' = 'clientStore', 'storeType'= 'dojo.data.ItemFileReadStore', 'storeParams' = array( 'url' = '/clients/autocomplete/format/ajax?autocomplete=1str=*',), 'autoComplete' = 'false', 'hasDownArrow' = 'true', 'id' = 'fk_client_id', )); $this-addElement('FilteringSelect', 'fk_client_contact_id', array( 'label'= 'Client contact:', 'storeId' = 'clientContactStore', 'storeType'= 'dojo.data.ItemFileReadStore', 'autoComplete' = 'false', 'hasDownArrow' = 'true', 'id' = 'fk_client_contact_id', )); Now for the javascript, this has to appear somewhere on the page that contains the form. dojo.connect(dijit.byId('fk_client_id'), 'onChange', function () { dijit.byId('fk_client_contact_id').store = new dojo.data.ItemFileReadStore({ url: /clientcontacts/autocomplete/format/ajax?autocomplete=1fk_client_id= + dijit.byId(fk_client_id).value }); }); As for the URLs for the Datastores, they are kind of an exercise for the reader, other than to say they obviously should filter correctly on the passed parameters, and they have to return JSON. This part was pretty annoying, but I eventually found that a function like this returns the correct JSON format: public function prepareAutoCompletion($data) { $items = array(); foreach ($data as $key = $value) { $items[] = array('label' = $value, 'name' = $value, 'key' = $key); } $final = array( 'identifier' = 'key', 'items' = $items, ); return $this-encodeJson($final); } You pass in to the function an array of id = value pairs, and it will output the correct JSON for the FilteringSelects. If you use the built in AutoCompleteDojo helper, it won't use the id from your table as the value that the form submits, which is pretty much useless. Oh, and one more trick, for the Edit action, you are going to need to include something like this: $form-populate($row); $form-getElement('fk_client_contact_id')-setStoreParams(array( 'url' = '/clientcontacts/autocomplete/format/ajax?autocomplete=1fk_client_id=' . $form-getElement('fk_client_id')-getValue() )); So that it prepopulates the form correctly. I promise I'll write up a really impressive document that spells this whole thing out in painstaking detail, I'm just absolutely flat out until christmas, I haven't had any time! On Tue, Dec 9, 2008 at 10:58 AM, Ace Paul sa...@acewebdesign.com.au wrote: I have a form, which I would like to use dependent drop downs in. I can't seem to find anything about it hear, after looking all morning trying to work it out. I have one field race_country when an option is selected I would like to show
Re: [fw-general] How to set up dependant dropdowns in form
Thank you very much for the reply. I have been looking high and low for a solution. I will let you know how I go with this. Thanks Themselves wrote: I have spent WAY too much time getting this exact scenario working using Zend Dojo forms and an MVC environment, and I plan on building an extensive article explaining it all soon, but for now, here's the really quick and dirty version. I haven't gotten my version perfect yet, I'm still not happy with the URLs I'm calling to retrieve the data, but that's not a huge deal. Anyway, on with the show. First of all, here's your two form elements. $this-addElement('FilteringSelect', 'fk_client_id', array( 'label'= 'Client:', 'storeId' = 'clientStore', 'storeType'= 'dojo.data.ItemFileReadStore', 'storeParams' = array( 'url' = '/clients/autocomplete/format/ajax?autocomplete=1str=*',), 'autoComplete' = 'false', 'hasDownArrow' = 'true', 'id' = 'fk_client_id', )); $this-addElement('FilteringSelect', 'fk_client_contact_id', array( 'label'= 'Client contact:', 'storeId' = 'clientContactStore', 'storeType'= 'dojo.data.ItemFileReadStore', 'autoComplete' = 'false', 'hasDownArrow' = 'true', 'id' = 'fk_client_contact_id', )); Now for the javascript, this has to appear somewhere on the page that contains the form. dojo.connect(dijit.byId('fk_client_id'), 'onChange', function () { dijit.byId('fk_client_contact_id').store = new dojo.data.ItemFileReadStore({ url: /clientcontacts/autocomplete/format/ajax?autocomplete=1fk_client_id= + dijit.byId(fk_client_id).value }); }); As for the URLs for the Datastores, they are kind of an exercise for the reader, other than to say they obviously should filter correctly on the passed parameters, and they have to return JSON. This part was pretty annoying, but I eventually found that a function like this returns the correct JSON format: public function prepareAutoCompletion($data) { $items = array(); foreach ($data as $key = $value) { $items[] = array('label' = $value, 'name' = $value, 'key' = $key); } $final = array( 'identifier' = 'key', 'items' = $items, ); return $this-encodeJson($final); } You pass in to the function an array of id = value pairs, and it will output the correct JSON for the FilteringSelects. If you use the built in AutoCompleteDojo helper, it won't use the id from your table as the value that the form submits, which is pretty much useless. Oh, and one more trick, for the Edit action, you are going to need to include something like this: $form-populate($row); $form-getElement('fk_client_contact_id')-setStoreParams(array( 'url' = '/clientcontacts/autocomplete/format/ajax?autocomplete=1fk_client_id=' . $form-getElement('fk_client_id')-getValue() )); So that it prepopulates the form correctly. I promise I'll write up a really impressive document that spells this whole thing out in painstaking detail, I'm just absolutely flat out until christmas, I haven't had any time! On Tue, Dec 9, 2008 at 10:58 AM, Ace Paul [EMAIL PROTECTED] wrote: I have a form, which I would like to use dependent drop downs in. I can't seem to find anything about it hear, after looking all morning trying to work it out. I have one field race_country when an option is selected I would like to show the cities in that country. The following is what I have currently in the form, which will show all countries and all cities. Any help would be great. thanks $table = new Country(); foreach ($table-fetchAll() as $c) { $country-addMultiOption($c-country_id, $c-country_name); } $this-addElement( $country); $city = new Zend_Form_Element_Select('race_city'); $city-setLabel('City') -setRequired(true); $table = new City(); foreach ($table-fetchAll() as $c) { $city-addMultiOption($c-city_id, $c-city_name); } $this-addElement( $city); -- View this message in context: http://www.nabble.com/How-to-set-up-dependant-dropdowns-in-form-tp20907379p20907379.html Sent from the Zend Framework mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/How-to-set-up-dependant-dropdowns-in-form-tp20907379p20910287.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] How to set up dependant dropdowns in form
I have a form, which I would like to use dependent drop downs in. I can't seem to find anything about it hear, after looking all morning trying to work it out. I have one field race_country when an option is selected I would like to show the cities in that country. The following is what I have currently in the form, which will show all countries and all cities. Any help would be great. thanks $table = new Country(); foreach ($table-fetchAll() as $c) { $country-addMultiOption($c-country_id, $c-country_name); } $this-addElement( $country); $city = new Zend_Form_Element_Select('race_city'); $city-setLabel('City') -setRequired(true); $table = new City(); foreach ($table-fetchAll() as $c) { $city-addMultiOption($c-city_id, $c-city_name); } $this-addElement( $city); -- View this message in context: http://www.nabble.com/How-to-set-up-dependant-dropdowns-in-form-tp20907379p20907379.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] Dojo editor not sending data to database
I have finally got the dojo editor working, well so I thought. I just set up an insert to database, but it isnt sending the data there. I am using this as a form element. (i use 3 of these for different fields, but they are all basically the same though. $this-addElement('Editor', 'race_description', array( 'label' = 'Race Description:', 'required' = false, 'filters'= array('StringTrim'), 'style'= 'width: 200px; height:100px;', )); and i get the data with this inside the array, which is working for other fields, but not for the ones using the dijit editor 'race_description' = $values['race_description'], thanks for any help -- View this message in context: http://www.nabble.com/Dojo-editor-not-sending-data-to-database-tp20773451p20773451.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] acl denying access when custom route used
I wrote a similar message before, but it said that it didnt send to mailing list, and I've looked into it further and found that the problem lies within acl defining the resource when a custom route is made in the bootstrap file. In the bootstrap I have the following $router = $frontController-getRouter(); $route = new Zend_Controller_Router_Route( 'wedding/bouquets/:bouquet/:page', array( 'controller' = 'wedding', 'action' = 'bouquet' ) ); $router-addRoute('bouquets',$route); $route2 = new Zend_Controller_Router_Route( 'bouquet/:bouquet/*', array( 'controller' = 'bouquet', 'action' = 'bouquet' ) ); $router-addRoute('bouquet',$route2); In the acl.php file i have this, which works well except in regards to the custom routes. $this-add(new Zend_Acl_Resource('default')) -add(new Zend_Acl_Resource('bouquets')); $this-add(new Zend_Acl_Resource('admin')); $this-addRole(new Zend_Acl_Role('guest')); $this-addRole(new Zend_Acl_Role('author'), 'guest'); $this-allow('guest', 'default') -allow('guest', 'bouquets'); I am able to access /wedding/ but not able to access wedding/bouquets/category as it is the custom route. If i remove the route from the bootstrap I can then access wedding/bouquet/bouquet/category Is there anyone that can help me, I've searched the boards, googled, done everything I could, but can't find anything about this at all. Thanks for any help -- View this message in context: http://www.nabble.com/acl-denying-access-when-custom-route-used-tp20727434p20727434.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] Pagination with routes not working.
Hi all. I'm having a bit of a problem trying to get the pagination working using a route. It is not printing the page numbers in the a href of the urls. so it just goes to wedding/bouquets/category instead of wedding/bouquets/category/2 etc The pagination shows, but I do not get the correct links. they just point to the base page. And when i go to wedding/bouquets/category/2 etc if shows the correct page too. So all is working except the links, which show, but don't function correctly. Also is it possible to link the number 1 link back so it doesnt have the 1 there. ie the base page? wedding/bouquets/category and have page 2 go to wedding/bouquets/category/2 etc in my bootstrap i have these routes set already $route = new Zend_Controller_Router_Route( 'wedding/bouquets/:bouquet', array( 'controller' = 'wedding', 'action' = 'bouquet' ) ); $router-addRoute('bouquet',$route2); $route3 = new Zend_Controller_Router_Route( 'wedding/bouquets/:bouquet/:page', array( 'controller' = 'wedding', 'action' = 'bouquet' ) ); in the wedding controller, bouquet action i have the following $bouquet = new Bouquet(); if ($category_id 0) { $obj = $bouquet-fetchAll('bouquet_category='.$category_id); $array = $obj-toArray(); $this-view-paginator = Zend_Paginator::factory($array); $this-view-paginator-setCurrentPageNumber($this-_getParam('page')); $this-view-bouquet = $bouquet-fetchAll('bouquet_category='.$category_id); return; } then in my view i have ?php if (count($this-paginator)): ??= $this-paginationControl($this-paginator, 'Sliding', 'my_pagination_control.phtml'); ? ul ?php echo $this-partialLoop('partials/_bouquets.phtml', $this-paginator); ? /ul ?= $this-paginationControl($this-paginator, 'Sliding', 'my_pagination_control.phtml'); ? ?php endif; ? and the my_pagination_control.phtml looks like this ?php if ($this-pageCount): ? div class=paginationControl !-- Previous page link -- ?php if (isset($this-previous)): ? ?= $this- url(array('page' = $this-previous)); ? lt; Previous | ?php else: ? lt; Previous | ?php endif; ? !-- Numbered page links -- ?php foreach ($this-pagesInRange as $page): ? ?php if ($page != $this-current): ? ?= $this- url(array('page' = $page)); ? ?= $page; ? | ?php else: ? ?= $page; ? | ?php endif; ? ?php endforeach; ? !-- Next page link -- ?php if (isset($this-next)): ? ?= $this- url(array('page' = $this-next)); ? Next gt; ?php else: ? Next gt; ?php endif; ? /div ?php endif; ? thanks for any help given. It is always much appreciated. -- View this message in context: http://www.nabble.com/Pagination-with-routes-not-working.-tp20657017p20657017.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Pagination with routes not working.
thanks for the quick response Keith. I gave that one a go, but no luck unfortunately. Will look into the tableSelectAdapter also. Still very new to ZF so taking baby steps at the moment. thanks for your help -- View this message in context: http://www.nabble.com/Pagination-with-routes-not-working.-tp20657017p20658202.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] setting style class of an element in navigation
Thank you very much for the reply Dan. For some reason using that method I am unable to get the style to print to the browser. I have used a quick fix like this, but if possible would like to do it the way that you have said, so that I am doing everything the correct Zend way. This is what I have now in the index.phtml layout page, which also calls the header.phtml page. style type=text/css !-- ?php echo $this-escape($this-navActive); ? { background: url(/images/menu-tab-bg.jpg) bottom left repeat-x; color: #5b5e56; display: block; padding: 0px 8px; } -- /style I tried this ?php $this-headStyle()-captureStart() ? ?php echo $this-view-navActive ? { background: url(/images/menu-tab-bg.jpg) bottom left repeat-x; color: #5b5e56; display: block; padding: 0px 8px; } ?php $this-headStyle()-captureEnd() ? but nothing was output at all. Is there something there that I missed. Thanks for all help. It is greatly appreciated. -- View this message in context: http://www.nabble.com/setting-style-class-of-an-element-in-navigation-tp20541245p20570914.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] setting style class of an element in navigation
Is there a way that I can set a tab to have a class such as active from the controller? So that the active tab would show as a different style? I know that this can be done with javascript, but I would like to know if it can be done within Zend framework for ease of use. thanks for any help -- View this message in context: http://www.nabble.com/setting-style-class-of-an-element-in-navigation-tp20541245p20541245.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] setting style class of an element in navigation
Thanks for the responses. Still a bit stuck. I haven't used the capture helpers, so its very new to me. Still working on my first ZF app. It seems to be a quick learning curve,but there is so much to learn. I have this section in the header.phtml file, in the layouts directory. The current and sub-current classes tell which page we are on. So that the navigation is highlighted in the header area. div id=navi ul id=navtabs li id=current Dashboard /li li /admin/business/ Businesses /li li Menu Item Two /li li Menu Item Three /li li Menu Item Four /li /ul div class=clear/div /div div id=subnavi ul id=subnav li id=sub-current Business List /li li Submenu Item /li li Submenu Item /li li Submenu Item /li li Submenu Item /li li Submenu Item /li /ul div class=clear/div /div -- View this message in context: http://www.nabble.com/setting-style-class-of-an-element-in-navigation-tp20541245p20552588.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] insert filename without path into database
My form intem looks like this $element = new Zend_Form_Element_File('logo_image'); $element-setLabel('Logo Image:') -setRequired('true') -setDestination('/home/pathto/images/logos/') -addValidator('Count', false, 1) // ensure only 1 file -addValidator('Size', false, 5002400) // limit to 100K -addValidator('Extension', false, 'jpg,png,gif'); // only JPEG, PNG, and GIFs $this-addElement($element, 'logo_image'); // add the comment element $this-addElement('hidden', 'logo_business', array( )); and it is inserted into db like this function addlogoAction() { $this-view-title = Add New Logo; $form = $this-_getLogoForm(); if (!$this-getRequest()-isPost()) { $this-view-LogoForm = $form; $form-getElement('logo_business')-setValue($this-_request-getParam('logo_business')); return; } elseif (!$form-isValid($_POST)) { $this-view-failedValidation = true; $this-view-LogoForm = $form; return; } $values = $form-getValues(); $table = new Logos(); $imagepath = $values['logo_image']; $data = array( 'logo_name' = $values['logo_name'], 'logo_image' = $values['logo_image'], 'logo_business' = $values['logo_business'] ); $table-insert($data); $this-view-LogoSaved = true; } how do i go about only storing the file name in the database instead of the entire path and filename. thanks for any help -- View this message in context: http://www.nabble.com/insert-filename-without-path-into-database-tp20495425p20495425.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] re[fw-general] writing a url from zend framework
What i have at the moment is this domain.com/controller/action/variable/variablename the thing is that action and variable are the same name, so is it possible to do a rewrite with zend so that i can call it with domain.com/controller/variable/variablename or domain.com/controller/action/variablename I'd like to set it up like this for more effective search engine optimisation. thanks for any help -- View this message in context: http://www.nabble.com/rewriting-a-url-from-zend-framework-tp20438641p20438641.html Sent from the Zend Framework mailing list archive at Nabble.com.