<?php

/**
 *
 * INDEXU
 * Copyright(C), Nicecoder, 2000-2006, All Rights Reserved.
 *
 * INDEXU(tm) is protected by Indonesia and International copyright laws.
 * Unauthorized use or distribution of INDEXU(tm) is strictly prohibited,
 * violators will be prosecuted. To obtain a license for using INDEXU(tm),
 * please register at Nicecoder home page at http://www.nicecoder.com
 *
 * Author:
 *    Dody Rachmat Wicaksono (dody@nicecoder.com)
 *    M. Zuber (zubby@nicecoder.com)
 *
 */

  /*===================================================
    ShowFormChangeModrewrite()
  ===================================================*/

  function ShowFormChangeModrewrite() {

    global $admin_template_path, $mod_status, $mod_category, $mod_detail, $msg;

    $mod_status   = GetModRewriteStatus();
    $mod_category = GetModRewritePatternCategory();
    $mod_detail   = GetModRewritePatternDetail();
    
    $mod_status = ShowRadioButton("mod_status",$msg["20011"],$msg["20012"],$mod_status);
   
    DisplayTemplate($admin_template_path . "app_mod_rewrite_form.html",
      "\$mod_status,\$mod_category,\$mod_detail");
  }


  /*===================================================
    ProcessFormChangeModrewrite()
  ===================================================*/

  function ProcessFormChangeModrewrite() {

    global $admin_template_path, $mod_status, $mod_category, $mod_detail, $msg, $message;
    
    WriteHtaccessToFile($mod_status, $mod_category, $mod_detail);

    $message = $msg['20451'];
    DisplayTemplate($admin_template_path . "message.html", "\$message");
  }


  /*===================================================
    main
  ===================================================*/

  include "../application.php";
  
  RunPreFilter(__FILE__);

  DisplayTemplate($admin_template_path . "header.html");
  if (empty($pflag)) {
    ShowFormChangeModrewrite();
  }
  elseif ($pflag == 'change') {
    ProcessFormChangeModrewrite();
  }
  DisplayTemplate($admin_template_path . "footer.html");

  RunPostFilter(__FILE__);

?>