Exemplo n.º 1
0
 /**
  * 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);
 }