with PHP itself instead of JavaScript.
- *
- * @todo find a better solution that uses $.append(), the recommended
- * method maybe by using an additional param, the id of the div to
- * append to
- */
-
- return '
';
+ return Template::get('getDivForSliderEffect')->render([
+ 'id' => $id,
+ 'InitialSlidersState' => $GLOBALS['cfg']['InitialSlidersState'],
+ 'message' => $message,
+ ]);
}
/**
@@ -2911,42 +2896,19 @@ class Util
$state = 'on';
}
- // Generate output
- return "\n"
- . "
\n"
- . "";
-
+ return Template::get('toggleButton')->render(
+ [
+ 'pmaThemeImage' => $GLOBALS['pmaThemeImage'],
+ 'text_dir' => $GLOBALS['text_dir'],
+ 'link_on' => $link_on,
+ 'toggleOn' => str_replace(' ', ' ', htmlspecialchars(
+ $options[1]['label'])),
+ 'toggleOff' => str_replace(' ', ' ', htmlspecialchars(
+ $options[0]['label'])),
+ 'link_off' => $link_off,
+ 'callback' => $callback,
+ 'state' => $state
+ ]);
} // end toggleButton()
/**
diff --git a/templates/getDivForSliderEffect.phtml b/templates/getDivForSliderEffect.phtml
new file mode 100644
index 0000000000..d69d9aafe6
--- /dev/null
+++ b/templates/getDivForSliderEffect.phtml
@@ -0,0 +1,15 @@
+
+
>
+
+ with PHP itself instead of JavaScript.
+ *
+ * @todo find a better solution that uses $.append(), the recommended
+ * method maybe by using an additional param, the id of the div to
+ * append to
+ */ ?>
+
+= ($InitialSlidersState == 'closed')? ' style="display: none; overflow:auto;"':'' ?> class="pma_auto_slider"
+= $message? 'title="'. htmlspecialchars($message) . '"': ""?> >
+
diff --git a/templates/toggleButton.phtml b/templates/toggleButton.phtml
new file mode 100644
index 0000000000..356d4972c1
--- /dev/null
+++ b/templates/toggleButton.phtml
@@ -0,0 +1,27 @@
+
+
+
+
\ No newline at end of file
diff --git a/test/libraries/common/PMA_getDivForSliderEffect_test.php b/test/libraries/common/PMA_getDivForSliderEffect_test.php
index 1054d957a5..e422099963 100644
--- a/test/libraries/common/PMA_getDivForSliderEffect_test.php
+++ b/test/libraries/common/PMA_getDivForSliderEffect_test.php
@@ -35,8 +35,7 @@ class PMA_GetDivForSliderEffectTest extends PHPUnit_Framework_TestCase
$this->assertEquals(
PMA\libraries\Util::getDivForSliderEffect($id, $message),
- '
'
+ "
"
);
}
@@ -55,8 +54,7 @@ class PMA_GetDivForSliderEffectTest extends PHPUnit_Framework_TestCase
$this->assertEquals(
PMA\libraries\Util::getDivForSliderEffect($id, $message),
- '
'
+ "
"
);
}
@@ -76,7 +74,7 @@ class PMA_GetDivForSliderEffectTest extends PHPUnit_Framework_TestCase
$this->assertEquals(
PMA\libraries\Util::getDivForSliderEffect($id, $message),
- '
'
+ "
"
);
}
}
\ No newline at end of file