[fw-general] Dinamicly created Menu question

2010-10-29 Thread vladimirn

First of all i would like to say hello to all of you guys.
There is a question bothering me for some time now.
While ago i have created a CMS where i allowed admin users to create a
pages, menus, categories etc.. dinamicly.
I would love to port all that ideas to Zend Framework env.
Talking about ZF, as far as i know, to show a page to user, at list i need
to have a controller and a view file.
If i want to create a new menu/page using zend framework, how i can do that?
I mean, i can make some nice form and i can create data and record it to
some table, but what i am wondering about is how user can access to newly
created menus an pages?
FOr egzample, if i create a menu Test, and record all Test attributes
(name, description, metatags etc..) in database, it is not a problem to
fetch it from DB and to add it to existing menu tree.
But what about content of this menu?
I can create a field in table, name it content and assign it to this new
Test. 
How to access this content on website? Do i have to create view file and
controler TestController.php and proper action to show the dinamicly created
content?
The goal is to have a CMS where admin can create menus and content on the
fly.
I hope i was clear enough :)
I would appreciate any advise here
Vladd
-- 
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/Dinamicly-created-Menu-question-tp3018527p3018527.html
Sent from the Zend Framework mailing list archive at Nabble.com.


[fw-general] Zend_Dojo CheckBox validation

2009-01-27 Thread vladimirn

I posted this a few months ago, but never got colution, so i will try one
more time :)
Hopefully someone will be able to help me on this.
I have a zend_dojo WORKING form, but checkbox validation wont work.
I'b been told to try this:
--
? $this-dojo()-javascriptCaptureStart() ?
dojo.addOnLoad(function () {
dojo.connect(dijit.byId(signup), onSubmit, validateForm);
});


function validateForm() {
var form = dijit.byId(signup);
if (!form.validate()) {
alert(Invalid form);
  return false;
  history.back;
}
return true;
} 
? $this-dojo()-javascriptCaptureEnd() ?
? $this-dojo()-onLoadCaptureStart() ?
function () {
dojo.connect(dijit.byId(signup), onSubmit, validateForm);
}
? $this-dojo()-onLoadCaptureEnd() ?
---

This wont work :)

However, in my controller i have this:
--
$agreements-addElement('CheckBox', 'ages', array ( 
   'checked' = 'checked' , 'required' = true , 'label' = 'I\'m
Over 18 years old' 
))-addElement('CheckBox', 'promotions', array ( 
'checked' = 'checked' , 'required' = true , 'label' = 'I
agree NOT to send any email promotions promoting this web site' ,
'invalidMessage' = 'You must validate that you are over 18' 
))-addElement('CheckBox', 'terms', array ( 
'checked' = 'checked' , 'required' = true , 'label' = 'I
agree to the Terms  Conditions' , 'invalidMessage' = 'You must validate
that you are over 18' 
))-addElement('SubmitButton', 'submit', array ( 
'label' = 'Submit!' , 'style' = 'clear:both' 
));
--

The other part of form is not relevant for my question. There are some
fields for name, username, password etc...
SO...
Whatever i am doing, validation of those checkboxes wont work, and if i
UNCHECK them, my form submit proceed. This should not be happen. 
Is there anyone in zend comunity who can help me to solve this? Not just to
drop some solution and then never look back if that helps, but to watch this
topic and my response on it? Please? :)
I am solving this for a moths...
Thanks,
V
-- 
View this message in context: 
http://www.nabble.com/Zend_Dojo-CheckBox-validation-tp21690246p21690246.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Dojo Email validation, checkbox and Submit dojo form question- please?

2008-12-29 Thread vladimirn

There was a few members pointing that this wont work, and i dont have it
worked yet. Any new ideas?

drj201 wrote:
 
 I confirm this does not work using capture... I have the same problem.
 
 Thanks
 
 
 gerardroche wrote:
 
 
 vladimirn wrote:
 
 Alert you suggested me to make wont work as well :(
 phtml:
 ? $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
 Thanks,
 Vladimir
 
 
 
 Sorry, you're right, this doesn't work.
 
 
 The javascript works if you do the following, i.e. paste it in After the
 dojo helper is echoed:
 
 ?php echo $this-dojo()-addStylesheetModule('dijit.themes.tundra'); ?
 
 script type=text/javascript
 //![CDATA[
 dojo.addOnLoad(function () {
 dojo.connect(dijit.byId(form id), onSubmit, validateForm);
 }
 );
 function validateForm() {
 var form = dijit.byId(form id);
 if (form.validate()) {
 alert(Invalid form);
 return false;
 }
 return true;
 }
 //]]
 
 /script
 
 That'll work, but when you capture it it doesn't. Bug?
 
 This is the javascript produced if you capture it via the dojo helper:
 
 
 script type=text/javascript
 //![CDATA[
 dojo.require(dijit.form.ValidationTextBox);
 dojo.require(dijit.form.Button);
 dojo.require(dijit.form.Form);
 dojo.require(dojo.parser);
 dojo.addOnLoad(function () {
 dojo.connect(dijit.byId(form id), onSubmit, validateForm);}
  );
  
 dojo.addOnLoad(function() {
 dojo.forEach(zendDijits, function(info) {
 var n = dojo.byId(info.id);
 if (null != n) {
 dojo.attr(n, dojo.mixin({ id: info.id }, info.params));
 }
 });
 dojo.parser.parse();
 });
 function validateForm() {
 var form = dijit.byId(form id);
 if (!form.validate()) {
 alert(Invalid form);
 return false;
 }
 return true;
 }
 var zendDijits =
 [{id:name,params:{invalidMessage:Required,trim:true,required:true,dojoType:dijit.form.ValidationTextBox}},{id:submit,params:{label:Save,dojoType:dijit.form.Button}},{id:clubForm,params:{dojoType:dijit.form.Form}}];
 //]]
 
 /script
 
 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Zend_Dojo-Email-validation%2C-checkbox-and-Submit-dojo-form-question--please--tp19441003p21208670.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Validation against another field in zend dojo form

2008-12-17 Thread vladimirn

I'v tried solution i found here in forum but it wont work for me.

So, my code looks is:
$form-addElement('ValidationTextBox', 'password', array ( 
'value' = $webmasterData [ 0 ] [ 'password' ] , 
'label' = 'Password' , 
'maxlength' = 20 , 
'regExp' = '\w{6,}' , 
'required' = true , 
'invalidMessage' = 'Password must be longer then 6 characters.'
, 
'filters' = array ( 
'StringTrim' , 
'StringToLower'
) , 'validators' = array ('NotEmpty', array ('StringLength' , true
, array (6 , 20) ) , array ('Regex' , true , array ('/\w+/i'))) 
))-addElement('ValidationTextBox', 'repeatpassword', array ( 
'label' = 'Repeat Password' , 
'maxlength' = 20 , 
'required' = true , 
'filters' = array ( 
'StringTrim' , 
'StringToLower' 
) , 'validators' =  array ( 
'Identical' , 'password'
) 
))

This wont work, and i can enter whatever i want in Repeat Password field.
How to fix that?
Thanks,
V
-- 
View this message in context: 
http://www.nabble.com/Validation-against-another-field-in-zend-dojo-form-tp21052614p21052614.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Zend dojo Editor does not pass value

2008-12-05 Thread vladimirn

Does any one know how to solve that?
I read over a mailing list, but did not find any suitable solution. So i am
kinda stucked here.
There is my actionView:
**
$form = new Zend_Dojo_Form ( );
$form-setMethod ( 'post' )-setAction ( process )-setName ( 
'editNews'
);
$form-setDecorators ( array ('FormElements', array 
('TabContainer', array
('id' = 'tabContainer', 'style' = 'width: 600px; height: 500px;',
'dijitParams' = array ('tabPosition' = 'top' ) ) ), 'DijitForm' ) );
$newsData = new Zend_Dojo_Form_SubForm ( );
$newsData-setAttribs ( array ('name' = 'News Editing', 
'legend' =
'Personal Data', 'style' = 'width:300px;float:left' ) )-setDecorators (
array ('FormElements', array ('HtmlTag', array ('tag' = 'dl' ) ),
'ContentPane' ) );
$newsData-addElement ( 'ValidationTextBox', 'Posted by', array 
('label'
= 'First Name:', 'lowercase' = 'true', 'maxlength' = 20, 'regExp' =
'\w{2,}', 'required' = true, 'invalidMessage' = 'First Name should have
been longer then 1 character??', 'filters' = array ('StringTrim',
'StringToLower' ), 'validators' = array ('NotEmpty', array ('StringLength',
true, array (2, 20 ) ), array ('Regex', true, array ('/\w+/i' ) ) ) )
)-addElement ( 'editor', 'content', array ('plugins' = array ('undo', '|',
'bold', 'italic' ), 'editActionInterval' = 2, 'focusOnLoad' = true,
'height' = '250px', 'inheritWidth' = true ) )-addElement (
'validationTextBox', 'password', array ('type' = 'password', 'label' =
'Password', 'lowercase' = 'true', 'maxlength' = 20, 'regExp' = '\w{6,}',
'required' = true, 'invalidMessage' = 'Password must be longer then 6
characters.', 'filters' = array ('StringTrim', 'StringToLower' ),
'validators' = array ('NotEmpty', array ('StringLength', true, array (6, 20
) ), array ('Regex', true, array ('/\w+/i' ) ) ) ) )-addElement (
'SubmitButton', 'submit', array ('label' = 'Submit!', 'style' =
'clear:both' ) );
$form = $form-addSubForm ( $newsData, 'personalData' );
$this-view-newsEditForm = $form;
**

after processing data to proccessAction() i am getting this:
array(1) {
  [personalData] = array(3) {
[Postedby] = string(9) asdasdasd
[content] = string(0) 
[password] = string(9) asdasdasd
  }
}

As you can see, content from Editor element is not in $_POST 

Thank you,
V
-- 
View this message in context: 
http://www.nabble.com/Zend-dojo-Editor-does-not-pass-value-tp20860862p20860862.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend dojo Editor does not pass value

2008-12-05 Thread vladimirn

Thank you very much :)

Giorgio Sironi wrote:
 
 2008/12/5 vladimirn [EMAIL PROTECTED]
 
 As you can see, content from Editor element is not in $_POST

 
 I had a similar problem using the programmatic model of dojo, switching to
 declarative solved the issue.
 
 -- 
 Giorgio Sironi
 Piccolo Principe  Ossigeno Scripter
 http://www.sourceforge.net/projects/ossigeno
 
 

-- 
View this message in context: 
http://www.nabble.com/Zend-dojo-Editor-does-not-pass-value-tp20860862p20861401.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] AjaxLink in Zend_Dojo

2008-12-03 Thread vladimirn

Is there any way to have same functionality which ajaxLink provide, but in
Zend Dojo?
Thanks,
V
-- 
View this message in context: 
http://www.nabble.com/AjaxLink-in-Zend_Dojo-tp20795432p20795432.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] QUestion about jQuery ajaxLink- can anyone take a look on this please?

2008-12-03 Thread vladimirn

Anyone pls?

-- 
View this message in context: 
http://www.nabble.com/QUestion-about-jQuery-ajaxLink--can-anyone-take-a-look-on-this-please--tp20732925p20795245.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] QUestion about jQuery ajaxLink- can anyone take a look on this please?

2008-12-03 Thread vladimirn

Thank you Daniel, 
i already have this added in my bootstrap.
At least you have read my post :)

ajaxLink works ok . But i need to have ajaxLink inside requested ajaxLInk
content.

Is my english to bad, or no one here can give me an answer? :)
I really want thats about my english and that i dont know to explain :)
If anyone thinks that could help on this, i will explain it over and over,
and make things clear :0)

Thanks in advance,
V

dan.latter wrote:
 
 you need
 
 $view-addHelperPath(ZendX/JQuery/View/Helper,
 ZendX_JQuery_View_Helper);
 
 in your view I think as this is JQuery related.
 
 Thank You
 Daniel Latter
 
 
 
 2008/12/2 vladimirn [EMAIL PROTECTED]:

 Anyone pls?

 --
 View this message in context:
 http://www.nabble.com/QUestion-about-jQuery-ajaxLink--can-anyone-take-a-look-on-this-please--tp20732925p20795245.html
 Sent from the Zend Framework mailing list archive at Nabble.com.


 
 

-- 
View this message in context: 
http://www.nabble.com/QUestion-about-jQuery-ajaxLink--can-anyone-take-a-look-on-this-please--tp20732925p20815247.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] QUestion about jQuery ajaxLink- can anyone take a look on this please?

2008-12-03 Thread vladimirn

Hello Benjamin, thanks for your response.
Are you saying that ajaxLInk could be used only to display pages which must
not have javascipt inside?
So, only plain text and html without javascript will work?
If so, i really dont see real use for it except to play and have ONE quickly
loaded page.
Also, no one told me WHY link name is out of href tags. I copied that part
of page source above, so i think that i have ajaxLink inside ajaxLink
requested page, but its missformated. I dont know.
So i must abandon jQuey for now, considering i dont have any knowledge about
javascript and dont know to write any.
Thanks,
V

