<?php

@( (bool)FALSE === strpos( $_SERVER['REQUEST_URI'], basename( __FILE__ ) ) ) OR exit( '!! ACCESS DENIED !!' );
error_reporting( _E_VALUE );


/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | myPHPNuke Version 188_8 RC2                                          |
// +----------------------------------------------------------------------+
// | License: GNU/GPL - http://www.gnu.org/copyleft/gpl.html              |
// +----------------------------------------------------------------------+
// | Support: http://myphpnuke.com/                                       |
// +----------------------------------------------------------------------+
// | Author: myPHPNuke Dev Team                                           |
// +----------------------------------------------------------------------+
// | Copyright: © 2001-2004 myPHPNuke Dev Team                            |
// +----------------------------------------------------------------------+
// $Id: main.php,v 1.5.2.6 2004/08/15 12:58:19 kirilt Exp $

checkAccess( 'blocks', array( 'main' ) );

include ("admin/mymsg2/mymsg2.$phpEx");

global $hlpfile;
$hlpfile = getHelpFile("mymsg2.htm","myphpnuke");

if (!isset($op))
{
    $op = null;
}
if (!isset($message_name))
{
    $message_name = '';
}

switch($op) {

    case "edit":
        include("header.$phpEx");
        echo "<br>";
        edit_mymsg2($message_id,$message_name);
        echo "<br>";
        include("footer.$phpEx");
        break;


    case "update":
        include("header.$phpEx");
        echo "<br>";
		if (!isset($display))
		{
		    $display = null;
		}

		update_mymsg2($message_id,$title,$text,$display);
        echo "<br>";
        include("footer.$phpEx");
        break;


    case "add":
        include("header.$phpEx");
        echo "<br>";
        add_mymsg2($catid,$topicid,$message_name);
        echo "<br>";
        include("footer.$phpEx");
        break;

    case "insert":
        include("header.$phpEx");
        echo "<br>";
        insert_mymsg2($title,$text,$catid,$topicid,$display);
        echo "<br>";
        include("footer.$phpEx");
        break;

    case "delete":
        include("header.$phpEx");
        echo "<br>";
        if ( ! isset( $ok ) ) { $ok = NULL; }
        delete_mymsg2($message_id,$message_name,$ok);
        echo "<br>";
        include("footer.$phpEx");
        break;


    default:
        include("header.$phpEx");
        admin_menu($hlpfile);
        echo "<br>";
        list_mymsg2();
        echo "<br>";
        include("footer.$phpEx");
        break;
}


?>
