Hi,

Well, 'SF_AddData.php' no longer exists, but I know what you mean. :)

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.

SF_ajax_form_preview is vaguely new - it's been around since version 1.8.3.

-Yaron

On Thu, Mar 18, 2010 at 5:56 AM, Thomas Schweitzer
<schweit...@ontoprise.de>wrote:

>  Hi John,
> 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?
>
> In SF_AddData.php
>
>     function execute($query) {
>         global $wgRequest;
>
>         $this->setHeaders();
>         $form_name = $wgRequest->getVal('form');
>         $target_name = $wgRequest->getVal('target');
>
>         // if query string did not contain these variables, try the URL
>         if (! $form_name && ! $target_name) {
>             $queryparts = explode('/', $query, 2);
>             $form_name = isset($queryparts[0]) ? $queryparts[0] : '';
>             $target_name = isset($queryparts[1]) ? $queryparts[1] : '';
> /*op-patch|TS|2009-09-29|SMWHalo|Store the name of the new page in a
> javascript variable|start*/
>             global $wgOut, $wgJsMimeType;
>             if (!empty($target_name)) {
>                 $t = Title::newFromText($target_name);
>                 $namespace = $t->getNamespace();
>                 $script = "<script type=
> \"$wgJsMimeType\">/*<![CDATA[*/\n";
>                 $script .= "sfgTargetNamespaceNumber = $namespace;";
>                 $script .= "\n/*]]>*/</script>\n";
>
>                 $wgOut->addScript($script);
>             }
> /*op-patch|TS|2009-09-29|end*/
>
>         }
>
>         $alt_forms = $wgRequest->getArray('alt_form');
>
>         self::printAddForm($form_name, $target_name, $alt_forms);
>     }
>
> 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?
>
>
> Best
>     Thomas
>
>
> John McClure schrieb:
>
> After installing the patch, now the Halo ACL toolbar is visible in edit
> mode, but when I "preview", then that request never completes (spinning
> clock). From firebug, it appears SF_ajax_form_preview is involved. I'm
> wondering if another patch is needed there.
> Thanks=
> John
>
> -----Original Message-----
> *From:* John McClure [mailto:jmccl...@hypergrove.com<jmccl...@hypergrove.com>
> ]
> *Sent:* Wednesday, March 17, 2010 11:25 AM
> *To:* jmccl...@hypergrove.com; 'Yaron Koren'; 'Thomas Schweitzer'
> *Cc:* semediawiki-devel@lists.sourceforge.net
> *Subject:* RE: [SMW-devel] HaloACL - where is sfEditPageBeforeForm
>
>  whoops - sent some test code before, now corrected
>
> -----Original Message-----
> *From:* John McClure [mailto:jmccl...@hypergrove.com<jmccl...@hypergrove.com>
> ]
> *Sent:* Wednesday, March 17, 2010 11:01 AM
> *To:* 'Yaron Koren'; 'Thomas Schweitzer'
> *Cc:* semediawiki-devel@lists.sourceforge.net
> *Subject:* Re: [SMW-devel] HaloACL - where is sfEditPageBeforeForm
>
>  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
>
> function addNonSpecialPageHeader(&$out) {
>   global $wgRequest;
>   $token = $wgRequest->getText( 'action', 'view' );
>   if( $token == 'edit' || $token == 'formedit' )     {
>      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>");
>     }
>
>
>
>  -----Original Message-----
> *From:* Yaron Koren [mailto:yaro...@gmail.com <yaro...@gmail.com>]
> *Sent:* Wednesday, March 17, 2010 5:09 AM
> *To:* Thomas Schweitzer
> *Cc:* jmccl...@hypergrove.com; semediawiki-devel@lists.sourceforge.net
> *Subject:* Re: [SMW-devel] HaloACL - where is sfEditPageBeforeForm
>
>  Hi,
>
>  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...
>
>  -Yaron
>
>
> On Wed, Mar 17, 2010 at 2:25 AM, Thomas Schweitzer <
> schweit...@ontoprise.de> wrote:
>
>> Hi John,
>>
>> Yaron added this hook for us in Semantic Forms and I thought it should
>> be part of his latest release. Yaron, can you please comment on this?
>>
>> I've still got it in form of a patch:
>> In SF_EditData.php. line 110
>>
>>    <form name="createbox" onsubmit="return validate_all()" action=""
>> method="post" class="createbox">
>>    <input type="hidden" name="query" value="true" />
>>
>> END;
>>        /*op-patch|TS|2009-09-18|HaloACL|Semantic protection|start*/
>>        //Original code: $text .= $form_text;
>>           $html = '';
>>           wfRunHooks('sfEditPageBeforeForm', array(&$page_title, &$html));
>>           $text .= $html.$form_text;
>>        /*op-patch|TS|2009-09-18|end*/
>>        }
>>    }
>>    SFUtils::addJavascriptAndCSS();
>>
>> And in SF_AddData.php line 207:
>>
>>            $text .=<<<END
>>                <form name="createbox" onsubmit="return validate_all()"
>> action="" method="post" class="createbox">
>>
>> END;
>>            /*op-patch|TS|2009-09-18|HaloACL|Semantic protection|start*/
>>              //Original code: $text .= $form_text;
>>             $html = '';
>>             wfRunHooks('sfEditPageBeforeForm', array(&$page_title,
>> &$html));
>>             $text .= $html.$form_text;
>>              /*op-patch|TS|2009-09-18|end*/
>>        }
>>    }
>>    SFUtils::addJavascriptAndCSS();
>>
>>
>> Hope this helps!
>>
>> Best
>>       Thomas
>>
>> John McClure schrieb:
>>  > The Halo ACL toolbar displays per the hook "EditPageBeforeEditButtons"
>> for
>> > normal page editing.
>> > The Halo ACL toolbar does not display when editing with a form. This is
>> a
>> > big problem for all SF users.
>> >
>> > The Halo ACL toolbar displays per the hook "sfEditPageBeforeForm"
>> > (HACL_GlobalFunctions.php)
>> > But "sfEditPageBeforeForm" does not appear in Semantic Forms source
>> code, so
>> > the hook is never called....
>> > Please advise! Thanks - jmc
>> >
>> >
>> >
>> ------------------------------------------------------------------------------
>> > Download Intel&#174; Parallel Studio Eval
>> > Try the new software tools for yourself. Speed compiling, find bugs
>> > proactively, and fine-tune applications for parallel performance.
>> > See why Intel Parallel Studio got high marks during beta.
>> > http://p.sf.net/sfu/intel-sw-dev
>> > _______________________________________________
>> > Semediawiki-devel mailing list
>> > Semediawiki-devel@lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/semediawiki-devel
>> >
>> >
>>
>>
>>  --
>> Thomas Schweitzer
>> Professional Services
>> ontoprise GmbH - know how to use Know-how
>> ---
>> Halo Extension - Want to get involved?
>> http://smwforum.ontoprise.com/development
>> ---
>> ontoprise ist Generalunternehmer für Vulcans Semantic Wiki im Projekt Halo
>> http://www.ontoprise.de/
>> ---
>> An der Raumfabrik 29; 76227 Karlsruhe
>> Tel.: +49 (0) 721 509 809 39; Fax: +49 (0) 721 509 809 11
>> eMail: schweit...@ontoprise.de;  www: http://www.ontoprise.de
>> Sitz der Gesellschaft: Amtsgericht Mannheim, HRB 9540
>> Geschäftsführer: Prof. Dr. Jürgen Angele, Dipl.Wi.-Ing. Hans-Peter Schnurr
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Download Intel&#174; Parallel Studio Eval
>> Try the new software tools for yourself. Speed compiling, find bugs
>> proactively, and fine-tune applications for parallel performance.
>> See why Intel Parallel Studio got high marks during beta.
>> http://p.sf.net/sfu/intel-sw-dev
>> _______________________________________________
>> Semediawiki-devel mailing list
>> Semediawiki-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/semediawiki-devel
>>
>
>
>
> --
> WikiWorks · MediaWiki Consulting · http://wikiworks.com
>
>
>
> --
> Thomas Schweitzer
> Professional Services
> ontoprise GmbH - know how to use Know-how
> ---
> Halo Extension - Want to get involved? 
> http://smwforum.ontoprise.com/development
>
> ---
> ontoprise ist Generalunternehmer für Vulcans Semantic Wiki im Projekt 
> Halohttp://www.ontoprise.de/
> ---
> An der Raumfabrik 29; 76227 Karlsruhe
> Tel.: +49 (0) 721 509 809 39; Fax: +49 (0) 721 509 809 11
> eMail: schweit...@ontoprise.de;  www: http://www.ontoprise.de
> Sitz der Gesellschaft: Amtsgericht Mannheim, HRB 9540
> Geschäftsführer: Prof. Dr. Jürgen Angele, Dipl.Wi.-Ing. Hans-Peter Schnurr
>
>


-- 
WikiWorks · MediaWiki Consulting · http://wikiworks.com
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to