beberlei wrote:
 
 Hello vladimirn,
 
 this is just not possible as i said earlier. You have to find a generic
 jQuery 
 by hand written solution for this. I have tested myself if its possible
 with 
 the inline argument, but that gives javascript errors.
 
 The problem is the following. The ajaxLink helper puts jQuery code onto
 the 
 jQuery Helper stack. When you render from ajax the stack has already been 
 outputted to the view, so its missing the hooks for the new links.
 
 If you write some generic javascript yourself you can circumvent this
 problem 
 rather easy.
 
 greetings,
 Benjamin
 
 On Wednesday 03 December 2008 16:36:02 vladimirn wrote:
 Thank you Daniel,
 i already have this added in my bootstrap.
 At least you have read my post :)

 ajaxLink works ok . But i need to have ajaxLink inside requested ajaxLInk
 content.

 Is my english to bad, or no one here can give me an answer? :)
 I really want thats about my english and that i dont know to explain :)
 If anyone thinks that could help on this, i will explain it over and
 over,
 and make things clear :0)

 Thanks in advance,
 V

 dan.latter wrote:
  you need
 
  $view-addHelperPath(ZendX/JQuery/View/Helper,
  ZendX_JQuery_View_Helper);
 
  in your view I think as this is JQuery related.
 
  Thank You
  Daniel Latter
 
  2008/12/2 vladimirn [EMAIL PROTECTED]:
  Anyone pls?
 
  --
  View this message in context:
 
 http://www.nabble.com/QUestion-about-jQuery-ajaxLink--can-anyone-take-a-
 look-on-this-please--tp20732925p20795245.html Sent from the Zend
  Framework mailing list archive at Nabble.com.
 
 -- 
 Benjamin Eberlei
 http://www.beberlei.de
 
 

-- 
View this message in context: 
http://www.nabble.com/QUestion-about-jQuery-ajaxLink--can-anyone-take-a-look-on-this-please--tp20732925p20816016.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] QUestion about jQuery ajaxLink

2008-11-28 Thread vladimirn

Hello all,
I have one simply question.
Whats the use of ajaxLInk? So far i find out that one can use ajaxLink only
like a some kind of toy, which could achieved by using any ajax script to
get some content into desired container.
It is pretty much hard for me to explain, so i will trow an example.

You have an link in your navigation. Eg. Home
This link looks like:
?php echo $this-ajaxLink(
Home, /admin/index/home,
array( 'id' = 'edit',
  'update' = '#content',
'noscript' = false,
'inline' = true,
'dataType'='script',
'method' = 'POST')); 
?
What happens here? We will get things from homeAction within
indexController.php, right?
And thats all?

I am asking this because i want to have another ajaxLink inside #contetn
container. And it seems immpossible to get it work. I tried dataType=html as
well, and nothing happens. 
Does it mean that ajaxLink can be used ONLY outside #container?
I am not familiar with writing any ajax or javascript functions so i am
pretty much stucked on this.
Also i think that great developers from ZF are able to make this work.
Otherwise i dont see some real use of ajaxLink plugin.
I really like idea of having ajaxLink avaliable inside ajaxLink requested
content.
Can anyone help me on this?
-- 
View this message in context: 
http://www.nabble.com/QUestion-about-jQuery-ajaxLink-tp20732925p20732925.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] jQuery Ajax link inside container- how to make this?

2008-11-26 Thread vladimirn

I would like to figure this out:
On my index.phtml page is a link:
--- index.phtml

?=$this-jQuery ();?
?=$this-ajaxLink( 
Home, 
/admin/index/hello, 
array('update' = 
'#contentJ',
  'noscript' = false,
  'method' = 'POST'));
?
- end of index.phtml
--

DIV contentJ is somwhere within same index.phtml page.


This function calling my helloAction inside indexController where i have:
 part of indexController-
helloAction-
$news = $db-fetchAll ( $newssql );
$this-view-news = $news;
 end


and my hello.phtml view script showing:
 hello.phtml
-
?php foreach ( $this-news as $news ) :?
?php echo $news['date'].' - '.$news['postedBy']? nbsp;nbsp;nbsp;nbsp;
?php echo $this-ajaxLink( 
[ Edit ], 
/admin/index/edit, 
array(  'id' = 'edit',

'update' = '#contentJ',

'noscript' = false,

'method' = 'POST'));
?
nbsp;
?php echo $this-ajaxLink( 
[ Delete ], 
/admin/index/delete, 
array(  'id' = 
'delete',

'update' = '#contentJ',

'noscript' = false,

'method' = 'POST'));
?

br
?php echo $news['newsText']?
br
br
?php endforeach; ?
--end of hello.phtml
---

SO far you can see that i tried to create 2 links inside hello.phtml. All
data are displayed, but [ Edit ] and [ Delete ] links are not links at all,
just plain text. 
Is it possible to make them as ajaxLink within given container (contentJ)
and clicking on them, new content is pulled in contentJ div?

Thanks a lot,
V

-- 
View this message in context: 
http://www.nabble.com/jQuery-Ajax-link-inside-container--how-to-make-this--tp20703903p20703903.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] jQuery Ajax link inside container- how to make this?

2008-11-26 Thread vladimirn

THank you for your quick reply.
Can you show me how to this, or point me somewhere where i can learn that
please?
And where to add that?
array('update' = '#contentJ',
  'noscript' = false,
  'method' = 'POST',
  'dataType'='html'
)
Like that?


beberlei wrote:
 
 
 You have to give dataType = html as additoinal parameter to the options,
 because for
 security by default ajax responses are handled as text.
 
 On Wed, 26 Nov 2008 08:07:39 -0800 (PST), vladimirn [EMAIL PROTECTED]
 wrote:
 
 I would like to figure this out:
 On my index.phtml page is a link:
 --- index.phtml
 
 ?=$this-jQuery ();?
 ?=$this-ajaxLink(
  Home, 
 /admin/index/hello,
  array('update' = 
 '#contentJ',
   'noscript' = false,
   'method' = 'POST'));
  ?
 - end of index.phtml
 --
 
 DIV contentJ is somwhere within same index.phtml page.
 
 
 This function calling my helloAction inside indexController where i have:
  part of indexController-
 helloAction-
 $news = $db-fetchAll ( $newssql );
 $this-view-news = $news;
  end
 
 
 and my hello.phtml view script showing:
  hello.phtml
 -
 ?php foreach ( $this-news as $news ) :?
 ?php echo $news['date'].' - '.$news['postedBy']?
 
 ?php echo $this-ajaxLink(
  [ Edit ], 
 /admin/index/edit,
  array(  'id' = 'edit',
  
 'update' = '#contentJ',
  
 'noscript' = false,
  
 'method' = 'POST'));
 ?
  
 ?php echo $this-ajaxLink(
  [ Delete ], 
 /admin/index/delete,
  array(  'id' = 
 'delete',
  
 'update' = '#contentJ',
  
 'noscript' = false,
  
 'method' = 'POST'));
 ?
 
  br
 ?php echo $news['newsText']?
  br
  br
 ?php endforeach; ?
 --end of hello.phtml
 ---
 
 SO far you can see that i tried to create 2 links inside hello.phtml. All
 data are displayed, but [ Edit ] and [ Delete ] links are not links at
 all,
 just plain text.
 Is it possible to make them as ajaxLink within given container (contentJ)
 and clicking on them, new content is pulled in contentJ div?
 
 Thanks a lot,
 V
 
 --
 View this message in context:

 http://www.nabble.com/jQuery-Ajax-link-inside-container--how-to-make-this--tp20703903p20703903.html
 Sent from the Zend Framework mailing list archive at Nabble.com.
 
 
 

-- 
View this message in context: 
http://www.nabble.com/jQuery-Ajax-link-inside-container--how-to-make-this--tp20703903p20704281.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] jQuery Ajax link inside container- how to make this?

2008-11-26 Thread vladimirn

Well, i added dataType to all 3 links, but no changes at all


vladimirn wrote:
 
 THank you for your quick reply.
 Can you show me how to this, or point me somewhere where i can learn that
 please?
 And where to add that?
 array('update' = '#contentJ',
   'noscript' = false,
   'method' = 'POST',
   'dataType'='html'
 )
 Like that?
 
 
 beberlei wrote:
 
 
 You have to give dataType = html as additoinal parameter to the options,
 because for
 security by default ajax responses are handled as text.
 
 On Wed, 26 Nov 2008 08:07:39 -0800 (PST), vladimirn
 [EMAIL PROTECTED]
 wrote:
 
 I would like to figure this out:
 On my index.phtml page is a link:
 --- index.phtml
 
 ?=$this-jQuery ();?
 ?=$this-ajaxLink(
 Home, 
 /admin/index/hello,
 array('update' = 
 '#contentJ',
   'noscript' = false,
   'method' = 'POST'));
 ?
 - end of index.phtml
 --
 
 DIV contentJ is somwhere within same index.phtml page.
 
 
 This function calling my helloAction inside indexController where i
 have:
  part of indexController-
 helloAction-
 $news = $db-fetchAll ( $newssql );
 $this-view-news = $news;
  end
 
 
 and my hello.phtml view script showing:
  hello.phtml
 -
 ?php foreach ( $this-news as $news ) :?
 ?php echo $news['date'].' - '.$news['postedBy']?
 
 ?php echo $this-ajaxLink(
 [ Edit ], 
 /admin/index/edit,
 array(  'id' = 'edit',
 
 'update' = '#contentJ',
 
 'noscript' = false,
 
 'method' = 'POST'));
 ?
  
 ?php echo $this-ajaxLink(
 [ Delete ], 
 /admin/index/delete,
 array(  'id' = 
 'delete',
 
 'update' = '#contentJ',
 
 'noscript' = false,
 
 'method' = 'POST'));
 ?
 
 br
 ?php echo $news['newsText']?
 br
 br
 ?php endforeach; ?
 --end of hello.phtml
 ---
 
 SO far you can see that i tried to create 2 links inside hello.phtml.
 All
 data are displayed, but [ Edit ] and [ Delete ] links are not links at
 all,
 just plain text.
 Is it possible to make them as ajaxLink within given container
 (contentJ)
 and clicking on them, new content is pulled in contentJ div?
 
 Thanks a lot,
 V
 
 --
 View this message in context:

 http://www.nabble.com/jQuery-Ajax-link-inside-container--how-to-make-this--tp20703903p20703903.html
 Sent from the Zend Framework mailing list archive at Nabble.com.
 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/jQuery-Ajax-link-inside-container--how-to-make-this--tp20703903p20704314.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] jQuery Ajax link inside container- how to make this?

2008-11-26 Thread vladimirn

I went thru
http://framework.zend.com/manual/en/zendx.jquery.view.html#zendx.jquery.view.helpers.ajaxlink
and it says that dataType = html is default. However, i explicitly gave this
to my ajaxLink and still wont work.
I tried to change to dataType=text and i am getting code of my hello.phtml

However links inside hello.phtml still wont work.
Can anyone help me on this please? :)
-- 
View this message in context: 
http://www.nabble.com/jQuery-Ajax-link-inside-container--how-to-make-this--tp20703903p20704908.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] jQuery Ajax link inside container- how to make this?

2008-11-26 Thread vladimirn

Thank you for reply.
I tried to set up like this, but still wont work.
I think that would be big deal to make such thing to work, so one can use
ajaxLink inside container requested by another ajaxLInk.
Is there anything else i can try? i would not like to abandon this, cause i
think its a great idea, so i will ask for help one more time ;)

Thanks,
V


