<?php


include_once "{$_SERVER['DOCUMENT_ROOT']}/common.inc.php";
include_once _ADM_INC_PATH_ . "/auth_check.php";
include_once _HOME_INC_PATH_ . "/ajax_init.php";

$qryobj = new cUtil\Mlang();

if (!_notAuth("R")) {
  /************ 권한체크*/
  switch ($_REQUEST['mode']) {

    case "getTranPage" :
      $_REQUEST['no_echo'] = true;
      $retval['data'] = $qryobj->getWordPage($_REQUEST);
      break;

    case "setTran" :
      $tran_id = $_REQUEST['TRAN_ID'];
      unset($_REQUEST['TRAN_ID']);
      unset($_REQUEST['mode']);
      $rst = $qryobj->setWord( $tran_id, $_REQUEST, true );
      move_page("./message_manage.php");
      break;

    case "setLang" :
      unset($_REQUEST['mode']);
      $qryobj->setLang($_REQUEST);
      hback();
      break;
  }
}

if (!$_REQUEST['no_echo']) {
  echo json_encode($retval);
}