From: Thomas S. <sch...@on...> - 2010-03-19 07:48:16
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body bgcolor="#ffffff" text="#000000"> Yaron Koren schrieb: <blockquote cite="mid:55d...@ma..." type="cite">Hi, <div><br> </div> <div>Well, 'SF_AddData.php' no longer exists, but I know what you mean. :)</div> <div><br> </div> <div>Speaking of hooks, though, couldn't this change be accomplished with a hook, instead of a whole patch? That seems like a cleaner solution - that way, the same extension (Halo) that uses that Javascript variable, will also be setting it.</div> </blockquote> A hook would definitely the better solution. If you provide the hook, I'll provide the implementation of the callback.<br> <blockquote cite="mid:55d...@ma..." type="cite"> <div><br> </div> <div>SF_ajax_form_preview is vaguely new - it's been around since version 1.8.3.</div> </blockquote> HaloACL has been developed on version 1.8.4. So I don't know what the problem of SF_ajax_form_preview is. Cann you drill down with Firebug and see where it hangs.<br> <br> Here is the complete list of patches for HaloACL in version 1.8.4. At least one was missing in the previous mails as I always forget that Semantic Forms also has *.inc files :-) My line numbers may differ from yours as we have many other patches besides the ones for HaloACL. I hope the context around the patches is sufficient to find them.<br> <br> SF_FormPrinter.inc, line 207<br> <br> <tt> // show previous set of deletions for this page, if it's been deleted before<br> if (! $form_submitted && ! $this->mPageTitle->exists())<br> $this->showDeletionLog($wgOut);<br> /*op-patch|TS|2009-09-11|HaloACL|Protect properties in Semantic Forms|start*/<br> // Original code: if (($wgUser->isAllowed('edit') && $this->mPageTitle->userCan('edit')) || $is_query) {<br> if (($wgUser->isAllowed('edit')<br> && ($this->mPageTitle->userCan('formedit') <br> || $this->mPageTitle->userCan('edit') )) <br> || $is_query) {<br> /*op-patch|TS|2009-09-11|end*/<br> $form_is_disabled = false;<br> $form_text = "";<br> // show "Your IP address will be recorded" warning if user is<br> // anonymous, and it's not a query -<br> // wikitext for bolding has to be replaced with HTML<br> </tt><br> <br> In SF_AddData.php, line 31<br> <br> <tt> if (! $form_name && ! $target_name) {<br> $queryparts = explode('/', $query, 2);<br> $form_name = isset($queryparts[0]) ? $queryparts[0] : '';<br> $target_name = isset($queryparts[1]) ? $queryparts[1] : '';<br> /*op-patch|TS|2009-09-29|SMWHalo|Store the name of the new page in a javascript variable|start*/<br> global $wgOut, $wgJsMimeType;<br> if (!empty($target_name)) {<br> $t = Title::newFromText($target_name);<br> $namespace = $t->getNamespace();<br> $script = "<script type= \"$wgJsMimeType\">/*<![CDATA[*/\n";<br> $script .= "sfgTargetNamespaceNumber = $namespace;";<br> $script .= "\n/*]]>*/</script>\n";<br> <br> $wgOut->addScript($script);<br> }<br> /*op-patch|TS|2009-09-29|end*/<br> <br> }<br> <br> $alt_forms = $wgRequest->getArray('alt_form');<br> <br> self::printAddForm($form_name, $target_name, $alt_forms);<br> </tt><br> In SF_AddData.php, line 211<br> <br> <tt> $text .=<<<END<br> <form name="createbox" onsubmit="return validate_all()" action="" method="post" class="createbox"><br> <br> END;<br> /*op-patch|TS|2009-09-18|HaloACL|Semantic protection|start*/<br> //Original code: $text .= $form_text;<br> $html = '';<br> wfRunHooks('sfEditPageBeforeForm', array(&$page_title, &$html));<br> $text .= $html.$form_text;<br> /*op-patch|TS|2009-09-18|end*/<br> }<br> }<br> <br> <br> </tt>In SF_EditData.php, line 114<br> <br> <tt> <form name="createbox" onsubmit="return validate_all()" action="" method="post" class="createbox"><br> <input type="hidden" name="query" value="true" /><br> <br> END;<br> /*op-patch|TS|2009-09-18|HaloACL|Semantic protection|start*/<br> //Original code: $text .= $form_text;<br> $html = '';<br> wfRunHooks('sfEditPageBeforeForm', array(&$page_title, &$html));<br> $text .= $html.$form_text;<br> /*op-patch|TS|2009-09-18|end*/<br> }<br> }<br> </tt><br> Hope this helps!<br> <br> Best,<br> Thomas<br> <br> <br> <blockquote cite="mid:55d...@ma..." type="cite"> <div><br> </div> <div>-Yaron<br> <br> <div class="gmail_quote">On Thu, Mar 18, 2010 at 5:56 AM, Thomas Schweitzer <span dir="ltr"><<a moz-do-not-send="true" href="mailto:sch...@on...">sch...@on...</a>></span> wrote:<br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <div bgcolor="#ffffff" text="#000000"> Hi John,<br> you are right, there was one patch missing. (That's one of the reasons why we have a bundled version. We have many patches for Semantic Forms.) So sorry, we must provide a patch file for Semantic Forms. Yaron, would you be willing to include the following patch?<br> <br> In SF_AddData.php<br> <tt><br> function execute($query) {<br> global $wgRequest;<br> <br> $this->setHeaders();<br> $form_name = $wgRequest->getVal('form');<br> $target_name = $wgRequest->getVal('target');<br> <br> // if query string did not contain these variables, try the URL<br> if (! $form_name && ! $target_name) {<br> $queryparts = explode('/', $query, 2);<br> $form_name = isset($queryparts[0]) ? $queryparts[0] : '';<br> $target_name = isset($queryparts[1]) ? $queryparts[1] : '';<br> /*op-patch|TS|2009-09-29|SMWHalo|Store the name of the new page in a javascript variable|start*/<br> global $wgOut, $wgJsMimeType;<br> if (!empty($target_name)) {<br> $t = Title::newFromText($target_name);<br> $namespace = $t->getNamespace();<br> $script = "<script type= \"$wgJsMimeType\">/*<![CDATA[*/\n";<br> $script .= "sfgTargetNamespaceNumber = $namespace;";<br> $script .= "\n/*]]>*/</script>\n";<br> <br> $wgOut->addScript($script);<br> }<br> /*op-patch|TS|2009-09-29|end*/<br> <br> }<br> <br> $alt_forms = $wgRequest->getArray('alt_form');<br> <br> self::printAddForm($form_name, $target_name, $alt_forms);<br> }<br> </tt><br> I can't find anything like SF_ajax_form_preview, neither in HaloACL nor in my local version of semantic forms. Yaron, is this a new function? <div> <div class="h5"><br> <br> Best<br> Thomas<br> <br> <br> John McClure schrieb: <blockquote type="cite"> <div><span><font face="Arial"><font color="#0000ff"><font size="2">After installing the patch, now the Halo ACL toolbar is visible in edit mode, but when I "preview", then <span>that request</span> never completes (spinning clock). <span>From firebug, it appears SF_ajax_form_preview is involved. I'm wondering if another patch is needed there.</span></font></font></font></span></div> <div><span><font face="Arial"><font color="#0000ff"><font size="2"><span>Thanks=</span></font></font></font></span></div> <div><span><font face="Arial"><font color="#0000ff"><font size="2"><span>John </span></font></font></font></span></div> <blockquote dir="ltr" style="margin-right: 0px;"> <div dir="ltr" align="left"><font face="Tahoma" size="2">-----Original Message-----<br> <b>From:</b> John McClure [<a moz-do-not-send="true" href="mailto:jmc...@hy..." target="_blank">mailto:jmc...@hy...</a>]<br> <b>Sent:</b> Wednesday, March 17, 2010 11:25 AM<br> <b>To:</b> <a moz-do-not-send="true" href="mailto:jmc...@hy..." target="_blank">jmc...@hy...</a>; 'Yaron Koren'; 'Thomas Schweitzer'<br> <b>Cc:</b> <a moz-do-not-send="true" href="mailto:sem...@li..." target="_blank">sem...@li...</a><br> <b>Subject:</b> RE: [SMW-devel] HaloACL - where is sfEditPageBeforeForm<br> <br> </font></div> <div><span><font color="#0000ff" face="Arial" size="2">whoops - sent some test code before, now corrected</font></span></div> <blockquote dir="ltr" style="margin-right: 0px;"> <div dir="ltr" align="left"><font face="Tahoma" size="2">-----Original Message-----<br> <b>From:</b> John McClure [<a moz-do-not-send="true" href="mailto:jmc...@hy..." target="_blank">mailto:jmc...@hy...</a>]<br> <b>Sent:</b> Wednesday, March 17, 2010 11:01 AM<br> <b>To:</b> 'Yaron Koren'; 'Thomas Schweitzer'<br> <b>Cc:</b> <a moz-do-not-send="true" href="mailto:sem...@li..." target="_blank">sem...@li...</a><br> <b>Subject:</b> Re: [SMW-devel] HaloACL - where is sfEditPageBeforeForm<br> <br> </font></div> <div><span><font color="#0000ff" face="Arial" size="2">Thank you Thomas & Yaron. Thomas, here is the simple change I made to your code, to curtail the inclusion of scripts in pages that don't display the Halo ACL tookbar. Thanks, John</font></span></div> <div><span> <pre>function addNonSpecialPageHeader(&$out) { global $wgRequest; $token = $wgRequest->getText( 'action', 'view' ); if( $token == 'edit' || $token == 'formedit' ) <span><font color="#0000ff" face="Arial" size="2"> </font></span>{ global $haclgHaloScriptPath, $haclgHaloScriptPath; // ------------------- if (!defined('SMW_HALO_VERSION')) { // don't include prototype.js if SMWHalo is present $out->addScript("<script type=\"text/javascript\" src=\"". $haclgHaloScriptPath . "/scripts/prototype.js\"></script>"); }</pre> <pre> </pre> </span></div> <blockquote dir="ltr" style="margin-right: 0px;"> <div dir="ltr" align="left"><font face="Tahoma" size="2">-----Original Message-----<br> <b>From:</b> Yaron Koren [<a moz-do-not-send="true" href="mailto:ya...@gm..." target="_blank">mailto:ya...@gm...</a>]<br> <b>Sent:</b> Wednesday, March 17, 2010 5:09 AM<br> <b>To:</b> Thomas Schweitzer<br> <b>Cc:</b> <a moz-do-not-send="true" href="mailto:jmc...@hy..." target="_blank">jmc...@hy...</a>; <a moz-do-not-send="true" href="mailto:sem...@li..." target="_blank">sem...@li...</a><br> <b>Subject:</b> Re: [SMW-devel] HaloACL - where is sfEditPageBeforeForm<br> <br> </font></div> Hi, <div><br> </div> <div>I have no record of that hook ever having been in the Semantic Forms code; or of my having been asked to add it in. My guess is that it's only been in the SMW+ version of Semantic Forms. I could add it in now, though...</div> <div><br> </div> <div>-Yaron</div> <div><br> <br> <div class="gmail_quote">On Wed, Mar 17, 2010 at 2:25 AM, Thomas Schweitzer <span dir="ltr"><<a moz-do-not-send="true" href="mailto:sch...@on..." target="_blank">sch...@on...</a>></span> wrote:<br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">Hi John,<br> <br> Yaron added this hook for us in Semantic Forms and I thought it should<br> be part of his latest release. Yaron, can you please comment on this?<br> <br> I've still got it in form of a patch:<br> In SF_EditData.php. line 110<br> <br> <form name="createbox" onsubmit="return validate_all()" action=""<br> method="post" class="createbox"><br> <input type="hidden" name="query" value="true" /><br> <br> END;<br> /*op-patch|TS|2009-09-18|HaloACL|Semantic protection|start*/<br> //Original code: $text .= $form_text;<br> $html = '';<br> wfRunHooks('sfEditPageBeforeForm', array(&$page_title, &$html));<br> $text .= $html.$form_text;<br> /*op-patch|TS|2009-09-18|end*/<br> }<br> }<br> SFUtils::addJavascriptAndCSS();<br> <br> And in SF_AddData.php line 207:<br> <br> $text .=<<<END<br> <form name="createbox" onsubmit="return validate_all()"<br> action="" method="post" class="createbox"><br> <br> END;<br> /*op-patch|TS|2009-09-18|HaloACL|Semantic protection|start*/<br> //Original code: $text .= $form_text;<br> $html = '';<br> wfRunHooks('sfEditPageBeforeForm', array(&$page_title,<br> &$html));<br> $text .= $html.$form_text;<br> /*op-patch|TS|2009-09-18|end*/<br> }<br> }<br> SFUtils::addJavascriptAndCSS();<br> <br> <br> Hope this helps!<br> <br> Best<br> Thomas<br> <br> John McClure schrieb:<br> <div> <div>> The Halo ACL toolbar displays per the hook "EditPageBeforeEditButtons" for<br> > normal page editing.<br> > The Halo ACL toolbar does not display when editing with a form. This is a<br> > big problem for all SF users.<br> ><br> > The Halo ACL toolbar displays per the hook "sfEditPageBeforeForm"<br> > (HACL_GlobalFunctions.php)<br> > But "sfEditPageBeforeForm" does not appear in Semantic Forms source code, so<br> > the hook is never called....<br> > Please advise! Thanks - jmc<br> ><br> ><br> > ------------------------------------------------------------------------------<br> > Download Intel&#174; Parallel Studio Eval<br> > Try the new software tools for yourself. Speed compiling, find bugs<br> > proactively, and fine-tune applications for parallel performance.<br> > See why Intel Parallel Studio got high marks during beta.<br> > <a moz-do-not-send="true" href="http://p.sf.net/sfu/intel-sw-dev" target="_blank">http://p.sf.net/sfu/intel-sw-dev</a><br> > _______________________________________________<br> > Semediawiki-devel mailing list<br> > <a moz-do-not-send="true" href="mailto:Sem...@li..." target="_blank">Sem...@li...</a><br> > <a moz-do-not-send="true" href="https://lists.sourceforge.net/lists/listinfo/semediawiki-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/semediawiki-devel</a><br> ><br> ><br> <br> <br> </div> </div> --<br> Thomas Schweitzer<br> Professional Services<br> ontoprise GmbH - know how to use Know-how<br> ---<br> Halo Extension - Want to get involved? <a moz-do-not-send="true" href="http://smwforum.ontoprise.com/development" target="_blank">http://smwforum.ontoprise.com/development</a><br> ---<br> ontoprise ist Generalunternehmer für Vulcans Semantic Wiki im Projekt Halo<br> <a moz-do-not-send="true" href="http://www.ontoprise.de/" target="_blank">http://www.ontoprise.de/</a><br> ---<br> An der Raumfabrik 29; 76227 Karlsruhe<br> Tel.: +49 (0) 721 509 809 39; Fax: +49 (0) 721 509 809 11<br> eMail: <a moz-do-not-send="true" href="mailto:sch...@on..." target="_blank">sch...@on...</a>; www: <a moz-do-not-send="true" href="http://www.ontoprise.de" target="_blank">http://www.ontoprise.de</a><br> Sitz der Gesellschaft: Amtsgericht Mannheim, HRB 9540<br> Geschäftsführer: Prof. Dr. Jürgen Angele, Dipl.Wi.-Ing. Hans-Peter Schnurr<br> <div> <div><br> <br> ------------------------------------------------------------------------------<br> Download Intel&#174; Parallel Studio Eval<br> Try the new software tools for yourself. Speed compiling, find bugs<br> proactively, and fine-tune applications for parallel performance.<br> See why Intel Parallel Studio got high marks during beta.<br> <a moz-do-not-send="true" href="http://p.sf.net/sfu/intel-sw-dev" target="_blank">http://p.sf.net/sfu/intel-sw-dev</a><br> _______________________________________________<br> Semediawiki-devel mailing list<br> <a moz-do-not-send="true" href="mailto:Sem...@li..." target="_blank">Sem...@li...</a><br> <a moz-do-not-send="true" href="https://lists.sourceforge.net/lists/listinfo/semediawiki-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/semediawiki-devel</a><br> </div> </div> </blockquote> </div> <br> <br clear="all"> <br> -- <br> WikiWorks · MediaWiki Consulting · <a moz-do-not-send="true" href="http://wikiworks.com" target="_blank">http://wikiworks.com</a><br> </div> </blockquote> </blockquote> </blockquote> </blockquote> <br> <br> </div> </div> <pre cols="72"><font color="#888888">-- Thomas Schweitzer Professional Services ontoprise GmbH - know how to use Know-how --- Halo Extension - Want to get involved? <a moz-do-not-send="true" href="http://smwforum.ontoprise.com/development" target="_blank">http://smwforum.ontoprise.com/development</a></font><div class="im"> --- ontoprise ist Generalunternehmer für Vulcans Semantic Wiki im Projekt Halo <a moz-do-not-send="true" href="http://www.ontoprise.de/" target="_blank">http://www.ontoprise.de/</a> --- An der Raumfabrik 29; 76227 Karlsruhe Tel.: +49 (0) 721 509 809 39; Fax: +49 (0) 721 509 809 11 eMail: <a moz-do-not-send="true" href="mailto:sch...@on..." target="_blank">sch...@on...</a>; www: <a moz-do-not-send="true" href="http://www.ontoprise.de" target="_blank">http://www.ontoprise.de</a> Sitz der Gesellschaft: Amtsgericht Mannheim, HRB 9540 Geschäftsführer: Prof. Dr. Jürgen Angele, Dipl.Wi.-Ing. Hans-Peter Schnurr </div></pre> </div> </blockquote> </div> <br> <br clear="all"> <br> -- <br> WikiWorks · MediaWiki Consulting · <a moz-do-not-send="true" href="http://wikiworks.com">http://wikiworks.com</a><br> </div> </blockquote> <br> <br> <pre class="moz-signature" cols="72">-- Thomas Schweitzer Professional Services ontoprise GmbH - know how to use Know-how --- Halo Extension - Want to get involved? <a class="moz-txt-link-freetext" href="http://smwforum.ontoprise.com/development">http://smwforum.ontoprise.com/development</a> --- ontoprise ist Generalunternehmer für Vulcans Semantic Wiki im Projekt Halo <a class="moz-txt-link-freetext" href="http://www.ontoprise.de/">http://www.ontoprise.de/</a> --- An der Raumfabrik 29; 76227 Karlsruhe Tel.: +49 (0) 721 509 809 39; Fax: +49 (0) 721 509 809 11 eMail: <a class="moz-txt-link-abbreviated" href="mailto:sch...@on...">sch...@on...</a>; www: <a class="moz-txt-link-freetext" href="http://www.ontoprise.de">http://www.ontoprise.de</a> Sitz der Gesellschaft: Amtsgericht Mannheim, HRB 9540 Geschäftsführer: Prof. Dr. Jürgen Angele, Dipl.Wi.-Ing. Hans-Peter Schnurr </pre> </body> </html> |