beberlei wrote:
 
 Hello,
 
 i have looked at the issue again, and what you try to achieve is not
 really 
 possible. Because ajaxLink generally creates jQuery javascript and
 attaches it 
 to the jQuery stack which you render with ?= $this-jQuery(); ? in your 
 view.
 
 Wenn you call the ajax content and return new links that are created with 
 ajaxLink() their javascript cannot be attached to the jQuery stack
 anymore, 
 because that has been rendered before.
 
 What you could try is the following, in the two links that are generated 
 through the ajax request set in the options 'inline'  = true, and in the 
 previous linke set: 'dataType' = 'script', so that it would look like:
 
 Normally generated link:
  array('update' = '#contentJ',
'noscript' = false,
'method' = 'POST',
'dataType'='script'
  )
 
 Ajax Requested Link:
 ?php echo $this-ajaxLink(
   [ Edit ], /admin/index/edit,
   array(  'id' = 'edit',
   'update' = '#contentJ',
   'noscript' = false,
   'inline' = true,
   'method' = 'POST'));
 
 On Wednesday 26 November 2008 17:27:37 vladimirn wrote:
 Well, i added dataType to all 3 links, but no changes at all

 vladimirn wrote:
  THank you for your quick reply.
  Can you show me how to this, or point me somewhere where i can learn
 that
  please?
  And where to add that?
  array('update' = '#contentJ',
'noscript' = false,
'method' = 'POST',
'dataType'='html'
  )
  Like that?
 
  beberlei wrote:
  You have to give dataType = html as additoinal parameter to the
 options,
  because for
  security by default ajax responses are handled as text.
 
  On Wed, 26 Nov 2008 08:07:39 -0800 (PST), vladimirn
  [EMAIL PROTECTED]
 
  wrote:
  I would like to figure this out:
  On my index.phtml page is a link:
  --- index.phtml
  
  ?=$this-jQuery ();?
  ?=$this-ajaxLink(
   Home, 
  /admin/index/hello,
   array('update' = 
  '#contentJ',
'noscript' = false,
'method' = 'POST'));
   ?
  - end of index.phtml
  --
 
  DIV contentJ is somwhere within same index.phtml page.
 
 
  This function calling my helloAction inside indexController where i
  have:
   part of indexController-
  helloAction-
  $news = $db-fetchAll ( $newssql );
  $this-view-news = $news;
   end
 
 ---
 -
 
  and my hello.phtml view script showing:
   hello.phtml
  -
  ?php foreach ( $this-news as $news ) :?
  ?php echo $news['date'].' - '.$news['postedBy']?
  
  ?php echo $this-ajaxLink(
   [ Edit ], 
  /admin/index/edit,
   array(  'id' = 'edit',
   
  'update' = '#contentJ',
   
  'noscript' = false,
   
  'method' = 'POST'));
  ?
   
  ?php echo $this-ajaxLink(
   [ Delete ], 
  /admin/index/delete,
   array(  'id' = 
  'delete',
   
  'update' = '#contentJ',
   
  'noscript' = false,
   
  'method' = 'POST'));
  ?
 
   br
  ?php echo $news['newsText']?
   br
   br
  ?php endforeach; ?
  --end of hello.phtml
  ---
 
  SO far you can see that i tried to create 2 links inside hello.phtml.
  All
  data are displayed, but [ Edit ] and [ Delete ] links are not links
 at
  all,
  just plain text.
  Is it possible to make them as ajaxLink within given container
  (contentJ)
  and clicking on them, new content is pulled in contentJ div?
 
  Thanks a lot,
  V
 
  --
  View this message

Re: [fw-general] jQuery Ajax link inside container- how to make this?

2008-11-26 Thread vladimirn

Just to add this:
i looked at source after clicked on first ajaxLink and i have this:
#  [ Edit ]nbsp;
#  [ Delete ]   
Somehow, [ Edit ] is out of a href tags..
-- 
View this message in context: 
http://www.nabble.com/jQuery-Ajax-link-inside-container--how-to-make-this--tp20703903p20705645.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] jQuery Ajax link inside container- how to make this?

2008-11-26 Thread vladimirn

Thanks.
Can u just tell me why Edit and Delete are not inside a href in hello.phtml?
It wont allow me to post how link looks like so i will improvize:
href=# id=delete onclick=$.post('/admin/index/hello', {},
function(data, textStatus) { $('#contentJ').html(data); }, 'html');return
false; [Delete]

See? [Delete] is totally out of link tag.
-- 
View this message in context: 
http://www.nabble.com/jQuery-Ajax-link-inside-container--how-to-make-this--tp20703903p20705922.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Unable to find controller index in module admin

2008-11-25 Thread vladimirn

Hello all!
I have to add admin folder into my application structure.
So far i did like this:
/application
-admin/
controllers/
---IndexController.php
views/
---scripts/
---index/
--index.phtml
controllers/
--IndexController.php
--ErrorController.php
views/
and so on...

When i point my url to www.domain.com/admin
i am getting this message:
Unable to find controller index in module admin

in my bootstrap i have something like:
$frontController = Zend_Controller_Front::getInstance();
/* Point the front controller to your action controller directory */
$frontController-addModuleDirectory($base.'/application/admin');
$frontController-setControllerDirectory(array('default'=$base.'/application/controllers','admin'=$base.'application/admin/controllers'));

What i need is to access admin folder which will have different controllers
then rest of the application, pointing URL to www.domain.com/admin
I thought to do this with routing, but i am not sure if this is a good
solution, because i will have a lot controllers in Admin folder, different
from controllers in application direcotory.

Thanks,
V
-- 
View this message in context: 
http://www.nabble.com/Unable-to-find-controller-%22index%22-in-module-%22admin%22-tp20679516p20679516.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Unable to find controller index in module admin

2008-11-25 Thread vladimirn

Hello Matt, 
i dunno why is your reply empty to me :)
However i find solution for this:
In Admin module, i need to name my indexController as Admin_indexController.

Also i changed my bootstrap :
$frontController-setControllerDirectory(
array(
'default' = $base . '/application/controllers',
'admin' = $base . '/application/admin/controllers'
)
);

Thankss,
V

Matthew Weier O'Phinney-3 wrote:
 
 -- vladimirn [EMAIL PROTECTED] wrote
 (on Tuesday, 25 November 2008, 03:31 AM -0800):
 
 Hello all!
 I have to add admin folder into my application structure.
 So far i did like this:
 /application
 -admin/
 controllers/
 ---IndexController.php
 
 Is the class in the above file named Admin_IndexController?
 
 views/
 ---scripts/
 ---index/
 --index.phtml
 controllers/
 --IndexController.php
 --ErrorController.php
 views/
 and so on...
 
 When i point my url to www.domain.com/admin
 i am getting this message:
 Unable to find controller index in module admin
 
 in my bootstrap i have something like:
 $frontController = Zend_Controller_Front::getInstance();
 /* Point the front controller to your action controller directory */
 $frontController-addModuleDirectory($base.'/application/admin');
 $frontController-setControllerDirectory(array('default'=$base.'/application/controllers','admin'=$base.'application/admin/controllers'));
 
 What i need is to access admin folder which will have different
 controllers
 then rest of the application, pointing URL to www.domain.com/admin
 I thought to do this with routing, but i am not sure if this is a good
 solution, because i will have a lot controllers in Admin folder,
 different
 from controllers in application direcotory.
 
 Thanks,
 V
 -- 
 View this message in context:
 http://www.nabble.com/Unable-to-find-controller-%22index%22-in-module-%22admin%22-tp20679516p20679516.html
 Sent from the Zend Framework mailing list archive at Nabble.com.
 
 
 -- 
 Matthew Weier O'Phinney
 Software Architect   | [EMAIL PROTECTED]
 Zend Framework   | http://framework.zend.com/
 
 

-- 
View this message in context: 
http://www.nabble.com/Unable-to-find-controller-%22index%22-in-module-%22admin%22-tp20679516p20680727.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] ZendX Jquery reports Zend_Dojo error???

2008-11-25 Thread vladimirn

I grab this code from documentation and tried to reporoduce some result.
So, this is a code:
public function indexAction() {
$form = new ZendX_JQuery_Form ( );
$form-setDecorators ( array ('FormElements', array 
('AccordionContainer',
array ('id' = 'tabContainer', 'style' = 'width: 600px;', 'jQueryParams' =
array ('alwaysOpen' = false, 'animated' = easeslide ) ) ), 'Form' ) );
$form-setAction ( 'formdemo.php' );
$form-setAttrib ( 'id', 'mainForm' );
$form-setAttrib ( 'class', 'flora' );
$subForm1 = new ZendX_JQuery_Form ( );
$subForm1-setDecorators ( array ('FormElements', array 
('HtmlTag', array
('tag' = 'dl' ) ), array ('TabPane', array ('jQueryParams' = array
('containerId' = 'mainForm', 'title' = 'DatePicker and Slider' ) ) ) ) );

$subForm2 = new ZendX_JQuery_Form ( );
$subForm2-setDecorators ( array ('FormElements', array 
('HtmlTag', array
('tag' = 'dl' ) ), array ('TabPane', array ('jQueryParams' = array
('containerId' = 'mainForm', 'title' = 'AutoComplete and Spinner' ) ) ) )
);
// Add Element Date Picker
$elem = new ZendX_JQuery_Form_Element_DatePicker ( 
datePicker1, array
(label = Date Picker: ) );
$elem-setJQueryParam ( 'dateFormat', 'dd.mm.yy' );
$subForm1-addElement ( $elem );

// Add Element Spinner
$elem = new ZendX_JQuery_Form_Element_Spinner ( spinner1, 
array ('label'
= 'Spinner:' ) );
$elem-setJQueryParams ( array ('min' = 0, 'max' = 1000, 
'start' = 100
) );
$subForm1-addElement ( $elem );

// Add Slider Element
$elem = new ZendX_JQuery_Form_Element_Slider ( slider1, array 
('label'
= 'Slider:' ) );
$elem-setJQueryParams ( array ('defaultValue' = '75' ) );
$subForm2-addElement ( $elem );

// Add Autocomplete Element
$elem = new ZendX_JQuery_Form_Element_AutoComplete ( ac1, 
array ('label'
= 'Autocomplete:' ) );
$elem-setJQueryParams ( array ('data' = array ('New York', 
'Berlin',
'Bern', 'Boston' ) ) );
$subForm2-addElement ( $elem );

// Submit Button
$elem = new Zend_Form_Element_Submit ( btn1, array ('value' 
= 'Submit'
) );
$subForm1-addElement ( $elem );
$form-addSubForm ( $subForm1, 'subform1' );
$form-addSubForm ( $subForm2, 'subform2' );

$formString = $form-render ( $view );
}

AFTER pointing url to the page, i am getting quite strange error:
Fatal error: Call to undefined method
Zend_Dojo_View_Helper_TabContainer::addPane() in
D:\wamp\www\singlescash\library\ZendX\JQuery\View\Helper\TabPane.php on line
72

I think i dont call any Zend_Dojo view helper in here? Or i do?
I am using Zend_dojo forms on web site, but not within this directory and
this controller
-- 
View this message in context: 
http://www.nabble.com/ZendX-Jquery-reports-Zend_Dojo-errortp20682080p20682080.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] ZendX Jquery reports Zend_Dojo error???

2008-11-25 Thread vladimirn

Yes, dojo is enabled in bootstrap file.
How to avoid this conflict? I am not sure that i know how to use
$view-getHelperPath() and $view-getPluginLoader()-getPaths();
Will using this make use of Dojo An JQeury at the same time?
Thanks,
V

beberlei wrote:
 
 but you enabled the View for Dojo support? Because having both Dojo and
 jQuery 
 helpers in your view will probably not work!
 
 you can try this by doing:
 
 $view-getHelperPaths() or
 $view-getPluginLoader()-getPaths()
 
 greetings,
 Benjamin
 
 On Tuesday 25 November 2008 15:55:30 vladimirn wrote:
 I grab this code from documentation and tried to reporoduce some result.
 So, this is a code:
 public function indexAction() {
  $form = new ZendX_JQuery_Form ( );
  $form-setDecorators ( array ('FormElements', array
 ('AccordionContainer', array ('id' = 'tabContainer', 'style' = 'width:
 600px;', 'jQueryParams' = array ('alwaysOpen' = false, 'animated' =
 easeslide ) ) ), 'Form' ) ); $form-setAction ( 'formdemo.php' );
  $form-setAttrib ( 'id', 'mainForm' );
  $form-setAttrib ( 'class', 'flora' );
  $subForm1 = new ZendX_JQuery_Form ( );
  $subForm1-setDecorators ( array ('FormElements', array 
 ('HtmlTag',
 array
 ('tag' = 'dl' ) ), array ('TabPane', array ('jQueryParams' = array
 ('containerId' = 'mainForm', 'title' = 'DatePicker and Slider' ) ) ) )
 );

  $subForm2 = new ZendX_JQuery_Form ( );
  $subForm2-setDecorators ( array ('FormElements', array 
 ('HtmlTag',
 array
 ('tag' = 'dl' ) ), array ('TabPane', array ('jQueryParams' = array
 ('containerId' = 'mainForm', 'title' = 'AutoComplete and Spinner' ) ) )
 )
 );
  // Add Element Date Picker
  $elem = new ZendX_JQuery_Form_Element_DatePicker ( 
 datePicker1, array
 (label = Date Picker: ) );
  $elem-setJQueryParam ( 'dateFormat', 'dd.mm.yy' );
  $subForm1-addElement ( $elem );

  // Add Element Spinner
  $elem = new ZendX_JQuery_Form_Element_Spinner ( spinner1, 
 array
 ('label' = 'Spinner:' ) );
  $elem-setJQueryParams ( array ('min' = 0, 'max' = 1000, 
 'start' =
 100
 ) );
  $subForm1-addElement ( $elem );

  // Add Slider Element
  $elem = new ZendX_JQuery_Form_Element_Slider ( slider1, array
 ('label'
 = 'Slider:' ) );
  $elem-setJQueryParams ( array ('defaultValue' = '75' ) );
  $subForm2-addElement ( $elem );

  // Add Autocomplete Element
  $elem = new ZendX_JQuery_Form_Element_AutoComplete ( ac1, 
 array
 ('label' = 'Autocomplete:' ) );
  $elem-setJQueryParams ( array ('data' = array ('New York', 
 'Berlin',
 'Bern', 'Boston' ) ) );
  $subForm2-addElement ( $elem );

  // Submit Button
  $elem = new Zend_Form_Element_Submit ( btn1, array ('value' =
 'Submit'
 ) );
  $subForm1-addElement ( $elem );
  $form-addSubForm ( $subForm1, 'subform1' );
  $form-addSubForm ( $subForm2, 'subform2' );

  $formString = $form-render ( $view );
  }

 AFTER pointing url to the page, i am getting quite strange error:
 Fatal error: Call to undefined method
 Zend_Dojo_View_Helper_TabContainer::addPane() in
 D:\wamp\www\singlescash\library\ZendX\JQuery\View\Helper\TabPane.php on
 line 72

 I think i dont call any Zend_Dojo view helper in here? Or i do?
 I am using Zend_dojo forms on web site, but not within this directory and
 this controller
 
 -- 
 Benjamin Eberlei
 http://www.beberlei.de
 
 

