You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
546 B
24 lines
546 B
<?php
|
|
class Language_json{
|
|
var $Labels;
|
|
var $FileName;
|
|
function Language_json( $FN ){
|
|
$this->FileName = $FN;
|
|
$DOP = file_get_contents( $FN );
|
|
$this->Labels = json_decode( $DOP, true );
|
|
}
|
|
function GetLabel($LabelKey){
|
|
if (isset($this->Labels[$LabelKey])){
|
|
return $this->Labels[$LabelKey];
|
|
} else return $LabelKey;
|
|
}
|
|
function AddLabel($LabelKey, $LabelText ){
|
|
$this->Labels[$LabelKey] = $LabelText;
|
|
$FD = fopen( $this->FileName, "w+" );
|
|
fprintf( $FD, json_encode( $this->Labels ) );
|
|
fclose( $FD );
|
|
}
|
|
};
|
|
|
|
|
|
?>
|