Changeset 30783 for extensions/greydragon/include
- Timestamp:
- Dec 19, 2014, 7:15:58 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/greydragon/include/greydragon.class.php
r30754 r30783 3 3 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 4 4 5 define('GDTHEME_VERSION', '1. 0.18');5 define('GDTHEME_VERSION', '1.1.19'); 6 6 7 7 define("QUOTES_NONE", FALSE); … … 17 17 private $themeConfig; 18 18 private $themeConfigMin; 19 private $dir; 20 private $cssfile; 19 21 20 22 public static function Instance($ver = '') { … … 26 28 27 29 private function __construct($ver = ''){ 30 $this->dir = PHPWG_ROOT_PATH . PWG_LOCAL_DIR . 'greydragon/'; 31 28 32 self::loadConfig($ver); 29 33 } … … 288 292 public function getHeader() { 289 293 $content = ""; 294 $root_base = get_root_url(); 295 if ($root_base): 296 else: 297 $root_base = '/'; 298 endif; 299 290 300 if ($this->hasOption('p_logo_path')): 291 $content .= '<a title="Home" id="g-logo" href="' . PHPWG_ROOT_PATH . '"><img alt="Home" src="' . PHPWG_ROOT_PATH. $this->getOption('p_logo_path') . '"></a>';301 $content .= '<a title="Home" id="g-logo" href="' . $root_base . '"><img alt="Home" src="' . $root_base . $this->getOption('p_logo_path') . '"></a>'; 292 302 endif; 293 303 if ($this->hasOption('p_header')): 294 $content .= '<a title="Home" id="g-header-text" href="' . PHPWG_ROOT_PATH. '">' . $this->getOption('p_header') . '</a>';304 $content .= '<a title="Home" id="g-header-text" href="' . $root_base . '">' . $this->getOption('p_header') . '</a>'; 295 305 elseif ($this->hasOption('page_banner', TRUE)): 296 $content .= '<a title="Home" id="g-header-text" href="' . PHPWG_ROOT_PATH. '">' . $this->getOption('page_banner', TRUE) . '</a>';306 $content .= '<a title="Home" id="g-header-text" href="' . $root_base . '">' . $this->getOption('page_banner', TRUE) . '</a>'; 297 307 endif; 298 308 … … 300 310 } 301 311 312 public function prepareCustomCSS() { 313 314 $this->cssfile = dirname(dirname(dirname(dirname(__FILE__)))) . '/' . PWG_LOCAL_DIR . 'greydragon/custom.css'; 315 316 if ($this->getOption('p_lowertext') == "on"): 317 $css = "/* Theme dynamic settings. Do not modify */\n" 318 . "html, body, input, select, textarea, file { text-transform: lowercase; }\n\n"; 319 else: 320 $css = ""; 321 endif; 322 $temp = $this->getOption('p_customcss'); 323 if ($temp): 324 $css .= "/* Custom CSS. Do not modify */\n" . $temp; 325 endif; 326 327 // create a local directory 328 if (!file_exists($this->dir)): 329 mkdir($this->dir, 0755); 330 endif; 331 332 if ($css): 333 $handle = fopen($this->cssfile, "w"); 334 if ($handle): 335 fwrite($handle, $css); 336 fclose($handle); 337 endif; 338 else: 339 @unlink($this->cssfile); 340 endif; 341 } 342 343 public function deleteCustomCSS() { 344 345 // delete local folder 346 foreach (scandir($this->dir) as $file): 347 if ($file == '.' or $file == '..') continue; 348 unlink($this->dir . $file); 349 endforeach; 350 rmdir($this->dir); 351 } 352 302 353 } 303 354
Note: See TracChangeset
for help on using the changeset viewer.