-- 
View this message in context: 
http://www.nabble.com/ZendX-Jquery-reports-Zend_Dojo-errortp20682080p20684609.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Pagination with routes not working.

2008-11-24 Thread vladimirn

Hey Ace, i had the same problem.
I solved it by making a link which leading me to the page with pagination
like this

before:
wedding/bouquets/category
(above wasnt work for me)
and this one works:
wedding/bouquets/category/1

//in bootstrap
$route3 = new Zend_Controller_Router_Route(
'wedding/bouquets/:bouquet/:page',
array(
'controller' = 'wedding',
'action' = 'bouquet'
)
// $obj = $bouquet-fetchAll('bouquet_category='.$category_id);

//in controller
$db = Zend_Registry::get ( 'db' );
$select = $db-select ()
-from ( 'bouqets', array ('*' ) )
-where ( 'bouquet_category= ?', $category_id );
 // Instantiate the Zend Paginator and give it the Zend_Db_Select instance 
Argument ($selection)
$paginator = Zend_Paginator::factory($select);

// Set parameters for paginator
$paginator-setCurrentPageNumber($this-_getParam(page)); 
// Note: For this to work of course, your URL must be something like
this: http:
//localhost:/index/index/page/1  - meaning we are currently on
page one, and pass that value into the setCurrentPageNumber
$paginator-setItemCountPerPage(3);
$paginator-setPageRange(5);
//$paginator-setCurrentPageNumber(2); 
// Make paginator available in your views
  $this-view-paginator = $paginator;

Ace Paul wrote:
 
 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.-tp20657017p20661726.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Question about zend pagination

2008-11-19 Thread vladimirn

Matt, thanks for posting this link and quote rom documents.
I've already read that before i posted in here :)
How to use that in my example?

Matthew Ratzloff wrote:
 
 From the documentation:
 The following is an example route you might use in an INI configuration
 file:
 
 routes.example.route = articles/:articleName/:page
 routes.example.defaults.controller = articles
 routes.example.defaults.action = view
 routes.example.defaults.page = 1
 routes.example.reqs.articleName = \w+
 routes.example.reqs.page = \d+
 

-- 
View this message in context: 
http://www.nabble.com/Question-about-zend-pagination-tp20543032p20582454.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Question about zend pagination

2008-11-18 Thread vladimirn

Can anyone help on this please? :)
-- 
View this message in context: 
http://www.nabble.com/Question-about-zend-pagination-tp20543032p20555822.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Question about zend pagination

2008-11-18 Thread vladimirn

Thank you Daniel,
This is my view script:
?php if (count($this-paginator)): ?

?php foreach ($this-paginator as $banner): ?
 div
div style=float:left; padding-left:20px ?php echo $banner['bannerurl']
? /div
/div
?php endforeach; ?


?php endif; ?
On the page i am getting expected amount of results.

Then in my controller:
$db = Zend_Registry::get ( 'db' );
$select = $db-select ()
-from ( 'banners', array ('bannerurl', 
'height', 'width', 'bannersize'
) )
-where ( 'active = ?', 'y' )
-where ('programid = ?', $programid)
-where('websiteid = ?', $websiteid)
-where('bannertype = ?', $bannertype)

-order ( 'height', 'ASC' );
$paginator = Zend_Paginator::factory($select);

// Set parameters for paginator
$paginator-setCurrentPageNumber($this-_getParam(page)); 
$paginator-setItemCountPerPage(3);
$paginator-setPageRange(5);
$this-view-paginator = $paginator;

And i am getting this on the page:
  Previous |  1 | 2 |  Next  
( there are 3 pictures, as expected)

And finnaly there is a links produced:
div class=paginationControl
!-- Previous page link -- 
 
  lt; Previous | 
 

!-- Numbered page links --
 
  1 | 
   
   /display/2/CL/3 2  | 
  
!-- Next page link -- 
 
   /display/2/CL/3 Next gt; 
 
/div

Above code for links i am getting via paginator.phtml 
It looks like:
?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; ? 


So, finnal thouth :)
I am getting number of results as expectede, and i am getting pagination
div, as expected, but when i click on Next, or on 2(which is a link) i am
not navigated to the next page, same page just reload, and shows same
pictures. Also, links( 1,2,Next,Previous) dont change as visited or
something if you know what i mean.

Thanks a lot,
V


-- 
View this message in context: 
http://www.nabble.com/Question-about-zend-pagination-tp20543032p20565246.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Question about zend pagination

2008-11-18 Thread vladimirn

I have this in my route:
$route = new Zend_Controller_Router_Route(
'display/:pid/:wid/:type',
array(
'controller' = 'banners',
'action' = 'display'
)
);

$router-addRoute('display', $route);

Matthew Ratzloff wrote:
 
 Do you define a page parameter in your route?
 -Matt
 
 On Tue, Nov 18, 2008 at 10:14 AM, vladimirn [EMAIL PROTECTED] wrote:
 

 Thank you Daniel,
 This is my view script:
 ?php if (count($this-paginator)): ?

 ?php foreach ($this-paginator as $banner): ?
  div
 div style=float:left; padding-left:20px ?php echo
 $banner['bannerurl']
 ? /div
 /div
 ?php endforeach; ?


 ?php endif; ?
 On the page i am getting expected amount of results.

 Then in my controller:
 $db = Zend_Registry::get ( 'db' );
$select = $db-select ()
-from ( 'banners', array ('bannerurl',
 'height', 'width', 'bannersize'
 ) )
-where ( 'active = ?', 'y' )
-where ('programid = ?', $programid)
-where('websiteid = ?', $websiteid)
-where('bannertype = ?', $bannertype)

-order ( 'height', 'ASC' );
$paginator = Zend_Paginator::factory($select);

 // Set parameters for paginator
$paginator-setCurrentPageNumber($this-_getParam(page));
$paginator-setItemCountPerPage(3);
$paginator-setPageRange(5);
$this-view-paginator = $paginator;

 And i am getting this on the page:
   Previous |  1 | 2 |  Next 
 ( there are 3 pictures, as expected)

 And finnaly there is a links produced:
 div class=paginationControl
 !-- Previous page link --

  lt; Previous |


 !-- Numbered page links --

  1 |

   /display/2/CL/3 2  |

 !-- Next page link --

   /display/2/CL/3 Next gt;

 /div

 Above code for links i am getting via paginator.phtml
 It looks like:
 ?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; ?


 So, finnal thouth :)
 I am getting number of results as expectede, and i am getting pagination
 div, as expected, but when i click on Next, or on 2(which is a link) i am
 not navigated to the next page, same page just reload, and shows same
 pictures. Also, links( 1,2,Next,Previous) dont change as visited or
 something if you know what i mean.

 Thanks a lot,
 V


 --
 View this message in context:
 http://www.nabble.com/Question-about-zend-pagination-tp20543032p20565246.html
 Sent from the Zend Framework mailing list archive at Nabble.com.


 
 

-- 
View this message in context: 
http://www.nabble.com/Question-about-zend-pagination-tp20543032p20569014.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Question about zend pagination

2008-11-17 Thread vladimirn

I have a problem with zend pagination.
In my controller i have this:
$result = $db-fetchAll ( $sql );
$page = $this-_getParam ( 'page', 1 );
$paginator = Zend_Paginator::factory ( $result );
$paginator-setItemCountPerPage ( 2 );
$paginator-setCurrentPageNumber ( $page );
$paginator-setPageRange ( 5 );
Zend_View_Helper_PaginationControl::setDefaultViewPartial (
'paginator.phtml' );
$this-view-paginator = $paginator;

Now in my view file i am getting this:
Start |  Previous | 1 2  3  | Next  |  End   Page 1 of 3

Page 2 and 3 and Next are links, but when i click on them, my browser
reload, but same result is display on the page. Actually i am not getting
result for page 2, 3 or next. Same result as for page 1 is displayed. How to
fix this?

Thanks,
V
-- 
View this message in context: 
http://www.nabble.com/Question-about-zend-pagination-tp20543032p20543032.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Question about zend pagination

2008-11-17 Thread vladimirn

Thank you for swift replay :)

Now i went with this:
$page = $this-_request-getParam('page') ;
$db = Zend_Registry::get ( 'db' );
$select = $db-select ()
-from ( 'banners', array ('bannerurl', 
'height', 'width', 'bannersize'
) )
-where ( 'active = ?', 'y' )
-where ('programid = ?', $programid)
-where('websiteid = ?', $websiteid)
-where('bannertype = ?', $bannertype)

-order ( 'height', 'ASC' );
 
$paginator = Zend_Paginator::factory($select);
   $paginator-setItemCountPerPage(3);
   $paginator-setCurrentPageNumber($page);
   $paginator-setPageRange(3);
   $paginator-setDefaultScrollingStyle('Sliding');

  
Zend_View_Helper_PaginationControl::setDefaultViewPartial('paginator.phtml');
   $this-view-paginator = $paginator; 

Still cant get proper results. Links are clickable, but not lead to next
page.
In display.phtml i have:
?php echo $this-paginator ?
?php foreach ( $this-paginator as $banner ) :?
div
div style=float:left; padding-left:20px ?php echo $banner['bannerurl']
? /div
/div
?php endforeach; ?

Any suggestion?
Thanks
V
-- 
View this message in context: 
http://www.nabble.com/Question-about-zend-pagination-tp20543032p20544008.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Question about zend pagination

2008-11-17 Thread vladimirn

i cant provide a link it is on my localhost :(
However, i cant get it working..
-- 
View this message in context: 
http://www.nabble.com/Question-about-zend-pagination-tp20543032p20547855.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] passing values from URL to zend dojo

2008-11-12 Thread vladimirn

Hey all,
I have a link http://www.example.com/banners where i am displaying some
tabelar stats about number of banners.
In movie category i have 3 banners. I would like to click on this number(3)
and that zend_dojo nicely do the job :)
Basicly i would like to display those 3 banners from the movie category(or
any other category) when you click on number of banners(3) using zend_dojo
if possible.
How to properly create a link for this and how to get values from created
link? I wish to have an action display within bannerController. I dont know
how to pass values from URL to displayAction().

eg. http://wwwexample.com/banners/display/2/HM/1 where /2 is category, HM is
first caps letter of the movie and /1 is a type of banner (horisontal,
vertical..)

Any ideas?
Thanks,
V
-- 
View this message in context: 
http://www.nabble.com/passing-values-from-URL-to-zend-dojo-tp20459719p20459719.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] How to return result from this sql?

2008-11-07 Thread vladimirn

Hi all,
i am stucked with this. I have to transform regular sql into Zend DB sql and
then to return values in my phtml file. After many days i am not able to
acompish that. There is my indexAction.


public function indexAction() {
$db = Zend_Registry::get ( 'db' );
$sql = $db-select ()
-from ( 'bannertype', array ('bannertypeid', 'bannercat',
'bannercatdesc', 'active','bannersacross','view_type' ) )
-where ( 'active = ?', 'y' )-order ( 'bannertypeid','ASC' );
$rez = $sql-query ();
$i=-1;
while($res = $rez-fetchAll ()){
foreach($res as $key=$value){
$i++;
//print_r($res);
$banncat= $res[$i]['bannertypeid']; 
}
$this-view-bannerCategorie = $res;
$result = $db-fetchAll(SELECT ws.*,b.*,bt.*,
(SELECT COUNT(*) FROM banners b WHERE b.websiteid = ws.websiteid AND
b.bannertype= '$banncat') AS theCountCategory1,
(SELECT bannercat FROM bannertype c WHERE c.bannertypeid= '$banncat') AS
theNameCategory1
FROM websites ws left join banners b on b.websiteid=ws.websiteid 
left join bannertype bt on b.bannertype=bt.bannertypeid where
b.bannertype='$banncat' group by ws.websiteid);
echo pre;print_r($result);echo /pre;// this gives me an array

$this-view-result = $result;// this one returns nothing to phtml :(
}
}


How to pass this result into phtml?
Thank you,
V
-- 
View this message in context: 
http://www.nabble.com/How-to-return-result-from-this-sql--tp20377930p20377930.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Checkbox and Dojo_foRM validation, please help if anyone know how

2008-10-01 Thread vladimirn

So, are we back from conference? :)

vladimirn wrote:
 
 Ah :)
 I would like i am there :)
 Have a nice time :)
 
 Matthew Weier O'Phinney-3 wrote:
 
 -- vladimirn [EMAIL PROTECTED] wrote
 (on Wednesday, 17 September 2008, 08:11 AM -0700):
 
 Anyone? :(
 
 Sorry, a lot of us are at ZendCon this week. ;)
 
 
 
 vladimirn wrote:
  
  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-if-anyone-know-how-tp19512338p19534303.html
 Sent from the Zend Framework mailing list archive at Nabble.com.
 
 
 -- 
 Matthew Weier O'Phinney
 Software Architect   | [EMAIL PROTECTED]
 Zend Framework   | http://framework.zend.com/
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Checkbox-and-Dojo_foRM-validation%2C-please-help-if-anyone-know-how-tp19512338p19756726.html
Sent from the Zend Framework mailing list archive at Nabble.com.



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

