示例#1
0
 /**
  * renderFromTag
  *
  * static constructor/callback function
  *
  * @access public
  * @static
  * @author Krzysztof Krzyżaniak <*****@*****.**>
  *
  * @param string $input : Text from tag
  * @param array $params : atrributions
  * @param Object $parser : Wiki Parser object
  *
  * @return string
  */
 public static function renderFromTag($input, $params, $parser)
 {
     /**
      * ID of the poll
      */
     $id = strtoupper(md5($input));
     $input = trim(strip_tags($parser->recursiveTagParse($input)));
     $class = new AjaxPollClass();
     $class->mId = $id;
     $class->mBody = $input;
     $class->mTitle = $parser->getTitle();
     $class->mParser = $parser;
     $class->mAttribs = $params;
     return $class->render();
 }
示例#2
0
/**
 * axAjaxPollSubmit
 *
 * entry point for ajax request submit
 *
 * @access public
 * @author eloy
 * @global
 */
function axAjaxPollSubmit()
{
    global $wgRequest;
    $pool_id = $wgRequest->getVal("wpPollId", null);
    $poll = AjaxPollClass::newFromId($pool_id);
    return json_encode($poll->doSubmit($wgRequest));
}