當前位置: 首頁>>代碼示例>>PHP>>正文


PHP gpPlugin::GetConfig方法代碼示例

本文整理匯總了PHP中gpPlugin::GetConfig方法的典型用法代碼示例。如果您正苦於以下問題:PHP gpPlugin::GetConfig方法的具體用法?PHP gpPlugin::GetConfig怎麽用?PHP gpPlugin::GetConfig使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在gpPlugin的用法示例。


在下文中一共展示了gpPlugin::GetConfig方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: HighlighterSettings

 function HighlighterSettings()
 {
     $this->config = gpPlugin::GetConfig();
     $this->config += array('theme' => 'default');
     $this->themes = array('default' => 'Default', 'django' => 'Django', 'eclipse' => 'Eclipse', 'emacs' => 'Emacs', 'fadetogrey' => 'Fade to Grey', 'midnight' => 'Midnight', 'rdark' => 'RDark', 'none' => '[None]');
     $this->themes = gpPlugin::Filter('syntaxhighlighter_themes', array($this->themes));
     $cmd = common::GetCommand();
     switch ($cmd) {
         case 'save':
             $this->Save();
             break;
     }
     $this->ShowForm();
 }
開發者ID:VTAMAGNO,項目名稱:gpEasy-CMS,代碼行數:14,代碼來源:Admin.php

示例2: CheckContent

 /**
  * Add syntax highlighting to the page
  * Check for <pre class="brush:jscript;">.. php...
  * Add the appropriate js and css files
  *
  */
 static function CheckContent()
 {
     global $page, $addonRelativeCode;
     $content = ob_get_contents();
     $avail_brushes['css'] = 'shBrushCss.js';
     $avail_brushes['diff'] = 'shBrushDiff.js';
     $avail_brushes['ini'] = 'shBrushIni.js';
     $avail_brushes['jscript'] = 'shBrushJScript.js';
     $avail_brushes['php'] = 'shBrushPhp.js';
     $avail_brushes['plain'] = 'shBrushPlain.js';
     $avail_brushes['sql'] = 'shBrushSql.js';
     $avail_brushes['xml'] = 'shBrushXml.js';
     $brushes = array();
     preg_match_all('#<pre[^<>]*>#', $content, $matches);
     if (!count($matches)) {
         return;
     }
     foreach ($matches[0] as $match) {
         preg_match('#class=[\'"]([^\'"]+)[\'"]#', $match, $classes);
         if (!isset($classes[1])) {
             continue;
         }
         preg_match('#brush:([^;\'"]+)[;"\']?#', $match, $type);
         if (!isset($type[1])) {
             continue;
         }
         $type = strtolower(trim($type[1]));
         if (!isset($avail_brushes[$type])) {
             continue;
         }
         $brushes[] = $avail_brushes[$type];
     }
     if (!count($brushes)) {
         return;
     }
     $config = gpPlugin::GetConfig();
     $theme =& $config['theme'];
     $page->head .= "\n\n";
     $page->head .= '<link rel="stylesheet" type="text/css" href="' . $addonRelativeCode . '/syntaxhighlighter/styles/shCore.css" />' . "\n";
     $css_file = 'shThemeDefault.css';
     switch ($theme) {
         case 'django':
             $css_file = 'shThemeDjango.css';
             break;
         case 'eclipse':
             $css_file = 'shThemeEclipse.css';
             break;
         case 'emacs':
             $css_file = 'shThemeEmacs.css';
             break;
         case 'fadetogrey':
             $css_file = 'shThemeFadeToGrey.css';
             break;
         case 'midnight':
             $css_file = 'shThemeMidnight.css';
             break;
         case 'rdark':
             $css_file = 'shThemeRDark.css';
             break;
         case 'none':
             $css_file = false;
             break;
     }
     if ($css_file) {
         $page->head .= '<link rel="stylesheet" type="text/css" href="' . $addonRelativeCode . '/syntaxhighlighter/styles/' . $css_file . '" />' . "\n";
     }
     $page->head .= '<script language="javascript" type="text/javascript" src="' . $addonRelativeCode . '/syntaxhighlighter/scripts/shCore.js"></script>' . "\n";
     foreach ($brushes as $brush) {
         $page->head .= '<script language="javascript" type="text/javascript" src="' . $addonRelativeCode . '/syntaxhighlighter/scripts/' . $brush . '"></script>' . "\n";
     }
     $page->jQueryCode .= "\nSyntaxHighlighter.all();\n";
 }
開發者ID:VTAMAGNO,項目名稱:gpEasy-CMS,代碼行數:78,代碼來源:HighlighterPlugin.php


注:本文中的gpPlugin::GetConfig方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。