2008-09-17 Thread vladimirn

Thanks Themodem.
Does anyone knows if Zend FW team will make some solution for this? 


Themodem wrote:
 
 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--tp19498776p19534258.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Checkbox and Dojo_foRM validation, please help if anyone know how

2008-09-17 Thread vladimirn

Anyone? :(


vladimirn wrote:
 
 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-if-anyone-know-how-tp19512338p19534303.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Checkbox and Dojo_foRM validation, please help if anyone know how

2008-09-17 Thread vladimirn

Ah :)
I would like i am there :)
Have a nice time :)

Matthew Weier O'Phinney-3 wrote:
 
 -- vladimirn [EMAIL PROTECTED] wrote
 (on Wednesday, 17 September 2008, 08:11 AM -0700):
 
 Anyone? :(
 
 Sorry, a lot of us are at ZendCon this week. ;)
 
 
 
 vladimirn wrote:
  
  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-if-anyone-know-how-tp19512338p19534303.html
 Sent from the Zend Framework mailing list archive at Nabble.com.
 
 
 -- 
 Matthew Weier O'Phinney
 Software Architect   | [EMAIL PROTECTED]
 Zend Framework   | http://framework.zend.com/
 
 

-- 
View this message in context: 
http://www.nabble.com/Checkbox-and-Dojo_foRM-validation%2C-please-help-if-anyone-know-how-tp19512338p19536978.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[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] One simple problem tooks me 2 hour- hope it will help someone..

2008-09-12 Thread vladimirn

Now i have similar(or not) issue.
Fatal error: Uncaught exception 'Zend_Loader_PluginLoader_Exception' with
message 'Plugin by name LoggedInUser was not found in the registry.

I have in application/views/helpers/ file LoggedInUser.php

?php
class Zend_View_Helper_LoggedInUser
{
protected $_view;
function setView($view) 
{ 
$this-_view = $view; 
} 
function loggedInUser()
{
$auth = Zend_Auth::getInstance();
if($auth-hasIdentity()) 
{
$logoutUrl = $this-_view-linkTo('login/logout');
$user = $auth-getIdentity(); 

$username = $this-_view-escape(ucfirst($user));
$string = 'Welcome ' . $username . ' |  ' .
$logoutUrl . ' Log out ';
} else {
//$loginUrl = $this-_view-linkTo('auth/identify'); #4
//$string = ' '. $loginUrl . ' Log in '; #5
}if (isset($user)) {
return $string;}
}
}

In my layout i am trying to do next:
?php if (!$this-loggedInUser()):?
div id=header.

In bootstrap file i have:
$base  = realpath(dirname(__FILE__) . '/../');
$paths = array(
'.', 
$base . '/library',
$base . '/application',
$base . '/application/forms',
$base . '/application/models',
);
ini_set('include_path', implode(PATH_SEPARATOR, $paths));

I would like to say that i already read similar topic here, but didnt helped
me.

Thank you very much,
Vladimir

-- 
View this message in context: 
http://www.nabble.com/One-simple-problem-tooks-me-2-hour--hope-it-will-help-someone..-tp19445706p19460458.html
Sent from the Zend Framework mailing list archive at Nabble.com.



RE: [fw-general] One simple problem tooks me 2 hour- hope it will help someone..

2008-09-12 Thread vladimirn



vRandom wrote:
 
 
 I don't see a reference to a helper path for the view to use.
 
 Something like : $this-_view-addHelperPath('path-to-helpers-dir'); 
 
 Hope it helps
 
 Terre
 
 
 


Thanks Terre :)
-- 
View this message in context: 
http://www.nabble.com/One-simple-problem-tooks-me-2-hour--hope-it-will-help-someone..-tp19445706p19462333.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Dojo Email validation, checkbox and Submit dojo form question- please?

2008-09-12 Thread vladimirn

Dear Matthew, 
thanks for your help.
I managed to prevent submiting form before all required fields are properly
filled.


Email:
-addElement ( 'validationTextBox', 'email', array ('required' = true,
'label' = 'Email address', 'regExp' =
'[EMAIL PROTECTED],4}\b', 'invalidMessage' =
'Please provide valid Email address.', 'filters' = array ('StringTrim',
'StringToLower' ), 'validators' = array ('NotEmpty', array ('StringLength',
true, array (6, 20 ) ), array ('Regex', true, array ('/\w+/i' ) ) ) ) )
(maybe someone will find this usefull)

BUT! :))

my checkboxes wont work :)

