コード例 #1
0
 /**
  * Default show-coordinates parameter for the chessboard widgets.
  *
  * @return boolean
  */
 public function getDefaultShowCoordinates()
 {
     if (!isset(self::$showCoordinates)) {
         $value = RPBChessboardHelperValidation::validateBooleanFromInt(get_option('rpbchessboard_showCoordinates'));
         self::$showCoordinates = isset($value) ? $value : self::DEFAULT_SHOW_COORDINATES;
     }
     return self::$showCoordinates;
 }
コード例 #2
0
 /**
  * Whether the compatibility mode is activated or not for the [pgn][/pgn] shortcode
  * (which means that [pgn_compat][/pgn_compat] would be used instead).
  *
  * @return boolean
  */
 public function getPGNCompatibilityMode()
 {
     if (!isset(self::$pgnCompatibilityMode)) {
         $value = RPBChessboardHelperValidation::validateBooleanFromInt(get_option('rpbchessboard_pgnCompatibilityMode'));
         self::$pgnCompatibilityMode = isset($value) ? $value : false;
     }
     return self::$pgnCompatibilityMode;
 }
コード例 #3
0
ファイル: smallscreens.php プロジェクト: eigentor/sbl
 /**
  * Whether the small-screen compatibility mode is enabled or not.
  *
  * @return boolean
  */
 public function getSmallScreenCompatibility()
 {
     if (!isset(self::$smallScreenCompatibility)) {
         $value = RPBChessboardHelperValidation::validateBooleanFromInt(get_option('rpbchessboard_smallScreenCompatibility'));
         self::$smallScreenCompatibility = isset($value) ? $value : true;
     }
     return self::$smallScreenCompatibility;
 }
コード例 #4
0
 /**
  * Load and validate a boolean post parameter with the given name.
  *
  * @param string $fieldName
  * @return boolean
  */
 private static function loadBooleanParameter($fieldName)
 {
     return isset($_POST[$fieldName]) ? RPBChessboardHelperValidation::validateBooleanFromInt($_POST[$fieldName]) : null;
 }
コード例 #5
0
ファイル: saveoptions.php プロジェクト: eigentor/sbl
 /**
  * Load and validate the small-screen mode corresponding to the given index.
  *
  * @param int $index
  * @return string
  */
 private static function loadSmallScreenMode($index)
 {
     $screenWidthKey = 'smallScreenMode' . $index . '-screenWidth';
     $squareSizeKey = 'smallScreenMode' . $index . '-squareSize';
     $hideCoordinatesKey = 'smallScreenMode' . $index . '-hideCoordinates';
     if (isset($_POST[$screenWidthKey]) && isset($squareSizeKey) && isset($hideCoordinatesKey)) {
         $screenWidth = RPBChessboardHelperValidation::validateInteger($_POST[$screenWidthKey], 1);
         $squareSize = RPBChessboardHelperValidation::validateSquareSize($_POST[$squareSizeKey]);
         $hideCoordinates = RPBChessboardHelperValidation::validateBooleanFromInt($_POST[$hideCoordinatesKey]);
         if (isset($screenWidth) && isset($squareSize) && isset($hideCoordinates)) {
             return $screenWidth . ':' . $squareSize . ':' . ($hideCoordinates ? 'true' : 'false');
         }
     }
     return null;
 }
コード例 #6
0
ファイル: defaultoptions.php プロジェクト: eigentor/sbl
 /**
  * Default show-move-arrow parameter.
  *
  * @return boolean
  */
 public function getDefaultShowMoveArrow()
 {
     if (!isset(self::$showMoveArrow)) {
         $value = RPBChessboardHelperValidation::validateBooleanFromInt(get_option('rpbchessboard_showMoveArrow'));
         self::$showMoveArrow = isset($value) ? $value : self::DEFAULT_SHOW_MOVE_ARROW;
     }
     return self::$showMoveArrow;
 }