From e2c610ebfa9155888ff60f4fb3d77bffbc1f2293 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Sun, 21 Sep 2008 03:33:38 -0400
Subject: [PATCH] - use more 'html' class

---
 program/steps/settings/identities.inc |    5 +----
 program/steps/mail/compose.inc        |    9 ++++-----
 program/steps/addressbook/func.inc    |   13 ++++---------
 program/steps/mail/func.inc           |   26 +++++---------------------
 4 files changed, 14 insertions(+), 39 deletions(-)

diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc
index 98cf29f..2172f97 100644
--- a/program/steps/addressbook/func.inc
+++ b/program/steps/addressbook/func.inc
@@ -152,11 +152,11 @@
     $attrib['id'] = 'rcmcontactframe';
     
   $attrib['name'] = $attrib['id'];
-  $attrib_str = create_attrib_string($attrib, array('name', 'id', 'class', 'style', 'src', 'width', 'height', 'frameborder'));
 
   $OUTPUT->set_env('contentframe', $attrib['name']);
   $OUTPUT->set_env('blankpage', $attrib['src'] ? $OUTPUT->abs_url($attrib['src']) : 'program/blank.gif');
-  return '<iframe'. $attrib_str . '></iframe>';
+
+  return html::tag('iframe', $attrib);
   }
 
 
@@ -169,13 +169,7 @@
 
   $OUTPUT->add_gui_object('countdisplay', $attrib['id']);
 
-  // allow the following attributes to be added to the <span> tag
-  $attrib_str = create_attrib_string($attrib, array('style', 'class', 'id'));
-
-  $out = '<span' . $attrib_str . '>';
-  $out .= rcmail_get_rowcount_text();
-  $out .= '</span>';
-  return $out;
+  return html::span($attrib, rcmail_get_rowcount_text());
   }
 
 
@@ -203,6 +197,7 @@
   return $out;
   }
 
+
 $OUTPUT->set_pagetitle(rcube_label('addressbook'));
   
 // register UI objects
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index 9ff4190..830168c 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -765,11 +765,10 @@
 
 function rcmail_compose_attachment_field($attrib)
 {
-  // allow the following attributes to be added to the <input> tag
-  $attrib_str = create_attrib_string($attrib, array('id', 'class', 'style', 'size'));
- 
-  $out = '<input type="file" name="_attachments[]"'. $attrib_str . " />";
-  return $out;
+  $attrib['type'] = 'file';
+  $attrib['name'] = '_attachments[]';
+  $field = new html_inputfield($attrib);
+  return $field->show();
 }
 
 
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index 3f81148..4469840 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -403,18 +403,12 @@
   if (empty($attrib['id']))
     $attrib['id'] = 'rcmailcontentwindow';
 
-  // allow the following attributes to be added to the <iframe> tag
-  $attrib_str = create_attrib_string($attrib, array('id', 'class', 'style', 'src', 'width', 'height', 'frameborder'));
-  $framename = $attrib['id'];
+  $attrib['name'] = $attrib['id'];
 
-  $out = sprintf('<iframe name="%s"%s></iframe>'."\n",
-         $framename,
-         $attrib_str);
-
-  $OUTPUT->set_env('contentframe', $framename);
+  $OUTPUT->set_env('contentframe', $attrib['id']);
   $OUTPUT->set_env('blankpage', $attrib['src'] ? $OUTPUT->abs_url($attrib['src']) : 'program/blank.gif');
 
-  return $out;
+  return html::tag('iframe', $attrib);
   }
 
 
@@ -430,14 +424,7 @@
 
   $OUTPUT->add_gui_object('countdisplay', $attrib['id']);
 
-  // allow the following attributes to be added to the <span> tag
-  $attrib_str = create_attrib_string($attrib, array('style', 'class', 'id'));
-
-  
-  $out = '<span' . $attrib_str . '>';
-  $out .= rcmail_get_messagecount_text();
-  $out .= '</span>';
-  return $out;
+  return html::span($attrib, rcmail_get_messagecount_text());
   }
 
 
@@ -1140,10 +1127,7 @@
 
   $attrib['src'] = Q('./?'.str_replace('_frame=', ($ctype_primary=='text' ? '_show=' : '_preload='), $_SERVER['QUERY_STRING']));
 
-  $attrib_str = create_attrib_string($attrib, array('id', 'class', 'style', 'src', 'width', 'height'));
-  $out = '<iframe '. $attrib_str . "></iframe>";
-    
-  return $out;
+  return html::tag('iframe', $attrib);
   }
 
 
diff --git a/program/steps/settings/identities.inc b/program/steps/settings/identities.inc
index e24a5c4..9d5af7b 100644
--- a/program/steps/settings/identities.inc
+++ b/program/steps/settings/identities.inc
@@ -36,10 +36,7 @@
 
   $OUTPUT->set_env('contentframe', $attrib['name']);
 
-  $attrib_str = create_attrib_string($attrib, array('name', 'id', 'class', 'style', 'src', 'width', 'height', 'frameborder'));
-  $out = '<iframe'. $attrib_str . '></iframe>';
-
-  return $out;
+  return html::tag('iframe', $attrib);
   }
 
 $OUTPUT->add_handler('identityframe', 'rcmail_identity_frame');

--
Gitblit v1.9.1