$agreements
-addElement ( 'checkbox', 'ages', array ('required' = true, 'label' =
'I\'m Over 18 years old', 'invalidMessage' = 'You must validate that you
are over 18' ) )
-addElement ( 'checkbox', 'promotions', array ('required' = true, 'label'
= 'I agree NOT to send any email promotions promoting this web site',
'invalidMessage' = 'You must validate that you are over 18' ) )
-addElement ( 'checkbox', 'terms', array ('required' = true, 'label' = 'I
agree to the Terms  Conditions', 'invalidMessage' = 'You must validate
that you are over 18' ) );

$form = new Zend_Dojo_Form ( );
$form-setMethod ( 'post' )-setAction ( /signup/process )-setName (
'signup' );

Alert you suggested me to make wont work as well :(
phtml:
? $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


Thanks,
Vladimir
-- 
View this message in context: 
http://www.nabble.com/Zend_Dojo-Email-validation%2C-checkbox-and-Submit-dojo-form-question--please--tp19441003p19462822.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend Form Grouping Elements

2008-09-11 Thread vladimirn

Hello Mathew,
I tried this, but wont work for me.
$form-addDisplayGroupPrefixPath('forms_Decorator', 'forms/Decorator');
.
 $form-addDisplayGroup(array('username', 'password'), 'login', array(
'legend' = 'Please Login:',
'decorators' = array(
'FormElements',
array('DivWrapper', array(
'labelFor'   = 'login',
'labelClass' = 'required left optional',
))
), 
..
and i have application/forms/Decorator/ with DivWrapper.php in it.
in bootstrap:
$base  = realpath(dirname(__FILE__) . '/../');
$paths = array(
'.', 
$base . '/library',
$base . '/application',
$base . '/application/forms',
$base . '/application/models',
);
ini_set('include_path', implode(PATH_SEPARATOR, $paths));

Error i am getting:
exception 'Zend_Loader_PluginLoader_Exception' with message 'Plugin by name
DivWrapper was not found in the registry.' in

Any suggestion?
Thanks
Vladimir

Matthew Weier O'Phinney-3 wrote:
 
 What did you try? :)
 
 Here's what I'd try: you'll need to create a custom decorator for the
 display group, which I'll detail below, and then the following
 element/group definitions.
 
 $form-addDisplayGroupPrefixPath('My_Form_Decorator',
 'My/Form/Decorator');
 $form-addElement('text', 'txtZipcode', array(
 'size'   = 10,
 'maxlength'  = 10,
 'class'  = 'true',
 'required'   = 'true',
 'decorators' = array('ViewHelper'),
 ));
 $form-addElement('text', 'txtCity', array(
 'size'   = 30,
 'maxlength'  = 20,
 'class'  = 'true',
 'required'   = 'true',
 'decorators' = array('ViewHelper'),
 ));
 $form-addDisplayGroup(array('txtZipcode', 'txtCity'), 'zipCity',
 array(
 'legend' = 'Zipcode/City',
 'decorators' = array(
 'FormElements',
 array('DivWrapper', array(
 'labelFor'   = 'txtZipcode', 
 'labelClass' = 'required left optional',
 ))
 ),
 ));
 
 The DivWrapper decorator would look like this:
 
 My_Form_Decorator_DivWrapper extends Zend_Form_Decorator_Abstract()
 {
 public function render($content)
 {
 $group = $this-getElement();
 if (null === $group) {
 return $content;
 }
 
 $labelFor   = $this-getOption('labelFor');
 $labelClass = $this-getOption('labelClass');
 $label  = $group-getLegend();
 
 $html =EOH
 div class=row
 label for=$labelFor class=$labelClass$label/label
 div class=element
 $content
 /div
 /div
 EOH;
 return $html;
 }
 }
 
 Put the above in My/Form/Decorator/DivWrapper.php on your include path,
 and you should be set.
 
 I think this is a common problem. So hopefully some can give me a hint
 how my decorator needs to look like...
 
 -- 
 Matthew Weier O'Phinney
 Software Architect   | [EMAIL PROTECTED]
 Zend Framework   | http://framework.zend.com/
 
 

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



Re: [fw-general] minial release contains .svn dirs

2008-09-11 Thread vladimirn

I just downloaded minimal, 3 min ago and there is .svn inside 

tfk wrote:
 
 On Thu, Sep 11, 2008 at 7:54 PM, Jordan Moore [EMAIL PROTECTED]
 wrote:
 I just downloaded both minimal zip and tar.gz archives, and neither
 one contained any .svn directories.
 
 Do you think I was dreaming? =)
 
 Thanks for fixing, whoever did it.
 
 

-- 
View this message in context: 
http://www.nabble.com/minial-release-contains-.svn-dirs-tp19440003p19444848.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] minial release contains .svn dirs

2008-09-11 Thread vladimirn

Oh, my bad, i am sorry, i was looking in the wrong folder with the same
name... i am sorry :)

vladimirn wrote:
 
 I just downloaded minimal, 3 min ago and there is .svn inside 
 
 tfk wrote:
 
 On Thu, Sep 11, 2008 at 7:54 PM, Jordan Moore [EMAIL PROTECTED]
 wrote:
 I just downloaded both minimal zip and tar.gz archives, and neither
 one contained any .svn directories.
 
 Do you think I was dreaming? =)
 
 Thanks for fixing, whoever did it.
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/minial-release-contains-.svn-dirs-tp19440003p19445012.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Zend_Dojo Email validation, checkbox and Submit dojo form question- please?

2008-09-11 Thread vladimirn

Hello guys,
I made my first Zend_dojo_form and I have 3 questions so far :)


I've attached file with my signupController.php because its to long to be
posted here. http://www.nabble.com/file/p19441003/signupController.php.txt
signupController.php.txt 
Its .txt but you can see whats inside.


I dont know how to do next things:
1. All fields in my form are required. But if you hit Submit button, all
validation are some kind a avoided and i am redirected to my form action
(signup/process). How to prevent form to do this?
My Code:
$footer= new Zend_Dojo_Form_SubForm();
$footer-setAttribs(array('name' = 'footerData','legend' =
'Submit','style' = 'clear:both')); 
$footer-addElement('SubmitButton', 'submit', 
array(
'label' = 'Submit!'
));

$form = $form   -addSubForm($personalData, 'personalData')
-addSubForm($agreements,'agreements')
-addSubForm($footer,'footerData');
2. I also have a 3 checkbox. All 3 must be checked to procced. But form
procced no matter what.
My code:
$agreements= new Zend_Dojo_Form_SubForm();
$agreements-setAttribs(array('name' = 'agreements','legend' =
'Submit','class' = 'agreements'));
$agreements -addElement('checkbox','ages',array('required'
=true,'checked'=true,'style'='float:left' ,'label'='I\'m Over 18 years
old','invalidMessage' = 'You must validate that you are over 18',))

-addElement('checkbox','promotions',array('required'
=true,'checked'=true,'style'='float:left' ,'label'='I agree NOT to send
any email promotions promoting this web site','invalidMessage' = 'You must
validate that you are over 18',))
-addElement('checkbox','terms',array('required'
=true,'checked'=true,'style'='float:left' ,'label'='I agree to the Terms
 Conditions','invalidMessage' = 'You must validate that you are over
18',));

3. Is there any way to validate a field if i need that this field have a
valid URL address? 
My code:
$personalData-addElement ( 
'validationTextBox', 
'url', 
array ( 
'label' = 'Main Site URL:', 
'lowercase' = 'true', 
'maxlength' = 40, 
'value'='http://', 
'required' = true, 
'invalidMessage' = 'Please enter your web site 
URL.', 
'filters' = array (
'StringTrim', 
'StringToLower' ), 
'validators' = array (
'NotEmpty',) ) )

4. Is it possible to validate Email address with Zend_Dojo_Form?
My code is like this:
$personalData-addElement( 
'validationTextBox', 
'email', 
array(
'required' = true , 
'label' = 'Email address' , 
'invalidMessage' = 'Please provide valid Email 
address.', 
'filters' = array('StringTrim', 
'StringToLower') , 
'validators' = array('NotEmpty',

array('StringLength', true, array (6, 20 ) ),

array('EmailAddress' , true, array(
)

This aint work :)
Can someone help me on this please?
Thanks Vladimir
-- 
View this message in context: 
http://www.nabble.com/Zend_Dojo-Email-validation%2C-checkbox-and-Submit-dojo-form-question--please--tp19441003p19441003.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] One simple problem tooks me 2 hour- hope it will help someone..

2008-09-11 Thread vladimirn

I am windows user.
So i had in my signupForm:
-addElement ( 'MultiSelect', 'promotion', 

everything works fine on my computer (windows vista) and when i uploaded
file on the web server(linux) i got error message that Plugin MultiSelect
wasnt found

After two hours of updating library from zend framewrok, and headache, i
found that
-addElement ( 'multiselect', 'promotion', ... is working.
All cases had to be lowered.

Hope this will help someone...
-- 
View this message in context: 
http://www.nabble.com/One-simple-problem-tooks-me-2-hour--hope-it-will-help-someone..-tp19445706p19445706.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Can someone help about zend multipage form? Example from ZF docs doesnt work

2008-09-05 Thread vladimirn

Hello all,
I already posted this, but no one answered, so  i deleted this post and i
will try with this one.
I used Example 19.9. Registration Form Example.
I did change the name of the file, and added some fields inside subforms and
delete some others.
SO imo, this should not cause this example from not working. Actually it
works, and all data provided do the validation, and button save and continue
works as well, but!
On every page i am getting this message:
Strict Standards: Declaration of forms_Registration::setSubFormDecorators()
should be compatible with that of Zend_Form::setSubFormDecorators()

What i need to paste here to helpp you to help me? :)
I didnt change anything from egzample in Zend docs but some fields inside
subforms.

-- 
View this message in context: 
http://www.nabble.com/Can-someone-help-about-zend-multipage-form--Example-from-ZF-docs-doesnt-work-tp19332460p19332460.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend Layout and _forward

2008-08-28 Thread vladimirn

Not so hard i think.
If i understud well, you should use $this-_forward at the end of you
action.
So lets say you have IndexController.php and in this controller you want to
use forward 
?php 

class IndexController extends Zend_Controller_Action
{
public function indexAction()
{
//there is some stuff you want to do
//and now you are calling your NavController
$this-_forward('menu','nav'); // where 'menu' stand for menuAction in
NavController and 'nav' is a NavController.php
}
}

Also you will like to setup in scripts/view/nav/menu.phtml and put in this
file whatever you want

then in you layout.phtml just call ?=$this-layout()-nav ?

i hope this will work or help :)




pvechi wrote:
 
 Thanks for your reply Tobias.
 
 In my example where I send only the title to the nav variable, i do so for
 illustrative purposes. Eventually i want to send  a complete navigation
 menu.
 
 However, I am looking for direction with the code based on the example in
 the ZF documentation. I am unsure how to create the menu based on the
 layout view script, actionstack, or maybe the use of _forward, as it
 implies in the doucmentation.
 
 ++Tx
 
 Pete
 
 
 Tobias Schifftner wrote:
 
 Normally you should not always forward to an other action. Only if you
 really need to do so. Not all the time...
 
 Well, as I can see you use already ?= $this-layout()-content; ?, so
 all other $this-view variables will be within that. In your view script
 view/scripts/action.phtml you can just use
 
 ?= $this-title ?
 
 But this only works when you not forward all the time. Just stay in you
 indexAction() function and you can easily use your variables in
 view/scripts/index.phtml
 
 
 

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



Re: [fw-general] How to add select=selected in Zend_Form_Element_Multiselect

2008-08-27 Thread vladimirn



Martin Martinov-2 wrote:
 
 Use the onchenge event of your select tag.
 
 -- 
 Regards,
 Martin Martinov
 http://mmartinov.com/
 
 
Thanks Martin, but if i use onChange event in select tag, this will show
hidden text area on any change inside multiselect, right? I need to make
text area visible only if user choose third option.
-- 
View this message in context: 
http://www.nabble.com/How-to-add-select%3Dselected-in-Zend_Form_Element_Multiselect-and-one-more-question-%3A%29-tp19166233p19176062.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] How to add select=selected in Zend_Form_Element_Multiselect

2008-08-27 Thread vladimirn

Well,  ok.
Thanks for your reply.
I still dont understand how to put onClick or some other event inside
option tag which is created by Zend_Form_Element_Multiselect.
I was not asking how to use js. 




Martin Martinov-2 wrote:
 
 2008/8/27 vladimirn [EMAIL PROTECTED]:



 Martin Martinov-2 wrote:

 Use the onchenge event of your select tag.

 --
 Regards,
 Martin Martinov
 http://mmartinov.com/


 Thanks Martin, but if i use onChange event in select tag, this will show
 hidden text area on any change inside multiselect, right? I need to make
 text area visible only if user choose third option.
 --
 View this message in context:
 http://www.nabble.com/How-to-add-select%3Dselected-in-Zend_Form_Element_Multiselect-and-one-more-question-%3A%29-tp19166233p19176062.html
 Sent from the Zend Framework mailing list archive at Nabble.com.


 
 Well, you'll just have to count how many options are selected in the
 onchange event handler, and show/hide your textarea as appropriate.
 This list is really not the place to discuss this thing :-)
 
 -- 
 Regards,
 Martin Martinov
 http://mmartinov.com/
 
 

-- 
View this message in context: 
http://www.nabble.com/How-to-add-select%3Dselected-in-Zend_Form_Element_Multiselect-and-one-more-question-%3A%29-tp19166233p19176713.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] How to add select=selected in Zend_Form_Element_Multiselect

2008-08-26 Thread vladimirn

I was searching all over but failed to find a way to add selected=selected
into multiselect.
My code is like this:
[code]
$listOptions=(array(
'first'= 'first choice',
'second' = 'second choice',
'third' = 'third choice'
);

$lists = new Zend_Form_SubForm();
$lists-addElements(array(
new Zend_Form_Element_Multiselect('nameOfMultiselect',array(
'label' = 'Select all you can apply',
'required'  =true,
'filters'   =array('StringTrim'),
'multiOptions'  = $listOptions,

'validators'= array(
array('InArray', false, array(array_keys($listOptions)))
)
))
));
[/code]

I would like to have selected second choice when multiselect display.
How this can be done?
Thanks,
Vladimir
-- 
View this message in context: 
http://www.nabble.com/How-to-add-select%3Dselected-in-Zend_Form_Element_Multiselect-tp19166233p19166233.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Zend Dojo and Back button in browser

2008-08-26 Thread vladimirn

Hello all, i was wondering if any of you have some nice solution for this
problem.
After displaying data on the page(using zend dojo) when i click on browser
Back button, i would like to keep those data on my page but i am navigated
out of page and  my data are lost.
Dojo have some solution using # anchor and something like that, but i dont
like it ;)
Is there any way to keep data pulled by dojo script and without using iframe
and anchor in url?
-- 
View this message in context: 
http://www.nabble.com/Zend-Dojo-and-Back-button-in-browser-tp19166492p19166492.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend Dojo and Back button in browser

2008-08-26 Thread vladimirn



Matthew Weier O'Phinney-3 wrote:
 
 -- vladimirn [EMAIL PROTECTED] wrote
 (on Tuesday, 26 August 2008, 10:35 AM -0700):
 Hello all, i was wondering if any of you have some nice solution for this
 problem.
 After displaying data on the page(using zend dojo) when i click on
 browser
 Back button, i would like to keep those data on my page but i am
 navigated
 out of page and  my data are lost.
 Dojo have some solution using # anchor and something like that, but i
 dont
 like it ;)
 
 Well, I have to question not using technology just because you don't
 like it. ;)
 
 What don't you like about it? This is becoming a standard mechanism for
 allowing for back button functionality -- gmail uses it, facebook uses
 it... it basically leverages the browser's inherent functionality.
 
 Is there any way to keep data pulled by dojo script and without using
 iframe
 and anchor in url?
 
 -- 
 Matthew Weier O'Phinney
 Software Architect   | [EMAIL PROTECTED]
 Zend Framework   | http://framework.zend.com/
 
 

Hey Matthew :)
Thanks for swift replay :)
Well, you are absoultely in right about it, it is only my overall feeling
when looking in URL :) looks ugly to me lol
So thats why i asked if there some 'nicer' method to do this :)

-- 
View this message in context: 
http://www.nabble.com/Zend-Dojo-and-Back-button-in-browser-tp19166492p19167256.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] How to add select=selected in Zend_Form_Element_Multiselect

2008-08-26 Thread vladimirn



Matthew Weier O'Phinney-3 wrote:
 
 -- vladimirn [EMAIL PROTECTED] wrote
 (on Tuesday, 26 August 2008, 10:29 AM -0700):
 I was searching all over but failed to find a way to add
 selected=selected
 into multiselect.
 My code is like this:
 [code]
 $listOptions=(array(
 'first'= 'first choice',
 'second' = 'second choice',
 'third' = 'third choice'
 );
 
 $lists = new Zend_Form_SubForm();
 $lists-addElements(array(
 new Zend_Form_Element_Multiselect('nameOfMultiselect',array(
 'label'  = 'Select all you can apply',
 
 Add a value. Multiselect expects an array of keys that should be
 selected:
 
   'value'   = array('second'),
 
 'required'   =true,
 'filters'=array('StringTrim'),
 'multiOptions'   = $listOptions,
 
 'validators' = array(
 array('InArray', false,
 array(array_keys($listOptions)))
 )
 ))
 ));
 [/code]
 
 I would like to have selected second choice when multiselect display.
 How this can be done?
 
 
 -- 
 Matthew Weier O'Phinney
 Software Architect   | [EMAIL PROTECTED]
 Zend Framework   | http://framework.zend.com/
 
 


Dang!
as simply as that :)
Thank you Matthew.

Well, is there a room to ask another question? or should i open a new topic?
I need to add hidden text area bellow multiselect, and if you select third
choice, this hidden box should appear visible.
How to set up something like this?
Thanks a lot,
Vladd

p.s. [off topic] about zend dojo webinar- can u post a link to my mail or
here pls?
-- 
View this message in context: 
http://www.nabble.com/How-to-add-select%3Dselected-in-Zend_Form_Element_Multiselect-tp19166233p19167409.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] How to add select=selected in Zend_Form_Element_Multiselect

2008-08-26 Thread vladimirn

Thanks for the link and for guide lines.
I thought that something like that should be solution, but i need to
rephrase my question-
how to add on click in my array? is there somethin like:
 new Zend_Form_Element_Multiselect('nameOfMultiselect',array(
'label' = 'Select all you can apply',
'required'  =true,
'filters'   =array('StringTrim'),
'multiOptions'  = $listOptions,
'value'   = array('eml'), 
'onClick'   = 'DoSomething'// ---

and more, how to add this on specific array key/value which i am building in 
$listOptions = array(
'first'='first choice',
'second' ='second choice',
'third' = 'third choice',
'clickOne' = 'I want this one to opena hidden text area :)'
);


:))


Matthew Weier O'Phinney-3 wrote:
 
 -- vladimirn [EMAIL PROTECTED] wrote
 (on Tuesday, 26 August 2008, 11:15 AM -0700):
 Well, is there a room to ask another question? or should i open a new
 topic?
 I need to add hidden text area bellow multiselect, and if you select
 third
 choice, this hidden box should appear visible.
 How to set up something like this?
 
 Use javascript to do this. When the page renders, do two things:
 
   * hide the element (set the visibility attribute to 'collapse')
   
   * connect an event handler to the multiselect option that looks for
 the number of selected options and re-displays the hidden element.
 
 For techniques on this, visit your favorite JS toolkit mailing list or
 IRC channel.
 
 p.s. [off topic] about zend dojo webinar- can u post a link to my mail or
 here pls?
 
 Sure:
 

 http://www.zend.com/en/company/news/event/webinar-zend-framework-and-dojo-integration
 
 -- 
 Matthew Weier O'Phinney
 Software Architect   | [EMAIL PROTECTED]
 Zend Framework   | http://framework.zend.com/
 
 

-- 
View this message in context: 
http://www.nabble.com/How-to-add-select%3Dselected-in-Zend_Form_Element_Multiselect-and-one-more-question-%3A%29-tp19166233p19168608.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Strict Standards: i dont understand this warning

2008-08-26 Thread vladimirn

Thank you for reply :)
I see.
But how to solve this?
i used a code from zend manual and this is a  part which i didnt touch (lol)
public function setSubFormDecorators(Zend_Form_SubForm $subForm)
{
$subForm-setDecorators(array(
'FormElements',
array('HtmlTag', array('tag' = 'dl', 'class' = 'zend_form')),
'Form',
));
return $this;
}
So i dont know what to do and how to make it compatible :)


R! wrote:
 
 It means that your method setSubFormDecorators must have same parameters
 as Zend_Form::setSubFormDecorators
 
 vladimirn wrote:
 
 Strict Standards: Declaration of
 forms_Registration::setSubFormDecorators() should be compatible with that
 of Zend_Form::setSubFormDecorators() in
 C:\wamp\www\zend-fw\application\forms\registration.php on line 2
 /* registration.php */
 ?php
 class forms_Registration extends Zend_Form // this is line 2
 {
 public function init()
 {
 // Create user sub form: username and password
 $user = new Zend_Form_SubForm();
 
 What this warning actually means? And it is displayed on every page on my
 multi page registration form.
 Files i am using are registration.php and RegistrationController.php
 
 Thanks,
 Vladd
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Strict-Standards%3A-i-dont-understand-this-warning-tp19167866p19169347.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] How to add select=selected in Zend_Form_Element_Multiselect

2008-08-26 Thread vladimirn

Huh, i think you dont understand me :)) 
I dont know how to put onClick event in select tag :) I know how to make
this without zend form, but cant figure it out how to put onClick in
$listOptions array:)
I will use CAPS just to point on some lines :) sorry about that :)
This array build my select tag if i understud well:
 
 $listOptions = array(
 'first'='first choice',
 'second' ='second choice',
 'third' = 'third choice'
)
and then i am building multiselect as:

