예제 #1
0
파일: yui.php 프로젝트: clrh/mediawiki
 function yuiClass($mgwords = null, $passingStyle = self::mw_style, $depth = 1)
 {
     parent::__construct($mgwords, $passingStyle, $depth);
     // required by ExtensionClass
     global $wgExtensionCredits;
     $wgExtensionCredits['other'][] = array('name' => self::thisName, 'version' => 'v1.01 $LastChangedRevision$', 'author' => 'Jean-Lou Dupont', 'url' => 'http://www.bluecortex.com', 'description' => 'Yahoo User Interface base class for Mediawiki ');
     self::$slist = array();
     self::$stylelist = array();
 }
예제 #2
0
파일: yuiPanel.php 프로젝트: clrh/mediawiki
    public function hParserAfterTidy(&$parser, &$text)
    {
        if (empty($this->panels)) {
            return true;
        }
        parent::hParserAfterTidy($parser, $text);
        // replace our markets
        foreach ($this->panels as $index => $panel) {
            $text = preg_replace("/___PANEL{$index}___/", $panel, $text);
        }
        // Sometimes this hook is called more than once: make sure
        // we only include the JS code once!
        if (!$this->placedJS) {
            $text .= <<<EOT
\t\t<script type="text/javascript"> 
\t\tfunction initPanels() 
\t\t{
EOT;
            foreach ($this->configs as $index => $cfg) {
                $this->initParams($cfg, self::$defaults);
                $this->formatParams($cfg, self::$defaults);
                $l = $this->formatCfgLine($cfg, self::$defaults);
                $text .= <<<EOT
\tvar panel{$index} = new YAHOO.widget.Panel('panel{$index}', { {$l} } );
\tpanel{$index}.render();
\tpanel{$index}.show();
\t
EOT;
            }
            $text .= <<<EOT
\t\t} 
\t\tYAHOO.util.Event.onContentReady('content',initPanels); 
\t\t</script>\t\t
EOT;
            $this->placedJS = true;
        }
        return true;
    }