Changeset 1527
- Timestamp:
- 08/09/06 11:06:03 (2 years ago)
- Location:
- trunk/gregarius
- Files:
-
- 2 modified
-
admin/themes.php (modified) (5 diffs)
-
themes/default/web/css/look.css (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/gregarius/admin/themes.php
r1372 r1527 45 45 $active_theme= getConfig('rss.output.theme'); 46 46 } 47 48 echo "<form style=\"float:right\" method=\"post\" action=\"" .$_SERVER['PHP_SELF'] ."\">\n" 49 . "<p><input type=\"hidden\" name=\"".CST_ADMIN_DOMAIN."\" value=\"".CST_ADMIN_DOMAIN_THEMES."\" />\n" 50 ."<input type=\"submit\" name=\"admin_themes_check_for_updates\" value=\"".LBL_ADMIN_CHECK_FOR_UPDATES."\" /></p>\n" 51 . "</form>\n"; 52 if (isset($_POST['admin_themes_check_for_updates'])) { 53 theme_getThemesUpdate(&$themes); 54 } 47 55 48 56 echo "<h2 class=\"trigger\">".LBL_ADMIN_THEMES."</h2>\n" … … 61 69 } 62 70 $active = ($entry == $active_theme); 71 $updateAvailable = isset($theme['updateVersion']); 63 72 if ($screenshot) { 64 73 $screenshotURL = "<img src=\"". getPath() . RSS_THEME_DIR . "/$fsname/$screenshot\" />"; … … 68 77 $h4="$name"; 69 78 $h5="By $author | Version: $version"; 79 if ($updateAvailable) { 80 $h5 .= ' | <a class="update" href="'.$theme['updateUrl'].'">Update to version ' .$theme['updateVersion'] .'</a>'; 81 } 82 70 83 if ($htmltheme) { 71 84 $seturl = "index.php?view=themes&theme=$entry"; … … 73 86 $seturl = ""; 74 87 } 75 echo "<div class=\"themeframe".($active?" active":""). "\"><span>";88 echo "<div class=\"themeframe".($active?" active":""). ($updateAvailable?" hilite":"")."\"><span>"; 76 89 if (!$active && $htmltheme) { 77 90 echo "<a href=\"$seturl\" class=\"bookmarklet\">".LBL_ADMIN_USE_THIS_THEME."</a>"; … … 399 412 } 400 413 414 function theme_getThemesUpdate(&$themes) { 415 $themesxml = array(); 416 global $themesxml; 417 $xml = getUrl('http://themes.gregarius.net/api.php'); 418 $xml = str_replace("\r", '', $xml); 419 $xml = str_replace("\n", '', $xml); 420 421 $xp = xml_parser_create() or rss_error("couldn't create parser"); 422 423 xml_set_element_handler($xp, 'themes_xml_startElement', 'themes_xml_endElement') 424 or rss_error("couldnt set XML handlers"); 425 426 xml_parse($xp, $xml, true) or rss_error("failed parsing xml"); 427 xml_parser_free($xp) or rss_error("failed freeing the parser"); 428 if (is_array($themesxml)) { 429 foreach($themesxml as $theme => $data) { 430 list($tversion,$turl) = $data; 431 if (isset($themes[$theme]) && $themes[$theme]['version'] < $tversion) { 432 $themes[$theme]['updateVersion'] = $tversion; 433 $themes[$theme]['updateUrl'] = $turl; 434 } 435 } 436 } 437 } 438 439 function themes_xml_startElement($xp, $element, $attr) { 440 global $themesxml; 441 442 if ($element == 'THEME' && 443 array_key_exists('PID',$attr) && 444 array_key_exists('URL',$attr) && 445 array_key_exists('VERSION',$attr)) { 446 447 $themesxml[$attr['PID']] = array($attr['VERSION'],$attr['URL']); 448 } 449 } 450 451 function themes_xml_endElement($xp, $element) { 452 ///global $pluginsxml; 453 return; 454 } 455 401 456 ?> -
trunk/gregarius/themes/default/web/css/look.css
r1435 r1527 129 129 tr.active td { font-weight:900; background-color:#f8f8ff; } 130 130 tr.hilite td { font-weight:900; background-color:#f0fff0; } 131 .themeframe.hilite span,.themeframe.hilite:hover span { background-color:#f0fff0; } 131 132 132 133 h3.collapsed { … … 404 405 } 405 406 407 .themeframe h5 a.update { color: #447; font-weight: 900 !important; } 408 406 409 .themeframe .bookmarklet { 407 410 float:right; … … 420 423 421 424 .themeframe span:hover, .themeframe.active span { 422 border-color: # eef;425 border-color: #dde; 423 426 background-color: #f8f8ff; 424 427 }