$lists = new Zend_Form_SubForm();
$lists-addElements(array(
new Zend_Form_Element_Multiselect('nameOfMultiselect',array(
'label' = 'Select all you can apply',
'required'  =true,
'filters'   =array('StringTrim'),
'multiOptions'  = $listOptions,
'value'   = array('second'), // this one sometimes works and
sometimes not, i cant figure it out why
'onClick'   ='some javascrpt code here',// THIS IS APPLIED 
ON SELECT
TAG INSTEAD ON OPTION TAG :))
'validators'= array(
array('InArray', false, array(array_keys($listOptions)))
)
)),
And later this will be displayed as bellow

select name=lists[nameOfMultiselect][] id=lists-nameOfMultiselect
multiple=multiple onClick=some javascript code here// there is unwanted
onClick event lol, i want this onClick inside of option tag
option value=first label=first choicefirst choice/option
option value=second label=second choicesecond
choice/option//THIS ONE SHOULD BE SELECTED, RIGHT? But somehow it is not
:) Well, sometimes it is selected, but not this time :)
option value=third label=third choicethird choice/option// here
i need onClick event :)







Matthew Weier O'Phinney-3 wrote:
 
 -- vladimirn [EMAIL PROTECTED] wrote
 (on Tuesday, 26 August 2008, 12:23 PM -0700):
 
 Thanks for the link and for guide lines.
 I thought that something like that should be solution, but i need to
 rephrase my question-
 how to add on click in my array? is there somethin like:
  new Zend_Form_Element_Multiselect('nameOfMultiselect',array(
 'label'  = 'Select all you can apply',
 'required'   =true,
 'filters'=array('StringTrim'),
 'multiOptions'   = $listOptions,
 'value'   = array('eml'), 
 'onClick'   = 'DoSomething'// ---
 
 Yep -- any configuration key that does not correspond to an accessor is
 then set as an object property, and passed as an attribute to the view
 helper.
 
 and more, how to add this on specific array key/value which i am building
 in 
 $listOptions = array(
 'first'='first choice',
 'second' ='second choice',
 'third' = 'third choice',
 'clickOne' = 'I want this one to opena hidden text area :)'
 );
 
 Again, go to your favorite JS toolkit mailing list or IRC channel. :)
 
 
 Matthew Weier O'Phinney-3 wrote:
  
  -- vladimirn [EMAIL PROTECTED] wrote
  (on Tuesday, 26 August 2008, 11:15 AM -0700):
  Well, is there a room to ask another question? or should i open a new
  topic?
  I need to add hidden text area bellow multiselect, and if you select
  third
  choice, this hidden box should appear visible.
  How to set up something like this?
  
  Use javascript to do this. When the page renders, do two things:
  
* hide the element (set the visibility attribute to 'collapse')

* connect an event handler to the multiselect option that looks for
  the number of selected options and re-displays the hidden element.
  
  For techniques on this, visit your favorite JS toolkit mailing list or
  IRC channel.
  
  p.s. [off topic] about zend dojo webinar- can u post a link to my mail
 or
  here pls?
  
  Sure:
  
 
 
 http://www.zend.com/en/company/news/event/webinar-zend-framework-and-dojo-integration
  
  -- 
  Matthew Weier O'Phinney
  Software Architect   | [EMAIL PROTECTED]
  Zend Framework   | http://framework.zend.com/
  
  
 
 -- 
 View this message in context:
 http://www.nabble.com/How-to-add-select%3Dselected-in-Zend_Form_Element_Multiselect-and-one-more-question-%3A%29-tp19166233p19168608.html
 Sent from the Zend Framework mailing list archive at Nabble.com.
 
 
 -- 
 Matthew Weier O'Phinney
 Software Architect   | [EMAIL PROTECTED]
 Zend Framework   | http://framework.zend.com/
 
 

-- 
View this message in context: 
http://www.nabble.com/How-to-add-select%3Dselected-in-Zend_Form_Element_Multiselect-and-one-more-question-%3A%29-tp19166233p19169726.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Almost there :) Now, file is on the server but error say that it is not :)

2008-05-19 Thread vladimirn

Error i am gettign is:
ErrorController: script 'banners/admin-index.phtml' not found in path
(application/views/helpers/pagelets/templates/:application/views/scripts/)

I have application/views/scripts/banners on my web server with
admin-index.phtml in this folder.
Exactly as on my localhost, where everything works just fine.

what i am doing wrong?
-- 
View this message in context: 
http://www.nabble.com/Almost-there-%3A%29-Now%2C-file-is-on-the-server-but-error-say-that-it-is-not-%3A%29-tp17326635p17326635.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Almost there :) Now, file is on the server but error say that it is not :)

2008-05-19 Thread vladimirn

Thanks Math! :)
it was permission thing :)
it was set as 775 instead of 755
i changed to 755 and everything went just fine :)
And i dont understand why this caused all my troubles tho :)
However, i really appreciate your help!
Vladimir


Matthew Weier O'Phinney-3 wrote:
 
 -- vladimirn [EMAIL PROTECTED] wrote
 (on Monday, 19 May 2008, 12:54 PM -0700):
 Error i am gettign is:
 ErrorController: script 'banners/admin-index.phtml' not found in path
 (application/views/helpers/pagelets/templates/:application/views/scripts/)
 
 I have application/views/scripts/banners on my web server with
 admin-index.phtml in this folder.
 Exactly as on my localhost, where everything works just fine.
 
 what i am doing wrong?
 
 1. Check permissions
 2. dump your view object's view script paths to verify that the path
exists
 
 Check those, and if you're still having issues, be prepared to post a
 few more details about your app (directory structure, etc.).
 
 -- 
 Matthew Weier O'Phinney
 Software Architect   | [EMAIL PROTECTED]
 Zend - The PHP Company   | http://www.zend.com/
 
 

-- 
View this message in context: 
http://www.nabble.com/Almost-there-%3A%29-Now%2C-file-is-on-the-server-but-error-say-that-it-is-not-%3A%29-tp17326635p17328518.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] noob problem - ZF works on localhost but not on webserver

2008-05-16 Thread vladimirn

Hello Jacob, thank you :)
I will try to explain. 
I have admin part of site. In administration i added new functionality-
adding new banners. 
I made a BannerController.php(controller), Banner.php(model), and following
the example of guy who made whole application i made admin-index.phtml and
admin-update.phtml in scripts/banner folder. 
When you click on link i made in administration- Manage index banner, on my
localhost i am getting a page with form for new banner. And it is working. 

Also there is an index,phtml page where i am calling
?=$this-getActiveBanner()? at some point. And this works fine too on my
localhost.

But when i upload all on live site, clicking on Manage index banner not
showing new form, but redirecting out of administration page, and display
Error 500: Internal server error, please try again  ... or some. :)
If no ideas so far, i can post my methods, so you can take a look into it. 
I am most confusing about that its work on localhost and same files doesn't
work on live server :)

Second question is:
I used existing file which have very similar functionality. It displays data
from other mysql table, but same methods are used. So i just copied existing
files, and made a new one.
Eg. file Popular.php and PopularController.php i renamed to Banner.php and
BannerController.php, and changed protected _name='popular' to
_name='banners'. 
Also changed some html code and when click on Manage index banner i was
getting error: No cuch metod updateBanner. Code for that was:
if($this-Banner-update()).. and then did: require_once('Banner.php');
if(Banner::update()) and then works :)
So i am so confused and dont have any clues about all this :)
Thank you one more time, 
Vladimir


oetting wrote:
 
 Hi and welcome :)
 
 You will have to supply more details about your problem for anyone to be
 able to help.
 
 For instance what kind of error messages do you get?
 
 Jacob Oettinger
 
 
 vladimirn wrote:
 
 First of all i would like to say hello to all in here  Tho, if i missed a
 topic, please move it onto the right place.
 
 Well, i got to make some changes on the web site which has been make with
 zend framework. So i am kinda noob on ZF But job must have be done.
 
 So i started to read tutorials and so on.. My task was to add some
 functionality on the existing web site.
 I did it on my localhost, and everything is just fine. But, when i upload
 files to the web server, it wont work.
 What could be possibly reason? Or reasons? Any ideas? Where to look into?
 Thanks a lot in advance,
 Vladimir
 
 

-- 
View this message in context: 
http://www.nabble.com/noob-problem---ZF-works-on-localhost-but-not-on-webserver-tp17272058p17272439.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] noob problem - ZF works on localhost but not on webserver

2008-05-16 Thread vladimirn

Hello Vincent :)
Web site is live and working on web server.
if($this-Banner-update()) is called in BannerController.php
(currently on webserver is: require_once('Banner.php');
if(Banner::update()))

.htaccess is identical on localhost and web server. I got it from web server
when got this project. And it is working on my localhost.

also i noticed that when i am calling method like: $this-update('some sql
statement') - which is in original file(popular.php - model) i remake for
banners, i am getting error 500. If i use $this-db-update('some sql
statement') it works fine.
Is there a possibility that problem is caused by version of FW? i am not
sure what version i have on my computer. It could be ZF1.5, but not sure and
dont know how to check. On web server i think that this is ZF 1.01. 
Also, there is a folder inside every subfolder on web site which is called
.svn. I dont know what is this for. :)
Sorry if i am bothering with my problem, just i dont know from where to
start to solve it .

@Jacob- i already read acrabat and all tutorial from acrabat web site, but
couldnt figure it out.. :(



Vincent-20 wrote:
 
 On 5/16/08, vladimirn [EMAIL PROTECTED] wrote:


 Hello Jacob, thank you :)
 I will try to explain.
 I have admin part of site. In administration i added new functionality-
 adding new banners.
 I made a BannerController.php(controller), Banner.php(model), and
 following
 the example of guy who made whole application i made admin-index.phtml
 and
 admin-update.phtml in scripts/banner folder.
 When you click on link i made in administration- Manage index banner, on
 my
 localhost i am getting a page with form for new banner. And it is
 working.

 Also there is an index,phtml page where i am calling
 ?=$this-getActiveBanner()? at some point. And this works fine too on
 my
 localhost.

 But when i upload all on live site, clicking on Manage index banner not
 showing new form, but redirecting out of administration page, and display
 Error 500: Internal server error, please try again  ... or some. :)
 If no ideas so far, i can post my methods, so you can take a look into
 it.
 I am most confusing about that its work on localhost and same files
 doesn't
 work on live server :)
 
 
 Has it worked before on the live server? If not, are you sure the rewrite
 rules are correct?
 
 Second question is:
 I used existing file which have very similar functionality. It displays
 data
 from other mysql table, but same methods are used. So i just copied
 existing
 files, and made a new one.
 Eg. file Popular.php and PopularController.php i renamed to Banner.php
 and
 BannerController.php, and changed protected _name='popular' to
 _name='banners'.
 Also changed some html code and when click on Manage index banner i was
 getting error: No cuch metod updateBanner. Code for that was:
 if($this-Banner-update()).. and then did: require_once('Banner.php');
 if(Banner::update()) and then works :)
 
 
 Sorry, I can't follow this. Where are you calling updateBanner?
 
 So i am so confused and dont have any clues about all this :)
 Thank you one more time,
 Vladimir




 Cheers,
 
 -- 
 Vincent
 
 

-- 
View this message in context: 
http://www.nabble.com/noob-problem---ZF-works-on-localhost-but-not-on-webserver-tp17272058p17272949.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] noob problem - ZF works on localhost but not on webserver

2008-05-16 Thread vladimirn

I misstyped what php said :) actually PHP said that method does not exist,
and i know that method exist. But when i include file Banner.php which
contain that method, and change in code from $this-Banner-update to
Banner::update() then works fine.
Original file(which i remake to make banner part) works fine with
$this-Popular-update()...
Also after changes i made, i moved completly folder structure from my
localhost back to web, changing only database data in config.php and
everything working but banners :)
I like zend framework and what ZF offer, but it is so confusing sometimes :)
I am not using SVn cause i cant figure it out how to use it. I read on svn
web site but still dont get it. And it was already on web site i got to
adjust.
Thank you very much for your reply :)


