User:Maosef: Difference between revisions

From DRMF
Jump to navigation Jump to search
imported>Maosef
No edit summary
imported>Maosef
No edit summary
Line 16: Line 16:


$contents = wfShellExec( $cmd, $retval );
$contents = wfShellExec( $cmd, $retval );
public function execute($par) {
        $this->setHeaders();
# A formDescriptor Array to tell HTMLForm what to build
        $formDescriptor = array(
                        'simpletextfield' => array(
                                'label' => 'Simple Text Field', # What's the label of the field
                                'class' => 'HTMLTextField' # What's the input type
                        )
                );
        $htmlForm = new HTMLForm( $formDescriptor, $this->getContext(), 'myform' ); # We build the HTMLForm object, calling the form "myform"
        $htmlForm->setSubmitText( 'Allons-y gaiement' ); # What text does the submit button display
        /* We set a callback function */
        $htmlForm->setSubmitCallback( array( 'SpecialMyForm', 'processInput' ) ); 
        # Call processInput() in SpecialMyForm on submit
        $htmlForm->show(); # Displaying the form
}
/* We write a callback function */
# OnSubmit Callback, here we do all the logic we want to do...
static function processInput( $formData ) {
        if ( $formData['simpletextfield'] == 'next' ) {
                return true; #if returned true, the form won't display again.
        } elseif ($formData['simpletextfield'] == 'again' ) {
                return false; #if returned false, the form will be redisplayed.
        }
        return 'Try again'; #if returned a string, it will be displayed as an error message with the form
}
#Retrieve Andre's program
$contents = wfShellExec( $cmd, $retval ); # Math mediawiki extension
LoggerFactory::getInstance( 'Math' )->debug( "TeX output:\n $contents\n---" );
$Result = preg_replace ("#</semantics>#", "<annotation encoding=\"OpenMath\" >" . $renderer->getUserInputTex() . "</annotation>\n</semantics>", $Result ); # puppet operations
#php code?

Revision as of 23:19, 12 May 2017


java -jar latex-to-cas-translator.jar -c -CAS=Maple -Expression="\cos@{\alpha}"


$(function () {

 var myElement = document.getElementById('mw-mywiki-example');
 myElement.innerHTML = 'any HTML';

}());


Bold text

$contents = wfShellExec( $cmd, $retval );


public function execute($par) {

        $this->setHeaders();
  1. A formDescriptor Array to tell HTMLForm what to build
       $formDescriptor = array(
                       'simpletextfield' => array(
                               'label' => 'Simple Text Field', # What's the label of the field
                               'class' => 'HTMLTextField' # What's the input type
                       )
               );
       $htmlForm = new HTMLForm( $formDescriptor, $this->getContext(), 'myform' ); # We build the HTMLForm object, calling the form "myform"
       $htmlForm->setSubmitText( 'Allons-y gaiement' ); # What text does the submit button display
       /* We set a callback function */
       $htmlForm->setSubmitCallback( array( 'SpecialMyForm', 'processInput' ) );  
       # Call processInput() in SpecialMyForm on submit
       $htmlForm->show(); # Displaying the form

}

/* We write a callback function */

  1. OnSubmit Callback, here we do all the logic we want to do...

static function processInput( $formData ) {

       if ( $formData['simpletextfield'] == 'next' ) {
               return true; #if returned true, the form won't display again. 
       } elseif ($formData['simpletextfield'] == 'again' ) {
               return false; #if returned false, the form will be redisplayed. 
       }
       return 'Try again'; #if returned a string, it will be displayed as an error message with the form

}


  1. Retrieve Andre's program

$contents = wfShellExec( $cmd, $retval ); # Math mediawiki extension LoggerFactory::getInstance( 'Math' )->debug( "TeX output:\n $contents\n---" );


$Result = preg_replace ("#</semantics>#", "<annotation encoding=\"OpenMath\" >" . $renderer->getUserInputTex() . "</annotation>\n</semantics>", $Result ); # puppet operations

  1. php code?