/** * {{#gravatar: email_p1=John.Smith | email_p2=gmail.com [|optional parameters] }} */ public function mg_gravatar(&$parser) { $params = func_get_args(); $liste = StubManager::processArgList($params, true); $output = $this->renderEntry($liste); return array($output, 'noparse' => true, 'isHTML' => true); }
/** List of actions to remove from the current page. */ public function mg_removeactions(&$parser) { $params = StubManager::processArgList(func_get_args(), true); if (isset($params)) { foreach ($params as $actionToRemove) { $this->actionsToRemove[] = $actionToRemove; } } }
/** * {{#quimble_poll: index=poll_index }} */ public function mg_quimble_poll(&$parser) { $params = func_get_args(); $liste = StubManager::processArgList($params, true); $code = $this->formatPoll($liste, $index, $output); if ($code !== true) { return $code; } return array($output, 'noparse' => true, 'isHTML' => true); }
/** * {{#jskitpoll(: [optional parameters] }} */ public function mg_jskitpoll(&$parser) { $params = func_get_args(); $liste = StubManager::processArgList($params, true); $output = $this->renderEntry($liste); $output .= <<<EOT \t<script src="http://js-kit.com/polls.js"></script> EOT; return array($output, 'noparse' => true, 'isHTML' => true); }
/** {{#gcode: project=PROJECT NAME|file=FILENAME }} */ public function mg_gcode(&$parser) { $args = func_get_args(); $argv = StubManager::processArgList($args, true); $project = @$argv['project']; $file = @$argv['file']; $result = $this->validateParameters($project, $file); // don't bother going forward if we already have an error message if (!empty($result)) { return $result; } $code = $this->getCode($project, $file, $result); // don't bother going forward if we already have an error message if (!empty($result)) { return $result; } return $code; }
/** * {{#jskitnavigator: [optional parameters] }} */ public function mg_jskitcomments(&$parser) { $params = func_get_args(); $liste = StubManager::processArgList($params, true); // check for ''noscript'' parameter $noscript = false; if (isset($liste['noscript'])) { $r = strtolower($liste['noscript']); if ($r == '1' || $r == 'true') { $noscript = true; } } $output = $this->renderEntry($liste); if (!$noscript) { if (!$this->scriptIncluded) { $this->scriptIncluded = true; $output .= $this->getScript(); } } return array($output, 'noparse' => true, 'isHTML' => true); }
/** * {{#jskitrating: [optional parameters] }} */ public function mg_jskitrating(&$parser) { $params = func_get_args(); $liste = StubManager::processArgList($params, true); // check for ''noscript'' parameter $noscript = false; if (isset($liste['noscript'])) { $r = strtolower($liste['noscript']); if ($r == '1' || $r == 'true') { $noscript = true; } } $output = $this->renderEntry($liste); if (!$noscript) { if (!$this->scriptIncluded) { $this->scriptIncluded = true; $output .= <<<EOT \t<script src="http://js-kit.com/ratings.js"></script> EOT; } } return array($output, 'noparse' => true, 'isHTML' => true); }
/** Gets a variable to an array. param 0: variable name param 1: array key */ public function mg_varaget(&$parser) { $params = StubManager::processArgList(func_get_args(), true); return @$this->pageVars[$params[0]][$params[1]]; }
/** * Creates an 'icon link': * Fetches a site's ''favicon.ico'' * * {{#iconlink: * [|site=url-of-page] * [|domaincheck=y|n] * [|target=target-text] * [|content=anchor-text] * [|alt=alternate-text] * [|height=height-parameter] * [|width=width-parameter] * [|border=border-parameter] * [|class=class-parameter] * [|title=title-parameter] * [|default=image-page-used-for-default] * [|onchange=onchange-handler] * [|onsubmit=onsubmit-handler] * [|onreset=onreset-handler] * [|onselect=onselect-handler] * [|onblur=onblur-handler] * [|onfocus=onfocus-handler] * [|onkeydown=onkeydown-handler] * [|onkeyup=onkeyup-handler] * [|onkeypress=onkeypress-handler] * [|onclick=onclick-handler] * [|ondblclick=ondblclick-handler] * [|onmousedown=onmousedown-handler] * [|onmousemove=onmousemove-handler] * [|onmouseout=onmouseout-handler] * [|onmouseover=onmouseover-handler] * [|onmouseup=onmouseup-handler] * }} */ public function mg_iconlink(&$parser) { $params = func_get_args(); $liste = StubManager::processArgList($params, true); $sliste = ExtHelper::doListSanitization($liste, self::$parametersIconLink); if (empty($sliste)) { return $this->getErrorMsg(self::codeListEmpty); } if (!is_array($sliste)) { return $this->getErrorMsg(self::codeMissingParameter, $sliste); } ExtHelper::doSanitization($sliste, self::$parameters); $result = ExtHelper::checkListForRestrictions($sliste, self::$parametersIconLink); $title = $parser->mTitle; // first check for restricted parameter usage $check = $this->checkRestrictionStatus($title, $result); if ($this->isError($check)) { return $this->getErrorMsg($check, $result); } // Normalize domainCheck parameter $site = $liste['site']; $domainCheckParam = @$liste['domaincheck']; $domainCheck = $this->extractBoolean($domainCheckParam); $iconURL = $this->getFavicon($site, $domainCheck); // Build the HTML element $html = $this->buildHTMLfromList($sliste, self::$parametersIconLink, $iconURL); if ($this->isError($html)) { return $this->getErrorMsg($html); } return array($html, 'noparse' => true, 'isHTML' => true); }