Permalink
Browse files

Merge branch '3.2/develop' into 3.3/develop

refs #4544
  • Loading branch information...
2 parents 8883571 + e5b7abe commit 02a8a3f1ef396e5a34c2d7794e7806b94b7ff691 @Zeelot Zeelot committed Jun 4, 2012
@@ -34,6 +34,9 @@ public function before()
Kodoc_Markdown::$base_url = URL::site($this->guide->uri()).'/';
Kodoc_Markdown::$image_url = URL::site($this->media->uri()).'/';
}
+
+ // Default show_comments to config value
+ $this->template->show_comments = Kohana::config('userguide.show_comments');
}
// List all modules that have userguides
@@ -45,7 +48,7 @@ public function index()
$this->template->menu = View::factory('userguide/menu', array('modules' => $this->_modules()));
// Don't show disqus on the index page
- $this->template->hide_disqus = TRUE;
+ $this->template->show_comments = FALSE;
}
// Display an error if a page isn't found
@@ -56,7 +59,7 @@ public function error($message)
$this->template->content = View::factory('userguide/error',array('message' => $message));
// Don't show disqus on error pages
- $this->template->hide_disqus = TRUE;
+ $this->template->show_comments = FALSE;
// If we are in a module and that module has a menu, show that
if ($module = $this->request->param('module') AND $menu = $this->file($module.'/menu') AND Kohana::$config->load('userguide.modules.'.$module.'.enabled'))
@@ -355,11 +358,11 @@ protected function _get_all_menu_markdown()
if ($file AND $text = file_get_contents($file))
{
// Add spans around non-link categories. This is a terrible hack.
- //echo Kohana::debug($text);
+ //echo Debug::vars($text);
//$text = preg_replace('/(\s*[\-\*\+]\s*)(.*)/','$1<span>$2</span>',$text);
$text = preg_replace('/^(\s*[\-\*\+]\s*)([^\[\]]+)$/m','$1<span>$2</span>',$text);
- //echo Kohana::debug($text);
+ //echo Debug::vars($text);
$markdown .= $text;
}
@@ -218,7 +218,7 @@ protected function _method_sort($a, $b)
/*
- echo kohana::debug('a is '.$a->class.'::'.$a->name,'b is '.$b->class.'::'.$b->name,
+ echo Debug::vars('a is '.$a->class.'::'.$a->name,'b is '.$b->class.'::'.$b->name,
'are the classes the same?', $a->class == $b->class,'if they are, the result is:',strcmp($a->name, $b->name),
'is a this class?', $a->name == $this->class->name,-1,
'is b this class?', $b->name == $this->class->name,1,
@@ -127,7 +127,7 @@ function _doHeaders_callback_atx($matches)
$attr = ' id="'.$this->make_heading_id($matches[2]).'"';
// Add this header to the page toc
- $this->_add_to_toc($level,$matches[2],$this->make_heading_id($matches[2]));
+ $this->_add_to_toc($level, $matches[2], $this->make_heading_id(empty($matches[3]) ? $matches[2] : $matches[3]));
$block = "<h$level$attr>".$this->runSpanGamut($matches[2])."</h$level>";
return "\n" . $this->hashBlock($block) . "\n\n";
View
@@ -4,11 +4,14 @@
(
// Enable the API browser. TRUE or FALSE
'api_browser' => TRUE,
-
+
// Enable these packages in the API browser. TRUE for all packages, or a string of comma seperated packages, using 'None' for a class with no @package
// Example: 'api_packages' => 'Kohana,Kohana/Database,Kohana/ORM,None',
'api_packages' => TRUE,
-
+
+ // Enables Disqus comments on the API and User Guide pages
+ 'show_comments' => Kohana::$environment === Kohana::PRODUCTION,
+
// Leave this alone
'modules' => array(
@@ -57,7 +57,7 @@
<div id="kodoc-body" class="span-16 suffix-1 last">
<?php echo $content ?>
- <?php if (Kohana::$environment === Kohana::PRODUCTION AND empty($hide_disqus)): ?>
+ <?php if ($show_comments): ?>
<div id="disqus_thread" class="clear"></div>
<script type="text/javascript">
var disqus_identifier = '<?php echo HTML::chars(Request::current()->uri()) ?>';

0 comments on commit 02a8a3f

Please sign in to comment.