Deprecated variables for templates removed, mor EL-rewrites, getMessage() rewritten:
[mailer.git] / inc / modules / admin / what-admins_contct.php
index 4cd6523c195c001211de2173e49197563e437f20..9203b250af3f22caa9ca8410c1d94e2a3b4c86e7 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /************************************************************************
- * MXChange v0.2.1                                    Start: 06/19/2004 *
- * ================                             Last change: 06/19/2004 *
+ * Mailer v0.2.1-FINAL                                Start: 06/19/2004 *
+ * ===================                          Last change: 06/19/2004 *
  *                                                                      *
  * -------------------------------------------------------------------- *
  * File              : what-admins_contct.php                          *
@@ -17,7 +17,8 @@
  * Needs to be in all Files and every File needs "svn propset           *
  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
  ************************************************************************/
 
 // Some security stuff...
-if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
-       require($INC);
-}
+if ((!defined('__SECURITY')) || (!isAdmin())) {
+       die();
+} // END - if
 
 // Add description as navigation point
-ADD_DESCR("admin", __FILE__);
+addMenuDescription('admin', __FILE__);
 
-if ((IS_FORM_SENT()) && (REQUEST_ISSET_GET('admin'))) {
+if ((isFormSent()) && (isGetRequestParameterSet('admin'))) {
        // Send mail or message
-       if ((EXT_IS_ACTIVE("msg")) && (REQUEST_POST('type') == "msg")) {
+       if ((isExtensionActive('msg')) && (postRequestParameter('type') == 'message')) {
                // Add message
-               $msg = LOAD_EMAIL_TEMPLATE("admins_msg_contct_admin", REQUEST_POST('text'), "0");
-               SEND_ADMIN_MESSAGE(REQUEST_GET('admin'), ADMINS_MSG_FROM_ADMIN, $msg);
+               $message = loadEmailTemplate('admins_msg_contct_admin', postRequestParameter('text'), 0);
+               sendAdminMessage(getRequestParameter('admin'), getMessage('ADMINS_MSG_FROM_ADMIN'), $message);
        } else {
                // Load admin's email address
-               $email = GET_ADMIN_EMAIL(bigintval(REQUEST_GET('admin')));
+               $email = getAdminEmail(bigintval(getRequestParameter('admin')));
 
                // Load email template and send the mail to the admin
-               $msg = LOAD_EMAIL_TEMPLATE("admins_mail_contct_admin", REQUEST_POST('text'), "0");
-               SEND_EMAIL($email, ADMINS_MSG_FROM_ADMIN, $msg);
+               $message = loadEmailTemplate('admins_mail_contct_admin', postRequestParameter('text'), 0);
+               sendEmail($email, getMessage('ADMINS_MSG_FROM_ADMIN'), $message);
        }
 
        // Mail / message dropped
-       LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMINS_ADMIN_CONTACTED'));
-} elseif (REQUEST_ISSET_GET('admin')) {
+       loadTemplate('admin_settings_saved', false, '{--ADMINS_ADMIN_CONTACTED--}');
+} elseif (isGetRequestParameterSet('admin')) {
        // Load contact form template
-       define('__ADMIN', REQUEST_GET('admin'));
-       if (EXT_IS_ACTIVE("msg")) {
+       $content['admin'] = getRequestParameter('admin');
+
+       if (isExtensionActive('msg')) {
                // Add option to select between mail and message
-               define('ADMINS_MESSAGING_SELECTION', LOAD_TEMPLATE("admin_admins_contct_select", true));
+               $content['message_selection'] = loadTemplate('admin_admins_contct_select', true);
        } else {
                // Outout hidden input
-               define('ADMINS_MESSAGING_SELECTION', LOAD_TEMPLATE("admin_admins_contct_default", true));
+               $content['message_selection'] = loadTemplate('admin_admins_contct_default', true);
        }
-       LOAD_TEMPLATE("admin_admins_contct_form");
+
+       // Load main form
+       loadTemplate('admin_admins_contct_form', false, $content);
 } else {
        // Please select an admin!
-       LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMINS_SELECT_ADMIN'));
+       loadTemplate('admin_settings_saved', false, '{--ADMINS_SELECT_ADMIN--}');
 }
 
-//
+// [EOF]
 ?>