Add javascript flag in templates
[banana.git] / banana / page.inc.php
index fe6a808..b325330 100644 (file)
@@ -7,7 +7,7 @@
 * Copyright: See COPYING files that comes with this distribution
 ********************************************************************************/
 
-if (!include_once('Smarty.class.php')) {
+if (@!include_once('Smarty.class.php')) {
     require_once 'smarty/libs/Smarty.class.php';
 }
 
@@ -182,6 +182,7 @@ class BananaPage extends Smarty
         $this->assign('withtabs'   , Banana::$withtabs);
         $this->assign('feed_format', Banana::$feed_format);
         $this->assign('feed_active', Banana::$feed_active);
+        $this->assign('with_javascript', Banana::$msgshow_javascript);
 
         $this->register_function('url',     array($this, 'makeUrl'));
         $this->register_function('link',    array($this, 'makeLink'));
@@ -265,7 +266,7 @@ class BananaPage extends Smarty
      */
     public function makeLink(array $params, &$smarty = null)
     {
-        $catch = array('text', 'popup', 'class', 'accesskey');
+        $catch = array('text', 'popup', 'class', 'accesskey', 'style');
         foreach ($catch as $key) {
             ${$key} = isset($params[$key]) ? $params[$key] : null;
             unset($params[$key]);
@@ -283,11 +284,14 @@ class BananaPage extends Smarty
         if (!is_null($class)) {
             $class = ' class="' . $class . '"';
         }
+        if (!is_null($style)) {
+            $style = ' style="' . $style . '"';
+        }
         if (!is_null($accesskey)) {
             $accesskey = ' accesskey="' . $accesskey . '"';
         }
         return '<a href="' . banana_entities($link) . '"'
-              . $popup . $class . $accesskey
+              . $popup . $class . $style . $accesskey
               . '>' . $text . '</a>';
     }