[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: www/themes/drupal5/oxygen
From: Niels van Mourik <niels () shodan ! nl>
Date: 2007-03-01 16:23:34
Message-ID: 1172766214.731592.20539.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 638340 by nielsvm:
I renamed printWithLove() to returnWithLove() and removed the printing functionality \
out of it. After that re-added printWithLove() which is a wrapper to returnWithLove() \
with printing functionality!!! My change does *not* break API in anyway though it \
does simplify some tasks.
M +32 -12 functions.php
--- trunk/www/themes/drupal5/oxygen/functions.php #638339:638340
@@ -78,33 +78,53 @@
/*
-* printWithLove( $content, $description, $tabs ) - Niels van Mourik \
(niels@shodan.nl) +* returnWithLove( $content, $description, $tabs ) - Niels van \
Mourik (niels@shodan.nl)
*
-* printWithLove() processes $content and performs a few simple tasks. It
+* returnWithLove() processes $content and performs a few simple tasks. It
* adds a nice html comment, and uses tabulate() to indent it nicely. This
* function is useful for page.tpl.php because a lot of Drupal's output
-* needs some love to print it nicely within the template's code.
+* needs some love to print it nicely within the template's code. This function
+* only returns the beautified code, use printWithLove() to actually print it.
*
*/
+function returnWithLove($content, $description, $tabs) {
+
+ //indent the actual content with 1 tab.
+ $content = tabulate("$content", 1);
+
+ //Our simple template, where $content will be in the middle of the output.
+ $output = "<!--Begin of $description-->\n$content\t\n\t<!--//End-->\n\n";
+
+ //Indent the template with the content in it.
+ $output = tabulate($output, $tabs);
+
+ //Return the content
+ return $output;
+
+}
+
+
+/*
+* printWithLove( $content, $description, $tabs ) - Niels van Mourik \
(niels@shodan.nl) +*
+* printWithLove() is a wrapper to returnWithLove(). It makes the output pretty and \
actually +* prints it. If you want to print output directly, use this function, if \
you need to return +* output without printing it yet you should use \
returnWithLove(). +*
+*/
function printWithLove($content, $description, $tabs) {
//We only print when $content is NOT empty!
if (!empty($content)) {
//indent the actual content with 1 tab.
- $content = tabulate("$content", 1);
+ $output = returnWithLove($content, $description, $tabs);
- //Our simple template, where $content will be in the center of attention =)
- $output = "<!--Begin of $description-->\n$content\t\n\t<!--//End-->\n\n";
-
- //Indent the template with the content in it.
- $output = tabulate($output, $tabs);
-
- //Print it with love!
+ //Print it!
echo($output);
return true;
-
+
} else {
return false;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic