Revision: 2523
https://sourceforge.net/p/mrbs/code/2523/
Author: cimorrison
Date: 2012-10-24 12:00:36 +0000 (Wed, 24 Oct 2012)
Log Message:
-----------
Restructured code
Modified Paths:
--------------
mrbs/trunk/web/edit_entry.php
mrbs/trunk/web/functions.inc
Modified: mrbs/trunk/web/edit_entry.php
===================================================================
--- mrbs/trunk/web/edit_entry.php 2012-10-24 11:45:49 UTC (rev 2522)
+++ mrbs/trunk/web/edit_entry.php 2012-10-24 12:00:36 UTC (rev 2523)
@@ -168,7 +168,7 @@
'id' => $prefix . 'seconds' . $area['id'],
'disabled' => $disabled || $display_none,
'create_hiden' => $disabled && !$display_none,
- 'attributes' => implode(' ', $attributes),
+ 'attributes' => $attributes,
'value' => $current_s,
'options' => $options,
'force_assoc' => TRUE);
@@ -379,7 +379,7 @@
'force_assoc' => TRUE,
'value' => $area_id,
'disabled' => $disabled,
- 'attributes' => implode(' ', $attributes));
+ 'attributes' => $attributes);
generate_select($params);
echo "</div>\n";
Modified: mrbs/trunk/web/functions.inc
===================================================================
--- mrbs/trunk/web/functions.inc 2012-10-24 11:45:49 UTC (rev 2522)
+++ mrbs/trunk/web/functions.inc 2012-10-24 12:00:36 UTC (rev 2523)
@@ -522,6 +522,7 @@
// 'disabled' Whether the field should be disabled. Default FALSE
// 'mandatory' Whether the field is a required field. Default FALSE
// 'attributes' Additional attributes, allowing HTML5 attributes.
Default NULL.
+// Can be either a simple string or an array of
attributes.
//
function generate_checkbox($params)
{
@@ -549,6 +550,11 @@
}
}
+ if (isset($params['attributes']) && is_array($params['attributes']))
+ {
+ $params['attributes'] = implode(' ', $params['attributes']);
+ }
+
// generate the HTML
// no HTML escaping for the label - it is trusted
$html = "<label for=\"" . $params['name'] . "\">" . $params['label'] .
"</label>\n";
@@ -578,7 +584,7 @@
// 'attributes' Additional attributes, allowing HTML5 input types such
as number and
// email to be used. Note that additional attributes
such as min, etc.
// can also be included in the string, eg 'type="number"
min="1" step="1"'.
-// Default NULL.
+// Default NULL. Can be ither a simple string or an
array of attributes.
//
function generate_input($params)
{
@@ -605,6 +611,11 @@
}
}
+ if (isset($params['attributes']) && is_array($params['attributes']))
+ {
+ $params['attributes'] = implode(' ', $params['attributes']);
+ }
+
// generate the HTML
$html = '';
if (isset($params['label']))
@@ -860,7 +871,8 @@
// 'create_hidden' Boolean. If TRUE hidden inputs are created if
'disabled' is set
// Default TRUE
// 'mandatory' Whether the field is a required field. Default FALSE
-// 'attributes' Can be used for passing other attributes. Default
NULL
+// 'attributes' Can be used for passing other attributes. Default
NULL.
+// Can be either a simple string or an array of
attributes
//
function generate_select($params)
{
@@ -897,6 +909,12 @@
}
}
}
+
+ if (isset($params['attributes']) && is_array($params['attributes']))
+ {
+ $params['attributes'] = implode(' ', $params['attributes']);
+ }
+
// generate the HTML
// no HTML escaping for the label - it is trusted
$html = '';
@@ -945,6 +963,7 @@
// 'disabled' Whether the field should be disabled. Default FALSE
// 'mandatory' Whether the field is a required field. Default FALSE
// 'attributes' Additional attributes, allowing HTML5 attributes.
Default NULL.
+// Can be either a simple string or an array of
attributes.
//
function generate_textarea($params)
{
@@ -971,6 +990,12 @@
}
}
}
+
+ if (isset($params['attributes']) && is_array($params['attributes']))
+ {
+ $params['attributes'] = implode(' ', $params['attributes']);
+ }
+
// generate the HTML
// no HTML escaping for the label - it is trusted
$html = "<label for=\"" . $params['name'] . "\">" . $params['label'] .
"</label>\n";
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits