]> git.mxchange.org Git - mailer.git/blobdiff - inc/template-functions.php
Added new (missing) template for admin area + continued a bit with ext-surfbar
[mailer.git] / inc / template-functions.php
index d4bd6354fa62f3d7c80f39cbfb730bdb743c35b8..6844430ab5e32b6e6aac05c2f9a0202df41473b5 100644 (file)
@@ -780,7 +780,7 @@ function compileRawCode ($code, $full = TRUE, $compileCode = TRUE) {
 }
 
 //
 }
 
 //
-function addSelectionBox ($type, $default, $prefix = '', $id = NULL, $class = 'form_select') {
+function addSelectionBox ($type, $default, $prefix = '', $id = NULL, $class = 'form_select', $allSteps = FALSE) {
        $OUT = '';
 
        if ($type == 'yn') {
        $OUT = '';
 
        if ($type == 'yn') {
@@ -880,7 +880,16 @@ function addSelectionBox ($type, $default, $prefix = '', $id = NULL, $class = 'f
 
                case 'mi': // Minutes
                case 'se': // Seconds
 
                case 'mi': // Minutes
                case 'se': // Seconds
-                       for ($idx = 0; $idx <= 59; $idx+=5) {
+                       // Default is 5 minutes/seconds step
+                       $step = 5;
+
+                       // All steps?
+                       if ($allSteps === TRUE) {
+                               // Then all steps
+                               $step = 1;
+                       } // END - if
+
+                       for ($idx = 0; $idx <= 59; $idx += $step) {
                                $padded = padLeftZero($idx, 2);
                                $OUT .= '<option value="' . $padded . '"';
                                if ($default == $padded) $OUT .= ' selected="selected"';
                                $padded = padLeftZero($idx, 2);
                                $OUT .= '<option value="' . $padded . '"';
                                if ($default == $padded) $OUT .= ' selected="selected"';
@@ -960,7 +969,7 @@ function generateImageOrCode ($img_code, $headerSent = TRUE) {
 }
 
 // Create selection box or array of splitted timestamp
 }
 
 // Create selection box or array of splitted timestamp
-function createTimeSelections ($timestamp, $prefix = '', $display = '', $align = 'center', $asArray = FALSE) {
+function createTimeSelections ($timestamp, $prefix = '', $display = '', $align = 'center', $asArray = FALSE, $allSteps = FALSE) {
        // Do not continue if ONE_DAY is absend
        if (!isConfigEntrySet('ONE_DAY')) {
                // Abort here
        // Do not continue if ONE_DAY is absend
        if (!isConfigEntrySet('ONE_DAY')) {
                // Abort here
@@ -1076,7 +1085,7 @@ function createTimeSelections ($timestamp, $prefix = '', $display = '', $align =
                        if (isInString($unit, $display) || (empty($display))) {
                                // Generate year selection
                                $OUT .= '<td align="center">';
                        if (isInString($unit, $display) || (empty($display))) {
                                // Generate year selection
                                $OUT .= '<td align="center">';
-                               $OUT .= addSelectionBox($field, $data[$unit], $prefix, NULL, 'mini_select');
+                               $OUT .= addSelectionBox($field, $data[$unit], $prefix, NULL, 'mini_select', $allSteps);
                                $OUT .= '</td>';
                        } else {
                                $OUT .= '<input type="hidden" name="' . $prefix . '_' . $field . '" value="0" />';
                                $OUT .= '</td>';
                        } else {
                                $OUT .= '<input type="hidden" name="' . $prefix . '_' . $field . '" value="0" />';