Skip to content

Commit

Permalink
Request #4634 Code block title/filename, uses conf css_filename
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.php.net/repository/pear/packages/Text_Wiki/trunk@190779 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information
bertrand Gugger committed Jul 16, 2005
1 parent c486b8d commit 55ba88b
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Text/Wiki/Render/Xhtml/Code.php
Expand Up @@ -6,7 +6,8 @@ class Text_Wiki_Render_Xhtml_Code extends Text_Wiki_Render {
'css' => null, // class for <pre>
'css_code' => null, // class for generic <code>
'css_php' => null, // class for PHP <code>
'css_html' => null // class for HTML <code>
'css_html' => null, // class for HTML <code>
'css_filename' => null // class for optional filename <div>
);

/**
Expand All @@ -32,6 +33,9 @@ function token($options)
$css_code = $this->formatConf(' class="%s"', 'css_code');
$css_php = $this->formatConf(' class="%s"', 'css_php');
$css_html = $this->formatConf(' class="%s"', 'css_html');
$css_filename = $this->formatConf(' class="%s"', 'css_filename');
print_r($options);
print_r($css_filename);

if ($type == 'php') {

Expand Down Expand Up @@ -96,7 +100,12 @@ function token($options)
$text = "<pre$css><code$css_code>$text</code></pre>";
}

if ($css_filename && isset($attr['filename'])) {
$text = '<div$css_filename>' .
$attr['filename'] . '</div>' . $text;
}

return "\n$text\n\n";
}
}
?>
?>

0 comments on commit 55ba88b

Please sign in to comment.