Các bài đăng được tạo bởi Urs Hunkler

Hình của Core developers

Hi Jon,


thank you very much for your comments.

> Make the code that gets the object less cryptic
This could work by setting the "name" of the objects and adressing them directly by "getElementsByName".

> Try to do all the containerDisplaySet() calls in one go
I'll try that later.

Urs

Hình của Core developers

Hi,

the JS and cookie combination is really working - without any "flicker" > test page

A short howto:

  • with every switch one cookie (named with "block name") for the changed block is written with the block's display state
  • on page reload every block is followed by a JS-call (patched web.lib)
  • the called function reads the cookie for that block and sets the content to it's saved state by CSS
  • the next block is written
  • ...
I tested the page with firefox, IE6 and Opera 7.54 on windows - all work. Does the page run on other browsers/systems too?

If anybody is intersted I'll be glad to tell you more details. Jon?

Urs

Moodle in English -> Themes -> Garden theme -> Re: Garden theme

Bởi Urs Hunkler -
Hình của Core developers

Hi George,

do I get you right, you just want to have no picture? Then you open the file styles.php in your garden themes folder and delete all instances of leftside.jpg:

One example - before:

...

.sideblockmain {
background-image: url(<?PHP echo "$themeurl"?>/leftside.jpg);
background-repeat: repeat-y;
}

...

This example - after:

...

.sideblockmain {

}

...

Good luck
Urs

Hình của Core developers

Hi,

not thinking at it let the idea come up to use a JS switch to find out whether PHP has replaced the variables with the path string. Depending on the result the 2. CSS call is written to the document or suppressed:

<HEAD>
<TITLE>Moodle Docs: Introduction</TITLE>
<link rel="stylesheet" type="TEXT/CSS" href="docstyles.css">
<script language="JavaScript">
<!-- //hide
var themeCSS = "<?php echo "$CFG->wwwroot/theme/$CFG->theme" ?>";
if (!themeCSS.indexOf("CFG->wwwroot/")) {
document.write ("<link rel=\"stylesheet\" type=\"text/css\" href=\"" + themeCSS +"/styles.php\" />");
}
// done hiding -->
</script>

<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
</HEAD>

It's producing the wanted outcome, but is it a good solution?

... is Urs asking.

Moodle in English -> General developer forum -> The Docs and Theme CSS

Bởi Urs Hunkler -
Hình của Core developers

Hi,

Ralf Hilgenstock asked me, how the doc files could be formated with the theme CSS. My proposal is, to use 2 CSS calls after another:


<link rel="stylesheet" href="docstyles.css" type="TEXT/CSS">
<link rel="stylesheet" type="text/css" href="<?php echo "$CFG->wwwroot/theme/$CFG->theme" ?>/styles.php" />

The first styles the page, when it's called directly, the second overwrites the first, when the doc-file is called through Moodle and styles the page in the theme design. This works, but with the problem that the browser shows a part of the second CSS-call on the page, when the file is opened directly. How can the second line be hidden from direct HTML rendering without losing it's function, when rendered through PHP?

I attach my testfile "intro.html" from the german docs.

Thank you very much for your help.
Urs

Trung bình điểm đánh giá: -