Bläddra i källkod

Add id attribute to hyperlink and image templates

pdontthink 18 år sedan
förälder
incheckning
548b9b18f8

+ 1 - 0
functions/page_header.php

@@ -169,6 +169,7 @@ function makeInternalLink($path, $text, $target='') {
     //
     //
     $oTemplate->assign('onclick', '');
     $oTemplate->assign('onclick', '');
     $oTemplate->assign('class', '');
     $oTemplate->assign('class', '');
+    $oTemplate->assign('id', '');
 
 
     return $oTemplate->fetch('hyperlink.tpl');
     return $oTemplate->fetch('hyperlink.tpl');
 }
 }

+ 1 - 0
functions/strings.php

@@ -816,6 +816,7 @@ function makeComposeLink($url, $text = null, $target='') {
         $oTemplate->assign('text', $text);
         $oTemplate->assign('text', $text);
         $oTemplate->assign('onclick', "comp_in_new('$compuri','$compose_width','$compose_height')");
         $oTemplate->assign('onclick', "comp_in_new('$compuri','$compose_width','$compose_height')");
         $oTemplate->assign('class', '');
         $oTemplate->assign('class', '');
+        $oTemplate->assign('id', '');
         return $oTemplate->fetch('hyperlink.tpl');
         return $oTemplate->fetch('hyperlink.tpl');
     }
     }
 
 

+ 2 - 0
functions/template/general_util.php

@@ -117,6 +117,8 @@ function getIcon($icon_theme_path, $icon_name, $text_icon, $alt_text='', $w=NULL
             $oTemplate->assign('border', '');
             $oTemplate->assign('border', '');
             $oTemplate->assign('hspace', '');
             $oTemplate->assign('hspace', '');
             $oTemplate->assign('vspace', '');
             $oTemplate->assign('vspace', '');
+            $oTemplate->assign('class', '');
+            $oTemplate->assign('id', '');
 
 
             $icon = $oTemplate->fetch('image.tpl');
             $icon = $oTemplate->fetch('image.tpl');
         } else {
         } else {

+ 1 - 0
plugins/listcommands/functions.php

@@ -67,6 +67,7 @@ function plugin_listcommands_menu_do() {
             $oTemplate->assign('target', '_blank');
             $oTemplate->assign('target', '_blank');
             $oTemplate->assign('text', $fieldsdescr[$cmd]);
             $oTemplate->assign('text', $fieldsdescr[$cmd]);
             $oTemplate->assign('class', '');
             $oTemplate->assign('class', '');
+            $oTemplate->assign('id', '');
             $oTemplate->assign('onclick', '');
             $oTemplate->assign('onclick', '');
             $output = $oTemplate->fetch('hyperlink.tpl');
             $output = $oTemplate->fetch('hyperlink.tpl');
             $links[] = $output;
             $links[] = $output;

+ 2 - 0
src/login.php

@@ -145,6 +145,8 @@ if (isset($org_logo) && $org_logo) {
         $oTemplate->assign('height', '');
         $oTemplate->assign('height', '');
     }
     }
     $oTemplate->assign('onclick', '');
     $oTemplate->assign('onclick', '');
+    $oTemplate->assign('id', '');
+    $oTemplate->assign('title', '');
     $oTemplate->assign('align', '');
     $oTemplate->assign('align', '');
     $oTemplate->assign('border', '');
     $oTemplate->assign('border', '');
     $oTemplate->assign('hspace', '');
     $oTemplate->assign('hspace', '');

+ 2 - 1
templates/default/hyperlink.tpl

@@ -12,6 +12,7 @@
   *                   (optional; may not be present)
   *                   (optional; may not be present)
   *      + $onclick - onClick JavaScript handler (optional; may not be present)
   *      + $onclick - onClick JavaScript handler (optional; may not be present)
   *      + $class   - CSS class name (optional; may not be present)
   *      + $class   - CSS class name (optional; may not be present)
+  *      + $id      - ID name (optional; may not be present)
   *
   *
   * @copyright © 1999-2006 The SquirrelMail Project Team
   * @copyright © 1999-2006 The SquirrelMail Project Team
   * @license http://opensource.org/licenses/gpl-license.php GNU Public License
   * @license http://opensource.org/licenses/gpl-license.php GNU Public License
@@ -26,4 +27,4 @@
 extract($t);
 extract($t);
 
 
 
 
-?><a href="<?php echo $uri ?>"<?php if (!empty($target)) echo ' target="' . $target . '"'; ?><?php if (!empty($onclick)) echo ' onclick="' . $onclick . '"'; ?><?php if (!empty($class)) echo ' class="' . $class . '"'; ?>><?php echo $text; ?></a>
+?><a href="<?php echo $uri ?>"<?php if (!empty($target)) echo ' target="' . $target . '"'; ?><?php if (!empty($onclick)) echo ' onclick="' . $onclick . '"'; ?><?php if (!empty($class)) echo ' class="' . $class . '"'; ?><?php if (!empty($id)) echo ' id="' . $id . '"'; ?>><?php echo $text; ?></a>

+ 2 - 1
templates/default/image.tpl

@@ -7,6 +7,7 @@
   *
   *
   * The following variables are available in this template:
   * The following variables are available in this template:
   *      + $src     - the image source path
   *      + $src     - the image source path
+  *      + $id      - ID name (optional; may not be present)
   *      + $class   - CSS class name (optional; may not be present)
   *      + $class   - CSS class name (optional; may not be present)
   *      + $alt     - alternative link text
   *      + $alt     - alternative link text
   *                   (optional; may not be present)
   *                   (optional; may not be present)
@@ -39,4 +40,4 @@
 extract($t);
 extract($t);
 
 
 
 
-?><img src="<?php echo $src ?>"<?php if (!empty($class)) echo ' class="' . $class . '"'; ?><?php if (!empty($alt)) echo ' alt="' . $alt . '"'; ?><?php if (!empty($title)) echo ' title="' . $title . '"'; ?><?php if (!empty($onclick)) echo ' onclick="' . $onclick . '"'; ?><?php if (!empty($width)) echo ' width="' . $width . '"'; ?><?php if (!empty($height)) echo ' height="' . $height . '"'; ?><?php if (!empty($align)) echo ' align="' . $align . '"'; ?><?php if (!empty($border)) echo ' border="' . $border . '"'; ?><?php if (!empty($hspace)) echo ' hspace="' . $hspace . '"'; ?><?php if (!empty($vspace)) echo ' vspace="' . $vspace . '"'; ?> />
+?><img src="<?php echo $src ?>"<?php if (!empty($class)) echo ' class="' . $class . '"'; ?><?php if (!empty($id)) echo ' id="' . $id . '"'; ?><?php if (!empty($alt)) echo ' alt="' . $alt . '"'; ?><?php if (!empty($title)) echo ' title="' . $title . '"'; ?><?php if (!empty($onclick)) echo ' onclick="' . $onclick . '"'; ?><?php if (!empty($width)) echo ' width="' . $width . '"'; ?><?php if (!empty($height)) echo ' height="' . $height . '"'; ?><?php if (!empty($align)) echo ' align="' . $align . '"'; ?><?php if (!empty($border)) echo ' border="' . $border . '"'; ?><?php if (!empty($hspace)) echo ' hspace="' . $hspace . '"'; ?><?php if (!empty($vspace)) echo ' vspace="' . $vspace . '"'; ?> />