On 5/9/05, Rowan Collins <rowan.collins(a)gmail.com> wrote:
On 09/05/05, Jordi Domingo <jordidr(a)gmail.com>
wrote:
I am looking for a debugger for php and so see
what's going on, but I
don't know any (I will try gubed).
Have you tried setting $wgDebugLogFile in LocalSettings.php to a
writable file, and then inserting lots of statements like wfDebug("my
variable contains $my_variable"); around the code? This can give you a
lot of feedback about what's going on at different stages. [as usual,
see includes/DefaultSettings.php for the range of possible options and
how to use them]
Thanks Rowan, I''ll try this.
In short:
does editpage.php remember global values when call again to editform()?
I'm afraid it's very hard to follow what exactly your code is
currently doing, and therefore to work out how your code should work:
* by "globals", do you mean variables that you've declared outside of
any function or class, and then declared using "global $foo;"-type
statements (by convention, these are named like $wgVarName in
MediaWiki)?
* if so, they should be remembered between functions, but remember
that every request of a page (e.g. clicking "Preview" or "Save" or
whatever) runs a completely new instance of the program, so no
variables will be "remembered"
Ooops, I believe that's it :( Indeed, the fact would be when I press
the save button, the request would had to remember
$current_screen=$current_screen + 1; (declared as global
$current_screen in function editform). Maybe a solution could be
create a file where I save the values of some variables...
* or, do you mean that these values are part of the
form itself (a
"hidden" field, like "wpEdittime" in the normal code)? This should
indeed be remembered between invocations, as long as you're setting it
appropriately when the form is [re-]output
Mmm, there's some of this also, as before do a multiple edit it saved
without problem in my .po file. Now, I press button and doesn't enter
in the code of save, isn't never in "save", is in "initial".
* or, do you mean that the values are part of the URL,
like the
action=edit, in which case the code may need to be changed so that
they are preserved when the form is submitted (i.e. the form needs to
be submitted to a URL with those same extra arguments in, despite the
"action=edit" changing to "action=submit"); presumably, there is
already code to do this for the "§ion=N", but I don't know where
it is or whether it would need changing
I don't know if these suggestions will seem overly simple, overly
complex, or turn out not to be true because of things already in the
code, but they're my best stab at helping based on the limited
information you provided.
--
Thanks, yes, I putted some messages before but where with too
information and so I putted this with maybe the main problem, the
"don't remember variables".
I believe the problems now are two:
1,- Doesn't remember my globals because of the new instance fact you
said. I will try a file with info of current screen, file selected,
and all stuff needed for more than one screen
2.-The invocation of the save doesn't go well, it's always "initial".
But it should go, and so it was before "multiple edit". I will compare
again my code with the original editpage
And one question:
- It's possible to present different things in editpage depending of a
parameter? It seems not by the "new instance" stuff, but I'll try with
some file created by me. Or maybe it's better the SpecialPAge way?
I put here some of the text of prior messages (from more recent to
more ancient). The main change from this is that now I make all
changes in editpage, not in editpage and article.php
--------------------------------------
<<<<<<<<<<<<<<<<<<<<<<<<<<
Hello, basically I would like to know if I can modify editpage.php to
show multiples types of edit and "link" them. I mean, my wiki would
present a first page where you select an archive (the button brings to
second page), a second page where you select a msgid/msgstr of the
presented (the button brings to third page),and the third page where
you edit the message. All three are "action=edit" pages,and i modified
index.php to enter as action=edit.
But some problems I encounter (the fact it's that I don't know if that
multiple edit is possible, however; apart, note I read/save to php
level, no using DB for the contents):
- I modify the editpage.php using things "if currentpage==1 do this,
else if ==2...". The idea is when submit in the first page, go to the
second...but it doesn't seem to capture tthe $intpo: that is, when I
submit, now it backs to actual screen (doesn't show previewnote
because I change manually beginning the editform...)
(in function editform)
global $currentscreen;
global $intpo;
if (!($intpo==true)){
$intpo=false;
}
if ( 'preview' == $formtype ) { #do this because else it goes to
preview when I submit
$formtype = 'initial';
}
(later....)
if ($currentscreen==1) {
if ($intpo){
$pcurrentscreen=3;
$filepo=$fileintroduced;
}
else {
$wgOut->addHTML( "<form
id=\"intpoform\" name=\"intpoform\"
method=\"post\" action=\"$action\"
enctype=\"multipart/form-data\">");
$introducepo="Introduce .po file:
<input tabindex='3' type='text'
value=\"$filepo\" name=\"$fileintroduced\" maxlength='50'
size='30'
/><br />";
$wgOut->addHTML( "$introducepo
<input tabindex='5' id='intpo'
type='submit' value=\"Edite file\"
name=\"$intpo\" accesskey=\"I\" title=\"Edite
file\"/>");
$wgOut->addHTML( "</form>\n" );
}
}
Basically, I would be glad If i know it's possible,all this "multiple
edit" stuff.
>>>>>>>>>>>>>>>>>>>>
-
the first in which you can load a file (.po) from your computer,
- the second in which you see some messages of the .po and you can try
the one which you want
- and the third, the one that I have already developed:default
action=edit, you can modify/introduce your translation.
As i say, the three pages of my web application should be more or less
editable...so, I forget special pages, and modify my editpage.php to
use code depending of the screen/page showing. I created a variable
inicializated to 1, and presents what i would like in my first page; I
change manually to 3, and presents what I had done as editpage, and
therefore...
If i control the variable dinamically (initializated to 1 and
incrementing when pressing the button that goes to next page), would
this be a good (although maybe a bit "dirty") solution?
>>>>>>>>>>>>>>>
Ok, I entered in my linux partition, continued doing things, and had a
¿weird? idea:
As i say, the three pages of my web application should be more or less
editable...so, I forget special pages, and modify my editpage.php to
use code depending of the screen/page showing. I created a variable
inicializated to 1, and presents what i would like in my first page; I
change manually to 3, and presents what I had done as editpage, and
therefore...
If i control the variable dinamically (initializated to 1 and
incrementing when pressing the button that goes to next page), would
this be a good (although maybe a bit "dirty") solution?
--------------------
Hello, I am developing a wiki for transaltion and finally seems it
would have three pages:
- the first in which you can load a file (.po) from your computer,
- the second in which you see some messages of the .po and you can try
the one which you want
- and the third, the one that I have already developed:default
action=edit, you can modify/introduce your translation.
I have seen the archives and the concepts of redirect, specialpages, etc, and...
- I understand that I have to do some SpecialMyproject (maybe three,
each for one). I did it and added them to LanguageCa.php, but the link
introduced (substitutong edithelp) doesn't find it.
- I don't know if I can default an action (view) in some of the pages
and other (edit) in others.
Maybe I have to do all as action=edit (after all, you have to select
things in the two first pages), but in the index.php I modified
action=view to action=Edit, and putting an action=view later doesn't
seem to be catched...
Huh, I don't know if maybe all it's a bit confusing...Basically, must
i do the specialmyproject pages, or do as a mainpage (until now, I
modified a lot article and editpage.php); and creating specialpages
it's all with putting inLanguagemylanguage.php?
Other thing, I want to do all to posible with mininum acces to bd, so
I think a [[redirect]] will not go well...
--------------------------------
Rowan Collins BSc
[IMSoP]
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l(a)Wikimedia.org
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Thanks
Jordi