Vincent-20 wrote:
 
 On 5/16/08, vladimirn [EMAIL PROTECTED] wrote:


 Hello Vincent :)
 Web site is live and working on web server.
 if($this-Banner-update()) is called in BannerController.php
 (currently on webserver is: require_once('Banner.php');
 if(Banner::update()))
 
 
 But you said PHP said:
 
 no such method updateBanner

 
 updateBanner() is a different method than update().
 
 .htaccess is identical on localhost and web server. I got it from web
 server
 when got this project. And it is working on my localhost.

 also i noticed that when i am calling method like: $this-update('some
 sql
 statement') - which is in original file(popular.php - model) i remake for
 banners, i am getting error 500. If i use $this-db-update('some sql
 statement') it works fine.
 
 
 Sorry, I don't use Zend_Db so I can't help you here...
 
 Is there a possibility that problem is caused by version of FW? i am not
 sure what version i have on my computer. It could be ZF1.5, but not sure
 and
 dont know how to check. On web server i think that this is ZF 1.01.
 
 
 Using different versions of ZF will very likely cause differences in
 behaviour, best to develop using the same version. The version can be
 checked by opening the file Zend/Version.php, the VERSION contant contains
 the version number.
 
 Also, there is a folder inside every subfolder on web site which is called
 .svn. I dont know what is this for. :)
 
 
 The .svn folders are metadata for Subversion, a Version Control System.
 Apparently this website is managed using Subversion, so it's a little bit
 odd that you're not using it yourself.
 
 Sorry if i am bothering with my problem, just i dont know from where to
 start to solve it .

 @Jacob- i already read acrabat and all tutorial from acrabat web site,
 but
 couldnt figure it out.. :(




 Vincent-20 wrote:
 
  On 5/16/08, vladimirn [EMAIL PROTECTED] wrote:
 
 
  Hello Jacob, thank you :)
  I will try to explain.
  I have admin part of site. In administration i added new
 functionality-
  adding new banners.
  I made a BannerController.php(controller), Banner.php(model), and
  following
  the example of guy who made whole application i made admin-index.phtml
  and
  admin-update.phtml in scripts/banner folder.
  When you click on link i made in administration- Manage index banner,
 on
  my
  localhost i am getting a page with form for new banner. And it is
  working.
 
  Also there is an index,phtml page where i am calling
  ?=$this-getActiveBanner()? at some point. And this works fine too
 on
  my
  localhost.
 
  But when i upload all on live site, clicking on Manage index banner
 not
  showing new form, but redirecting out of administration page, and
 display
  Error 500: Internal server error, please try again  ... or some. :)
  If no ideas so far, i can post my methods, so you can take a look into
  it.
  I am most confusing about that its work on localhost and same files
  doesn't
  work on live server :)
 
 
  Has it worked before on the live server? If not, are you sure the
 rewrite
  rules are correct?
 
  Second question is:
  I used existing file which have very similar functionality. It
 displays
  data
  from other mysql table, but same methods are used. So i just copied
  existing
  files, and made a new one.
  Eg. file Popular.php and PopularController.php i renamed to Banner.php
  and
  BannerController.php, and changed protected _name='popular' to
  _name='banners'.
  Also changed some html code and when click on Manage index banner i
 was
  getting error: No cuch metod updateBanner. Code for that was:
  if($this-Banner-update()).. and then did:
 require_once('Banner.php');
  if(Banner::update()) and then works :)
 
 
  Sorry, I can't follow this. Where are you calling updateBanner?
 
  So i am so confused and dont have any clues about all this :)
  Thank you one more time,
  Vladimir
 
 
 
 
  Cheers,
 
  --
  Vincent
 
 


 --
 View this message in context:
 http://www.nabble.com/noob-problem---ZF-works-on-localhost-but-not-on-webserver-tp17272058p17272949.html

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


 
 
 -- 
 Vincent
 
 

-- 
View this message in context: 
http://www.nabble.com/noob

Re: [fw-general] noob problem - ZF works on localhost but not on webserver

2008-05-16 Thread vladimirn

curently i am not at this computer. I will reply in hour and half :)


Vincent-20 wrote:
 
 On 5/16/08, vladimirn [EMAIL PROTECTED] wrote:


 I misstyped what php said :) actually PHP said that method does not
 exist,

 and i know that method exist. But when i include file Banner.php which

 contain that method, and change in code from $this-Banner-update to
 Banner::update() then works fine.

 Original file(which i remake to make banner part) works fine with

 $this-Popular-update()...
 Also after changes i made, i moved completly folder structure from my
 localhost back to web, changing only database data in config.php and

 everything working but banners :)

 I like zend framework and what ZF offer, but it is so confusing sometimes
 :)
 I am not using SVn cause i cant figure it out how to use it. I read on
 svn
 web site but still dont get it. And it was already on web site i got to
 adjust.
 Thank you very much for your reply :)
 
 
 
 So what does get_class($this-Banner) say?
 
 -- 
 Vincent
 
 

-- 
View this message in context: 
http://www.nabble.com/noob-problem---ZF-works-on-localhost-but-not-on-webserver-tp17272058p17273590.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] noob problem - ZF works on localhost but not on webserver

2008-05-16 Thread vladimirn

BannersController.php - my version of existing method
[code] 
public function adminIndexAction()
{
if (!$this-is_admin()) $this-_redirect(/admin/login);

$this-view-status_list = array('1' = 'online', '0'= 'offline');
$this-view-data = Banners::getBanners();


$this-view-messages = $this-_flashMessenger-getMessages();
}

[/code]
 if i use  $this-view-data = $this-Banners-getBanners(); i am getting:
Fatal error: Call to a member function getBanners() on a non-object in
C:\wamp\www\dev\application\controllers\BannersController.php on line 30

This works just fine on $this-Populars-getPopulars

Existing method i got from Populars.php
[code]
 public function adminIndexAction()
{
if (!$this-is_admin()) $this-_redirect(/admin/login);

$this-view-status_list = array('1' = 'online', '0'= 'offline');
$this-view-data = $this-Populars-getPopulars(false);
$this-view-messages = $this-_flashMessenger-getMessages();
}
[/code]

This is how i remake original method 

public function getBanners()
{  $where = null;
if ($online_only) $where = 'status = 1';

$rowset = $this-db-fetchAll('select * from banners');
if (is_null($rowset)) return array();
$idx = 0;
foreach ($rowset as $row){
$ar_res[$idx]['Banners'] = $row;
$idx++;
}

return $ar_res;
}

Original method was:

public function getPopulars($online_only = true)
{
$where = null;
if ($online_only) $where = 'status = 1';

$rowset = $this-fetchAll($where, $this-getOrder());
if (is_null($rowset)) return array();
$idx = 0;
foreach ($rowset as $row){
$ar_res[$idx]['Populars'] = $row-toArray();
$idx++;
}

return $ar_res;
}
On my local mashine:
When i am using original method, i am redirected to public area of site and
getting this:
Internal server error
Error
An error occurred, please try again later.

if i am using first method i rewrote, everything is working on local
machine, but not on the live site.


Vincent-20 wrote:
 
 On 5/16/08, vladimirn [EMAIL PROTECTED] wrote:


 I misstyped what php said :) actually PHP said that method does not
 exist,

 and i know that method exist. But when i include file Banner.php which

 contain that method, and change in code from $this-Banner-update to
 Banner::update() then works fine.

 Original file(which i remake to make banner part) works fine with

 $this-Popular-update()...
 Also after changes i made, i moved completly folder structure from my
 localhost back to web, changing only database data in config.php and

 everything working but banners :)

 I like zend framework and what ZF offer, but it is so confusing sometimes
 :)
 I am not using SVn cause i cant figure it out how to use it. I read on
 svn
 web site but still dont get it. And it was already on web site i got to
 adjust.
 Thank you very much for your reply :)
 
 
 
 So what does get_class($this-Banner) say?
 
 -- 
 Vincent
 
 

-- 
View this message in context: 
http://www.nabble.com/noob-problem---ZF-works-on-localhost-but-not-on-webserver-tp17272058p17277324.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] noob problem - ZF works on localhost but not on webserver

2008-05-16 Thread vladimirn

this is what i tought :)
but BannersController and PopularController have same methods. This is
init()
public function init()
{
parent::init();

require_once 'Zend/Filter.php';

// load filters
require_once 'Zend/Filter/StripTags.php';
//require_once 'Zend/Filter/HtmlEntities.php';
require_once 'lib/Zend/Filter/StripSlashes.php';

$this-filters = new Zend_Filter();
//$this-filters-addFilter(new Zend_Filter_StripTags())
//-addFilter(new Zend_Filter_HtmlEntities())
$this-filters-addFilter(new Zend_Filter_StripSlashes());
}

Vincent-20 wrote:
 
 On Fri, May 16, 2008 at 5:21 PM, vladimirn [EMAIL PROTECTED] wrote:
 

 BannersController.php - my version of existing method
 [code]
 public function adminIndexAction()
{
if (!$this-is_admin()) $this-_redirect(/admin/login);

$this-view-status_list = array('1' = 'online', '0'=
 'offline');
$this-view-data = Banners::getBanners();


$this-view-messages = $this-_flashMessenger-getMessages();
}

 [/code]
  if i use  $this-view-data = $this-Banners-getBanners(); i am
 getting:
 Fatal error: Call to a member function getBanners() on a non-object in
 C:\wamp\www\dev\application\controllers\BannersController.php on line 30

 
 So $this-Banners is not an object. Perhaps in the PopularController's
 init() method $this-Populars is defined? You'll probably need to do
 something similar in the BannersController, i.e. $this-Banners = new
 Banners().
 
 

 This works just fine on $this-Populars-getPopulars

 Existing method i got from Populars.php
 [code]
  public function adminIndexAction()
{
if (!$this-is_admin()) $this-_redirect(/admin/login);

$this-view-status_list = array('1' = 'online', '0'=
 'offline');
$this-view-data = $this-Populars-getPopulars(false);
$this-view-messages = $this-_flashMessenger-getMessages();
}
 [/code]

 This is how i remake original method

 public function getBanners()
{  $where = null;
if ($online_only) $where = 'status = 1';

$rowset = $this-db-fetchAll('select * from banners');
if (is_null($rowset)) return array();
$idx = 0;
foreach ($rowset as $row){
$ar_res[$idx]['Banners'] = $row;
$idx++;
}

return $ar_res;
 }

 Original method was:

 public function getPopulars($online_only = true)
{
$where = null;
if ($online_only) $where = 'status = 1';

$rowset = $this-fetchAll($where, $this-getOrder());
if (is_null($rowset)) return array();
$idx = 0;
foreach ($rowset as $row){
$ar_res[$idx]['Populars'] = $row-toArray();
$idx++;
}

return $ar_res;
}
 On my local mashine:
 When i am using original method, i am redirected to public area of site
 and
 getting this:
 Internal server error
 Error
 An error occurred, please try again later.

 if i am using first method i rewrote, everything is working on local
 machine, but not on the live site.

 
 Could you post your .htaccess?
 
 


 Vincent-20 wrote:
 
  On 5/16/08, vladimirn [EMAIL PROTECTED] wrote:
 
 
  I misstyped what php said :) actually PHP said that method does not
  exist,
 
  and i know that method exist. But when i include file Banner.php which
 
  contain that method, and change in code from $this-Banner-update to
  Banner::update() then works fine.
 
  Original file(which i remake to make banner part) works fine with
 
  $this-Popular-update()...
  Also after changes i made, i moved completly folder structure from my
  localhost back to web, changing only database data in config.php and
 
  everything working but banners :)
 
  I like zend framework and what ZF offer, but it is so confusing
 sometimes
  :)
  I am not using SVn cause i cant figure it out how to use it. I read on
  svn
  web site but still dont get it. And it was already on web site i got
 to
  adjust.
  Thank you very much for your reply :)
 
 
 
  So what does get_class($this-Banner) say?
 
  --
  Vincent
 
 

 --
 View this message in context:
 http://www.nabble.com/noob-problem---ZF-works-on-localhost-but-not-on-webserver-tp17272058p17277324.html
 Sent from the Zend Framework mailing list archive at Nabble.com.


 
 
 -- 
 Vincent
 
 

-- 
View this message in context: 
http://www.nabble.com/noob-problem---ZF-works-on-localhost-but-not-on-webserver-tp17272058p17278467.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] noob problem - ZF works on localhost but not on webserver

2008-05-16 Thread vladimirn

Hello, i would like to thanks to Vincent and Jacob for their eforts to help
me solve this.
With their help i found what causes the problem.
If i am calling:
$rowset = $this-fetchAll($where, $this-getOrder()); in Banners.php this
aint work.
also above part of code is working in other model files...

$rowset = $this-db-fetchAll(''select * from banners'); works for
Banner.php

any ideas? :)



vladimirn wrote:
 
 First of all i would like to say hello to all in here  Tho, if i missed a
 topic, please move it onto the right place.
 
 Well, i got to make some changes on the web site which has been make with
 zend framework. So i am kinda noob on ZF But job must have be done.
 
 So i started to read tutorials and so on.. My task was to add some
 functionality on the existing web site.
 I did it on my localhost, and everything is just fine. But, when i upload
 files to the web server, it wont work.
 What could be possibly reason? Or reasons? Any ideas? Where to look into?
 Thanks a lot in advance,
 Vladimir
 

-- 
View this message in context: 
http://www.nabble.com/noob-problem---ZF-works-on-localhost-but-not-on-webserver-tp17272058p17282216.html
Sent from the Zend Framework mailing list archive at Nabble.com.