Beispiel #1
0
 public function testDirection()
 {
     $this->assertEquals("checked", Filter_CustomCSS::directionUnspecified(100));
     $this->assertEquals("", Filter_CustomCSS::directionUnspecified(101));
     $this->assertEquals("checked", Filter_CustomCSS::directionLeftToRight(101));
     $this->assertEquals("", Filter_CustomCSS::directionLeftToRight(102));
     $this->assertEquals("checked", Filter_CustomCSS::directionRightToLeft(102));
     $this->assertEquals("", Filter_CustomCSS::directionRightToLeft(103));
     $this->assertEquals(0, Filter_CustomCSS::directionValue(""));
     $this->assertEquals(1, Filter_CustomCSS::directionValue("ltr"));
     $this->assertEquals(2, Filter_CustomCSS::directionValue("rtl"));
 }
Beispiel #2
0
*/
require_once "../bootstrap/bootstrap.php";
page_access_level(Filter_Roles::TRANSLATOR_LEVEL);
Assets_Page::header(Locale_Translate::_("Font and text direction"));
$view = new Assets_View(__FILE__);
$database_config_bible = Database_Config_Bible::getInstance();
// The name of the Bible.
$bible = Access_Bible::clamp($_GET['bible']);
$view->view->bible = Filter_Html::sanitize($bible);
// Data submission.
if (isset($_POST['submit'])) {
    $font = $_POST["font"];
    $font = trim($font);
    $database_config_bible->setTextFont($bible, $font);
    $direction = $_POST["direction"];
    $direction = Filter_CustomCSS::directionValue($direction);
    $mode = $_POST["mode"];
    $mode = Filter_CustomCSS::writingModeValue($mode);
    $database_config_bible->setTextDirection($bible, $mode * 10 + $direction);
    Assets_Page::error("The information was saved.");
}
$font = $database_config_bible->getTextFont($bible);
$view->view->font = $font;
$direction = $database_config_bible->getTextDirection($bible);
$view->view->direction_none = Filter_CustomCSS::directionUnspecified($direction);
$view->view->direction_ltr = Filter_CustomCSS::directionLeftToRight($direction);
$view->view->direction_rtl = Filter_CustomCSS::directionRightToLeft($direction);
$view->view->mode_none = Filter_CustomCSS::writingModeUnspecified($direction);
$view->view->mode_tblr = Filter_CustomCSS::writingModeTopBottomLeftRight($direction);
$view->view->mode_tbrl = Filter_CustomCSS::writingModeTopBottomRightLeft($direction);
$view->view->mode_btlr = Filter_CustomCSS::writingModeBottomTopLeftRight($direction);