public function display_page() { if (SSFA_ADMINSTYLE === 'minimal') { unset($this->sections['about']); } $randysave = rand(1, 5); if (SSFA_ADMINSTYLE !== 'minimal') { if ($randysave < 4) { $saving = 'Filing away...'; $saved = 'Oh Glory!'; } elseif ($randysave === 4) { $saving = 'Gettin\' saved...'; $saved = 'Hallelujah, by and by.'; } elseif ($randysave === 5) { $saving = 'Just a few more weary days and then...'; $saved = '...your settings will be saved.'; } $savinganimation = "<img src='" . SSFA_IMAGES_URL . "saving.gif'>"; $bannersize = '500px'; } else { $saving = 'Saving changes...'; $saved = 'Changes saved.'; $savinganimation = null; $bannersize = '300px'; } echo '<div class="wrap"> <img src="' . SSFA_IMAGES_URL . 'fileaway_banner.png" style="width:' . $bannersize . ';">'; if (isset($_GET['settings-updated']) and $_GET['settings-updated'] == true) { echo '<div class="updated fade"><p>' . __('Settings Saved.') . '</p></div>'; } echo '<form action="options.php" method="post" id="ssfa-form">'; settings_fields('fileaway_options'); echo '<div class="ssfa-ui-tabs"> <ul class="ssfa-ui-tabs-nav">'; foreach ($this->sections as $section_slug => $section) { echo "<li class='{$section_slug}'><a href='#{$section_slug}' class='{$section_slug}'>{$section}</a></li>"; } echo '</ul>'; do_settings_sections($_GET['page']); echo "</div>\r\n\t\t<div id='ssfa-saving-backdrop'>\r\n\t\t<div id='ssfa-saving'>{$saving}</div>\r\n\t\t<div id='ssfa-saving-img'>{$savinganimation}</div>\t\t\r\n\t\t<div id='ssfa-settings-saved'>{$saved}</div>\r\n\t\t</div>\r\n\t\t</form>"; echo '<script type="text/javascript"> jQuery(document).ready(function($){ var sections = [];'; foreach ($this->sections as $section_slug => $section) { echo "sections['{$section}'] = '{$section_slug}';"; } echo 'var wrapped = $(".wrap h3").wrap("<div class=\\"ssfa-ui-tabs-panel\\">"); wrapped.each(function(){ $(this).parent().append($(this).parent().nextUntil("div.ssfa-ui-tabs-panel")); }); $(".ssfa-ui-tabs-panel").each(function(index){ $(this).attr("id", sections[$(this).children("h3").text()]); if (index > 0) $(this).addClass("ssfa-ui-tabs-hide"); }); $(".ssfa-ui-tabs").tabs({ show: { effect: "fadeIn", duration: 500, delay: 500 }, hide: { effect: "fadeOut", duration: 500, }, activate: function(event, ui){ ui.newTab.index(); cminst.refresh(); } }); $("input[type=text], textarea").each(function(){ if ($(this).val() == $(this).attr("placeholder") || $(this).val() == "") $(this).css("color", "#BBBBBB"); }); $("input[type=text], textarea").focus(function(){ if ($(this).val() == $(this).attr("placeholder") || $(this).val() == ""){ $(this).val(""); $(this).css("color", "#666666"); } }).blur(function(){ if ($(this).val() == "" || $(this).val() == $(this).attr("placeholder")){ $(this).val($(this).attr("placeholder")); $(this).css("color", "#BBBBBB"); } }); $(".wrap h3, .wrap table").show(); $(".warning").change(function(){ if ($(this).is(":checked")) $(this).parent().css("background", "#AB7137").css("color", "#fff").css("fontWeight", "normal"); else $(this).parent().css("background", "none").css("color", "inherit").css("fontWeight", "normal"); }); // Browser compatibility if ($.browser.mozilla) $("form").attr("autocomplete", "off"); }); </script>'; include_once SSFA_ADMIN_RESOURCES . 'options-help.php'; echo '</div>'; // PUSH CUSTOM CSS $ssfa_customcss = ssfa_customcss(); if (!empty($ssfa_customcss)) { ssfa_create_css(); } elseif (empty($ssfa_customcss) and file_exists(css_path())) { unlink(css_path()); } }
<?php defined('SSFA_FILE') or die("Shirley, you can't be serious."); $ssfa_customcss = ssfa_customcss(); if (!empty($ssfa_customcss) and !file_exists(css_path())) { ssfa_create_css(); } function css_path() { global $blog_id; $cssid = $blog_id > "1" ? $cssid = "_id-" . $blog_id : ($cssid = null); $css_path = SSFA_CUSTOM_CSS_UPLOADS . "ssfa-custom-styles" . $cssid . ".css"; return $css_path; } function css_url() { global $blog_id; $cssid = $blog_id > "1" ? $cssid = "_id-" . $blog_id : ($cssid = null); $css_url = SSFA_CUSTOM_CSS_UPLOADS_URL . "ssfa-custom-styles" . $cssid . ".css"; return $css_url; } function ssfa_customcss() { $ssfa_customcss = strip_tags(SSFA_CUSTOMCSS); return $ssfa_customcss; } function ssfa_create_css() { $ssfa_create_css = file_put_contents(css_path(), "/********* Do not edit this file. It is dynamically generated. *********/\n\n\n" . ssfa_customcss()); return $ssfa_create_css; }