|
From: <luc...@us...> - 2014-02-07 21:20:26
|
Revision: 12292
http://sourceforge.net/p/xoops/svn/12292
Author: luciorota
Date: 2014-02-07 21:20:20 +0000 (Fri, 07 Feb 2014)
Log Message:
-----------
standardize and templatize module: still in progress
Modified Paths:
--------------
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/sendletter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/cron.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/header.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/functions.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/task.inc.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/index.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/admin.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/main.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/modinfo.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/letter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/print.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/protocol.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/sendletter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/subscription.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xnewsletter_protocol.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xnewsletter_subscription_list_subscriptions.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/xoops_version.php
Added Paths:
-----------
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/request.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/session.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xnewsletter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/common.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/constants.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/common.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xnewsletter_print.html
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/sendletter.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/sendletter.php 2014-02-07 20:41:47 UTC (rev 12291)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/sendletter.php 2014-02-07 21:20:20 UTC (rev 12292)
@@ -39,9 +39,9 @@
$xn_send_in_packages_time = 0;
}
-$result = Create_Tasklist($op, $letter_id, $xn_send_in_packages, $xn_send_in_packages_time);
+$result = xNewsletter_createTasks($op, $letter_id, $xn_send_in_packages, $xn_send_in_packages_time);
-$result_exec = Execute_Tasks($xn_send_in_packages, $letter_id);
+$result_exec = xNewsletter_executeTasks($xn_send_in_packages, $letter_id);
redirect_header("letter.php", 3, $result_exec);
Added: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/request.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/request.php (rev 0)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/request.php 2014-02-07 21:20:20 UTC (rev 12292)
@@ -0,0 +1,998 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * xNewsletterRequest class
+ *
+ * @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
+ * @license GNU/GPL, see LICENSE.php
+ * Joomla! is free software. This version may have been modified pursuant
+ * to the GNU General Public License, and as distributed it includes or
+ * is derivative of works licensed under the GNU General Public License or
+ * other free or open source software licenses.
+ * See COPYRIGHT.php for copyright notices and details.
+ * @package xNewsletter
+ * @since 1.3
+ * @author trabis <lus...@gm...>
+ * @version svn:$id$
+ */
+
+/**
+ * Set the available masks for cleaning variables
+ */
+define('XNEWSLETTER_REQUEST_NOTRIM', 1);
+define('XNEWSLETTER_REQUEST_ALLOWRAW', 2);
+define('XNEWSLETTER_REQUEST_ALLOWHTML', 4);
+
+/**
+ * xNewsletterRequest Class
+ * This class serves to provide a common interface to access
+ * request variables. This includes $_POST, $_GET, and naturally $_REQUEST. Variables
+ * can be passed through an input filter to avoid injection or returned raw.
+ */
+class xNewsletterRequest
+{
+
+ /**
+ * Gets the request method
+ *
+ * @return string
+ */
+ static function getMethod()
+ {
+ $method = strtoupper($_SERVER['REQUEST_METHOD']);
+
+ return $method;
+ }
+
+ /**
+ * Fetches and returns a given variable.
+ * The default behaviour is fetching variables depending on the
+ * current request method: GET and HEAD will result in returning
+ * an entry from $_GET, POST and PUT will result in returning an
+ * entry from $_POST.
+ * You can force the source by setting the $hash parameter:
+ * post $_POST
+ * get $_GET
+ * files $_FILES
+ * cookie $_COOKIE
+ * env $_ENV
+ * server $_SERVER
+ * method via current $_SERVER['REQUEST_METHOD']
+ * default $_REQUEST
+ *
+ * @static
+ *
+ * @param string $name Variable name
+ * @param string $default Default value if the variable does not exist
+ * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD)
+ * @param string $type Return type for the variable, for valid values see {@link JFilterInput::clean()}
+ * @param int $mask Filter mask for the variable
+ *
+ * @return mixed Requested variable
+ */
+ static function getVar($name, $default = null, $hash = 'default', $type = 'none', $mask = 0)
+ {
+ // Ensure hash and type are uppercase
+ $hash = strtoupper($hash);
+ if ($hash === 'METHOD') {
+ $hash = strtoupper($_SERVER['REQUEST_METHOD']);
+ }
+ $type = strtoupper($type);
+ // Get the input hash
+ switch ($hash) {
+ case 'GET' :
+ $input = & $_GET;
+ break;
+ case 'POST' :
+ $input = & $_POST;
+ break;
+ case 'FILES' :
+ $input = & $_FILES;
+ break;
+ case 'COOKIE' :
+ $input = & $_COOKIE;
+ break;
+ case 'ENV' :
+ $input = & $_ENV;
+ break;
+ case 'SERVER' :
+ $input = & $_SERVER;
+ break;
+ default:
+ $input = & $_REQUEST;
+ $hash = 'REQUEST';
+ break;
+ }
+ if (isset($input[$name]) && $input[$name] !== null) {
+ // Get the variable from the input hash and clean it
+ $var = xNewsletterRequest::_cleanVar($input[$name], $mask, $type);
+ // Handle magic quotes compatability
+ if (get_magic_quotes_gpc() && ($var != $default) && ($hash != 'FILES')) {
+ $var = xNewsletterRequest::_stripSlashesRecursive($var);
+ }
+ } elseif ($default !== null) {
+ // Clean the default value
+ $var = xNewsletterRequest::_cleanVar($default, $mask, $type);
+ } else {
+ $var = $default;
+ }
+
+ return $var;
+ }
+
+ /**
+ * Fetches and returns a given filtered variable. The integer
+ * filter will allow only digits to be returned. This is currently
+ * only a proxy function for getVar().
+ * See getVar() for more in-depth documentation on the parameters.
+ *
+ * @static
+ *
+ * @param string $name Variable name
+ * @param int $default Default value if the variable does not exist
+ * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD)
+ *
+ * @return integer Requested variable
+ */
+ static function getInt($name, $default = 0, $hash = 'default')
+ {
+ return xNewsletterRequest::getVar($name, $default, $hash, 'int');
+ }
+
+ /**
+ * Fetches and returns a given filtered variable. The float
+ * filter only allows digits and periods. This is currently
+ * only a proxy function for getVar().
+ * See getVar() for more in-depth documentation on the parameters.
+ *
+ * @static
+ *
+ * @param string $name Variable name
+ * @param float $default Default value if the variable does not exist
+ * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD)
+ *
+ * @return float Requested variable
+ */
+ static function getFloat($name, $default = 0.0, $hash = 'default')
+ {
+ return xNewsletterRequest::getVar($name, $default, $hash, 'float');
+ }
+
+ /**
+ * Fetches and returns a given filtered variable. The bool
+ * filter will only return true/false bool values. This is
+ * currently only a proxy function for getVar().
+ * See getVar() for more in-depth documentation on the parameters.
+ *
+ * @static
+ *
+ * @param string $name Variable name
+ * @param bool $default Default value if the variable does not exist
+ * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD)
+ *
+ * @return bool Requested variable
+ */
+ static function getBool($name, $default = false, $hash = 'default')
+ {
+ return xNewsletterRequest::getVar($name, $default, $hash, 'bool');
+ }
+
+ /**
+ * Fetches and returns a given filtered variable. The word
+ * filter only allows the characters [A-Za-z_]. This is currently
+ * only a proxy function for getVar().
+ * See getVar() for more in-depth documentation on the parameters.
+ *
+ * @static
+ *
+ * @param string $name Variable name
+ * @param string $default Default value if the variable does not exist
+ * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD)
+ *
+ * @return string Requested variable
+ */
+ static function getWord($name, $default = '', $hash = 'default')
+ {
+ return xNewsletterRequest::getVar($name, $default, $hash, 'word');
+ }
+
+ /**
+ * Fetches and returns a given filtered variable. The cmd
+ * filter only allows the characters [A-Za-z0-9.-_]. This is
+ * currently only a proxy function for getVar().
+ * See getVar() for more in-depth documentation on the parameters.
+ *
+ * @static
+ *
+ * @param string $name Variable name
+ * @param string $default Default value if the variable does not exist
+ * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD)
+ *
+ * @return string Requested variable
+ */
+ static function getCmd($name, $default = '', $hash = 'default')
+ {
+ return xNewsletterRequest::getVar($name, $default, $hash, 'cmd');
+ }
+
+ /**
+ * Fetches and returns a given filtered variable. The string
+ * filter deletes 'bad' HTML code, if not overridden by the mask.
+ * This is currently only a proxy function for getVar().
+ * See getVar() for more in-depth documentation on the parameters.
+ *
+ * @static
+ *
+ * @param string $name Variable name
+ * @param string $default Default value if the variable does not exist
+ * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD)
+ * @param int $mask Filter mask for the variable
+ *
+ * @return string Requested variable
+ */
+ static function getString($name, $default = '', $hash = 'default', $mask = 0)
+ {
+ // Cast to string, in case JREQUEST_ALLOWRAW was specified for mask
+ return (string)xNewsletterRequest::getVar($name, $default, $hash, 'string', $mask);
+ }
+
+ static function getArray($name, $default = array(), $hash = 'default')
+ {
+ return xNewsletterRequest::getVar($name, $default, $hash, 'array');
+ }
+
+ static function getText($name, $default = '', $hash = 'default')
+ {
+ return (string)xNewsletterRequest::getVar($name, $default, $hash, 'string', PUBLISHER_REQUEST_ALLOWRAW);
+ }
+
+ /**
+ * Set a variabe in on of the request variables
+ *
+ * @access public
+ *
+ * @param string $name Name
+ * @param string $value Value
+ * @param string $hash Hash
+ * @param boolean $overwrite Boolean
+ *
+ * @return string Previous value
+ */
+ static function setVar($name, $value = null, $hash = 'method', $overwrite = true)
+ {
+ //If overwrite is true, makes sure the variable hasn't been set yet
+ if (!$overwrite && array_key_exists($name, $_REQUEST)) {
+ return $_REQUEST[$name];
+ }
+ // Get the request hash value
+ $hash = strtoupper($hash);
+ if ($hash === 'METHOD') {
+ $hash = strtoupper($_SERVER['REQUEST_METHOD']);
+ }
+ $previous = array_key_exists($name, $_REQUEST) ? $_REQUEST[$name] : null;
+ switch ($hash) {
+ case 'GET' :
+ $_GET[$name] = $value;
+ $_REQUEST[$name] = $value;
+ break;
+ case 'POST' :
+ $_POST[$name] = $value;
+ $_REQUEST[$name] = $value;
+ break;
+ case 'COOKIE' :
+ $_COOKIE[$name] = $value;
+ $_REQUEST[$name] = $value;
+ break;
+ case 'FILES' :
+ $_FILES[$name] = $value;
+ break;
+ case 'ENV' :
+ $_ENV['name'] = $value;
+ break;
+ case 'SERVER' :
+ $_SERVER['name'] = $value;
+ break;
+ }
+
+ return $previous;
+ }
+
+ /**
+ * Fetches and returns a request array.
+ * The default behaviour is fetching variables depending on the
+ * current request method: GET and HEAD will result in returning
+ * $_GET, POST and PUT will result in returning $_POST.
+ * You can force the source by setting the $hash parameter:
+ * post $_POST
+ * get $_GET
+ * files $_FILES
+ * cookie $_COOKIE
+ * env $_ENV
+ * server $_SERVER
+ * method via current $_SERVER['REQUEST_METHOD']
+ * default $_REQUEST
+ *
+ * @static
+ *
+ * @param string $hash to get (POST, GET, FILES, METHOD)
+ * @param int $mask Filter mask for the variable
+ *
+ * @return mixed Request hash
+ */
+ static function get($hash = 'default', $mask = 0)
+ {
+ $hash = strtoupper($hash);
+ if ($hash === 'METHOD') {
+ $hash = strtoupper($_SERVER['REQUEST_METHOD']);
+ }
+ switch ($hash) {
+ case 'GET' :
+ $input = $_GET;
+ break;
+ case 'POST' :
+ $input = $_POST;
+ break;
+ case 'FILES' :
+ $input = $_FILES;
+ break;
+ case 'COOKIE' :
+ $input = $_COOKIE;
+ break;
+ case 'ENV' :
+ $input = & $_ENV;
+ break;
+ case 'SERVER' :
+ $input = & $_SERVER;
+ break;
+ default:
+ $input = $_REQUEST;
+ break;
+ }
+ $result = xNewsletterRequest::_cleanVar($input, $mask);
+ // Handle magic quotes compatability
+ if (get_magic_quotes_gpc() && ($hash != 'FILES')) {
+ $result = xNewsletterRequest::_stripSlashesRecursive($result);
+ }
+
+ return $result;
+ }
+
+ /**
+ * Sets a request variable
+ *
+ * @param array $array An associative array of key-value pairs
+ * @param string $hash The request variable to set (POST, GET, FILES, METHOD)
+ * @param boolean $overwrite If true and an existing key is found, the value is overwritten, otherwise it is ingored
+ */
+ static function set($array, $hash = 'default', $overwrite = true)
+ {
+ foreach ($array as $key => $value) {
+ xNewsletterRequest::setVar($key, $value, $hash, $overwrite);
+ }
+ }
+
+ /**
+ * Cleans the request from script injection.
+ *
+ * @static
+ * @return void
+ */
+ static function clean()
+ {
+ xNewsletterRequest::_cleanArray($_FILES);
+ xNewsletterRequest::_cleanArray($_ENV);
+ xNewsletterRequest::_cleanArray($_GET);
+ xNewsletterRequest::_cleanArray($_POST);
+ xNewsletterRequest::_cleanArray($_COOKIE);
+ xNewsletterRequest::_cleanArray($_SERVER);
+ if (isset($_SESSION)) {
+ xNewsletterRequest::_cleanArray($_SESSION);
+ }
+ $REQUEST = $_REQUEST;
+ $GET = $_GET;
+ $POST = $_POST;
+ $COOKIE = $_COOKIE;
+ $FILES = $_FILES;
+ $ENV = $_ENV;
+ $SERVER = $_SERVER;
+ if (isset ($_SESSION)) {
+ $SESSION = $_SESSION;
+ }
+ foreach ($GLOBALS as $key => $value) {
+ if ($key != 'GLOBALS') {
+ unset($GLOBALS[$key]);
+ }
+ }
+ $_REQUEST = $REQUEST;
+ $_GET = $GET;
+ $_POST = $POST;
+ $_COOKIE = $COOKIE;
+ $_FILES = $FILES;
+ $_ENV = $ENV;
+ $_SERVER = $SERVER;
+ if (isset($SESSION)) {
+ $_SESSION = $SESSION;
+ }
+ }
+
+ /**
+ * Adds an array to the GLOBALS array and checks that the GLOBALS variable is not being attacked
+ *
+ * @access protected
+ *
+ * @param array $array Array to clean
+ * @param boolean $globalise True if the array is to be added to the GLOBALS
+ */
+ static function _cleanArray(&$array, $globalise = false)
+ {
+ static $banned = array('_files', '_env', '_get', '_post', '_cookie', '_server', '_session', 'globals');
+ foreach ($array as $key => $value) {
+ // PHP GLOBALS injection bug
+ $failed = in_array(strtolower($key), $banned);
+ // PHP Zend_Hash_Del_Key_Or_Index bug
+ $failed |= is_numeric($key);
+ if ($failed) {
+ exit('Illegal variable <strong>' . implode('</strong> or <strong>', $banned) . '</strong> passed to script.');
+ }
+ if ($globalise) {
+ $GLOBALS[$key] = $value;
+ }
+ }
+ }
+
+ /**
+ * Clean up an input variable.
+ *
+ * @param mixed $var The input variable.
+ * @param int $mask Filter bit mask. 1=no trim: If this flag is cleared and the
+ * input is a string, the string will have leading and trailing whitespace
+ * trimmed. 2=allow_raw: If set, no more filtering is performed, higher bits
+ * are ignored. 4=allow_html: HTML is allowed, but passed through a safe
+ * HTML filter first. If set, no more filtering is performed. If no bits
+ * other than the 1 bit is set, a strict filter is applied.
+ * @param string $type The variable type {@see JFilterInput::clean()}.
+ *
+ * @return string
+ */
+ static function _cleanVar($var, $mask = 0, $type = null)
+ {
+ // Static input filters for specific settings
+ static $noHtmlFilter = null;
+ static $safeHtmlFilter = null;
+ // If the no trim flag is not set, trim the variable
+ if (!($mask & 1) && is_string($var)) {
+ $var = trim($var);
+ }
+ // Now we handle input filtering
+ if ($mask & 2) {
+ // If the allow raw flag is set, do not modify the variable
+ } elseif ($mask & 4) {
+ // If the allow html flag is set, apply a safe html filter to the variable
+ if (is_null($safeHtmlFilter)) {
+ $safeHtmlFilter = xNewsletterFilterInput::getInstance(null, null, 1, 1);
+ }
+ $var = $safeHtmlFilter->clean($var, $type);
+ } else {
+ // Since no allow flags were set, we will apply the most strict filter to the variable
+ if (is_null($noHtmlFilter)) {
+ $noHtmlFilter = xNewsletterFilterInput::getInstance( /* $tags, $attr, $tag_method, $attr_method, $xss_auto */);
+ }
+ $var = $noHtmlFilter->clean($var, $type);
+ }
+
+ return $var;
+ }
+
+ /**
+ * Strips slashes recursively on an array
+ *
+ * @access protected
+ *
+ * @param array $value Array of (nested arrays of) strings
+ *
+ * @return array|string The input array with stripshlashes applied to it
+ */
+ protected function _stripSlashesRecursive($value)
+ {
+ $value = is_array($value) ? array_map(array('xNewsletterRequest', '_stripSlashesRecursive'), $value) : stripslashes($value);
+
+ return $value;
+ }
+}
+
+/**
+ * xNewsletterInput is a class for filtering input from any data source
+ * Forked from the php input filter library by: Daniel Morris <da...@ro...>
+ * Original Contributors: Gianpaolo Racca, Ghislain Picard, Marco Wandschneider, Chris Tobin and Andrew Eddie.
+ *
+ * @author Louis Landry <lou...@jo...>
+ */
+class xNewsletterFilterInput
+{
+ var $tagsArray; // default = empty array
+ var $attrArray; // default = empty array
+ var $tagsMethod; // default = 0
+ var $attrMethod; // default = 0
+ var $xssAuto; // default = 1
+ var $tagBlacklist
+ = array(
+ 'applet',
+ 'body',
+ 'bgsound',
+ 'base',
+ 'basefont',
+ 'embed',
+ 'frame',
+ 'frameset',
+ 'head',
+ 'html',
+ 'id',
+ 'iframe',
+ 'ilayer',
+ 'layer',
+ 'link',
+ 'meta',
+ 'name',
+ 'object',
+ 'script',
+ 'style',
+ 'title',
+ 'xml'
+ );
+ var $attrBlacklist = array('action', 'background', 'codebase', 'dynsrc', 'lowsrc'); // also will strip ALL event handlers
+ /**
+ * Constructor for inputFilter class. Only first parameter is required.
+ *
+ * @access protected
+ *
+ * @param array $tagsArray list of user-defined tags
+ * @param array $attrArray list of user-defined attributes
+ * @param int $tagsMethod WhiteList method = 0, BlackList method = 1
+ * @param int $attrMethod WhiteList method = 0, BlackList method = 1
+ * @param int $xssAuto Only auto clean essentials = 0, Allow clean blacklisted tags/attr = 1
+ */
+ public function __construct($tagsArray = array(), $attrArray = array(), $tagsMethod = 0, $attrMethod = 0, $xssAuto = 1)
+ {
+ // Make sure user defined arrays are in lowercase
+ $tagsArray = array_map('strtolower', (array)$tagsArray);
+ $attrArray = array_map('strtolower', (array)$attrArray);
+ // Assign member variables
+ $this->tagsArray = $tagsArray;
+ $this->attrArray = $attrArray;
+ $this->tagsMethod = $tagsMethod;
+ $this->attrMethod = $attrMethod;
+ $this->xssAuto = $xssAuto;
+ }
+
+ /**
+ * Returns a reference to an input filter object, only creating it if it doesn't already exist.
+ * This method must be invoked as:
+ * <pre> $filter = & xNewsletterFilterInput::getInstance();</pre>
+ *
+ * @static
+ *
+ * @param array $tagsArray list of user-defined tags
+ * @param array $attrArray list of user-defined attributes
+ * @param int $tagsMethod WhiteList method = 0, BlackList method = 1
+ * @param int $attrMethod WhiteList method = 0, BlackList method = 1
+ * @param int $xssAuto Only auto clean essentials = 0, Allow clean blacklisted tags/attr = 1
+ *
+ * @return object The xNewsletterFilterInput object.
+ * @since 1.5
+ */
+ public static function & getInstance($tagsArray = array(), $attrArray = array(), $tagsMethod = 0, $attrMethod = 0, $xssAuto = 1)
+ {
+ static $instances;
+ $sig = md5(serialize(array($tagsArray, $attrArray, $tagsMethod, $attrMethod, $xssAuto)));
+ if (!isset ($instances)) {
+ $instances = array();
+ }
+ if (empty ($instances[$sig])) {
+ $instances[$sig] = new xNewsletterFilterInput($tagsArray, $attrArray, $tagsMethod, $attrMethod, $xssAuto);
+ }
+
+ return $instances[$sig];
+ }
+
+ /**
+ * Method to be called by another php script. Processes for XSS and
+ * specified bad code.
+ *
+ * @access public
+ *
+ * @param mixed $source Input string/array-of-string to be 'cleaned'
+ * @param string $type Return type for the variable (INT, FLOAT, BOOLEAN, WORD, ALNUM, CMD, BASE64, STRING, ARRAY, PATH, NONE)
+ *
+ * @return mixed 'Cleaned' version of input parameter
+ * @static
+ */
+ public function clean($source, $type = 'string')
+ {
+ // Handle the type constraint
+ switch (strtoupper($type)) {
+ case 'INT' :
+ case 'INTEGER' :
+ // Only use the first integer value
+ preg_match('/-?[0-9]+/', (string)$source, $matches);
+ $result = @ (int)$matches[0];
+ break;
+ case 'FLOAT' :
+ case 'DOUBLE' :
+ // Only use the first floating point value
+ preg_match('/-?[0-9]+(\.[0-9]+)?/', (string)$source, $matches);
+ $result = @ (float)$matches[0];
+ break;
+ case 'BOOL' :
+ case 'BOOLEAN' :
+ $result = (bool)$source;
+ break;
+ case 'WORD' :
+ $result = (string)preg_replace('/[^A-Z_]/i', '', $source);
+ break;
+ case 'ALNUM' :
+ $result = (string)preg_replace('/[^A-Z0-9]/i', '', $source);
+ break;
+ case 'CMD' :
+ $result = (string)preg_replace('/[^A-Z0-9_\.-]/i', '', $source);
+ $result = ltrim($result, '.');
+ break;
+ case 'BASE64' :
+ $result = (string)preg_replace('/[^A-Z0-9\/+=]/i', '', $source);
+ break;
+ case 'STRING' :
+ // Check for static usage and assign $filter the proper variable
+ if (isset($this) && is_a($this, 'xNewsletterFilterInput')) {
+ $filter =& $this;
+ } else {
+ $filter = xNewsletterFilterInput::getInstance();
+ }
+ $result = (string)$filter->_remove($filter->_decode((string)$source));
+ break;
+ case 'ARRAY' :
+ $result = (is_array($source)) ? (array)$source : array();
+ break;
+ case 'PATH' :
+ $pattern = '/^[A-Za-z0-9_-]+[A-Za-z0-9_\.-]*([\\\\\/][A-Za-z0-9_-]+[A-Za-z0-9_\.-]*)*$/';
+ preg_match($pattern, (string)$source, $matches);
+ $result = @ (string)$matches[0];
+ break;
+ case 'USERNAME' :
+ $result = (string)preg_replace('/[\x00-\x1F\x7F<>"\'%&]/', '', $source);
+ break;
+ default :
+ // Check for static usage and assign $filter the proper variable
+ if (is_object($this) && get_class($this) == 'xNewsletterFilterInput') {
+ $filter =& $this;
+ } else {
+ $filter = xNewsletterFilterInput::getInstance();
+ }
+ // Are we dealing with an array?
+ if (is_array($source)) {
+ foreach ($source as $key => $value) {
+ // filter element for XSS and other 'bad' code etc.
+ if (is_string($value)) {
+ $source[$key] = $filter->_remove($filter->_decode($value));
+ }
+ }
+ $result = $source;
+ } else {
+ // Or a string?
+ if (is_string($source) && !empty ($source)) {
+ // filter source for XSS and other 'bad' code etc.
+ $result = $filter->_remove($filter->_decode($source));
+ } else {
+ // Not an array or string.. return the passed parameter
+ $result = $source;
+ }
+ }
+ break;
+ }
+
+ return $result;
+ }
+
+ /**
+ * Function to determine if contents of an attribute is safe
+ *
+ * @static
+ *
+ * @param array $attrSubSet A 2 element array for attributes name,value
+ *
+ * @return boolean True if bad code is detected
+ */
+ public function checkAttribute($attrSubSet)
+ {
+ $attrSubSet[0] = strtolower($attrSubSet[0]);
+ $attrSubSet[1] = strtolower($attrSubSet[1]);
+
+ return (((strpos($attrSubSet[1], 'expression') !== false) && ($attrS...
[truncated message content] |
|
From: <luc...@us...> - 2014-02-28 21:30:02
|
Revision: 12336
http://sourceforge.net/p/xoops/svn/12336
Author: luciorota
Date: 2014-02-28 21:29:57 +0000 (Fri, 28 Feb 2014)
Log Message:
-----------
code standardization (in progress), templatization (in progress), improved html2text function
Modified Paths:
--------------
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/import.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/letter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_import.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_subscr.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/docs/changelog.txt
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/header.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/functions.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/task.inc.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/index.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/letter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/csv.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/evennews.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/rmbulletin.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/smartpartner.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/subscribers.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/weblinks.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/xoopsuser.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/print.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/sendletter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/subscription.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xnewsletter_protocol.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xnewsletter_subscription_list_subscriptions.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xnewsletter_subscription_result.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/xoops_version.php
Added Paths:
-----------
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/html2text/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/html2text/epl-v10.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/html2text/html2text.php
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/import.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/import.php 2014-02-28 10:31:35 UTC (rev 12335)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/import.php 2014-02-28 21:29:57 UTC (rev 12336)
@@ -424,7 +424,7 @@
default:
//show basic search form
$objImport =& $importHandler->create();
- $form = $objImport->getFormSearch($plugin, $action_after_read, $limitcheck);
+ $form = $objImport->getSearchForm($plugin, $action_after_read, $limitcheck);
$form->display();
break;
}
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/letter.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/letter.php 2014-02-28 10:31:35 UTC (rev 12335)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/letter.php 2014-02-28 21:29:57 UTC (rev 12336)
@@ -106,10 +106,11 @@
$tpl->assign('sex', _AM_XNEWSLETTER_SUBSCR_SEX_MALE);
$tpl->assign('firstname', _AM_XNEWSLETTER_SUBSCR_FIRSTNAME);
$tpl->assign('lastname', _AM_XNEWSLETTER_SUBSCR_LASTNAME);
+ $tpl->assign('title', $letterObj->getVar('letter_title', 'n')); // new from v1.3
$tpl->assign('content', $obj_letter->getVar("letter_content", "n"));
- $tpl->assign('unsubscribe_url', XOOPS_URL . '/modules/xNewsletter/');
+ $tpl->assign('unsubscribe_url', XOOPS_URL . '/modules/xNewsletter/'); // new from v1.3
//$tpl->assign('catsubscr_id', "0");
- $tpl->assign('subscr_email', "");
+ $tpl->assign('subscr_email', '');
echo "<h2>".$obj_letter->getVar("letter_title")."</h2>";
echo "<div style='clear:both'><div style='padding:10px;border:1px solid black'>";
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_import.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_import.php 2014-02-28 10:31:35 UTC (rev 12335)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_import.php 2014-02-28 21:29:57 UTC (rev 12336)
@@ -46,7 +46,7 @@
$this->initVar("import_status", XOBJ_DTYPE_INT, null, false, 1);
}
- public function getFormSearch($plugin, $action_after_read = 1, $limitcheck = 0, $action = false)
+ public function getSearchForm($plugin, $action_after_read = 1, $limitcheck = 0, $action = false)
{
global $xoopsDB, $xoopsModuleConfig;
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_subscr.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_subscr.php 2014-02-28 10:31:35 UTC (rev 12335)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_subscr.php 2014-02-28 21:29:57 UTC (rev 12336)
@@ -49,7 +49,7 @@
$this->initVar("subscr_actoptions", XOBJ_DTYPE_TXTBOX, null, false, 500);
}
- public function getFormSearch($action = false)
+ public function getSearchForm($action = false)
{
global $xoopsDB, $xoopsModuleConfig;
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/docs/changelog.txt
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/docs/changelog.txt 2014-02-28 10:31:35 UTC (rev 12335)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/docs/changelog.txt 2014-02-28 21:29:57 UTC (rev 12336)
@@ -1,3 +1,9 @@
+Version 1.3
+--------------
+ - templatize user side (luciorota)
+ - standardize code (luciorota)
+ - added html2txt function for non-HTML mail clients (luciorota)
+
Version 1.2
--------------
- standardize code (luciorota)
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/header.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/header.php 2014-02-28 10:31:35 UTC (rev 12335)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/header.php 2014-02-28 21:29:57 UTC (rev 12336)
@@ -31,6 +31,7 @@
global $xoopsConfig, $xoopsModule, $xoopsModuleConfig;
include_once XOOPS_ROOT_PATH . "/class/pagenav.php";
+include_once XOOPS_ROOT_PATH . '/include/functions.php';
include_once XOOPS_ROOT_PATH . "/modules/{$xoopsModule->getVar('dirname')}/include/config.php";
include_once XNEWSLETTER_PATH . "/include/functions.php";
@@ -49,14 +50,14 @@
}
// Get the module instances
-$accountsHandler =& xoops_getModuleHandler('xNewsletter_accounts', XNEWSLETTER_DIRNAME);
-$catHandler =& xoops_getModuleHandler('xNewsletter_cat', XNEWSLETTER_DIRNAME);
-$subscrHandler =& xoops_getModuleHandler('xNewsletter_subscr', XNEWSLETTER_DIRNAME);
-$catsubscrHandler =& xoops_getModuleHandler('xNewsletter_catsubscr', XNEWSLETTER_DIRNAME);
-$letterHandler =& xoops_getModuleHandler('xNewsletter_letter', XNEWSLETTER_DIRNAME);
-$attachmentHandler =& xoops_getModuleHandler('xNewsletter_attachment', XNEWSLETTER_DIRNAME);
-$protocolHandler =& xoops_getModuleHandler('xNewsletter_protocol', XNEWSLETTER_DIRNAME);
-$mailinglistHandler =& xoops_getModuleHandler('xNewsletter_mailinglist', XNEWSLETTER_DIRNAME);
+$accountsHandler = xoops_getModuleHandler('xNewsletter_accounts', XNEWSLETTER_DIRNAME);
+$catHandler = xoops_getModuleHandler('xNewsletter_cat', XNEWSLETTER_DIRNAME);
+$subscrHandler = xoops_getModuleHandler('xNewsletter_subscr', XNEWSLETTER_DIRNAME);
+$catsubscrHandler = xoops_getModuleHandler('xNewsletter_catsubscr', XNEWSLETTER_DIRNAME);
+$letterHandler = xoops_getModuleHandler('xNewsletter_letter', XNEWSLETTER_DIRNAME);
+$attachmentHandler = xoops_getModuleHandler('xNewsletter_attachment', XNEWSLETTER_DIRNAME);
+$protocolHandler = xoops_getModuleHandler('xNewsletter_protocol', XNEWSLETTER_DIRNAME);
+$mailinglistHandler = xoops_getModuleHandler('xNewsletter_mailinglist', XNEWSLETTER_DIRNAME);
xoops_loadLanguage('modinfo', XNEWSLETTER_DIRNAME);
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/functions.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/functions.php 2014-02-28 10:31:35 UTC (rev 12335)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/functions.php 2014-02-28 21:29:57 UTC (rev 12336)
@@ -25,10 +25,13 @@
* Version : 1 Mon 2012/11/05 14:31:32 : Exp $
* ****************************************************************************
*/
+if (!defined("XOOPS_ROOT_PATH")) {
+ die("XOOPS root path not defined");
+}
+include_once dirname(__FILE__) . '/common.php';
-/***************Blocks***************/
function xNewsletter_block_addCatSelect($cats) {
if(is_array($cats)) {
$cat_sql = "(" . current($cats);
@@ -78,6 +81,8 @@
return $xnewsletter_isAdmin;
}
+
+
function xNewsletter_checkEmail($email, $antispam = false) {
include_once XOOPS_ROOT_PATH . '/include/functions.php';
return checkEmail($email, $antispam);
@@ -85,6 +90,13 @@
+function xNewsletter_html2text($html) {
+ include_once XNEWSLETTER_ROOT_PATH . '/include/html2text/html2text.php';
+ return convert_html_to_text($html);
+}
+
+
+
function xNewsletter_CleanVars(&$global, $key, $default = '', $type = 'int', $notset=false) {
include_once XOOPS_ROOT_PATH . '/include/functions.php';
switch ( $type ) {
Added: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/html2text/epl-v10.html
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/html2text/epl-v10.html (rev 0)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/html2text/epl-v10.html 2014-02-28 21:29:57 UTC (rev 12336)
@@ -0,0 +1,259 @@
+<!--?xml version="1.0" encoding="ISO-8859-1" ?-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Eclipse Public License - Version 1.0</title>
+<style type="text/css">
+ body {
+ size: 8.5in 11.0in;
+ margin: 0.25in 0.5in 0.25in 0.5in;
+ tab-interval: 0.5in;
+ }
+ p {
+ margin-left: auto;
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+ }
+ p.list {
+ margin-left: 0.5in;
+ margin-top: 0.05em;
+ margin-bottom: 0.05em;
+ }
+ </style>
+
+</head>
+
+<body lang="EN-US">
+
+<h2>Eclipse Public License - v 1.0</h2>
+
+<p>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
+PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR
+DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS
+AGREEMENT.</p>
+
+<p><b>1. DEFINITIONS</b></p>
+
+<p>"Contribution" means:</p>
+
+<p class="list">a) in the case of the initial Contributor, the initial
+code and documentation distributed under this Agreement, and</p>
+<p class="list">b) in the case of each subsequent Contributor:</p>
+<p class="list">i) changes to the Program, and</p>
+<p class="list">ii) additions to the Program;</p>
+<p class="list">where such changes and/or additions to the Program
+originate from and are distributed by that particular Contributor. A
+Contribution 'originates' from a Contributor if it was added to the
+Program by such Contributor itself or anyone acting on such
+Contributor's behalf. Contributions do not include additions to the
+Program which: (i) are separate modules of software distributed in
+conjunction with the Program under their own license agreement, and (ii)
+are not derivative works of the Program.</p>
+
+<p>"Contributor" means any person or entity that distributes
+the Program.</p>
+
+<p>"Licensed Patents" mean patent claims licensable by a
+Contributor which are necessarily infringed by the use or sale of its
+Contribution alone or when combined with the Program.</p>
+
+<p>"Program" means the Contributions distributed in accordance
+with this Agreement.</p>
+
+<p>"Recipient" means anyone who receives the Program under
+this Agreement, including all Contributors.</p>
+
+<p><b>2. GRANT OF RIGHTS</b></p>
+
+<p class="list">a) Subject to the terms of this Agreement, each
+Contributor hereby grants Recipient a non-exclusive, worldwide,
+royalty-free copyright license to reproduce, prepare derivative works
+of, publicly display, publicly perform, distribute and sublicense the
+Contribution of such Contributor, if any, and such derivative works, in
+source code and object code form.</p>
+
+<p class="list">b) Subject to the terms of this Agreement, each
+Contributor hereby grants Recipient a non-exclusive, worldwide,
+royalty-free patent license under Licensed Patents to make, use, sell,
+offer to sell, import and otherwise transfer the Contribution of such
+Contributor, if any, in source code and object code form. This patent
+license shall apply to the combination of the Contribution and the
+Program if, at the time the Contribution is added by the Contributor,
+such addition of the Contribution causes such combination to be covered
+by the Licensed Patents. The patent license shall not apply to any other
+combinations which include the Contribution. No hardware per se is
+licensed hereunder.</p>
+
+<p class="list">c) Recipient understands that although each Contributor
+grants the licenses to its Contributions set forth herein, no assurances
+are provided by any Contributor that the Program does not infringe the
+patent or other intellectual property rights of any other entity. Each
+Contributor disclaims any liability to Recipient for claims brought by
+any other entity based on infringement of intellectual property rights
+or otherwise. As a condition to exercising the rights and licenses
+granted hereunder, each Recipient hereby assumes sole responsibility to
+secure any other intellectual property rights needed, if any. For
+example, if a third party patent license is required to allow Recipient
+to distribute the Program, it is Recipient's responsibility to acquire
+that license before distributing the Program.</p>
+
+<p class="list">d) Each Contributor represents that to its knowledge it
+has sufficient copyright rights in its Contribution, if any, to grant
+the copyright license set forth in this Agreement.</p>
+
+<p><b>3. REQUIREMENTS</b></p>
+
+<p>A Contributor may choose to distribute the Program in object code
+form under its own license agreement, provided that:</p>
+
+<p class="list">a) it complies with the terms and conditions of this
+Agreement; and</p>
+
+<p class="list">b) its license agreement:</p>
+
+<p class="list">i) effectively disclaims on behalf of all Contributors
+all warranties and conditions, express and implied, including warranties
+or conditions of title and non-infringement, and implied warranties or
+conditions of merchantability and fitness for a particular purpose;</p>
+
+<p class="list">ii) effectively excludes on behalf of all Contributors
+all liability for damages, including direct, indirect, special,
+incidental and consequential damages, such as lost profits;</p>
+
+<p class="list">iii) states that any provisions which differ from this
+Agreement are offered by that Contributor alone and not by any other
+party; and</p>
+
+<p class="list">iv) states that source code for the Program is available
+from such Contributor, and informs licensees how to obtain it in a
+reasonable manner on or through a medium customarily used for software
+exchange.</p>
+
+<p>When the Program is made available in source code form:</p>
+
+<p class="list">a) it must be made available under this Agreement; and</p>
+
+<p class="list">b) a copy of this Agreement must be included with each
+copy of the Program.</p>
+
+<p>Contributors may not remove or alter any copyright notices contained
+within the Program.</p>
+
+<p>Each Contributor must identify itself as the originator of its
+Contribution, if any, in a manner that reasonably allows subsequent
+Recipients to identify the originator of the Contribution.</p>
+
+<p><b>4. COMMERCIAL DISTRIBUTION</b></p>
+
+<p>Commercial distributors of software may accept certain
+responsibilities with respect to end users, business partners and the
+like. While this license is intended to facilitate the commercial use of
+the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create
+potential liability for other Contributors. Therefore, if a Contributor
+includes the Program in a commercial product offering, such Contributor
+("Commercial Contributor") hereby agrees to defend and
+indemnify every other Contributor ("Indemnified Contributor")
+against any losses, damages and costs (collectively "Losses")
+arising from claims, lawsuits and other legal actions brought by a third
+party against the Indemnified Contributor to the extent caused by the
+acts or omissions of such Commercial Contributor in connection with its
+distribution of the Program in a commercial product offering. The
+obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In
+order to qualify, an Indemnified Contributor must: a) promptly notify
+the Commercial Contributor in writing of such claim, and b) allow the
+Commercial Contributor to control, and cooperate with the Commercial
+Contributor in, the defense and any related settlement negotiations. The
+Indemnified Contributor may participate in any such claim at its own
+expense.</p>
+
+<p>For example, a Contributor might include the Program in a commercial
+product offering, Product X. That Contributor is then a Commercial
+Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance
+claims and warranties are such Commercial Contributor's responsibility
+alone. Under this section, the Commercial Contributor would have to
+defend claims against the other Contributors related to those
+performance claims and warranties, and if a court requires any other
+Contributor to pay any damages as a result, the Commercial Contributor
+must pay those damages.</p>
+
+<p><b>5. NO WARRANTY</b></p>
+
+<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
+PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION,
+ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
+OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and
+distributing the Program and assumes all risks associated with its
+exercise of rights under this Agreement , including but not limited to
+the risks and costs of program errors, compliance with applicable laws,
+damage to or loss of data, programs or equipment, and unavailability or
+interruption of operations.</p>
+
+<p><b>6. DISCLAIMER OF LIABILITY</b></p>
+
+<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
+NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
+WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
+DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
+HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.</p>
+
+<p><b>7. GENERAL</b></p>
+
+<p>If any provision of this Agreement is invalid or unenforceable under
+applicable law, it shall not affect the validity or enforceability of
+the remainder of the terms of this Agreement, and without further action
+by the parties hereto, such provision shall be reformed to the minimum
+extent necessary to make such provision valid and enforceable.</p>
+
+<p>If Recipient institutes patent litigation against any entity
+(including a cross-claim or counterclaim in a lawsuit) alleging that the
+Program itself (excluding combinations of the Program with other
+software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of the
+date such litigation is filed.</p>
+
+<p>All Recipient's rights under this Agreement shall terminate if it
+fails to comply with any of the material terms or conditions of this
+Agreement and does not cure such failure in a reasonable period of time
+after becoming aware of such noncompliance. If all Recipient's rights
+under this Agreement terminate, Recipient agrees to cease use and
+distribution of the Program as soon as reasonably practicable. However,
+Recipient's obligations under this Agreement and any licenses granted by
+Recipient relating to the Program shall continue and survive.</p>
+
+<p>Everyone is permitted to copy and distribute copies of this
+Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The
+Agreement Steward reserves the right to publish new versions (including
+revisions) of this Agreement from time to time. No one other than the
+Agreement Steward has the right to modify this Agreement. The Eclipse
+Foundation is the initial Agreement Steward. The Eclipse Foundation may
+assign the responsibility to serve as the Agreement Steward to a
+suitable separate entity. Each new version of the Agreement will be
+given a distinguishing version number. The Program (including
+Contributions) may always be distributed subject to the version of the
+Agreement under which it was received. In addition, after a new version
+of the Agreement is published, Contributor may elect to distribute the
+Program (including its Contributions) under the new version. Except as
+expressly stated in Sections 2(a) and 2(b) above, Recipient receives no
+rights or licenses to the intellectual property of any Contributor under
+this Agreement, whether expressly, by implication, estoppel or
+otherwise. All rights in the Program not expressly granted under this
+Agreement are reserved.</p>
+
+<p>This Agreement is governed by the laws of the State of New York and
+the intellectual property laws of the United States of America. No party
+to this Agreement will bring a legal action under this Agreement more
+than one year after the cause of action arose. Each party waives its
+rights to a jury trial in any resulting litigation.</p>
+
+
+
+</body></html>
\ No newline at end of file
Added: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/html2text/html2text.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/html2text/html2text.php (rev 0)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/html2text/html2text.php 2014-02-28 21:29:57 UTC (rev 12336)
@@ -0,0 +1,225 @@
+<?php
+/******************************************************************************
+ * Copyright (c) 2010 Jevon Wright and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Jevon Wright - initial API and implementation
+ ****************************************************************************/
+
+/**
+ * Tries to convert the given HTML into a plain text format - best suited for
+ * e-mail display, etc.
+ *
+ * <p>In particular, it tries to maintain the following features:
+ * <ul>
+ * <li>Links are maintained, with the 'href' copied over
+ * <li>Information in the <head> is lost
+ * </ul>
+ *
+ * @param html the input HTML
+ * @return the HTML converted, as best as possible, to text
+ */
+function convert_html_to_text($html) {
+ $html = fix_newlines($html);
+
+ $doc = new DOMDocument();
+ if (!$doc->loadHTML($html))
+ throw new Html2TextException("Could not load HTML - badly formed?", $html);
+
+ $output = iterate_over_node($doc);
+
+ // remove leading and trailing spaces on each line
+ $output = preg_replace("/[ \t]*\n[ \t]*/im", "\n", $output);
+
+ // remove leading and trailing whitespace
+ $output = trim($output);
+
+ return $output;
+}
+
+/**
+ * Unify newlines; in particular, \r\n becomes \n, and
+ * then \r becomes \n. This means that all newlines (Unix, Windows, Mac)
+ * all become \ns.
+ *
+ * @param text text with any number of \r, \r\n and \n combinations
+ * @return the fixed text
+ */
+function fix_newlines($text) {
+ // replace \r\n to \n
+ $text = str_replace("\r\n", "\n", $text);
+ // remove \rs
+ $text = str_replace("\r", "\n", $text);
+
+ return $text;
+}
+
+function next_child_name($node) {
+ // get the next child
+ $nextNode = $node->nextSibling;
+ while ($nextNode != null) {
+ if ($nextNode instanceof DOMElement) {
+ break;
+ }
+ $nextNode = $nextNode->nextSibling;
+ }
+ $nextName = null;
+ if ($nextNode instanceof DOMElement && $nextNode != null) {
+ $nextName = strtolower($nextNode->nodeName);
+ }
+
+ return $nextName;
+}
+function prev_child_name($node) {
+ // get the previous child
+ $nextNode = $node->previousSibling;
+ while ($nextNode != null) {
+ if ($nextNode instanceof DOMElement) {
+ break;
+ }
+ $nextNode = $nextNode->previousSibling;
+ }
+ $nextName = null;
+ if ($nextNode instanceof DOMElement && $nextNode != null) {
+ $nextName = strtolower($nextNode->nodeName);
+ }
+
+ return $nextName;
+}
+
+function iterate_over_node($node) {
+ if ($node instanceof DOMText) {
+ return preg_replace("/\\s+/im", " ", $node->wholeText);
+ }
+ if ($node instanceof DOMDocumentType) {
+ // ignore
+ return "";
+ }
+
+ $nextName = next_child_name($node);
+ $prevName = prev_child_name($node);
+
+ $name = strtolower($node->nodeName);
+
+ // start whitespace
+ switch ($name) {
+ case "hr":
+ return "------\n";
+
+ case "style":
+ case "head":
+ case "title":
+ case "meta":
+ case "script":
+ // ignore these tags
+ return "";
+
+ case "h1":
+ case "h2":
+ case "h3":
+ case "h4":
+ case "h5":
+ case "h6":
+ // add two newlines
+ $output = "\n";
+ break;
+
+ case "p":
+ case "div":
+ // add one line
+ $output = "\n";
+ break;
+
+ default:
+ // print out contents of unknown tags
+ $output = "";
+ break;
+ }
+
+ // debug
+ //$output .= "[$name,$nextName]";
+
+ for ($i = 0; $i < $node->childNodes->length; $i++) {
+ $n = $node->childNodes->item($i);
+
+ $text = iterate_over_node($n);
+
+ $output .= $text;
+ }
+
+ // end whitespace
+ switch ($name) {
+ case "style":
+ case "head":
+ case "title":
+ case "meta":
+ case "script":
+ // ignore these tags
+ return "";
+
+ case "h1":
+ case "h2":
+ case "h3":
+ case "h4":
+ case "h5":
+ case "h6":
+ $output .= "\n";
+ break;
+
+ case "p":
+ case "br":
+ // add one line
+ if ($nextName != "div")
+ $output .= "\n";
+ break;
+
+ case "div":
+ // add one line only if the next child isn't a div
+ if ($nextName != "div" && $nextName != null)
+ $output .= "\n";
+ break;
+
+ case "a":
+ // links are returned in [text](link) format
+ $href = $node->getAttribute("href");
+ if ($href == null) {
+ // it doesn't link anywhere
+ if ($node->getAttribute("name") != null) {
+ $output = "[$output]";
+ }
+ } else {
+ if ($href == $output) {
+ // link to the same address: just use link
+ $output;
+ } else {
+ // replace it
+ $output = "[$output]($href)";
+ }
+ }
+
+ // does the next node require additional whitespace?
+ switch ($nextName) {
+ case "h1": case "h2": case "h3": case "h4": case "h5": case "h6":
+ $output .= "\n";
+ break;
+ }
+
+ default:
+ // do nothing
+ }
+
+ return $output;
+}
+
+class Html2TextException extends Exception {
+ var $more_info;
+
+ public function __construct($message = "", $more_info = "") {
+ parent::__construct($message);
+ $this->more_info = $more_info;
+ }
+}
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/task.inc.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/task.inc.php 2014-02-28 10:31:35 UTC (rev 12335)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/task.in...
[truncated message content] |
|
From: <luc...@us...> - 2014-03-24 19:19:48
|
Revision: 12405
http://sourceforge.net/p/xoops/svn/12405
Author: luciorota
Date: 2014-03-24 19:19:45 +0000 (Mon, 24 Mar 2014)
Log Message:
-----------
change directory structure
Added Paths:
-----------
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/css/module.css
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/js/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/js/index.html
Removed Paths:
-------------
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/css/style.css
Added: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/css/module.css
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/css/module.css (rev 0)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/css/module.css 2014-03-24 19:19:45 UTC (rev 12405)
@@ -0,0 +1,574 @@
+/**
+ * ****************************************************************************
+ * - A Project by Developers TEAM For Xoops - ( http://www.xoops.org )
+ * ****************************************************************************
+ * XNEWSLETTER - MODULE FOR XOOPS
+ * Copyright (c) 2007 - 2012
+ * goffy ( )
+ *
+ * You may not change or alter any portion of this comment or credits
+ * of supporting developers from this source code or any supporting
+ * source code which is considered copyrighted (c) material of the
+ * original comment or credit authors.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ * ---------------------------------------------------------------------------
+ * @copyright goffy. luciorota ( )
+ * @license gpl 2.0
+ * @package xNewsletter
+ * @author goffy, luciorota ( )
+ *
+ * Version : svn:$Id$
+ * ****************************************************************************
+ */
+
+.box-header {
+ margin: 2px;
+ padding: 5px;
+ background-color: #ccc;
+ width: 100%;
+ height: 50px;
+}
+
+.registration {
+ padding: 30px;
+ text-align: center;
+}
+
+.xnewsletter_headertable {
+ padding: 0;
+ border-bottom: 1px solid;
+ margin: 0 0 10px;
+}
+
+.xnewsletter_modulename {
+ font-size: 10px;
+ text-align: left;
+ font-weight: bold;
+ padding-right: 0.3em;
+ line-height: 18px;
+}
+
+.xnewsletter_breadcrumb {
+ font-size: 10px;
+ line-height: 18px;
+}
+
+.xnewsletter_infotitle {
+ margin-top: 8px;
+ margin-bottom: 8px;
+ font-size: 250%;
+ line-height: 250%;
+ font-weight: bold;
+ display: block;
+}
+
+.xnewsletter_infotext {
+ margin-bottom: 8px;
+ line-height: 130%;
+ display: block;
+}
+
+.xnewsletter_adminlinks {
+ padding-top: 15px;
+ padding-bottom: 5px;
+ font-size: 10px;
+ text-align: center;
+ line-height: 18px;
+}
+
+.xnewsletter_indexfooter {
+ font-size: 10px;
+ font-weight: bold;
+ text-align: center;
+ padding: 10px;
+}
+
+.xnewsletter_itemfooter {
+ font-size: 10px;
+ font-weight: bold;
+ text-align: center;
+ padding: 10px;
+}
+
+ul {
+ padding: 2px;
+ list-style: disc;
+ text-align: left;
+}
+
+li {
+ margin-left: 5px;
+ color: #2F5376;
+}
+
+h4 {
+ font-size: 14px;
+ text-decoration: underline;
+}
+
+.xnewsletter_container {
+ height: 100%;
+ display: table;
+ width: 100%;
+ margin: 0 auto;
+ border: none;
+}
+
+.xnewsletter_static {
+ position: static;
+ clear: both;
+}
+
+/* ---------- global ---------- */
+.xnewsletter_pagenav {
+ text-align: right;
+}
+
+.xnewsletter_copyright {
+ text-align: center;
+}
+
+/* ---------- header.html ---------- */
+.xnewsletter_head_catimgheader {
+ text-align: center;
+}
+
+.xnewsletter_head_downimgheader {
+ text-align: center;
+}
+
+.xnewsletter_head_imgheader {
+ text-align: center;
+}
+
+.xnewsletter_head_catindexheader {
+ /* text-align: center; do not uncomment (will stop index alignment option working) */
+}
+
+.xnewsletter_head_catletters {
+ text-align: center;
+ font-size: 80%;
+}
+
+.xnewsletter_head_cattoolbar {
+ text-align: center;
+}
+
+/* ---------- footer.html ---------- */
+.xnewsletter_foot_commentnav {
+ text-align: center;
+ padding: 3px;
+ margin: 3px;
+}
+
+.xnewsletter_foot_comments {
+ padding: 3px;
+ margin: 3px;
+}
+
+/* ---------- newlist.html ---------- */
+.xnewsletter_newlist_top {
+ text-align: center;
+ width: 100%;
+}
+
+.xnewsletter_newlist_top fieldset {
+ text-align: center;
+ border: 1px solid silver;
+ width: 450px;
+}
+
+.xnewsletter_newlist_totallast {
+ text-align: center;
+ width: 100%;
+ font-weight: bold;
+ font-size: large;
+}
+
+/* ---------- disclaimer.html ---------- */
+.xnewsletter_disc_imghead {
+ text-align: center;
+}
+
+.xnewsletter_disc_disclaimer {
+ text-align: center;
+}
+
+.xnewsletter_disc_discform {
+ text-align: center;
+}
+
+/* ---------- ratefile.html ---------- */
+.xnewsletter_rate_imghead {
+ text-align: center;
+}
+
+/* ---------- viewcat.html ---------- */
+.xnewsletter_view_top {
+}
+
+.xnewsletter_view_subs {
+ border: 0;
+ padding: 0;
+ margin: 0;
+}
+
+.xnewsletter_view_subs h3 {
+ text-align: center;
+ width: 100%;
+ background-color: #BEC8D1;
+}
+
+.xnewsletter_view_subs fieldset {
+}
+
+.xnewsletter_view_subslist {
+ text-align: left;
+ vertical-align: middle;
+ width: 90%;
+}
+
+.xnewsletter_view_catpath {
+ text-align: left;
+ margin-left: 5px;
+ padding: 0;
+ font-weight: bold;
+}
+
+.xnewsletter_view_sortlist {
+ text-align: center;
+ font-size: small;
+}
+
+/* ---------- download.html ---------- */
+.xnewsletter_down_title {
+ padding-top: 2.0em
+}
+
+.xnewsletter_down_top_r {
+ float: right;
+ margin-right: 10px;
+ position: relative;
+}
+
+.xnewsletter_down_top_l {
+ float: left;
+}
+
+.xnewsletter_down_main_l {
+ width: 74%;
+ float: left;
+ height: 100%;
+ position: relative;
+ display: table;
+}
+
+.xnewsletter_down_main_l p {
+ padding-top: 10px;
+ margin: 0;
+}
+
+.xnewsletter_down_viewdetails {
+ text-align: right;
+}
+
+.xnewsletter_down_main_r {
+ width: 25%;
+ height: 100%;
+ float: right;
+ position: relative;
+ display: table;
+}
+
+.xnewsletter_down_main_r p {
+ padding-top: 10px;
+ margin: 0;
+}
+
+.xnewsletter_down_info_top {
+ margin-left: 10px;
+ margin-right: 10px;
+ padding: 4px;
+ background-color: silver;
+ border-color: #999999;
+ font-size: .8em;
+}
+
+.xnewsletter_down_info_bottom {
+ margin-left: 10px;
+ margin-right: 10px;
+ padding: 4px;
+ font-size: .8em;
+}
+
+.xnewsletter_down_main_b {
+ text-align: center;
+}
+
+.xnewsletter_down_main_bottom {
+ width: 100%;
+ position: relative;
+ text-align: center;
+}
+
+.xnewsletter_down_main_bottom2 {
+ text-align: center;
+ background-color: silver;
+ width: 100%;
+ position: relative;
+ line-height: 150%;
+}
+
+.xnewsletter_down_custom {
+ width: 100%;
+ position: relative;
+ text-align: center;
+}
+
+/* ---------- singlefile.html ---------- */
+.xnewsletter_single_title {
+ padding-top: 2.0em
+}
+
+.xnewsletter_single_title a {
+ color: #32529C;
+ background-color: inherit;
+ font-weight: bold;
+ text-decoration: none;
+}
+
+.xnewsletter_single_title a:hover {
+ color: #666;
+ background-color: inherit;
+ text-decoration: none;
+}
+
+.xnewsletter_single_top_r {
+ float: right;
+ margin-right: 10px;
+ position: relative;
+}
+
+.xnewsletter_single_top_l {
+ float: left;
+}
+
+.xnewsletter_single_main_l {
+ width: 74%;
+ height: 100%;
+ float: left;
+ position: relative;
+ display: table;
+}
+
+.xnewsletter_single_main_l p {
+ padding-top: 10px;
+ margin: 0;
+}
+
+.xnewsletter_single_main_r {
+ width: 25%;
+ float: right;
+ display: table-column;
+}
+
+.xnewsletter_single_info_top {
+ margin-left: 10px;
+ margin-right: 10px;
+ padding: 4px;
+ background-color: silver;
+ border-color: #999999;
+ color: #333;
+ font-size: .8em;
+}
+
+.xnewsletter_single_info_dtimes {
+ margin-left: 4px;
+}
+
+.xnewsletter_single_main_custom {
+ width: 100%;
+ position: relative;
+ text-align: center;
+}
+
+.xnewsletter_single_main_bottom {
+ text-align: center;
+ background-color: silver;
+ width: 100%;
+ position: relative;
+ float: bottom;
+}
+
+.xnewsletter_single_userrev {
+ padding: 3px;
+ margin: 3px;
+}
+
+.xnewsletter_single_usermir {
+ padding: 3px;
+ margin: 3px;
+}
+
+/* ---------- mirrors.html ---------- */
+.xnewsletter_mirrors_head, .xnewsletter_mirrors_head2, .xnewsletter_mirrors_head3 {
+ border-bottom: 2px solid #000000;
+ border-left: 1px solid #000000;
+ background-color: #BEC8D1;
+ text-align: left;
+ font-family: Verdana, sans-serif;
+ font-weight: bold;
+ font-size: 14px;
+ color: #404040;
+}
+
+.xnewsletter_mirrors_head4 {
+ border-bottom: 2px solid #000000;
+ border-left: 1px solid #000000;
+ background-color: #BEC8D1;
+ text-align: center;
+ font-weight: bold;
+ font-size: 14px;
+ color: #404040;
+ width: 50px;
+}
+
+.xnewsletter_mirrors_head5 {
+ border-bottom: 2px solid #000000;
+ border-left: 0 solid #000000;
+ background-color: #BEC8D1;
+ text-align: center;
+ font-weight: bold;
+ font-size: 14px;
+ color: #404040;
+ width: 30px;
+}
+
+tr.xnewsletter_mirrors_elist {
+ line-height: 25px;
+}
+
+.xnewsletter_mirrors_list, .xnewsletter_mirrors_list2, .xnewsletter_mirrors_list3 {
+ text-align: left;
+ border-right: 1px solid #000000;
+}
+
+.xnewsletter_mirrors_list4, .xnewsletter_mirrors_list5 {
+ text-align: center;
+ vertical-align: middle;
+}
+
+.xnewsletter_mirrors_found {
+}
+
+table.xnewsletter_mirrors {
+ width: 95%;
+ padding: 10px 10px 10px 10px;
+ border: 1px #000000 solid;
+ border-collapse: collapse;
+ border-spacing: 0;
+}
+
+tr.xnewsletter_mirrors_end {
+ background-color: #BEC8D1;
+}
+
+.xnewsletter_mirrors_foot, .xnewsletter_mirrors_foot a {
+ border-top: 2px solid #000000;
+ font-weight: bold;
+}
+
+.xnewsletter_mirrors_bottom {
+ font-weight: bold;
+}
+
+/* ---------- reviews.html ---------- */
+.xnewsletter_reviews_title {
+}
+
+.xnewsletter_reviews_desc {
+}
+
+.xnewsletter_reviews_catpath {
+}
+
+.xnewsletter_reviews_found {
+ width: 90%;
+ text-align: center;
+}
+
+.xnewsletter_reviews_revfound {
+ text-align: left;
+}
+
+.xnewsletter_reviews_addrev {
+ text-align: right;
+}
+
+.xnewsletter_reviews_reviewlist {
+ padding: 10px 10px 10px 10px;
+ border: 1px #000000 solid;
+ border-collapse: collapse;
+ width: 95%;
+}
+
+.xnewsletter_reviews_reviewer {
+ text-align: left;
+ width: 80%;
+ background-color: #BEC8D1;
+ /* border-right: 1px solid #000000; */
+ border-bottom: 2px solid #000000;
+}
+
+.xnewsletter_reviews_reviewdate {
+ text-align: right;
+ width: 15%;
+ background-color: #BEC8D1;
+ border-bottom: 2px solid #000000;
+}
+
+.xnewsletter_reviews_revlistleft {
+ text-align: left;
+ border-right: 1px solid #000000;
+ width: 120px;
+}
+
+.xnewsletter_reviews_revlistright {
+ text-align: left;
+}
+
+.xnewsletter_reviews_revlistreview {
+ position: absolute;
+ top: 0;
+ left: 125px;
+ width: 90%;
+}
+
+.xnewsletter_reviews_revlisttitle {
+ margin-left: 10px;
+ margin-right: 10px;
+ padding: 4px;
+ font-weight: bold;
+ color: #0000CC;
+}
+
+.xnewsletter_reviews_revlistrev {
+}
+
+.xnewsletter_reviews_foot {
+ background-color: #BEC8D1;
+ border: 2px solid #000000;
+ width: 95%;
+}
+
+.xnewsletter_reviews_addrev {
+ position: absolute;
+ top: 0;
+ left: 0;
+ background-color: #BEC8D1;
+ border: 2px solid #000000;
+}
Deleted: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/css/style.css
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/css/style.css 2014-03-24 19:16:59 UTC (rev 12404)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/css/style.css 2014-03-24 19:19:45 UTC (rev 12405)
@@ -1,39 +0,0 @@
-/**
- * ****************************************************************************
- * - A Project by Developers TEAM For Xoops - ( http://www.xoops.org )
- * ****************************************************************************
- * XNEWSLETTER - MODULE FOR XOOPS
- * Copyright (c) 2007 - 2012
- * goffy ( )
- *
- * You may not change or alter any portion of this comment or credits
- * of supporting developers from this source code or any supporting
- * source code which is considered copyrighted (c) material of the
- * original comment or credit authors.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * ---------------------------------------------------------------------------
- * @copyright goffy ( )
- * @license gpl 2.0
- * @package xNewsletter
- * @author goffy ( )
- *
- * Version : 1 Mon 2012/11/05 14:31:32 : Exp $
- * ****************************************************************************
- */
-
-.box-header {
- margin: 2px;
- padding: 5px;
- background-color: #ccc;
- width: 100%;
- height: 50px;
-}
-
-.registration {
- padding: 30px;
- text-align: center;
-}
\ No newline at end of file
Added: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/js/index.html
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/js/index.html (rev 0)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/js/index.html 2014-03-24 19:19:45 UTC (rev 12405)
@@ -0,0 +1 @@
+<script>history.go(-1);</script>
\ No newline at end of file
|
|
From: <luc...@us...> - 2014-03-24 19:29:07
|
Revision: 12406
http://sourceforge.net/p/xoops/svn/12406
Author: luciorota
Date: 2014-03-24 19:29:02 +0000 (Mon, 24 Mar 2014)
Log Message:
-----------
257 multipage help, added breadcrumb, standardize footer, ..., standardize xoops_version.php (still in progress), ...
Modified Paths:
--------------
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/css/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/docs/changelog.txt
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/header.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/common.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/config.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/index.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/help/help.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/main.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/modinfo.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/letter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/print.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/protocol.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/sendletter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/subscription.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_footer.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_header.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xnewsletter_print.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/xoops_version.php
Added Paths:
-----------
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/breadcrumb.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/footer.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/module.css
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/help/help2.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xnewsletter_common_breadcrumb.html
Added: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/breadcrumb.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/breadcrumb.php (rev 0)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/breadcrumb.php 2014-03-24 19:29:02 UTC (rev 12406)
@@ -0,0 +1,70 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * xNewsletterBreadcrumb Class
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license http://www.fsf.org/copyleft/gpl.html GNU public license
+ * @author lucio <luc...@gm...>
+ * @package xNewsletter
+ * @since 1.3
+ * @version $Id:$
+ *
+ * Example:
+ * $breadcrumb = new xNewsletterBreadcrumb();
+ * $breadcrumb->addLink( 'bread 1', 'index1.php' );
+ * $breadcrumb->addLink( 'bread 2', '' );
+ * $breadcrumb->addLink( 'bread 3', 'index3.php' );
+ * echo $breadcrumb->render();
+ */
+defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
+
+class xNewsletterBreadcrumb
+{
+ var $dirname;
+ var $_bread = array();
+
+ function __construct()
+ {
+ $this->dirname = basename(dirname(dirname(__FILE__)));
+ }
+
+ /**
+ * Add link to breadcrumb
+ *
+ */
+ function addLink( $title='', $link='' )
+ {
+ $this->_bread[] = array(
+ 'link' => $link,
+ 'title' => $title
+ );
+ }
+
+ /**
+ * Render xNewsletter BreadCrumb
+ *
+ */
+ function render()
+ {
+ if ( !isset($GLOBALS['xoTheme']) || !is_object($GLOBALS['xoTheme']) ) {
+ include_once $GLOBALS['xoops']->path( "/class/theme.php" );
+ $GLOBALS['xoTheme'] = new xos_opal_Theme();
+ }
+
+ require_once $GLOBALS['xoops']->path('class/template.php');
+ $breadcrumbTpl = new XoopsTpl();
+ $breadcrumbTpl->assign('breadcrumb', $this->_bread);
+ $html = $breadcrumbTpl->fetch("db:" . $this->dirname . "_common_breadcrumb.html");
+ unset($breadcrumbTpl);
+ return $html;
+ }
+}
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/css/index.html
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/css/index.html 2014-03-24 19:19:45 UTC (rev 12405)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/css/index.html 2014-03-24 19:29:02 UTC (rev 12406)
@@ -1 +1 @@
- <script>history.go(-1);</script>
\ No newline at end of file
+<script>history.go(-1);</script>
\ No newline at end of file
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/docs/changelog.txt
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/docs/changelog.txt 2014-03-24 19:19:45 UTC (rev 12405)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/docs/changelog.txt 2014-03-24 19:29:02 UTC (rev 12406)
@@ -3,6 +3,8 @@
- templatize user side (luciorota)
- standardize code (luciorota)
- added html2txt function for non-HTML mail clients (luciorota)
+ - added: breadcrumb class (luciorota)
+ - added: updating to XOOPS 2.5.7 Multi-page help (luciorota)
Version 1.2
--------------
Added: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/footer.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/footer.php (rev 0)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/footer.php 2014-03-24 19:29:02 UTC (rev 12406)
@@ -0,0 +1,37 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * xNewsletter module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
+ * @package xnewsletter
+ * @since 1.3
+ * @author Xoops Development Team
+ * @version svn:$id$
+ */
+include_once XNEWSLETTER_PATH . "/include/functions.php";
+
+// copyright
+$xoopsTpl->assign('copyright', $moduleCopyrightHtml); // this definition is not removed for backward compatibility issues
+$xoopsTpl->assign('copyright_code', $moduleCopyrightHtml); // include/config.php
+// advertise
+$xoopsTpl->assign('adv', $GLOBALS['xoopsModuleConfig']['advertise']); // this definition is not removed for backward compatibility issues
+$xoopsTpl->assign('advertise_code', $GLOBALS['xoopsModuleConfig']['advertise']);
+// social
+if($GLOBALS['xoopsModuleConfig']['social_active'] == true) {
+ $xoopsTpl->assign('social_active', $GLOBALS['xoopsModuleConfig']['social_active']);
+ $xoopsTpl->assign('social_code', $GLOBALS['xoopsModuleConfig']['social_code']);
+}
+
+$xoopsTpl->assign("isAdmin", xNewsletter_userIsAdmin());
+
+include_once XOOPS_ROOT_PATH . '/footer.php';
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/header.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/header.php 2014-03-24 19:19:45 UTC (rev 12405)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/header.php 2014-03-24 19:29:02 UTC (rev 12406)
@@ -43,7 +43,6 @@
xoops_load('XoopsUserUtility');
$myts = & MyTextSanitizer::getInstance();
-$style = XNEWSLETTER_URL . "/css/style.css";
if (empty($xoopsModuleConfig)) {
$xoopsModuleConfig = $config_handler->getConfigsByCat(0, $xoopsModule->mid());
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/common.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/common.php 2014-03-24 19:19:45 UTC (rev 12405)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/common.php 2014-03-24 19:29:02 UTC (rev 12406)
@@ -38,6 +38,7 @@
include_once XNEWSLETTER_ROOT_PATH . '/class/session.php'; // xNewsletterSession class
include_once XNEWSLETTER_ROOT_PATH . '/class/xnewsletter.php'; // xNewsletterxNewsletter class
include_once XNEWSLETTER_ROOT_PATH . '/class/request.php'; // xNewsletterRequest class
+include_once XNEWSLETTER_ROOT_PATH . '/class/breadcrumb.php'; // xNewsletterBreadcrumb class
xoops_load('XoopsUserUtility');
// MyTextSanitizer object
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/config.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/config.php 2014-03-24 19:19:45 UTC (rev 12405)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/config.php 2014-03-24 19:29:02 UTC (rev 12406)
@@ -38,7 +38,7 @@
// module information
$moduleImageUrl = XNEWSLETTER_URL . "/images/xNewsletter.png";
-$moduleCopyrightHtml = "<br /><br /><a href='' title='' target='_blank'><img src='{$moduleImageUrl}' alt='' /></a>";
+$moduleCopyrightHtml = ""; //"<br /><br /><a href='' title='' target='_blank'><img src='{$moduleImageUrl}' alt='' /></a>";
// constants for account
define("_AM_ACCOUNTS_TYPE_VAL_PHP_MAIL", "1");
Added: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/module.css
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/module.css (rev 0)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/module.css 2014-03-24 19:29:02 UTC (rev 12406)
@@ -0,0 +1,553 @@
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * xNewsletter module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package xnewsletter
+ * @since 1.3
+ * @author xNewsletter, Xoops Development Team, luciorota
+ * @version svn:$Id$
+ */
+.xnewsletter_headertable {
+ padding: 0;
+ border-bottom: 1px solid;
+ margin: 0 0 10px;
+}
+
+.xnewsletter_modulename {
+ font-size: 10px;
+ text-align: left;
+ font-weight: bold;
+ padding-right: 0.3em;
+ line-height: 18px;
+}
+
+.xnewsletter_breadcrumb {
+ font-size: 10px;
+ line-height: 18px;
+}
+
+.xnewsletter_infotitle {
+ margin-top: 8px;
+ margin-bottom: 8px;
+ font-size: 250%;
+ line-height: 250%;
+ font-weight: bold;
+ display: block;
+}
+
+.xnewsletter_infotext {
+ margin-bottom: 8px;
+ line-height: 130%;
+ display: block;
+}
+
+.xnewsletter_adminlinks {
+ padding-top: 15px;
+ padding-bottom: 5px;
+ font-size: 10px;
+ text-align: center;
+ line-height: 18px;
+}
+
+.xnewsletter_indexfooter {
+ font-size: 10px;
+ font-weight: bold;
+ text-align: center;
+ padding: 10px;
+}
+
+.xnewsletter_itemfooter {
+ font-size: 10px;
+ font-weight: bold;
+ text-align: center;
+ padding: 10px;
+}
+
+ul {
+ padding: 2px;
+ list-style: disc;
+ text-align: left;
+}
+
+li {
+ margin-left: 5px;
+ color: #2F5376;
+}
+
+h4 {
+ font-size: 14px;
+ text-decoration: underline;
+}
+
+.xnewsletter_container {
+ height: 100%;
+ display: table;
+ width: 100%;
+ margin: 0 auto;
+ border: none;
+}
+
+.xnewsletter_static {
+ position: static;
+ clear: both;
+}
+
+/* ---------- global ---------- */
+.xnewsletter_pagenav {
+ text-align: right;
+}
+
+.xnewsletter_copyright {
+ text-align: center;
+}
+
+/* ---------- header.html ---------- */
+.xnewsletter_head_catimgheader {
+ text-align: center;
+}
+
+.xnewsletter_head_downimgheader {
+ text-align: center;
+}
+
+.xnewsletter_head_imgheader {
+ text-align: center;
+}
+
+.xnewsletter_head_catindexheader {
+ /* text-align: center; do not uncomment (will stop index alignment option working) */
+}
+
+.xnewsletter_head_catletters {
+ text-align: center;
+ font-size: 80%;
+}
+
+.xnewsletter_head_cattoolbar {
+ text-align: center;
+}
+
+/* ---------- footer.html ---------- */
+.xnewsletter_foot_commentnav {
+ text-align: center;
+ padding: 3px;
+ margin: 3px;
+}
+
+.xnewsletter_foot_comments {
+ padding: 3px;
+ margin: 3px;
+}
+
+/* ---------- newlist.html ---------- */
+.xnewsletter_newlist_top {
+ text-align: center;
+ width: 100%;
+}
+
+.xnewsletter_newlist_top fieldset {
+ text-align: center;
+ border: 1px solid silver;
+ width: 450px;
+}
+
+.xnewsletter_newlist_totallast {
+ text-align: center;
+ width: 100%;
+ font-weight: bold;
+ font-size: large;
+}
+
+/* ---------- disclaimer.html ---------- */
+.xnewsletter_disc_imghead {
+ text-align: center;
+}
+
+.xnewsletter_disc_disclaimer {
+ text-align: center;
+}
+
+.xnewsletter_disc_discform {
+ text-align: center;
+}
+
+/* ---------- ratefile.html ---------- */
+.xnewsletter_rate_imghead {
+ text-align: center;
+}
+
+/* ---------- viewcat.html ---------- */
+.xnewsletter_view_top {
+}
+
+.xnewsletter_view_subs {
+ border: 0;
+ padding: 0;
+ margin: 0;
+}
+
+.xnewsletter_view_subs h3 {
+ text-align: center;
+ width: 100%;
+ background-color: #BEC8D1;
+}
+
+.xnewsletter_view_subs fieldset {
+}
+
+.xnewsletter_view_subslist {
+ text-align: left;
+ vertical-align: middle;
+ width: 90%;
+}
+
+.xnewsletter_view_catpath {
+ text-align: left;
+ margin-left: 5px;
+ padding: 0;
+ font-weight: bold;
+}
+
+.xnewsletter_view_sortlist {
+ text-align: center;
+ font-size: small;
+}
+
+/* ---------- download.html ---------- */
+.xnewsletter_down_title {
+ padding-top: 2.0em
+}
+
+.xnewsletter_down_top_r {
+ float: right;
+ margin-right: 10px;
+ position: relative;
+}
+
+.xnewsletter_down_top_l {
+ float: left;
+}
+
+.xnewsletter_down_main_l {
+ width: 74%;
+ float: left;
+ height: 100%;
+ position: relative;
+ display: table;
+}
+
+.xnewsletter_down_main_l p {
+ padding-top: 10px;
+ margin: 0;
+}
+
+.xnewsletter_down_viewdetails {
+ text-align: right;
+}
+
+.xnewsletter_down_main_r {
+ width: 25%;
+ height: 100%;
+ float: right;
+ position: relative;
+ display: table;
+}
+
+.xnewsletter_down_main_r p {
+ padding-top: 10px;
+ margin: 0;
+}
+
+.xnewsletter_down_info_top {
+ margin-left: 10px;
+ margin-right: 10px;
+ padding: 4px;
+ background-color: silver;
+ border-color: #999999;
+ font-size: .8em;
+}
+
+.xnewsletter_down_info_bottom {
+ margin-left: 10px;
+ margin-right: 10px;
+ padding: 4px;
+ font-size: .8em;
+}
+
+.xnewsletter_down_main_b {
+ text-align: center;
+}
+
+.xnewsletter_down_main_bottom {
+ width: 100%;
+ position: relative;
+ text-align: center;
+}
+
+.xnewsletter_down_main_bottom2 {
+ text-align: center;
+ background-color: silver;
+ width: 100%;
+ position: relative;
+ line-height: 150%;
+}
+
+.xnewsletter_down_custom {
+ width: 100%;
+ position: relative;
+ text-align: center;
+}
+
+/* ---------- singlefile.html ---------- */
+.xnewsletter_single_title {
+ padding-top: 2.0em
+}
+
+.xnewsletter_single_title a {
+ color: #32529C;
+ background-color: inherit;
+ font-weight: bold;
+ text-decoration: none;
+}
+
+.xnewsletter_single_title a:hover {
+ color: #666;
+ background-color: inherit;
+ text-decoration: none;
+}
+
+.xnewsletter_single_top_r {
+ float: right;
+ margin-right: 10px;
+ position: relative;
+}
+
+.xnewsletter_single_top_l {
+ float: left;
+}
+
+.xnewsletter_single_main_l {
+ width: 74%;
+ height: 100%;
+ float: left;
+ position: relative;
+ display: table;
+}
+
+.xnewsletter_single_main_l p {
+ padding-top: 10px;
+ margin: 0;
+}
+
+.xnewsletter_single_main_r {
+ width: 25%;
+ float: right;
+ display: table-column;
+}
+
+.xnewsletter_single_info_top {
+ margin-left: 10px;
+ margin-right: 10px;
+ padding: 4px;
+ background-color: silver;
+ border-color: #999999;
+ color: #333;
+ font-size: .8em;
+}
+
+.xnewsletter_single_info_dtimes {
+ margin-left: 4px;
+}
+
+.xnewsletter_single_main_custom {
+ width: 100%;
+ position: relative;
+ text-align: center;
+}
+
+.xnewsletter_single_main_bottom {
+ text-align: center;
+ background-color: silver;
+ width: 100%;
+ position: relative;
+ float: bottom;
+}
+
+.xnewsletter_single_userrev {
+ padding: 3px;
+ margin: 3px;
+}
+
+.xnewsletter_single_usermir {
+ padding: 3px;
+ margin: 3px;
+}
+
+/* ---------- mirrors.html ---------- */
+.xnewsletter_mirrors_head, .xnewsletter_mirrors_head2, .xnewsletter_mirrors_head3 {
+ border-bottom: 2px solid #000000;
+ border-left: 1px solid #000000;
+ background-color: #BEC8D1;
+ text-align: left;
+ font-family: Verdana, sans-serif;
+ font-weight: bold;
+ font-size: 14px;
+ color: #404040;
+}
+
+.xnewsletter_mirrors_head4 {
+ border-bottom: 2px solid #000000;
+ border-left: 1px solid #000000;
+ background-color: #BEC8D1;
+ text-align: center;
+ font-weight: bold;
+ font-size: 14px;
+ color: #404040;
+ width: 50px;
+}
+
+.xnewsletter_mirrors_head5 {
+ border-bottom: 2px solid #000000;
+ border-left: 0 solid #000000;
+ background-color: #BEC8D1;
+ text-align: center;
+ font-weight: bold;
+ font-size: 14px;
+ color: #404040;
+ width: 30px;
+}
+
+tr.xnewsletter_mirrors_elist {
+ line-height: 25px;
+}
+
+.xnewsletter_mirrors_list, .xnewsletter_mirrors_list2, .xnewsletter_mirrors_list3 {
+ text-align: left;
+ border-right: 1px solid #000000;
+}
+
+.xnewsletter_mirrors_list4, .xnewsletter_mirrors_list5 {
+ text-align: center;
+ vertical-align: middle;
+}
+
+.xnewsletter_mirrors_found {
+}
+
+table.xnewsletter_mirrors {
+ width: 95%;
+ padding: 10px 10px 10px 10px;
+ border: 1px #000000 solid;
+ border-collapse: collapse;
+ border-spacing: 0;
+}
+
+tr.xnewsletter_mirrors_end {
+ background-color: #BEC8D1;
+}
+
+.xnewsletter_mirrors_foot, .xnewsletter_mirrors_foot a {
+ border-top: 2px solid #000000;
+ font-weight: bold;
+}
+
+.xnewsletter_mirrors_bottom {
+ font-weight: bold;
+}
+
+/* ---------- reviews.html ---------- */
+.xnewsletter_reviews_title {
+}
+
+.xnewsletter_reviews_desc {
+}
+
+.xnewsletter_reviews_catpath {
+}
+
+.xnewsletter_reviews_found {
+ width: 90%;
+ text-align: center;
+}
+
+.xnewsletter_reviews_revfound {
+ text-align: left;
+}
+
+.xnewsletter_reviews_addrev {
+ text-align: right;
+}
+
+.xnewsletter_reviews_reviewlist {
+ padding: 10px 10px 10px 10px;
+ border: 1px #000000 solid;
+ border-collapse: collapse;
+ width: 95%;
+}
+
+.xnewsletter_reviews_reviewer {
+ text-align: left;
+ width: 80%;
+ background-color: #BEC8D1;
+ /* border-right: 1px solid #000000; */
+ border-bottom: 2px solid #000000;
+}
+
+.xnewsletter_reviews_reviewdate {
+ text-align: right;
+ width: 15%;
+ background-color: #BEC8D1;
+ border-bottom: 2px solid #000000;
+}
+
+.xnewsletter_reviews_revlistleft {
+ text-align: left;
+ border-right: 1px solid #000000;
+ width: 120px;
+}
+
+.xnewsletter_reviews_revlistright {
+ text-align: left;
+}
+
+.xnewsletter_reviews_revlistreview {
+ position: absolute;
+ top: 0;
+ left: 125px;
+ width: 90%;
+}
+
+.xnewsletter_reviews_revlisttitle {
+ margin-left: 10px;
+ margin-right: 10px;
+ padding: 4px;
+ font-weight: bold;
+ color: #0000CC;
+}
+
+.xnewsletter_reviews_revlistrev {
+}
+
+.xnewsletter_reviews_foot {
+ background-color: #BEC8D1;
+ border: 2px solid #000000;
+ width: 95%;
+}
+
+.xnewsletter_reviews_addrev {
+ position: absolute;
+ top: 0;
+ left: 0;
+ background-color: #BEC8D1;
+ border: 2px solid #000000;
+}
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/index.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/index.php 2014-03-24 19:19:45 UTC (rev 12405)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/index.php 2014-03-24 19:29:02 UTC (rev 12406)
@@ -37,20 +37,16 @@
$xoopsOption['template_main'] = 'xNewsletter_index.html';
include XOOPS_ROOT_PATH . "/header.php";
- $xoTheme->addStylesheet($style);
- $xoopsTpl->assign('xnewsletter_url', XNEWSLETTER_URL);
- $xoopsTpl->assign('copyright', $moduleCopyrightHtml);
+ $xoTheme->addStylesheet(XNEWSLETTER_URL . '/css/module.css');
$xoTheme->addMeta('meta', 'keywords', $GLOBALS['xoopsModuleConfig']['keywords']); // keywords only for index page
$xoTheme->addMeta('meta', 'description', strip_tags(_MA_XNEWSLETTER_DESC)); // description
- // module configs for template
- $xoopsTpl->assign('adv', $GLOBALS['xoopsModuleConfig']['advertise']);
- $xoopsTpl->assign('advertise', $GLOBALS['xoopsModuleConfig']['advertise']);
- if($GLOBALS['xoopsModuleConfig']['social_active'] == true) {
- $xoopsTpl->assign('social_active', $GLOBALS['xoopsModuleConfig']['social_active']);
- $xoopsTpl->assign('social_code', $GLOBALS['xoopsModuleConfig']['social_code']);
- }
+
+ // Breadcrumb
+ $breadcrumb = new xNewsletterBreadcrumb();
+ $breadcrumb->addLink($xnewsletter->getModule()->getVar('name'), XNEWSLETTER_URL);
+ $xoopsTpl->assign('xnewsletter_breadcrumb', $breadcrumb->render());
+
$xoopsTpl->assign('welcome_message', $GLOBALS['xoopsModuleConfig']['welcome_message']);
-
$xoopsTpl->assign('xnewsletter_content', _MA_XNEWSLETTER_WELCOME); // this definition is not removed for backward compatibility issues
break;
@@ -59,18 +55,15 @@
$xoopsOption['template_main'] = 'xnewsletter_letter_preview.html';
include XOOPS_ROOT_PATH . "/header.php";
- $xoTheme->addStylesheet($style);
- $xoopsTpl->assign('xnewsletter_url', XNEWSLETTER_URL);
- $xoopsTpl->assign('copyright', $moduleCopyrightHtml);
+ $xoTheme->addStylesheet(XNEWSLETTER_URL . '/css/module.css');
$xoTheme->addMeta('meta', 'keywords', $GLOBALS['xoopsModuleConfig']['keywords']); // keywords only for index page
$xoTheme->addMeta('meta', 'description', strip_tags(_MA_XNEWSLETTER_DESC)); // description
- // module configs for template
- $xoopsTpl->assign('adv', $GLOBALS['xoopsModuleConfig']['advertise']);
- $xoopsTpl->assign('advertise', $GLOBALS['xoopsModuleConfig']['advertise']);
- if($GLOBALS['xoopsModuleConfig']['social_active'] == true) {
- $xoopsTpl->assign('social_active', $GLOBALS['xoopsModuleConfig']['social_active']);
- $xoopsTpl->assign('social_code', $GLOBALS['xoopsModuleConfig']['social_code']);
- }
+
+ // Breadcrumb
+ $breadcrumb = new xNewsletterBreadcrumb();
+ $breadcrumb->addLink($xnewsletter->getModule()->getVar('name'), XNEWSLETTER_URL);
+ $xoopsTpl->assign('xnewsletter_breadcrumb', $breadcrumb->render());
+
$xoopsTpl->assign('welcome_message', $GLOBALS['xoopsModuleConfig']['welcome_message']);
$template_path = XNEWSLETTER_PATH . '/language/' . $GLOBALS['xoopsConfig']['language'] . '/templates/';
@@ -107,18 +100,16 @@
$xoopsOption['template_main'] = 'xNewsletter_index_list_letters.html';
include XOOPS_ROOT_PATH . "/header.php";
- $xoTheme->addStylesheet($style);
- $xoopsTpl->assign('xnewsletter_url', XNEWSLETTER_URL);
- $xoopsTpl->assign('copyright', $moduleCopyrightHtml);
+ $xoTheme->addStylesheet(XNEWSLETTER_URL . '/css/module.css');
$xoTheme->addMeta('meta', 'keywords', $GLOBALS['xoopsModuleConfig']['keywords']); // keywords only for index page
$xoTheme->addMeta('meta', 'description', strip_tags(_MA_XNEWSLETTER_DESC)); // description
- // module configs for template
- $xoopsTpl->assign('adv', $GLOBALS['xoopsModuleConfig']['advertise']);
- $xoopsTpl->assign('advertise', $GLOBALS['xoopsModuleConfig']['advertise']);
- if($GLOBALS['xoopsModuleConfig']['social_active'] == true) {
- $xoopsTpl->assign('social_active', $GLOBALS['xoopsModuleConfig']['social_active']);
- $xoopsTpl->assign('social_code', $GLOBALS['xoopsModuleConfig']['social_code']);
- }
+
+ // Breadcrumb
+ $breadcrumb = new xNewsletterBreadcrumb();
+ $breadcrumb->addLink($xnewsletter->getModule()->getVar('name'), XNEWSLETTER_URL);
+ $breadcrumb->addLink(_MD_XNEWSLETTER_LIST, '');
+ $xoopsTpl->assign('xnewsletter_breadcrumb', $breadcrumb->render());
+
$xoopsTpl->assign('welcome_message', $GLOBALS['xoopsModuleConfig']['welcome_message']);
// get letters array
@@ -163,4 +154,4 @@
break;
}
-include_once XOOPS_ROOT_PATH . "/footer.php";
+include 'footer.php';
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/help/help.html
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/help/help.html 2014-03-24 19:19:45 UTC (rev 12405)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/help/help.html 2014-03-24 19:29:02 UTC (rev 12406)
@@ -25,7 +25,7 @@
* Version : 1 Mon 2012/11/05 14:31:32 : Exp $
* ****************************************************************************
*/
-
+
<div id="help-template" class="outer">
<h1 class="head">Help:
<a class="ui-corner-all tooltip" href="<{$xoops_url}>/modules/xNewsletter/admin/index.php"
@@ -44,10 +44,10 @@
- Newsletter are based on templates<br />
- Detailed handling of permissions for groups and newsletter (subscribe, write, send)<br />
- Send: send test mail, resend to all subscribers or only to subscribers, where sending failed<br />
- - Sending newsletters to unlimited number of recipients or in packages with certain number of recipients by using cronjob<br />
+ - Sending newsletters to unlimited number of recipients or in packages with certain number of recipients by using cron job<br />
- Bounced email handler for handling Bounced emails in case of invalid e-mail-addresses<br />
- Optionally synchronisation with mailing lists (e.g. majordomo)<br />
- - Maintenace function included<br />
+ - Maintenance function included<br />
- Creating protocol for the important steps<br />
<br />
</p>
@@ -59,18 +59,18 @@
Manual</a>.<br /><br /></p>
<h4 class="odd">Tutorial</h4>
<!-- -----Help Content ---------- -->
-
-
-
+
+
+
<h5 class="odd">Basic information</h5>
<p class="even">The module is based on PHPMailer and PHPMailer-BMH
<br /><br /></p>
-
+
<h5 class="odd">(Un) subscriptions to newsletters</h5>
<p class="even">
- You can define for each newsletter and for each group, whether for (un) subscritpion or change a confirmation email with activation key is necessary or not (use double-option).<br />
+ You can define for each newsletter and for each group, whether for (un) subscription or change a confirmation email with activation key is necessary or not (use double-option).<br />
<br /><br /></p>
-
+
<h5 class="odd">Accounts</h5>
<p class="even">
You can use one or more email-account; sending with php mail, php sendmail, smtp is possible.<br />
@@ -78,13 +78,13 @@
<br />
Pay attention: functions like testing account, sending emails, start Bounced email handler,... work not with local server (you get white page without any error).<br />
<br /><br /></p>
-
+
<h5 class="odd">Newsletter categories</h5>
<p class="even">
You can handle one or more newsletter categories.<br />
It is possible to set permissions "read", "create", "admin" and "list subscribers" for each newsletter cat.<br />
<br /><br /></p>
-
+
<h5 class="odd">Create a newsletter</h5>
<p class="even">
The newsletter can be created with each text editor which is installed in current xoops core (e.g. TinyMCE). <br />
@@ -94,14 +94,14 @@
Optionally you can also copy an older newsletter and edit or send it as a new one.<br /><br />
The type of text editor, allows mime-types and size of mail attachments can be set in module preferences.<br />
<br /><br /></p>
-
+
<h5 class="odd">Newsletter templates</h5>
<p class="even">
The newsletters are template based.<br />
The templates you can find in language/{yourlanguage}/templates.<br />
To create a new template you have only to make a new html-file in this folder and to put in the smarty-vars.<br />
<br /><br /></p>
-
+
<h5 class="odd">Sending newsletter</h5>
<p class="even">
You can s...
[truncated message content] |
|
From: <luc...@us...> - 2014-03-28 20:12:27
|
Revision: 12414
http://sourceforge.net/p/xoops/svn/12414
Author: luciorota
Date: 2014-03-28 20:12:18 +0000 (Fri, 28 Mar 2014)
Log Message:
-----------
standardize module (IN PROGRESS)
Modified Paths:
--------------
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/admin_footer.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/admin_header.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/attachment.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/bmh.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/bmh_callback_database.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/cat.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/catsubscr.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/import.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/index.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/letter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/mailinglist.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/maintenance.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/menu.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/protocol.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/sendletter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/subscr.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/task.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/blocks/blocks_catsubscr.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/blocks/blocks_letter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_accounts.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_attachment.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_bmh.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_cat.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_catsubscr.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_import.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_letter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_mailinglist.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_protocol.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_subscr.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_task.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/cron.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/docs/changelog.txt
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/footer.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/header.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/common.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/config.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/functions.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/mailinglist.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/task.inc.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/index.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/help/help.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/modinfo.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/letter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/csv.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/evennews.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/rmbulletin.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/smartpartner.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/subscribers.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/weblinks.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/xoopsuser.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/print.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/protocol.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/sendletter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/subscription.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xnewsletter_index_list_letters.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xnewsletter_letter_list_letters.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xnewsletter_letter_list_subscrs.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xnewsletter_protocol.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xnewsletter_subscription_list_subscriptions.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xnewsletter_subscription_result.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/xoops_version.php
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.php 2014-03-27 14:28:58 UTC (rev 12413)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.php 2014-03-28 20:12:18 UTC (rev 12414)
@@ -42,8 +42,8 @@
{
case "check_account":
- $img_ok = "<img src='".XNEWSLETTER_ICON."/xn_ok.png' alt='"._AM_XNEWSLETTER_OK."' title='"._AM_XNEWSLETTER_OK."' /> ";
- $img_failed = "<img src='".XNEWSLETTER_ICON."/xn_failed.png' alt='"._AM_XNEWSLETTER_FAILED."' title='"._AM_XNEWSLETTER_FAILED."' /> ";
+ $img_ok = "<img src='" . XNEWSLETTER_ICONS_URL . "/xn_ok.png' alt='" . _AM_XNEWSLETTER_OK . "' title='"._AM_XNEWSLETTER_OK . "' /> ";
+ $img_failed = "<img src='" . XNEWSLETTER_ICONS_URL . "/xn_failed.png' alt='" . _AM_XNEWSLETTER_FAILED . "' title='" . _AM_XNEWSLETTER_FAILED . "' /> ";
echo $indexAdmin->addNavigation("accounts.php");
$indexAdmin->addItemButton(_AM_XNEWSLETTER_ACCOUNTSLIST, 'accounts.php?op=list', 'list');
@@ -52,7 +52,7 @@
if ($accounts_id == 0) {
redirect_header("accounts.php", 3, _AM_XNEWSLETTER_ERROR_NO_VALID_ID);
} else {
- $obj_account =& $accountsHandler->get($accounts_id);
+ $obj_account =& $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
}
$mailhost = $obj_account->getVar("accounts_server_in");
@@ -188,11 +188,11 @@
$criteria = new CriteriaCompo();
$criteria->setSort("accounts_id ASC, accounts_type");
$criteria->setOrder("ASC");
- $numrows = $accountsHandler->getCount();
+ $numrows = $xnewsletter->getHandler('xNewsletter_accounts')->getCount();
$start = xNewsletter_CleanVars ( $_REQUEST, 'start', 0, 'int' );
$criteria->setStart($start);
$criteria->setLimit($limit);
- $accounts_arr = $accountsHandler->getall($criteria);
+ $accounts_arr = $xnewsletter->getHandler('xNewsletter_accounts')->getall($criteria);
if ( $numrows > $limit ) {
include_once XOOPS_ROOT_PATH . "/class/pagenav.php";
$pagenav = new XoopsPageNav($numrows, $limit, $start, 'start', 'op=list');
@@ -236,10 +236,10 @@
echo "<td class='center'>".$verif_accounts_default."</td>";
echo "<td class='center width5'>";
- echo " <a href='accounts.php?op=edit_account&accounts_id=".$i."'><img src=".XNEWSLETTER_ICON."/xn_edit.png alt='"._EDIT."' title='"._EDIT."' /></a>";
- echo " <a href='accounts.php?op=delete_account&accounts_id=".$i."'><img src=".XNEWSLETTER_ICON."/xn_delete.png alt='"._DELETE."' title='"._DELETE."' /></a>";
+ echo " <a href='accounts.php?op=edit_account&accounts_id=".$i."'><img src=".XNEWSLETTER_ICONS_URL."/xn_edit.png alt='"._EDIT."' title='"._EDIT."' /></a>";
+ echo " <a href='accounts.php?op=delete_account&accounts_id=".$i."'><img src=".XNEWSLETTER_ICONS_URL."/xn_delete.png alt='"._DELETE."' title='"._DELETE."' /></a>";
if ($accounts_arr[$i]->getVar("accounts_type") != _AM_ACCOUNTS_TYPE_VAL_PHP_MAIL && $accounts_arr[$i]->getVar("accounts_type") != _AM_ACCOUNTS_TYPE_VAL_PHP_SENDMAIL) {
- echo " <a href='accounts.php?op=check_account&accounts_id=".$i."'><img src=".XNEWSLETTER_ICON."/xn_check.png alt='"._AM_ACCOUNTS_TYPE_CHECK."' title='"._AM_ACCOUNTS_TYPE_CHECK."' /></a>";
+ echo " <a href='accounts.php?op=check_account&accounts_id=".$i."'><img src=".XNEWSLETTER_ICONS_URL."/xn_check.png alt='"._AM_ACCOUNTS_TYPE_CHECK."' title='"._AM_ACCOUNTS_TYPE_CHECK."' /></a>";
}
echo "</td>";
echo "</tr>";
@@ -274,7 +274,7 @@
echo $indexAdmin->addNavigation("accounts.php");
$indexAdmin->addItemButton(_AM_XNEWSLETTER_ACCOUNTSLIST, 'accounts.php?op=list', 'list');
echo $indexAdmin->renderButton();
- $obj =& $accountsHandler->create();
+ $obj = $xnewsletter->getHandler('xNewsletter_accounts')->create();
$obj = xNewsletter_setPost($obj,$_POST);
$form = $obj->getForm();
$form->display();
@@ -285,19 +285,19 @@
redirect_header("accounts.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
}
- $obj =& $accountsHandler->get($accounts_id);
+ $obj =& $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
$_POST['accounts_id'] = $accounts_id;
$obj = xNewsletter_setPost($obj,$_POST);
$criteria = new CriteriaCompo();
$criteria->add(new Criteria("accounts_default", 1));
- $count_accounts_default = $accountsHandler->getCount($criteria);
+ $count_accounts_default = $xnewsletter->getHandler('xNewsletter_accounts')->getCount($criteria);
if ($count_accounts_default > 0) {
if ($obj->getVar("accounts_default") == 1) {
global $xoopsDB;
$verif_accounts_default = "1";
//reset old accounts_default
- $sql = "UPDATE `".$xoopsDB->prefix("mod_xnewsletter_accounts")."` SET `accounts_default` = '0'";
+ $sql = "UPDATE `{$xoopsDB->prefix("mod_xnewsletter_accounts")}` SET `accounts_default` = '0'";
$result= $xoopsDB->query($sql) or die ("MySQL-Error: " . mysql_error());
} else {
$verif_accounts_default = "0";
@@ -307,7 +307,7 @@
}
$obj->setVar("accounts_default", $verif_accounts_default);
if ($obj->getVar("accounts_yourmail") != "" && $obj->getVar("accounts_yourmail") != _AM_ACCOUNTS_TYPE_YOUREMAIL ) {
- if ($accountsHandler->insert($obj)) {
+ if ($xnewsletter->getHandler('xNewsletter_accounts')->insert($obj)) {
if ($save_and_check == 'none') {
redirect_header("accounts.php?op=list", 2, _AM_XNEWSLETTER_FORMOK);
} else {
@@ -328,19 +328,19 @@
$indexAdmin->addItemButton(_AM_XNEWSLETTER_NEWACCOUNTS, 'accounts.php?op=new_account', 'add');
$indexAdmin->addItemButton(_AM_XNEWSLETTER_ACCOUNTSLIST, 'accounts.php?op=list', 'list');
echo $indexAdmin->renderButton();
- $obj = $accountsHandler->get($accounts_id);
+ $obj = $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
if ( !empty($_POST) ) xNewsletter_setPost($obj,$_POST);
$form = $obj->getForm();
$form->display();
break;
case "delete_account":
- $obj =& $accountsHandler->get($accounts_id);
+ $obj = $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
if (isset($_POST["ok"]) && $_POST["ok"] == "1") {
if ( !$GLOBALS["xoopsSecurity"]->check() ) {
redirect_header("accounts.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
}
- if ($accountsHandler->delete($obj)) {
+ if ($xnewsletter->getHandler('xNewsletter_accounts')->delete($obj)) {
redirect_header("accounts.php", 3, _AM_XNEWSLETTER_FORMDELOK);
} else {
echo $obj->getHtmlErrors();
@@ -351,5 +351,3 @@
break;
}
include "admin_footer.php";
-
-?>
\ No newline at end of file
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/admin_footer.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/admin_footer.php 2014-03-27 14:28:58 UTC (rev 12413)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/admin_footer.php 2014-03-28 20:12:18 UTC (rev 12414)
@@ -28,11 +28,11 @@
echo "
<br /><br /><div align='center'><a href='http://www.xoops.org' target='_blank'>
-<img src='" . XNEWSLETTER_ICON . "/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS' /></a>
+<img src='" . XNEWSLETTER_ICONS_URL . "/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS' /></a>
</div>";
echo "
<div class='center small italic pad5'>
-<strong>" . $xoopsModule->getVar('name') . "</strong> " . _AM_XNEWSLETTER_MAINTAINEDBY . "
+<strong>" . $xnewsletter->getModule()->getVar('name') . "</strong> " . _AM_XNEWSLETTER_MAINTAINEDBY . "
<a href='http://www.xoops.org' title='Visit' class='tooltip' rel='external'>XOOPS Community</a>
</div>";
xoops_cp_footer();
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/admin_header.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/admin_header.php 2014-03-27 14:28:58 UTC (rev 12413)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/admin_header.php 2014-03-28 20:12:18 UTC (rev 12414)
@@ -27,20 +27,29 @@
*/
include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/mainfile.php';
+include_once dirname(dirname(__FILE__)) . '/include/common.php';
+
+// Include xoops admin header
include_once XOOPS_ROOT_PATH . "/include/cp_functions.php";
+/*
+$pathIcon16 = XOOPS_URL . '/' . $xnewsletter->getModule()->getInfo('icons16');
+$pathIcon32 = XOOPS_URL . '/' . $xnewsletter->getModule()->getInfo('icons32');
+$pathModuleAdmin = XOOPS_ROOT_PATH . '/' . $xnewsletter->getModule()->getInfo('dirmoduleadmin');
+require_once $pathModuleAdmin . '/moduleadmin/moduleadmin.php';
+*/
-$dirname = basename(dirname(dirname(__FILE__)));
+//$dirname = basename(dirname(dirname(__FILE__)));
-include_once XOOPS_ROOT_PATH . "/modules/" . $dirname . "/include/functions.php";
-include_once XOOPS_ROOT_PATH . "/modules/" . $dirname . "/include/config.php";
+//include_once XOOPS_ROOT_PATH . "/modules/" . $xnewsletter->getModule()->dirname() . "/include/functions.php";
+//include_once XOOPS_ROOT_PATH . "/modules/" . $xnewsletter->getModule()->dirname() . "/include/config.php";
-$module_handler =& xoops_gethandler('module');
-$xoopsModule = & $module_handler->getByDirname($dirname);
+//$module_handler =& xoops_gethandler('module');
+$xoopsModule = $xnewsletter->getModule();
//Load languages
-xoops_loadLanguage('admin', $dirname);
-xoops_loadLanguage('modinfo', $dirname);
-xoops_loadLanguage('main', $dirname);
+xoops_loadLanguage('admin', $xnewsletter->getModule()->dirname());
+xoops_loadLanguage('modinfo', $xnewsletter->getModule()->dirname());
+xoops_loadLanguage('main', $xnewsletter->getModule()->dirname());
if (!xNewsletter_checkModuleAdmin()) {
xoops_cp_header();
@@ -49,33 +58,15 @@
exit();
}
-$moduleInfo =& $module_handler->get($xoopsModule->getVar('mid'));
//$pathIcon = XOOPS_URL . "/modules/" . $dirname . "/images/icons";
$indexAdmin = new ModuleAdmin();
-global $xoopsModuleConfig;
-if (empty($xoopsModuleConfig)) {
- $config_handler =& xoops_gethandler("config");
- $xoopsModuleConfig =& $config_handler->getConfigsByCat(0, $xoopsModule->mid());
-}
+$myts = MyTextSanitizer::getInstance();
-$accountsHandler =& xoops_getModuleHandler('xNewsletter_accounts', $dirname);
-$catHandler =& xoops_getModuleHandler('xNewsletter_cat', $dirname);
-$subscrHandler =& xoops_getModuleHandler('xNewsletter_subscr', $dirname);
-$catsubscrHandler =& xoops_getModuleHandler('xNewsletter_catsubscr', $dirname);
-$letterHandler =& xoops_getModuleHandler('xNewsletter_letter', $dirname);
-$attachmentHandler =& xoops_getModuleHandler('xNewsletter_attachment', $dirname);
-$protocolHandler =& xoops_getModuleHandler('xNewsletter_protocol', $dirname);
-$mailinglistHandler =& xoops_getModuleHandler('xNewsletter_mailinglist', $dirname);
-$bmhHandler =& xoops_getModuleHandler('xNewsletter_bmh', $dirname);
-$importHandler =& xoops_getModuleHandler('xNewsletter_import', $dirname);
-$taskHandler =& xoops_getModuleHandler('xNewsletter_task', $dirname);
-$myts = MyTextSanitizer::getInstance();
-
if ($xoopsUser) {
$moduleperm_handler =& xoops_gethandler('groupperm');
- if (!$moduleperm_handler->checkRight('module_admin', $xoopsModule->getVar('mid'), $xoopsUser->getGroups())) {
+ if (!$moduleperm_handler->checkRight('module_admin', $xnewsletter->getModule()->mid(), $xoopsUser->getGroups())) {
redirect_header(XOOPS_URL, 1, _NOPERM);
exit();
}
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/attachment.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/attachment.php 2014-03-27 14:28:58 UTC (rev 12413)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/attachment.php 2014-03-28 20:12:18 UTC (rev 12414)
@@ -44,11 +44,11 @@
$criteria = new CriteriaCompo();
$criteria->setSort("attachment_letter_id DESC, attachment_id");
$criteria->setOrder("DESC");
- $numrows = $attachmentHandler->getCount();
+ $numrows = $xnewsletter->getHandler('xNewsletter_attachment')->getCount();
$start = xNewsletter_CleanVars ( $_REQUEST, 'start', 0, 'int' );
$criteria->setStart($start);
$criteria->setLimit($limit);
- $attachment_arr = $attachmentHandler->getall($criteria);
+ $attachment_arr = $xnewsletter->getHandler('xNewsletter_attachment')->getall($criteria);
if ($numrows > $limit) {
include_once XOOPS_ROOT_PATH . "/class/pagenav.php";
$pagenav = new XoopsPageNav($numrows, $limit, $start, 'start', 'op=list');
@@ -79,7 +79,7 @@
$class = ($class == "even") ? "odd" : "even";
echo "<td class='center'>".$i."</td>";
- $letter =& $letterHandler->get($attachment_arr[$i]->getVar("attachment_letter_id"));
+ $letter =& $xnewsletter->getHandler('xNewsletter_letter')->get($attachment_arr[$i]->getVar("attachment_letter_id"));
$title_letter = $letter->getVar("letter_title");
echo "<td class='center'>" . $title_letter . "</td>";
echo "<td class='center'>" . $attachment_arr[$i]->getVar("attachment_name") . "</td>";
@@ -89,8 +89,8 @@
echo "
<td class='center width5' nowrap='nowrap'>
- <a href='attachment.php?op=edit_attachment&attachment_id=" . $i . "'><img src=" . XNEWSLETTER_ICON . "/xn_edit.png alt='" . _EDIT . "' title='" . _EDIT . "' /></a>
- <a href='attachment.php?op=delete_attachment&attachment_id=" . $i . "'><img src=" . XNEWSLETTER_ICON . "/xn_delete.png alt='" . _DELETE . "' title='" . _DELETE . "' /></a>
+ <a href='attachment.php?op=edit_attachment&attachment_id=" . $i . "'><img src=" . XNEWSLETTER_ICONS_URL . "/xn_edit.png alt='" . _EDIT . "' title='" . _EDIT . "' /></a>
+ <a href='attachment.php?op=delete_attachment&attachment_id=" . $i . "'><img src=" . XNEWSLETTER_ICONS_URL . "/xn_delete.png alt='" . _DELETE . "' title='" . _DELETE . "' /></a>
</td>
";
echo "</tr>";
@@ -119,7 +119,7 @@
$indexAdmin->addItemButton(_AM_XNEWSLETTER_ATTACHMENTLIST, 'attachment.php?op=list', 'list');
echo $indexAdmin->renderButton();
- $obj =& $attachmentHandler->create();
+ $obj =& $xnewsletter->getHandler('xNewsletter_attachment')->create();
$form = $obj->getForm();
$form->display();
break;
@@ -129,7 +129,7 @@
redirect_header("attachment.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
}
- $obj =& $attachmentHandler->get($attachment_id);
+ $obj =& $xnewsletter->getHandler('xNewsletter_attachment')->get($attachment_id);
//Form attachment_letter_id
$obj->setVar("attachment_letter_id", xNewsletter_CleanVars($_REQUEST, "attachment_letter_id", 0, "int"));
//Form attachment_name
@@ -141,7 +141,7 @@
//Form attachment_created
$obj->setVar("attachment_created", xNewsletter_CleanVars($_REQUEST, "attachment_created", time(), "int"));
- if ($attachmentHandler->insert($obj)) {
+ if ($xnewsletter->getHandler('xNewsletter_attachment')->insert($obj)) {
redirect_header("attachment.php?op=list", 2, _AM_XNEWSLETTER_FORMOK);
}
@@ -155,18 +155,18 @@
$indexAdmin->addItemButton(_AM_XNEWSLETTER_NEWATTACHMENT, 'attachment.php?op=new_attachment', 'add');
$indexAdmin->addItemButton(_AM_XNEWSLETTER_ATTACHMENTLIST, 'attachment.php?op=list', 'list');
echo $indexAdmin->renderButton();
- $obj = $attachmentHandler->get($attachment_id);
+ $obj = $xnewsletter->getHandler('xNewsletter_attachment')->get($attachment_id);
$form = $obj->getForm();
$form->display();
break;
case "delete_attachment" :
- $obj =& $attachmentHandler->get($attachment_id);
+ $obj =& $xnewsletter->getHandler('xNewsletter_attachment')->get($attachment_id);
if (isset($_POST["ok"]) && $_POST["ok"] == 1) {
if (!$GLOBALS["xoopsSecurity"]->check()) {
redirect_header("attachment.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
}
- if ($attachmentHandler->delete($obj)) {
+ if ($xnewsletter->getHandler('xNewsletter_attachment')->delete($obj)) {
redirect_header("attachment.php", 3, _AM_XNEWSLETTER_FORMDELOK);
} else {
echo $obj->getHtmlErrors();
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/bmh.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/bmh.php 2014-03-27 14:28:58 UTC (rev 12413)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/bmh.php 2014-03-28 20:12:18 UTC (rev 12414)
@@ -43,7 +43,7 @@
if ( (isset($_POST["ok"]) && $_POST["ok"] == 1) ) {
$count_err = 0;
- $obj_bmh =& $bmhHandler->get($bmh_id);
+ $obj_bmh =& $xnewsletter->getHandler('xNewsletter_bmh')->get($bmh_id);
$bmh_email = $obj_bmh->getVar("bmh_email");
$sql = "SELECT subscr_id FROM " . $xoopsDB->prefix("mod_xnewsletter_subscr") . " WHERE (";
@@ -60,10 +60,10 @@
$xoopsDB->query($sql_upd_measure);
redirect_header("bmh.php?op=list", 5, _AM_XNEWSLETTER_BMH_ERROR_NO_SUBSCRID);
}
- $obj_subscr =& $subscrHandler->get($subscr_id);
+ $obj_subscr =& $xnewsletter->getHandler('xNewsletter_subscr')->get($subscr_id);
// delete subscriber
- if (!$subscrHandler->delete($obj_subscr,true)) {
+ if (!$xnewsletter->getHandler('xNewsletter_subscr')->delete($obj_subscr,true)) {
$actionprot_err = $obj_subscr->getHtmlErrors()."<br/><br/><br/>";
$count_err++;
}
@@ -71,15 +71,15 @@
//delete subscription
$crit_catsubscr = new CriteriaCompo();
$crit_catsubscr->add(new Criteria('catsubscr_subscrid', $subscr_id));
- $numrows_catsubscr = $catsubscrHandler->getCount($crit_catsubscr);
+ $numrows_catsubscr = $xnewsletter->getHandler('xNewsletter_catsubscr')->getCount($crit_catsubscr);
if ($numrows_catsubscr > 0) {
- $catsubscr_arr = $catsubscrHandler->getall($crit_catsubscr);
+ $catsubscr_arr = $xnewsletter->getHandler('xNewsletter_catsubscr')->getall($crit_catsubscr);
foreach (array_keys($catsubscr_arr) as $cat) {
- $obj_catsubscr =& $catsubscrHandler->get($catsubscr_arr[$cat]->getVar("catsubscr_id"));
- $obj_cat =& $catHandler->get($catsubscr_arr[$cat]->getVar("catsubscr_catid"));
+ $obj_catsubscr =& $xnewsletter->getHandler('xNewsletter_catsubscr')->get($catsubscr_arr[$cat]->getVar("catsubscr_id"));
+ $obj_cat =& $xnewsletter->getHandler('xNewsletter_cat')->get($catsubscr_arr[$cat]->getVar("catsubscr_catid"));
$cat_mailinglist = $obj_cat->getVar("cat_mailinglist");
- if ($catsubscrHandler->delete($obj_catsubscr, true)) {
+ if ($xnewsletter->getHandler('xNewsletter_catsubscr')->delete($obj_catsubscr, true)) {
//handle mailinglists
if ($cat_mailinglist > 0) {
require_once( XOOPS_ROOT_PATH."/modules/xNewsletter/include/mailinglist.php" );
@@ -106,7 +106,7 @@
if ($bmh_id == 0) redirect_header("bmh.php", 3, _AM_XNEWSLETTER_ERROR_NO_VALID_ID);
if ($bmh_measure == 0) redirect_header("bmh.php", 3, _AM_XNEWSLETTER_ERROR_NO_VALID_ID);
- $obj_bmh =& $bmhHandler->get($bmh_id);
+ $obj_bmh =& $xnewsletter->getHandler('xNewsletter_bmh')->get($bmh_id);
if ($obj_bmh->getVar("bmh_measure") == _AM_XNEWSLETTER_BMH_MEASURE_VAL_DELETE ) {
redirect_header("bmh.php?op=list&filter=".$filter."'", 3, _AM_XNEWSLETTER_BMH_MEASURE_ALREADY_DELETED);
@@ -141,11 +141,11 @@
$accounts_crit = new CriteriaCompo();
$accounts_crit->add(new Criteria("accounts_use_bmh", "1"));
- $numrows_acc = $accountsHandler->getCount($accounts_crit);
+ $numrows_acc = $xnewsletter->getHandler('xNewsletter_accounts')->getCount($accounts_crit);
if ($numrows_acc > 0)
{
- $accounts_arr = $accountsHandler->getall($accounts_crit);
+ $accounts_arr = $xnewsletter->getHandler('xNewsletter_accounts')->getall($accounts_crit);
$result_bmh = _AM_XNEWSLETTER_BMH_SUCCESSFUL."<br/>";
foreach (array_keys($accounts_arr) as $acc)
@@ -225,11 +225,11 @@
if ($filter > -1) $criteria->add(new Criteria("bmh_measure", $filter));
$criteria->setSort("bmh_id");
$criteria->setOrder("DESC");
- $numrows = $bmhHandler->getCount($criteria);
+ $numrows = $xnewsletter->getHandler('xNewsletter_bmh')->getCount($criteria);
$start = xNewsletter_CleanVars ( $_REQUEST, 'start', 0, 'int' );
$criteria->setStart($start);
$criteria->setLimit($limit);
- $bmh_arr = $bmhHandler->getall($criteria);
+ $bmh_arr = $xnewsletter->getHandler('xNewsletter_bmh')->getall($criteria);
if ( $numrows > $limit ) {
include_once XOOPS_ROOT_PATH . "/class/pagenav.php";
$pagenav = new XoopsPageNav($numrows, $limit, $start, 'start', 'op=list');
@@ -300,16 +300,16 @@
echo "<td class='center width20'>
<a href='bmh.php?op=handle_bmh&bmh_id=".$i."&bmh_measure="._AM_XNEWSLETTER_BMH_MEASURE_VAL_NOTHING."&filter=".$filter."'>
- <img src=".XNEWSLETTER_ICON."/xn_nothing.png alt='"._AM_XNEWSLETTER_BMH_MEASURE_NOTHING."' title='"._AM_XNEWSLETTER_BMH_MEASURE_NOTHING."' />
+ <img src=".XNEWSLETTER_ICONS_URL."/xn_nothing.png alt='"._AM_XNEWSLETTER_BMH_MEASURE_NOTHING."' title='"._AM_XNEWSLETTER_BMH_MEASURE_NOTHING."' />
</a>
<a href='bmh.php?op=handle_bmh&bmh_id=".$i."&bmh_measure="._AM_XNEWSLETTER_BMH_MEASURE_VAL_QUIT."&filter=".$filter."'>
- <img src=".XNEWSLETTER_ICON."/xn_catsubscr_temp.png alt='"._AM_XNEWSLETTER_BMH_MEASURE_QUIT."' title='"._AM_XNEWSLETTER_BMH_MEASURE_QUIT."' />
+ <img src=".XNEWSLETTER_ICONS_URL."/xn_catsubscr_temp.png alt='"._AM_XNEWSLETTER_BMH_MEASURE_QUIT."' title='"._AM_XNEWSLETTER_BMH_MEASURE_QUIT."' />
</a>
<a href='bmh.php?op=bmh_delsubscr&bmh_id=".$i."&filter=".$filter."'>
- <img src=".XNEWSLETTER_ICON."/xn_quit.png alt='"._AM_XNEWSLETTER_BMH_MEASURE_DELETE."' title='"._AM_XNEWSLETTER_BMH_MEASURE_DELETE."' />
+ <img src=".XNEWSLETTER_ICONS_URL."/xn_quit.png alt='"._AM_XNEWSLETTER_BMH_MEASURE_DELETE."' title='"._AM_XNEWSLETTER_BMH_MEASURE_DELETE."' />
</a>
- <a href='bmh.php?op=edit_bmh&bmh_id=".$i."'><img src=".XNEWSLETTER_ICON."/xn_edit.png alt='"._AM_XNEWSLETTER_BMH_EDIT."' title='"._AM_XNEWSLETTER_BMH_EDIT."' width='16px' /></a>
- <a href='bmh.php?op=delete_bmh&bmh_id=".$i."'><img src=".XNEWSLETTER_ICON."/xn_delete.png alt='"._AM_XNEWSLETTER_BMH_DELETE."' title='"._AM_XNEWSLETTER_BMH_DELETE."' width='16px' /></a>
+ <a href='bmh.php?op=edit_bmh&bmh_id=".$i."'><img src=".XNEWSLETTER_ICONS_URL."/xn_edit.png alt='"._AM_XNEWSLETTER_BMH_EDIT."' title='"._AM_XNEWSLETTER_BMH_EDIT."' width='16px' /></a>
+ <a href='bmh.php?op=delete_bmh&bmh_id=".$i."'><img src=".XNEWSLETTER_ICONS_URL."/xn_delete.png alt='"._AM_XNEWSLETTER_BMH_DELETE."' title='"._AM_XNEWSLETTER_BMH_DELETE."' width='16px' /></a>
</td>";
echo "</tr>";
}
@@ -341,7 +341,7 @@
redirect_header("bmh.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
}
- $obj =& $bmhHandler->get($bmh_id);
+ $obj =& $xnewsletter->getHandler('xNewsletter_bmh')->get($bmh_id);
//Form bmh_rule_no
$obj->setVar("bmh_rule_no", xNewsletter_CleanVars( $_REQUEST, "bmh_rule_no", "", "string") );
@@ -362,7 +362,7 @@
//Form bmh_created
$obj->setVar("bmh_created", xNewsletter_CleanVars( $_REQUEST, "bmh_created", 0, "int") );
- if ($bmhHandler->insert($obj)) {
+ if ($xnewsletter->getHandler('xNewsletter_bmh')->insert($obj)) {
redirect_header("bmh.php?op=list", 2, _AM_XNEWSLETTER_FORMOK);
}
echo $obj->getHtmlErrors();
@@ -374,18 +374,18 @@
echo $indexAdmin->addNavigation("bmh.php");
$indexAdmin->addItemButton(_AM_XNEWSLETTER_BMHLIST, 'bmh.php?op=list', 'list');
echo $indexAdmin->renderButton();
- $obj = $bmhHandler->get($bmh_id);
+ $obj = $xnewsletter->getHandler('xNewsletter_bmh')->get($bmh_id);
$form = $obj->getForm();
$form->display();
break;
case "delete_bmh":
- $obj =& $bmhHandler->get($bmh_id);
+ $obj =& $xnewsletter->getHandler('xNewsletter_bmh')->get($bmh_id);
if (isset($_POST["ok"]) && $_POST...
[truncated message content] |
|
From: <luc...@us...> - 2014-04-05 02:54:27
|
Revision: 12421
http://sourceforge.net/p/xoops/svn/12421
Author: luciorota
Date: 2014-04-05 02:54:22 +0000 (Sat, 05 Apr 2014)
Log Message:
-----------
standardization: fixed some errors
Modified Paths:
--------------
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_subscr.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/common.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/config.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/index.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/letter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/subscription.php
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_subscr.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_subscr.php 2014-04-03 13:51:04 UTC (rev 12420)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_subscr.php 2014-04-05 02:54:22 UTC (rev 12421)
@@ -228,7 +228,7 @@
//$form->addElement(new XoopsFormSelectUser(_AM_XNEWSLETTER_SUBSCR_SUBMITTER, "subscr_submitter", false, $this->getVar("subscr_submitter"), 1, false), true);
if ( $this->getVar("subscr_id") > 0 ) {
- $form->addElement(new XoopsFormLabel(_AM_XNEWSLETTER_SUBSCR_CREATED, formatTimestamp($this->getVar("subscr_created"), $xnewsletter->getConfig('dateformat')) . " [" . $this->getVar("subscr_ip") . "]"));
+ $form->addElement(new XoopsFormLabel(_AM_XNEWSLETTER_SUBSCR_CREATED, formatTimestamp($this->getVar("subscr_created"), $this->xnewsletter->getConfig('dateformat')) . " [" . $this->getVar("subscr_ip") . "]"));
$form->addElement(new XoopsFormHidden('subscr_created', $this->getVar("subscr_created")));
$form->addElement(new XoopsFormHidden('subscr_ip', $this->getVar("subscr_ip")));
} else {
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/common.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/common.php 2014-04-03 13:51:04 UTC (rev 12420)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/common.php 2014-04-05 02:54:22 UTC (rev 12421)
@@ -35,6 +35,7 @@
//include_once XOOPS_ROOT_PATH . '/class/tree.php';
//include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
+ include_once XNEWSLETTER_ROOT_PATH . '/include/config.php'; // IN PROGRESS
include_once XNEWSLETTER_ROOT_PATH . '/include/functions.php';
include_once XNEWSLETTER_ROOT_PATH . '/include/constants.php';
include_once XNEWSLETTER_ROOT_PATH . '/class/session.php'; // xNewsletterSession class
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/config.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/config.php 2014-04-03 13:51:04 UTC (rev 12420)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/config.php 2014-04-05 02:54:22 UTC (rev 12421)
@@ -30,12 +30,6 @@
die("XOOPS root path not defined");
}
-$dirname = basename( dirname(dirname(__FILE__)));
-define("XNEWSLETTER_DIRNAME", $dirname);
-define("XNEWSLETTER_PATH", XOOPS_ROOT_PATH . "/modules/" . XNEWSLETTER_DIRNAME);
-define("XNEWSLETTER_URL", XOOPS_URL . "/modules/" . XNEWSLETTER_DIRNAME);
-define("XNEWSLETTER_ICONS_URL", XNEWSLETTER_URL . '/images/icons');
-
// module information
$moduleImageUrl = XNEWSLETTER_URL . "/images/xNewsletter.png";
$moduleCopyrightHtml = ""; //"<br /><br /><a href='' title='' target='_blank'><img src='{$moduleImageUrl}' alt='' /></a>";
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/index.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/index.php 2014-04-03 13:51:04 UTC (rev 12420)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/index.php 2014-04-05 02:54:22 UTC (rev 12421)
@@ -133,7 +133,7 @@
$cat_ids = explode('|' , $letterObj->getVar('letter_cats'));
foreach ($cat_ids as $cat_id) {
$catObj = $xnewsletter->getHandler('xNewsletter_cat')->get($cat_id);
- if ($gperm_handler->checkRight('newsletter_read_cat', $catObj->getVar('cat_id'), $groups, $xnewsletter->getModule->mid())) {
+ if ($gperm_handler->checkRight('newsletter_read_cat', $catObj->getVar('cat_id'), $groups, $xnewsletter->getModule()->mid())) {
$catsAvailableCount++;
unset($letter_array['letter_cats']);
$letter_array['letter_cats'][] = $catObj->toArray();
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/letter.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/letter.php 2014-04-03 13:51:04 UTC (rev 12420)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/letter.php 2014-04-05 02:54:22 UTC (rev 12421)
@@ -106,7 +106,7 @@
$catObjs = $xnewsletter->getHandler('xNewsletter_cat')->getAll($criteria_cats, null, true, true);
// cats table
foreach ($catObjs as $cat_id => $catObj) {
- $permissionShowCats[$cat_id] = $gperm_handler->checkRight('newsletter_list_cat', $cat_id, $groups, $xnewsletter->getModule->mid());
+ $permissionShowCats[$cat_id] = $gperm_handler->checkRight('newsletter_list_cat', $cat_id, $groups, $xnewsletter->getModule()->mid());
if ($permissionShowCats[$cat_id] == true) {
$cat_array = $catObj->toArray();
$criteria_catsubscrs = new CriteriaCompo();
@@ -298,7 +298,7 @@
unset($letter_array['letter_cats']); // IN PROGRESS
foreach ($cat_ids as $cat_id) {
$catObj = $xnewsletter->getHandler('xNewsletter_cat')->get($cat_id);
- if ($gperm_handler->checkRight('newsletter_read_cat', $catObj->getVar('cat_id'), $groups, $xnewsletter->getModule->mid())) {
+ if ($gperm_handler->checkRight('newsletter_read_cat', $catObj->getVar('cat_id'), $groups, $xnewsletter->getModule()->mid())) {
$catsAvailableCount++;
$letter_array['letter_cats'][] = $catObj->toArray();
}
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/subscription.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/subscription.php 2014-04-03 13:51:04 UTC (rev 12420)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/subscription.php 2014-04-05 02:54:22 UTC (rev 12421)
@@ -52,8 +52,8 @@
$op = 'delete_subscription';
}
if ($op == 'unsub') {
+ $op = 'list_subscriptions';
$xoopsOption['template_main'] = 'xnewsletter_subscription.html';
- $op = 'list_subscriptions';
$_SESSION['redirect_mail'] = xNewsletter_CleanVars($_REQUEST, 'email', '', 'string');
$_SESSION['unsub'] = '1';
}
@@ -168,7 +168,7 @@
if ($subscr_email == '') {
redirect_header($currentFile, 3, _MA_XNEWSLETTER_SUBSCRIPTION_ERROR_NOEMAIL);
}
- if (!checkEmail($subscr_email))
+ if (!xNewsletter_checkEmail($subscr_email))
redirect_header($currentFile, 3, _MA_XNEWSLETTER_SUBSCRIPTION_ERROR_NOEMAIL);
@@ -593,7 +593,7 @@
}
}
- if ((isset($_POST['ok']) && $_POST['ok'] == 1) || $activationKey) {
+ if ((isset($_POST['ok']) && $_POST['ok'] == true) || $activationKey) {
$count_err = 0;
$actionProts_error = '';
@@ -637,7 +637,8 @@
}
if ($valid) {
- $sql = "SELECT subscr_id FROM {$xoopsDB->prefix("mod_xnewsletter_subscr")}";
+ $sql = "SELECT subscr_id";
+ $sql.= " FROM {$xoopsDB->prefix("mod_xnewsletter_subscr")}";
$sql.= " WHERE (subscr_email='{$subscr_email}' AND subscr_id={$subscr_id}";
if ($activationKey)
$sql .= " AND subscr_actkey='{$code}'";
@@ -661,9 +662,9 @@
//delete subscription
$criteria_catsubscr = new CriteriaCompo();
$criteria_catsubscr->add(new Criteria('catsubscr_subscrid', $subscr_id));
- $numrows_catsubscr = $xnewsletter->getHandler('xNewsletter_catsubscr')->getCount($criteria_catsubscr);
+ $catsubscrCount = $xnewsletter->getHandler('xNewsletter_catsubscr')->getCount($criteria_catsubscr);
- if ($numrows_catsubscr > 0) {
+ if ($catsubscrCount > 0) {
$catsubscrObjs = $xnewsletter->getHandler('xNewsletter_catsubscr')->getall($criteria_catsubscr);
foreach (array_keys($catsubscrObjs) as $cat) {
$catsubscrObj =& $xnewsletter->getHandler('xNewsletter_catsubscr')->get($catsubscrObjs[$cat]->getVar("catsubscr_id"));
@@ -693,12 +694,12 @@
echo $actionProts_error;
}
} else {
- if (!$GLOBALS["xoopsSecurity"]->check()) {
- redirect_header('subscr.php', 3, implode(',', $GLOBALS["xoopsSecurity"]->getErrors()));
+ if (!$GLOBALS['xoopsSecurity']->check()) {
+ redirect_header('subscr.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
$subscrObj =& $xnewsletter->getHandler('xNewsletter_subscr')->get($subscr_id);
- $subscrObj->setVar("subscr_actkey", xoops_makepass());
+ $subscrObj->setVar('subscr_actkey', xoops_makepass());
if (!$xnewsletter->getHandler('xNewsletter_subscr')->insert($subscrObj)) {
redirect_header($currentFile, 2, _MA_XNEWSLETTER_SUBSCRIPTION_ERROR);
}
@@ -729,7 +730,7 @@
}
} else {
$subscrObj =& $xnewsletter->getHandler('xNewsletter_subscr')->get($subscr_id);
- xoops_confirm(array("ok" => 1, "subscr_id" => $subscr_id, "subscr_email" => $subscr_email, "op" => "delete_subscription"), $currentFile, sprintf(_MA_XNEWSLETTER_SUBSCRIPTION_DELETE_SURE));
+ xoops_confirm(array('ok' => true, 'subscr_id' => $subscr_id, 'subscr_email' => $subscr_email, 'op' => 'delete_subscription'), $currentFile, sprintf(_MA_XNEWSLETTER_SUBSCRIPTION_DELETE_SURE));
}
break;
@@ -758,7 +759,7 @@
$subscr_email = xNewsletter_CleanVars($_REQUEST, 'subscr_email', '', 'string');
if ($subscr_email != '') {
// existing email from search form
- if (!checkEmail($subscr_email))
+ if (!xNewsletter_checkEmail($subscr_email))
redirect_header($currentFile, 3, _MA_XNEWSLETTER_SUBSCRIPTION_ERROR_NOEMAIL);
xoops_load("captcha");
$xoopsCaptcha = XoopsCaptcha::getinstance();
@@ -769,7 +770,7 @@
$showSubscrSearchForm = false;
}
} elseif (is_object($xoopsUser) && isset($xoopsUser)) {
- // take actual xoops user
+ // take actual xoops user email
$subscr_email = $xoopsUser->email();
$showSubscrSearchForm = false;
} else {
@@ -780,7 +781,7 @@
$xoopsTpl->assign('showSubscrSearchForm', $showSubscrSearchForm);
if ($showSubscrSearchForm) {
// show form search
- $subscrObj =& $xnewsletter->getHandler('xNewsletter_subscr')->create();
+ $subscrObj = $xnewsletter->getHandler('xNewsletter_subscr')->create();
$redirect_mail = (isset($_SESSION['redirect_mail'])) ? $_SESSION['redirect_mail'] : '';
if ($redirect_mail != '') {
$subscrObj->setVar('subscr_email', $redirect_mail);
@@ -803,8 +804,8 @@
// look for existing subscriptions
$criteria_subscr = new CriteriaCompo();
$criteria_subscr->add(new Criteria('subscr_email', $subscr_email));
- $criteria_subscr->setSort("subscr_id");
- $criteria_subscr->setOrder("ASC");
+ $criteria_subscr->setSort('subscr_id');
+ $criteria_subscr->setOrder('ASC');
$subscrCount = $xnewsletter->getHandler('xNewsletter_subscr')->getCount($criteria_subscr);
$xoopsTpl->assign('subscrCount', $subscrCount);
|
|
From: <luc...@us...> - 2014-04-07 19:14:45
|
Revision: 12433
http://sourceforge.net/p/xoops/svn/12433
Author: luciorota
Date: 2014-04-07 19:14:42 +0000 (Mon, 07 Apr 2014)
Log Message:
-----------
fixed bugs in xoops_version.php
improved footer
Modified Paths:
--------------
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_accounts.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_attachment.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_bmh.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_cat.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_catsubscr.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_import.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_letter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_mailinglist.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_protocol.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_subscr.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_task.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/css/module.css
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/footer.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/subscription.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_footer.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/xoops_version.php
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_accounts.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_accounts.php 2014-04-07 10:58:17 UTC (rev 12432)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_accounts.php 2014-04-07 19:14:42 UTC (rev 12433)
@@ -26,10 +26,8 @@
* ****************************************************************************
*/
-if (!defined("XOOPS_ROOT_PATH")) {
- die("XOOPS root path not defined");
-}
-
+defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
+include_once dirname(dirname(__FILE__)) . '/include/common.php';
class xnewsletter_accounts extends XoopsObject
{
public $xnewsletter = null;
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_attachment.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_attachment.php 2014-04-07 10:58:17 UTC (rev 12432)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_attachment.php 2014-04-07 19:14:42 UTC (rev 12433)
@@ -26,10 +26,8 @@
* ****************************************************************************
*/
-if (!defined("XOOPS_ROOT_PATH")) {
- die("XOOPS root path not defined");
-}
-
+defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
+include_once dirname(dirname(__FILE__)) . '/include/common.php';
class xnewsletter_attachment extends XoopsObject
{
public $xnewsletter = null;
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_bmh.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_bmh.php 2014-04-07 10:58:17 UTC (rev 12432)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_bmh.php 2014-04-07 19:14:42 UTC (rev 12433)
@@ -26,10 +26,8 @@
* ****************************************************************************
*/
-if (!defined("XOOPS_ROOT_PATH")) {
- die("XOOPS root path not defined");
-}
-
+defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
+include_once dirname(dirname(__FILE__)) . '/include/common.php';
class xnewsletter_bmh extends XoopsObject
{
public $xnewsletter = null;
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_cat.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_cat.php 2014-04-07 10:58:17 UTC (rev 12432)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_cat.php 2014-04-07 19:14:42 UTC (rev 12433)
@@ -26,10 +26,8 @@
* ****************************************************************************
*/
-if (!defined("XOOPS_ROOT_PATH")) {
- die("XOOPS root path not defined");
-}
-
+defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
+include_once dirname(dirname(__FILE__)) . '/include/common.php';
class xnewsletter_cat extends XoopsObject
{
/**
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_catsubscr.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_catsubscr.php 2014-04-07 10:58:17 UTC (rev 12432)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_catsubscr.php 2014-04-07 19:14:42 UTC (rev 12433)
@@ -26,10 +26,8 @@
* ****************************************************************************
*/
-if (!defined("XOOPS_ROOT_PATH")) {
- die("XOOPS root path not defined");
-}
-
+defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
+include_once dirname(dirname(__FILE__)) . '/include/common.php';
class xnewsletter_catsubscr extends XoopsObject
{
public $xnewsletter = null;
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_import.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_import.php 2014-04-07 10:58:17 UTC (rev 12432)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_import.php 2014-04-07 19:14:42 UTC (rev 12433)
@@ -26,10 +26,8 @@
* ****************************************************************************
*/
-if (!defined("XOOPS_ROOT_PATH")) {
- die("XOOPS root path not defined");
-}
-
+defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
+include_once dirname(dirname(__FILE__)) . '/include/common.php';
class xnewsletter_import extends XoopsObject
{
public $xnewsletter = null;
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_letter.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_letter.php 2014-04-07 10:58:17 UTC (rev 12432)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_letter.php 2014-04-07 19:14:42 UTC (rev 12433)
@@ -26,10 +26,8 @@
* ****************************************************************************
*/
-if (!defined("XOOPS_ROOT_PATH")) {
- die("XOOPS root path not defined");
-}
-
+defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
+include_once dirname(dirname(__FILE__)) . '/include/common.php';
class xnewsletter_letter extends XoopsObject
{
public $xnewsletter = null;
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_mailinglist.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_mailinglist.php 2014-04-07 10:58:17 UTC (rev 12432)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_mailinglist.php 2014-04-07 19:14:42 UTC (rev 12433)
@@ -26,10 +26,8 @@
* ****************************************************************************
*/
-if (!defined("XOOPS_ROOT_PATH")) {
- die("XOOPS root path not defined");
-}
-
+defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
+include_once dirname(dirname(__FILE__)) . '/include/common.php';
class xnewsletter_mailinglist extends XoopsObject
{
public $xnewsletter = null;
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_protocol.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_protocol.php 2014-04-07 10:58:17 UTC (rev 12432)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_protocol.php 2014-04-07 19:14:42 UTC (rev 12433)
@@ -26,10 +26,8 @@
* ****************************************************************************
*/
-if (!defined("XOOPS_ROOT_PATH")) {
- die("XOOPS root path not defined");
-}
-
+defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
+include_once dirname(dirname(__FILE__)) . '/include/common.php';
class xnewsletter_protocol extends XoopsObject
{
public $xnewsletter = null;
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_subscr.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_subscr.php 2014-04-07 10:58:17 UTC (rev 12432)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_subscr.php 2014-04-07 19:14:42 UTC (rev 12433)
@@ -26,10 +26,8 @@
* ****************************************************************************
*/
-if (!defined("XOOPS_ROOT_PATH")) {
- die("XOOPS root path not defined");
-}
-
+defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
+include_once dirname(dirname(__FILE__)) . '/include/common.php';
class xnewsletter_subscr extends XoopsObject
{
public $xnewsletter = null;
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_task.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_task.php 2014-04-07 10:58:17 UTC (rev 12432)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_task.php 2014-04-07 19:14:42 UTC (rev 12433)
@@ -20,10 +20,8 @@
* @version $Id: xNewsletter_task.php 000000 2012-07-13 10:41:41Z txmodxoops $
*/
-if (!defined("XOOPS_ROOT_PATH")) {
- die("XOOPS root path not defined");
-}
-
+defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
+include_once dirname(dirname(__FILE__)) . '/include/common.php';
class xnewsletter_task extends XoopsObject
{
public $xnewsletter = null;
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/css/module.css
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/css/module.css 2014-04-07 10:58:17 UTC (rev 12432)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/css/module.css 2014-04-07 19:14:42 UTC (rev 12433)
@@ -72,6 +72,7 @@
display: block;
}
+.xnewsletter_footerlinks,
.xnewsletter_adminlinks {
padding-top: 15px;
padding-bottom: 5px;
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/footer.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/footer.php 2014-04-07 10:58:17 UTC (rev 12432)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/footer.php 2014-04-07 19:14:42 UTC (rev 12433)
@@ -18,6 +18,28 @@
* @author Xoops Development Team
* @version svn:$id$
*/
+$showEdit = false;
+$showCreate = false;
+$showList = true;
+
+if (is_object($xoopsUser) && isset($xoopsUser)) {
+ if (is_object($xoopsModule)) {
+ $mid = $xnewsletter->getModule()->mid();
+ $my_group_ids = $member_handler->getGroupsByUser($xoopsUser->uid());
+
+ $cat_criteria = new CriteriaCompo();
+ $cat_criteria->setSort('cat_id');
+ $cat_criteria->setOrder('ASC');
+ $catObjs = $xnewsletter->getHandler('xNewsletter_cat')->getAll($cat_criteria);
+ foreach ($catObjs as $catObj) {
+ if ($gperm_handler->checkRight('newsletter_create_cat', $catObj->getVar('cat_id'), $my_group_ids, $mid) == true)
+ $showCreate = true;
+ if ($gperm_handler->checkRight('newsletter_list_cat', $catObj->getVar('cat_id'), $my_group_ids, $mid) == true)
+ $showList = true;
+ }
+ }
+}
+
// copyright
$xoopsTpl->assign('copyright', $moduleCopyrightHtml); // this definition is not removed for backward compatibility issues
$xoopsTpl->assign('copyright_code', $moduleCopyrightHtml); // include/config.php
@@ -31,5 +53,8 @@
}
$xoopsTpl->assign('isAdmin', xNewsletter_userIsAdmin());
+$xoopsTpl->assign('showCreate', $showCreate);
+$xoopsTpl->assign('showList', $showList);
+
include_once XOOPS_ROOT_PATH . '/footer.php';
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/subscription.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/subscription.php 2014-04-07 10:58:17 UTC (rev 12432)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/subscription.php 2014-04-07 19:14:42 UTC (rev 12433)
@@ -157,9 +157,9 @@
}
} else {
// user not logged in
+ // NOP
}
-
if (!$activationKey) {
// activation key doesn't exist
if (!$GLOBALS["xoopsSecurity"]->check()) {
@@ -193,7 +193,6 @@
$code_selections .= $old_catsubcr_quited;
}
-
// save subscriber first
if ($subscr_id > 0) {
$subscrObj =& $xnewsletter->getHandler('xNewsletter_subscr')->get($subscr_id);
@@ -232,8 +231,6 @@
$subscrObj->setVar('subscr_activated', 0);
}
-
-
if ($activationKey || $allowedWithoutActivationKey) {
// subscr_firstname
$subscrObj->setVar('subscr_firstname', xNewsletter_CleanVars($_REQUEST, 'subscr_firstname', '', 'string'));
@@ -255,8 +252,6 @@
$subscrObj->setVar('subscr_actoptions', serialize($code_options));
}
-
-
if ($xnewsletter->getHandler('xNewsletter_subscr')->insert($subscrObj)) {
if ($subscr_id < 1) {
$actionProts_ok[] = _MA_XNEWSLETTER_SUBSCRIPTION_REG_OK;
@@ -266,10 +261,10 @@
$subscr_id = $subscrObj->getVar('subscr_id');
if ($allowedWithoutActivationKey) {
- $valid = true;
+ $isValid = true;
$cat_selections = explode('|', $code_selections);
} else {
- $valid = false;
+ $isValid = false;
$xoopsMailer =& xoops_getMailer();
$xoopsMailer->reset();
$xoopsMailer->setTemplateDir();
@@ -302,51 +297,53 @@
} else {
// activation key exist
$activationKey_array = explode('||', base64_decode($activationKey));
- $valid = false;
+ $isValid = false;
if ($activationKey_array[0] == XOOPS_URL) { // from here
if (trim($activationKey_array[1]) != '') { // savetype ok
if ((int)$activationKey_array[2] > 0) { // user is ok
if (trim($activationKey_array[3]) != '') {
- $valid = true;
+ $isValid = true;
}
}
}
}
- if ($valid === false) redirect_header($currentFile, 5, _MA_XNEWSLETTER_SUBSCRIPTION_ERROR_INVALIDKEY);
+ if (!$isValid) {
+ redirect_header($currentFile, 5, _MA_XNEWSLETTER_SUBSCRIPTION_ERROR_INVALIDKEY);
+ } else {
+ $saveType = trim($activationKey_array[1]);
+ $subscr_id = (int)$activationKey_array[2];
+ $subscr_actkey = trim($activationKey_array[3]);
- $saveType = trim($activationKey_array[1]);
- $subscr_id = (int)$activationKey_array[2];
- $subscr_actkey = trim($activationKey_array[3]);
+ //check given data with table subscr
+ $criteria_subscr = new CriteriaCompo();
+ $criteria_subscr->add(new Criteria('subscr_id', $subscr_id));
+ $criteria_subscr->add(new Criteria('subscr_actkey', $subscr_actkey));
+ $subscrCount = $xnewsletter->getHandler('xNewsletter_subscr')->getCount($criteria_subscr);
+ if ($subscrCount == 0)
+ redirect_header($currentFile, 5, _MA_XNEWSLETTER_SUBSCRIPTION_ERROR_NODATAKEY);
- //check given data with table subscr
- $criteria_subscr = new CriteriaCompo();
- $criteria_subscr->add(new Criteria('subscr_id', $subscr_id));
- $criteria_subscr->add(new Criteria('subscr_actkey', $subscr_actkey));
- $subscrCount = $xnewsletter->getHandler('xNewsletter_subscr')->getCount($criteria_subscr);
- if ($subscrCount == 0)
- redirect_header($currentFile, 5, _MA_XNEWSLETTER_SUBSCRIPTION_ERROR_NODATAKEY);
-
- //read data from table subscr
- $subscrObj =& $xnewsletter->getHandler('xNewsletter_subscr')->get($subscr_id);
- $actoptions = unserialize(trim($subscrObj->getVar('subscr_actoptions', 'N')));
- //format subscr_actoptions:selected_newsletters||firstname||lastname||sex||date||ip
- $cat_selections = explode('|', trim($actoptions[0]));
- $subscr_firstname = trim($actoptions[1]);
- $subscr_lastname = trim($actoptions[2]);
- $subscr_sex = trim($actoptions[3]);
- if ((int)$actoptions[4] < time() - 86400) { //Zeit checken -> 24 Stunden ??
- //Zeit abgelaufen
- $subscrObj->setVar('subscr_actkey', '');
- $subscrObj->setVar('subscr_actoptions', '');
- $xnewsletter->getHandler('xNewsletter_subscr')->insert($subscrObj);
- redirect_header($currentFile, 5, _MA_XNEWSLETTER_SUBSCRIPTION_ERROR_NODATAKEY);
+ //read data from table subscr
+ $subscrObj =& $xnewsletter->getHandler('xNewsletter_subscr')->get($subscr_id);
+ $actoptions = unserialize(trim($subscrObj->getVar('subscr_actoptions', 'N')));
+ //format subscr_actoptions:selected_newsletters||firstname||lastname||sex||date||ip
+ $cat_selections = explode('|', trim($actoptions[0]));
+ $subscr_firstname = trim($actoptions[1]);
+ $subscr_lastname = trim($actoptions[2]);
+ $subscr_sex = trim($actoptions[3]);
+ if ((int)$actoptions[4] < time() - 86400) { //Zeit checken -> 24 Stunden ??
+ //Zeit abgelaufen
+ $subscrObj->setVar('subscr_actkey', '');
+ $subscrObj->setVar('subscr_actoptions', '');
+ $xnewsletter->getHandler('xNewsletter_subscr')->insert($subscrObj);
+ redirect_header($currentFile, 5, _MA_XNEWSLETTER_SUBSCRIPTION_ERROR_NODATAKEY);
+ }
}
}
- if ($valid) {
+ if ($isValid) {
// update xnewsletter_subscr
$subscrObj =& $xnewsletter->getHandler('xNewsletter_subscr')->get($subscr_id);
if (!$allowedWithoutActivationKey) {
@@ -376,7 +373,6 @@
$actionProts_ok[] = _MA_XNEWSLETTER_SUBSCRIPTION_REG_UPDATE_CLOSED;
}
}
-
// handle current selections
foreach ($cat_selections as $sel) {
$selection = array();
@@ -386,11 +382,9 @@
$catsubcr = $selection[1];
$catsubcr_id_old = (int)$selection[2];
$catsubcr_quited_old = (int)$selection[3];
-
- $obj_cat = $xnewsletter->getHandler('xNewsletter_cat')->get($cat_id);
- $cat_mailinglist = $obj_cat->getVar('cat_mailinglist');
- $cat_name = $obj_cat->getVar('cat_name');
-
+ $catObj = $xnewsletter->getHandler('xNewsletter_cat')->get($cat_id);
+ $cat_mailinglist = $catObj->getVar('cat_mailinglist');
+ $cat_name = $catObj->getVar('cat_name');
if ($catsubcr == '1' && $catsubcr_id_old == 0) {
// subscribe
$catsubscrObj = $xnewsletter->getHandler('xNewsletter_catsubscr')->create();
@@ -402,8 +396,7 @@
$catsubscrObj->setVar("catsubscr_submitter", $submitterUid);
//Form catsubscr_submitter
$catsubscrObj->setVar("catsubscr_created", time());
-
- if ($xnewsletter->getHandler('xNewsletter_catsubscr')->insert($obj_catsubscr)) {
+ if ($xnewsletter->getHandler('xNewsletter_catsubscr')->insert($catsubscrObj)) {
$count_ok++;
if ($catsubcr_id_old > 0) {
$actionProts_ok[] = str_replace("%nl", $cat_name, _MA_XNEWSLETTER_SUBSCRIPTION_PROT_NO_CHANGE);
@@ -422,7 +415,7 @@
} elseif ($catsubcr == '0' && $catsubcr_id_old > 0) {
// unsubscribe / delete old subscription
$catsubscrObj = $xnewsletter->getHandler('xNewsletter_catsubscr')->get($catsubcr_id_old);
- if ($xnewsletter->getHandler('xNewsletter_catsubscr')->delete($obj_catsubscr, true)) {
+ if ($xnewsletter->getHandler('xNewsletter_catsubscr')->delete($catsubscrObj, true)) {
//handle mailinglists
if ($cat_mailinglist > 0) {
require_once(XOOPS_ROOT_PATH . "/modules/xNewsletter/include/mailinglist.php");
@@ -437,14 +430,13 @@
redirect_header($currentFile, 3, _AM_XNEWSLETTER_FORMDELNOTOK);
}
$actionProts_ok[] = str_replace ("%nl", $cat_name, _MA_XNEWSLETTER_SUBSCRIPTION_PROT_UNSUBSCRIBE);
-
} elseif ($catsubcr_id_old > 0 && $catsubcr_quited_old > 0) {
// newsletter stay selected, but catsubscr_quited will be removed
$catsubscrObj = $xnewsletter->getHandler('xNewsletter_catsubscr')->get($catsubcr_id_old);
//Form catsubscr_quited
$catsubscrObj->setVar('catsubscr_quited', '0');
- if ($xnewsletter->getHandler('xNewsletter_catsubscr')->insert($obj_catsubscr)) {
+ if ($xnewsletter->getHandler('xNewsletter_catsubscr')->insert($catsubscrObj)) {
$count_ok++;
$actionProts_ok[] = str_replace ("%nl", $cat_name, _MA_XNEWSLETTER_SUBSCRIPTION_PROT_DAT_QUITED_REMOVED);
} else {
@@ -615,7 +607,7 @@
if ($activationKey || $allowedWithoutActivationKey) {
// got actkey or user is allowed to delete without actkey
- $valid = false;
+ $isValid = false;
if ($activationKey) {
$activationKey_array = explode('||', base64_decode($activationKey));
if ($activationKey_array[0] == XOOPS_URL) {
@@ -624,19 +616,19 @@
// user is ok
if (trim($activationKey_array[2]) != '')
// code ok
- $valid = true;
+ $isValid = true;
}
}
- if ($valid) {
+ if ($isValid) {
$subscr_id = (int)$activationKey_array[1];
$code = trim($activationKey_array[2]);
$subscr_email = trim($activationKey_array[3]);
}
} elseif ($allowedWithoutActivationKey) {
- $valid = true;
+ $isValid = true;
}
- if ($valid) {
+ if ($isValid) {
$sql = "SELECT subscr_id";
$sql.= " FROM {$xoopsDB->prefix("mod_xnewsletter_subscr")}";
$sql.= " WHERE (subscr_email='{$subscr_email}' AND subscr_id={$subscr_id}";
@@ -668,10 +660,10 @@
$catsubscrObjs = $xnewsletter->getHandler('xNewsletter_catsubscr')->getall($criteria_catsubscr);
foreach (array_keys($catsubscrObjs) as $cat) {
$catsubscrObj =& $xnewsletter->getHandler('xNewsletter_catsubscr')->get($catsubscrObjs[$cat]->getVar("catsubscr_id"));
- $obj_cat =& $xnewsletter->getHandler('xNewsletter_cat')->get($catsubscrObjs[$cat]->getVar("catsubscr_catid"));
- $cat_mailinglist = $obj_cat->getVar("cat_mailinglist");
+ $catObj = $xnewsletter->getHandler('xNewsletter_cat')->get($catsubscrObjs[$cat]->getVar("catsubscr_catid"));
+ $cat_mailinglist = $catObj->getVar("cat_mailinglist");
- if ($xnewsletter->getHandler('xNewsletter_catsubscr')->delete($obj_catsubscr, true)) {
+ if ($xnewsletter->getHandler('xNewsletter_catsubscr')->delete($catsubscrObj, true)) {
//handle mailinglists
if ($cat_mailinglist > 0) {
require_once( XOOPS_ROOT_PATH . "/modules/xNewsletter/include/mailinglist.php");
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_footer.html
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_footer.html 2014-04-07 10:58:17 UTC (rev 12432)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_footer.html 2014-04-07 19:14:42 UTC (rev 12433)
@@ -12,10 +12,28 @@
<{$copyright_code}>
</div>
+<div class="xnewsletter_adminlinks">
+ <a href='<{$smarty.const.XNEWSLETTER_URL}>/subscription.php?op=list_subscriptions'>
+ <{$smarty.const._MI_XNEWSLETTER_SUBSCRIBE}>
+ </a>
+ <a href='<{$smarty.const.XNEWSLETTER_URL}>/letter.php?op=list_letters'>
+ <{$smarty.const._MI_XNEWSLETTER_LIST}>
+ </a>
+<{if $showCreate == true}>
+ <a href='<{$smarty.const.XNEWSLETTER_URL}>/letter.php?op=new_letter'>
+ <{$smarty.const._MI_XNEWSLETTER_CREATE}>
+ </a>
+<{/if}>
+<{if $showList == true}>
+ <a href='<{$smarty.const.XNEWSLETTER_URL}>/letter.php?op=list_subscrs'>
+ <{$smarty.const._MI_XNEWSLETTER_LIST_SUBSCR}>
+ </a>
+<{/if}>
+</div>
+<div class="xnewsletter_adminlinks">
<{if $isAdmin == true}>
-<div class="xnewsletter_adminlinks">
<a href='<{$smarty.const.XNEWSLETTER_URL}>/admin/index.php'>
<{$smarty.const._MA_XNEWSLETTER_ADMIN}>
</a>
+<{/if}>
</div>
-<{/if}>
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/xoops_version.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/xoops_version.php 2014-04-07 10:58:17 UTC (rev 12432)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/xoops_version.php 2014-04-07 19:14:42 UTC (rev 12433)
@@ -126,17 +126,19 @@
// Menu
global $xoopsUser;
-include_once XOOPS_ROOT_PATH . "/modules/{$modversion['dirname']}/include/common.php";
$modversion['hasMain'] = true;
$subcount = 1;
-$modversion['sub'][$subcount]['name'] = _MI_XNEWSLETTER_SUBSCRIBE ;
-$modversion['sub'][$subcount++]['url'] = "subscription.php?op=list_subscriptions" ;
+$modversion['sub'][$subcount]['name'] = _MI_XNEWSLETTER_SUBSCRIBE;
+$modversion['sub'][$subcount++]['url'] = "subscription.php?op=list_subscriptions";
+$modversion['sub'][$subcount]['name'] = _MI_XNEWSLETTER_LIST;
+$modversion['sub'][$subcount++]['url'] = "index.php?op=list_letters";
+
$showEdit = false;
$showCreate = false;
-$showList = false;
+$showList = true;
if (is_object($xoopsUser) && isset($xoopsUser)) {
$gperm_handler = xoops_gethandler('groupperm');
@@ -153,35 +155,22 @@
$cat_criteria->setOrder('ASC');
$catObjs = $catHandler->getAll($cat_criteria);
foreach ($catObjs as $catObj) {
- $show = $gperm_handler->checkRight('newsletter_create_cat', $catObj->getVar('cat_id'), $my_group_ids, $mid);
- if ($show == true)
+ if ($gperm_handler->checkRight('newsletter_create_cat', $catObj->getVar('cat_id'), $my_group_ids, $mid) == true)
$showCreate = true;
- }
- foreach ($catObjs as $catObj) {
- $show = $gperm_handler->checkRight('newsletter_list_cat', $catObj->getVar('cat_id'), $my_group_ids, $mid);
- if ($show == true)
+ if ($gperm_handler->checkRight('newsletter_list_cat', $catObj->getVar('cat_id'), $my_group_ids, $mid) == true)
$showList = true;
}
if ($showCreate == true) {
- $modversion['sub'][$subcount]['name'] = _MI_XNEWSLETTER_LIST ;
- $modversion['sub'][$subcount++]['url'] = "letter.php?op=list_letters" ;
- $modversion['sub'][$subcount]['name'] = _MI_XNEWSLETTER_CREATE ;
- $modversion['sub'][$subcount++]['url'] = "letter.php?op=new_letter" ;
- } else {
- $modversion['sub'][$subcount]['name'] = _MI_XNEWSLETTER_LIST ;
- $modversion['sub'][$subcount++]['url'] = "index.php?op=list_letters" ;
+ $modversion['sub'][$subcount]['name'] = _MI_XNEWSLETTER_CREATE;
+ $modversion['sub'][$subcount++]['url'] = "letter.php?op=new_letter";
}
if ($showList == true) {
- $modversion['sub'][$subcount]['name'] = _MI_XNEWSLETTER_LIST_SUBSCR ;
- $modversion['sub'][$subcount++]['url'] = "letter.php?op=list_subscrs" ;
+ $modversion['sub'][$subcount]['...
[truncated message content] |
|
From: <luc...@us...> - 2014-04-08 21:31:06
|
Revision: 12437
http://sourceforge.net/p/xoops/svn/12437
Author: luciorota
Date: 2014-04-08 21:31:01 +0000 (Tue, 08 Apr 2014)
Log Message:
-----------
use defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
change $i++; to ++$i;
Modified Paths:
--------------
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/config.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/functions.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/task.inc.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/xoopsuser.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/xoops_version.php
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/config.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/config.php 2014-04-08 21:29:30 UTC (rev 12436)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/config.php 2014-04-08 21:31:01 UTC (rev 12437)
@@ -26,9 +26,7 @@
* ****************************************************************************
*/
-if (!defined("XOOPS_ROOT_PATH")) {
- die("XOOPS root path not defined");
-}
+defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
// module information
$moduleImageUrl = XNEWSLETTER_URL . "/images/xNewsletter.png";
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/functions.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/functions.php 2014-04-08 21:29:30 UTC (rev 12436)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/functions.php 2014-04-08 21:31:01 UTC (rev 12437)
@@ -25,9 +25,7 @@
* Version : 1 Mon 2012/11/05 14:31:32 : Exp $
* ****************************************************************************
*/
-if (!defined("XOOPS_ROOT_PATH")) {
- die("XOOPS root path not defined");
-}
+defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
include_once dirname(__FILE__) . '/common.php';
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/task.inc.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/task.inc.php 2014-04-08 21:29:30 UTC (rev 12436)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/task.inc.php 2014-04-08 21:31:01 UTC (rev 12437)
@@ -26,9 +26,7 @@
* ****************************************************************************
*/
-if (!defined("XOOPS_ROOT_PATH")) {
- die("XOOPS root path not defined");
-}
+defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
include_once dirname(__FILE__) . '/common.php';
function xNewsletter_createTasks($op, $letter_id, $xn_send_in_packages, $xn_send_in_packages_time) {
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/xoopsuser.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/xoopsuser.php 2014-04-08 21:29:30 UTC (rev 12436)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/xoopsuser.php 2014-04-08 21:31:01 UTC (rev 12437)
@@ -25,9 +25,7 @@
* Version : $Id $
* ****************************************************************************
*/
-if (!defined("XOOPS_ROOT_PATH")) {
- die("XOOPS root path not defined");
-}
+defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
include_once dirname(__FILE__) . '/common.php';
function xnewsletter_plugin_getinfo_xoopsuser() {
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/xoops_version.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/xoops_version.php 2014-04-08 21:29:30 UTC (rev 12436)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/xoops_version.php 2014-04-08 21:31:01 UTC (rev 12437)
@@ -79,7 +79,7 @@
$i = 0;
$modversion['helpsection'][$i]['name'] = "Overview";
$modversion['helpsection'][$i]['link'] = "page=help";
-$i++;
+++$i;
$modversion['helpsection'][$i]['name'] = "Install";
$modversion['helpsection'][$i]['link'] = "page=help2";
@@ -131,10 +131,11 @@
$subcount = 1;
$modversion['sub'][$subcount]['name'] = _MI_XNEWSLETTER_SUBSCRIBE;
-$modversion['sub'][$subcount++]['url'] = "subscription.php?op=list_subscriptions";
-
+$modversion['sub'][$subcount]['url'] = "subscription.php?op=list_subscriptions";
+++$subcount;
$modversion['sub'][$subcount]['name'] = _MI_XNEWSLETTER_LIST;
-$modversion['sub'][$subcount++]['url'] = "index.php?op=list_letters";
+$modversion['sub'][$subcount]['url'] = "index.php?op=list_letters";
+++$subcount;
$showEdit = false;
$showCreate = false;
@@ -162,11 +163,13 @@
}
if ($showCreate == true) {
$modversion['sub'][$subcount]['name'] = _MI_XNEWSLETTER_CREATE;
- $modversion['sub'][$subcount++]['url'] = "letter.php?op=new_letter";
+ $modversion['sub'][$subcount]['url'] = "letter.php?op=new_letter";
+ ++$subcount;
}
if ($showList == true) {
$modversion['sub'][$subcount]['name'] = _MI_XNEWSLETTER_LIST_SUBSCR;
- $modversion['sub'][$subcount++]['url'] = "letter.php?op=list_subscrs";
+ $modversion['sub'][$subcount]['url'] = "letter.php?op=list_subscrs";
+ ++$subcount;
}
}
}
@@ -175,45 +178,45 @@
$i = 1;
$modversion['templates'][$i]['file'] = $modversion['dirname'] . '_header.html';
$modversion['templates'][$i]['description'] = '';
-$i++;
+++$i;
$modversion['templates'][$i]['file'] = $modversion['dirname'] . '_footer.html';
$modversion['templates'][$i]['description'] = '';
-$i++;
+++$i;
$modversion['templates'][$i]['file'] = $modversion['dirname'] . '_index.html';
$modversion['templates'][$i]['description'] = '';
-$i++;
+++$i;
$modversion['templates'][$i]['file'] = $modversion['dirname'] . '_index_list_letters.html';
$modversion['templates'][$i]['description'] = '';
-$i++;
+++$i;
$modversion['templates'][$i]['file'] = $modversion['dirname'] . '_subscription.html';
$modversion['templates'][$i]['description'] = '';
-$i++;
+++$i;
$modversion['templates'][$i]['file'] = $modversion['dirname'] . '_subscription_result.html';
$modversion['templates'][$i]['description'] = '';
-$i++;
+++$i;
$modversion['templates'][$i]['file'] = $modversion['dirname'] . '_subscription_list_subscriptions.html';
$modversion['templates'][$i]['description'] = '';
-$i++;
+++$i;
$modversion['templates'][$i]['file'] = $modversion['dirname'] . '_letter.html';
$modversion['templates'][$i]['description'] = '';
-$i++;
+++$i;
$modversion['templates'][$i]['file'] = $modversion['dirname'] . '_print.html';
$modversion['templates'][$i]['description'] = '';
-$i++;
+++$i;
$modversion['templates'][$i]['file'] = $modversion['dirname'] . '_letter_preview.html';
$modversion['templates'][$i]['description'] = '';
-$i++;
+++$i;
$modversion['templates'][$i]['file'] = $modversion['dirname'] . '_letter_list_letters.html';
$modversion['templates'][$i]['description'] = '';
-$i++;
+++$i;
$modversion['templates'][$i]['file'] = $modversion['dirname'] . '_letter_list_subscrs.html';
$modversion['templates'][$i]['description'] = '';
-$i++;
+++$i;
$modversion['templates'][$i]['file'] = $modversion['dirname'] . '_protocol.html';
$modversion['templates'][$i]['description'] = '';
// Common templates
-$i++;
+++$i;
$modversion['templates'][$i]['file'] = $modversion['dirname'] . '_common_breadcrumb.html';
$modversion['templates'][$i]['description'] = '';
@@ -231,14 +234,14 @@
$modversion['config'][$i]['default'] = "dhtmltextarea";
$modversion['config'][$i]['options'] = XoopsLists::getEditorList();
$modversion['config'][$i]['category'] = "global";
-$i++;
+++$i;
$modversion['config'][$i]['name'] = "keywords";
$modversion['config'][$i]['title'] = "_MI_XNEWSLETTER_KEYWORDS";
$modversion['config'][$i]['description'] = "_MI_XNEWSLETTER_KEYWORDS_DESC";
$modversion['config'][$i]['formtype'] = "textbox";
$modversion['config'][$i]['valuetype'] = "text";
$modversion['config'][$i]['default'] = "";
-$i++;
+++$i;
//Uploads : size letter_attachment
$modversion['config'][$i]['name'] = "xn_maxsize";
$modversion['config'][$i]['title'] = "_MI_XNEWSLETTER_ATTACHMENT_MAXSIZE";
@@ -246,7 +249,7 @@
$modversion['config'][$i]['formtype'] = "textbox";
$modversion['config'][$i]['valuetype'] = "int";
$modversion['config'][$i]['default'] = "10485760"; // 1MByte
-$i++;
+++$i;
//Uploads : mimetypes letter_attachment
$modversion['config'][$i]['name'] = "xn_mimetypes";
$modversion['config'][$i]['title'] = "_MI_XNEWSLETTER_ATTACHMENT_MIMETYPES";
@@ -284,7 +287,7 @@
'rtf' => 'text/rtf'
);
-$i++;
+++$i;
//Uploads : path attachments
$modversion["config"][$i]["name"] = "xn_attachment_path";
$modversion["config"][$i]["title"] = "_MI_XNEWSLETTER_ATTACHMENT_PATH";
@@ -292,14 +295,14 @@
$modversion["config"][$i]["formtype"] = "textbox";
$modversion["config"][$i]["valuetype"] = "text";
$modversion["config"][$i]["default"] = "/xNewsletter/attachments/";
-$i++;
+++$i;
$modversion['config'][$i]['name'] = "adminperpage";
$modversion['config'][$i]['title'] = "_MI_XNEWSLETTER_ADMINPERPAGE";
$modversion['config'][$i]['description'] = "_MI_XNEWSLETTER_ADMINPERPAGE_DESC";
$modversion['config'][$i]['formtype'] = "textbox";
$modversion['config'][$i]['valuetype'] = "text";
$modversion['config'][$i]['default'] = '15';
-$i++;
+++$i;
$modversion['config'][$i] = array(
'name' => 'dateformat',
'title' => '_MI_XNEWSLETTER_DATEFORMAT',
@@ -308,70 +311,70 @@
'valuetype' => 'text',
'default' => _DATESTRING
); //'D, d-M-Y');
-$i++;
+++$i;
$modversion['config'][$i]['name'] = "welcome_message";
$modversion['config'][$i]['title'] = "_MI_XNEWSLETTER_WELCOME_MESSAGE";
$modversion['config'][$i]['description'] = "_MI_XNEWSLETTER_WELCOME_MESSAGE_DESC";
$modversion['config'][$i]['formtype'] = "textarea";
$modversion['config'][$i]['valuetype'] = "text";
$modversion['config'][$i]['default'] = _MI_XNEWSLETTER_WELCOME;
-$i++;
+++$i;
$modversion['config'][$i]['name'] = "advertise";
$modversion['config'][$i]['title'] = "_MI_XNEWSLETTER_ADVERTISE";
$modversion['config'][$i]['description'] = "_MI_XNEWSLETTER_ADVERTISE_DESC";
$modversion['config'][$i]['formtype'] = "textarea";
$modversion['config'][$i]['valuetype'] = "text";
$modversion['config'][$i]['default'] = "";
-$i++;
+++$i;
$modversion['config'][$i]['name'] = "social_active";
$modversion['config'][$i]['title'] = "_MI_XNEWSLETTER_SOCIALACTIVE";
$modversion['config'][$i]['description'] = "_MI_XNEWSLETTER_SOCIALACTIVE_DESC";
$modversion['config'][$i]['formtype'] = "yesno";
$modversion['config'][$i]['valuetype'] = "int";
$modversion['config'][$i]['default'] = 0; // false
-$i++;
+++$i;
$modversion['config'][$i]['name'] = "social_code";
$modversion['config'][$i]['title'] = "_MI_XNEWSLETTER_SOCIALCODE";
$modversion['config'][$i]['description'] = "_MI_XNEWSLETTER_SOCIALCODE_DESC";
$modversion['config'][$i]['formtype'] = "textarea";
$modversion['config'][$i]['valuetype'] = "text";
$modversion['config'][$i]['default'] = "";
-$i++;
+++$i;
$modversion['config'][$i]['name'] = "xn_use_mailinglist";
$modversion['config'][$i]['title'] = "_MI_XNEWSLETTER_USE_MAILINGLIST";
$modversion['config'][$i]['description'] = "_MI_XNEWSLETTER_USE_MAILINGLIST_DESC";
$modversion['config'][$i]['formtype'] = "yesno";
$modversion['config'][$i]['valuetype'] = "int";
$modversion['config'][$i]['default'] = 0; // false
-$i++;
+++$i;
$modversion['config'][$i]['name'] = "xn_use_salutation";
$modversion['config'][$i]['title'] = "_MI_XNEWSLETTER_USE_SALUTATION";
$modversion['config'][$i]['description'] = "_MI_XNEWSLETTER_USE_SALUTATION_DESC";
$modversion['config'][$i]['formtype'] = "yesno";
$modversion['config'][$i]['valuetype'] = "int";
$modversion['config'][$i]['default'] = 1; // true
-$i++;
+++$i;
$modversion['config'][$i]['name'] = "xn_groups_without_actkey";
$modversion['config'][$i]['title'] = "_MI_XNEWSLETTER_GROUPS_WITHOUT_ACTKEY";
$modversion['config'][$i]['description'] = "_MI_XNEWSLETTER_GROUPS_WITHOUT_ACTKEY_DESC";
$modversion['config'][$i]['formtype'] = "group_multi";
$modversion['config'][$i]['valuetype'] = "array";
$modversion['config'][$i]['default'] = '1';
-$i++;
+++$i;
$modversion['config'][$i]['name'] = "xn_groups_change_other";
$modversion['config'][$i]['title'] = "_MI_XNEWSLETTER_GROUPS_CHANGE_OTHER";
$modversion['config'][$i]['description'] = "_MI_XNEWSLETTER_GROUPS_CHANGE_OTHER_DESC";
$modversion['config'][$i]['formtype'] = "group_multi";
$modversion['config'][$i]['valuetype'] = "array";
$modversion['config'][$i]['default'] = '1';
-$i++;
+++$i;
$modversion['config'][$i]['name'] = "xn_send_in_packages";
$modversion['config'][$i]['title'] = "_MI_XNEWSLETTER_SEND_IN_PACKAGES";
$modversion['config'][$i]['description'] = "_MI_XNEWSLETTER_SEND_IN_PACKAGES_DESC";
$modversion['config'][$i]['formtype'] = "textbox";
$modversion['config'][$i]['valuetype'] = "int";
$modversion['config'][$i]['default'] = '0';
-$i++;
+++$i;
$modversion['config'][$i]['name'] = "xn_send_in_packages_time";
$modversion['config'][$i]['title'] = "_MI_XNEWSLETTER_SEND_IN_PACKAGES_TIME";
$modversion['config'][$i]['description'] = "_MI_XNEWSLETTER_SEND_IN_PACKAGES_TIME_DESC";
|
|
From: <luc...@us...> - 2014-04-16 16:33:03
|
Revision: 12454
http://sourceforge.net/p/xoops/svn/12454
Author: luciorota
Date: 2014-04-16 16:32:59 +0000 (Wed, 16 Apr 2014)
Log Message:
-----------
delete wrong files
Modified Paths:
--------------
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/bmh_callback_database.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/import.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/index.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/letter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/menu.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/sendletter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_import.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_letter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/footer.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/header.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/task.inc.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/index.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/letter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/csv.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/evennews.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/rmbulletin.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/smartpartner.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/subscribers.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/weblinks.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/xoopsuser.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/print.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/xoops_version.php
Removed Paths:
-------------
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/xnewsletter_catsubscr_block_day.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/xnewsletter_catsubscr_block_recent.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/xnewsletter_letter_block_day.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/xnewsletter_letter_block_random.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/xnewsletter_letter_block_recent.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/xnewsletter_subscrinfo_block.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_footer.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_header.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xnewsletter_common_breadcrumb.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xnewsletter_index_list_letters.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xnewsletter_letter.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xnewsletter_letter_list_letters.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xnewsletter_letter_list_subscrs.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xnewsletter_letter_preview.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xnewsletter_print.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xnewsletter_protocol.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xnewsletter_subscription.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xnewsletter_subscription_list_subscriptions.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xnewsletter_subscription_result.html
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.php 2014-04-16 16:22:45 UTC (rev 12453)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.php 2014-04-16 16:32:59 UTC (rev 12454)
@@ -31,179 +31,187 @@
//global $indexAdmin;
// We recovered the value of the argument op in the URL$
-$op = xNewsletter_CleanVars($_REQUEST, 'op', 'list', 'string');
+$op = xNewsletter_CleanVars($_REQUEST, 'op', 'list', 'string');
$save_and_check = xNewsletter_CleanVars($_REQUEST, 'save_and_check', 'none', 'string');
-$accounts_id = xNewsletter_CleanVars($_REQUEST, 'accounts_id', 0, 'int');
-$post = xNewsletter_CleanVars($_REQUEST, 'post', '', 'string');
+$accounts_id = xNewsletter_CleanVars($_REQUEST, 'accounts_id', 0, 'int');
+$post = xNewsletter_CleanVars($_REQUEST, 'post', '', 'string');
-if ( $post == "" && $op == "save_accounts" && $save_and_check =="none" ) $op = "edit_account";
+if ($post == "" && $op == "save_accounts" && $save_and_check =="none" ) $op = "edit_account";
-switch ($op)
-{
- case "check_account":
-
- $img_ok = "<img src='" . XNEWSLETTER_ICONS_URL . "/xn_ok.png' alt='" . _AM_XNEWSLETTER_OK . "' title='"._AM_XNEWSLETTER_OK . "' /> ";
- $img_failed = "<img src='" . XNEWSLETTER_ICONS_URL . "/xn_failed.png' alt='" . _AM_XNEWSLETTER_FAILED . "' title='" . _AM_XNEWSLETTER_FAILED . "' /> ";
+switch ($op) {
+ case "check_account" :
+ $img_ok = "<img src='" . XNEWSLETTER_ICONS_URL . "/xn_ok.png' alt='" . _AM_XNEWSLETTER_OK . "' title='"._AM_XNEWSLETTER_OK . "' /> ";
+ $img_failed = "<img src='" . XNEWSLETTER_ICONS_URL . "/xn_failed.png' alt='" . _AM_XNEWSLETTER_FAILED . "' title='" . _AM_XNEWSLETTER_FAILED . "' /> ";
- echo $indexAdmin->addNavigation("accounts.php");
- $indexAdmin->addItemButton(_AM_XNEWSLETTER_ACCOUNTSLIST, 'accounts.php?op=list', 'list');
- echo $indexAdmin->renderButton();
-
- if ($accounts_id == 0) {
- redirect_header("accounts.php", 3, _AM_XNEWSLETTER_ERROR_NO_VALID_ID);
- } else {
- $obj_account =& $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
- }
-
- $mailhost = $obj_account->getVar("accounts_server_in");
- $port = $obj_account->getVar("accounts_port_in");
- switch ($obj_account->getVar("accounts_type")) {
- case _AM_ACCOUNTS_TYPE_VAL_POP3:
- $service = "pop3";
- break;
- case _AM_ACCOUNTS_TYPE_VAL_SMTP:
- case _AM_ACCOUNTS_TYPE_VAL_GMAIL:
- $service = "imap";
- break;
- case "default":
- default:
- $service = "";
- break;
- }
- $service_option = $obj_account->getVar("accounts_securetype_in");
- $accounts_password = $obj_account->getVar("accounts_password");
- $accounts_username = $obj_account->getVar("accounts_username");
- $accounts_inbox = $obj_account->getVar("accounts_inbox"); $accounts_inbox_ok = 0;
- $accounts_hardbox = $obj_account->getVar("accounts_hardbox"); $accounts_hardbox_ok = 0;
- $accounts_softbox = $obj_account->getVar("accounts_softbox"); $accounts_softbox_ok = 0;
-
- $command = $mailhost.":".$port;
- if ($service !='') $command .= '/' . $service;
- if ($service_option !='') $command .= '/' . $service_option;
-
- echo "<table class='outer width100' cellspacing='1'>
+ echo $indexAdmin->addNavigation("accounts.php");
+ $indexAdmin->addItemButton(_AM_XNEWSLETTER_ACCOUNTSLIST, 'accounts.php?op=list', 'list');
+ echo $indexAdmin->renderButton();
+
+ if ($accounts_id == 0) {
+ redirect_header("accounts.php", 3, _AM_XNEWSLETTER_ERROR_NO_VALID_ID);
+ } else {
+ $accountObj =& $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
+ }
+
+ $mailhost = $accountObj->getVar("accounts_server_in");
+ $port = $accountObj->getVar("accounts_port_in");
+ switch ($accountObj->getVar("accounts_type")) {
+ case _AM_ACCOUNTS_TYPE_VAL_POP3:
+ $service = "pop3";
+ break;
+ case _AM_ACCOUNTS_TYPE_VAL_SMTP:
+ case _AM_ACCOUNTS_TYPE_VAL_GMAIL:
+ $service = "imap";
+ break;
+ case "default":
+ default:
+ $service = "";
+ break;
+ }
+ $service_option = $accountObj->getVar("accounts_securetype_in");
+ $accounts_password = $accountObj->getVar("accounts_password");
+ $accounts_username = $accountObj->getVar("accounts_username");
+ $accounts_inbox = $accountObj->getVar("accounts_inbox"); $accounts_inbox_ok = 0;
+ $accounts_hardbox = $accountObj->getVar("accounts_hardbox"); $accounts_hardbox_ok = 0;
+ $accounts_softbox = $accountObj->getVar("accounts_softbox"); $accounts_softbox_ok = 0;
+
+ $command = $mailhost.":".$port;
+ if ($service !='') $command .= '/' . $service;
+ if ($service_option !='') $command .= '/' . $service_option;
+
+ echo "<table class='outer width100' cellspacing='1'>
<tr>
<th class='center width5'></th>
<th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK."</th>
<th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK_INFO."</th>
</tr>";
- $mbox = @imap_open("{".$command."}", $accounts_username, $accounts_password); // or die ("can't connect: " . imap_last_error());
- if ( $mbox === false ) {
- echo "<tr>";
- echo "<td class='center width5'>".$img_failed."</td>";
- echo "<td class='left'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_MAILBOX._AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED."</td>";
- echo "<td class='left'>".imap_last_error()."</td>";
- echo "</tr>";
- } else {
- echo "<tr>";
- echo "<td class='center width5'>".$img_ok."</td>";
- echo "<td class='left'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_MAILBOX._AM_XNEWSLETTER_ACCOUNTS_CHECK_OK."</td>";
- echo "<td class='left'></td>";
- echo "</tr>";
-
- $folders = imap_listmailbox($mbox, "{".$command."}", "*");
- if ($folders == false) {
- echo "<tr>";
- echo "<td class='center width5'>".$img_failed."</td>";
- echo "<td class='left'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_FOLDERS._AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED."</td>";
- echo "<td class='left'>".imap_last_error()."</td>";
- echo "</tr>";
- } else {
- echo "<tr>";
- echo "<td class='center width5'>".$img_ok."</td>";
- echo "<td class='left'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_FOLDERS._AM_XNEWSLETTER_ACCOUNTS_CHECK_OK."</td>";
- echo "<td class='left'>";
- if (is_array($folders)) {
- reset ($folders);
- sort($folders);
- $foldercreated = 0;
- while (list( $key, $val) = each ($folders)) {
- echo "($key) ";
- echo imap_utf7_decode (str_replace("{".$command."}","",$val)) . "<br>\n";
- if ("{".$command."}".$accounts_inbox == $val) $accounts_inbox_ok = 1;
- if ("{".$command."}".$accounts_hardbox == $val) {
- $accounts_hardbox_ok = 1;
- } else {
- @imap_createmailbox($mbox, imap_utf7_encode('{'.$command.'}' . $accounts_hardbox));
- $foldercreated = 1;
- }
- if ("{".$command."}".$accounts_softbox == $val) {
- $accounts_softbox_ok = 1;
- } else {
- @imap_createmailbox($mbox, imap_utf7_encode('{'.$command.'}' . $accounts_softbox));
- $foldercreated = 1;
- }
- }
- if ($foldercreated == 1) {
- $folders_recheck = imap_listmailbox($mbox, "{".$command."}", "*");
- while (list( $key, $val) = each ($folders_recheck)) {
- if ("{".$command."}".$accounts_hardbox == $val) $accounts_hardbox_ok = 1;
- if ("{".$command."}".$accounts_softbox == $val) $accounts_softbox_ok = 1;
- }
- }
- }
-
- echo "</td>";
- echo "</tr>";
- echo "<tr>";
- if ($obj_account->getVar("accounts_use_bmh") == '1') {
- if ($accounts_inbox_ok == 1 && $accounts_hardbox_ok == 1 && $accounts_softbox_ok == 1) {
- echo "<td class='center width5'>".$img_ok."</td>";
- } else {
- echo "<td class='center width5'>".$img_failed."</td>";
- }
- echo "<td class='left'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH."</td>";
- echo "<td class='left'>";
- echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH_INBOX." ";
- if ($accounts_inbox_ok == 1) {echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_OK.$img_ok;} else {echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED.$img_failed;}
- echo "<br />";
- echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH_HARDBOX." ";
- if ($accounts_hardbox_ok == 1) {echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_OK.$img_ok;} else {echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED.$img_failed;}
- echo "<br />";
- echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH_SOFTBOX." ";
- if ($accounts_softbox_ok == 1) {echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_OK.$img_ok;} else {echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED.$img_failed;}
- echo "<br />";
- echo "</td>";
- } else {
- echo "<td class='center width5'>".$img_ok."</td>";
- echo "<td class='left'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH._AM_XNEWSLETTER_ACCOUNTS_CHECK_SKIPPED."</td>";
- echo "<td class='center'></td>";
- }
- echo "</tr>";
- }
- imap_close($mbox);
- }
+ $mbox = @imap_open("{" . $command . "}", $accounts_username, $accounts_password); // or die ("can't connect: " . imap_last_error());
+ if ( $mbox === false ) {
+ echo "<tr>";
+ echo "<td class='center width5'>".$img_failed."</td>";
+ echo "<td class='left'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_MAILBOX._AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED."</td>";
+ echo "<td class='left'>".imap_last_error()."</td>";
+ echo "</tr>";
+ } else {
+ echo "<tr>";
+ echo "<td class='center width5'>".$img_ok."</td>";
+ echo "<td class='left'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_MAILBOX._AM_XNEWSLETTER_ACCOUNTS_CHECK_OK."</td>";
+ echo "<td class='left'></td>";
+ echo "</tr>";
- echo "</table>";
- break;
+ $folders = imap_listmailbox($mbox, "{".$command."}", "*");
+ if ($folders == false) {
+ echo "<tr>";
+ echo "<td class='center width5'>".$img_failed."</td>";
+ echo "<td class='left'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_FOLDERS._AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED."</td>";
+ echo "<td class='left'>".imap_last_error()."</td>";
+ echo "</tr>";
+ } else {
+ echo "<tr>";
+ echo "<td class='center width5'>".$img_ok."</td>";
+ echo "<td class='left'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_FOLDERS._AM_XNEWSLETTER_ACCOUNTS_CHECK_OK."</td>";
+ echo "<td class='left'>";
+ if (is_array($folders)) {
+ reset ($folders);
+ sort ($folders);
+ $foldercreated = 0;
+ while (list( $key, $val) = each ($folders)) {
+ echo "($key) ";
+ echo imap_utf7_decode (str_replace("{".$command."}","",$val)) . "<br>\n";
+ if ("{".$command."}".$accounts_inbox == $val) $accounts_inbox_ok = 1;
+ if ("{".$command."}".$accounts_hardbox == $val) {
+ $accounts_hardbox_ok = 1;
+ } else {
+ @imap_createmailbox($mbox, imap_utf7_encode('{'.$command.'}' . $accounts_hardbox));
+ $foldercreated = 1;
+ }
+ if ("{".$command."}".$accounts_softbox == $val) {
+ $accounts_softbox_ok = 1;
+ } else {
+ @imap_createmailbox($mbox, imap_utf7_encode('{' . $command . '}' . $accounts_softbox));
+ $foldercreated = 1;
+ }
+ }
+ if ($foldercreated == 1) {
+ $folders_recheck = imap_listmailbox($mbox, "{" . $command . "}", "*");
+ while (list( $key, $val) = each ($folders_recheck)) {
+ if ("{".$command."}".$accounts_hardbox == $val) $accounts_hardbox_ok = 1;
+ if ("{".$command."}".$accounts_softbox == $val) $accounts_softbox_ok = 1;
+ }
+ }
+ }
- case "list":
- default:
- echo $indexAdmin->addNavigation('accounts.php') ;
- $indexAdmin->addItemButton(_AM_XNEWSLETTER_NEWACCOUNTS, 'accounts.php?op=new_account', 'add');
- echo $indexAdmin->renderButton();
+ echo "</td>";
+ echo "</tr>";
+ echo "<tr>";
+ if ($accountObj->getVar("accounts_use_bmh") == '1') {
+ if ($accounts_inbox_ok == 1 && $accounts_hardbox_ok == 1 && $accounts_softbox_ok == 1) {
+ echo "<td class='center width5'>" . $img_ok . "</td>";
+ } else {
+ echo "<td class='center width5'>" . $img_failed . "</td>";
+ }
+ echo "<td class='left'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH . "</td>";
+ echo "<td class='left'>";
+ echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH_INBOX . " ";
+ if ($accounts_inbox_ok == 1) {
+ echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_OK . $img_ok;
+ } else {
+ echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED . $img_failed;
+ }
+ echo "<br />";
+ echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH_HARDBOX." ";
+ if ($accounts_hardbox_ok == 1) {
+ echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_OK . $img_ok;
+ } else {
+ echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED . $img_failed;
+ }
+ echo "<br />";
+ echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH_SOFTBOX . " ";
+ if ($accounts_softbox_ok == 1) {
+ echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_OK . $img_ok;
+ } else {
+ echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED . $img_failed;
+ }
+ echo "<br />";
+ echo "</td>";
+ } else {
+ echo "<td class='center width5'>" . $img_ok . "</td>";
+ echo "<td class='left'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH._AM_XNEWSLETTER_ACCOUNTS_CHECK_SKIPPED . "</td>";
+ echo "<td class='center'></td>";
+ }
+ echo "</tr>";
+ }
+ imap_close($mbox);
+ }
+ echo "</table>";
+ break;
- $limit = $GLOBALS['xoopsModuleConfig']['adminperpage'];
- $criteria = new CriteriaCompo();
- $criteria->setSort("accounts_id ASC, accounts_type");
- $criteria->setOrder("ASC");
- $numrows = $xnewsletter->getHandler('xNewsletter_accounts')->getCount();
- $start = xNewsletter_CleanVars ( $_REQUEST, 'start', 0, 'int' );
- $criteria->setStart($start);
- $criteria->setLimit($limit);
- $accounts_arr = $xnewsletter->getHandler('xNewsletter_accounts')->getall($criteria);
- if ( $numrows > $limit ) {
- include_once XOOPS_ROOT_PATH . "/class/pagenav.php";
+ case "list":
+ default:
+ echo $indexAdmin->addNavigation('accounts.php') ;
+ $indexAdmin->addItemButton(_AM_XNEWSLETTER_NEWACCOUNTS, 'accounts.php?op=new_account', 'add');
+ echo $indexAdmin->renderButton();
+
+ $limit = $GLOBALS['xoopsModuleConfig']['adminperpage'];
+ $criteria = new CriteriaCompo();
+ $criteria->setSort("accounts_id ASC, accounts_type");
+ $criteria->setOrder("ASC");
+ $numrows = $xnewsletter->getHandler('xNewsletter_accounts')->getCount();
+ $start = xNewsletter_CleanVars ( $_REQUEST, 'start', 0, 'int' );
+ $criteria->setStart($start);
+ $criteria->setLimit($limit);
+ $accounts_arr = $xnewsletter->getHandler('xNewsletter_accounts')->getall($criteria);
+ if ( $numrows > $limit ) {
+ include_once XOOPS_ROOT_PATH . "/class/pagenav.php";
$pagenav = new XoopsPageNav($numrows, $limit, $start, 'start', 'op=list');
$pagenav = $pagenav->renderNav(4);
} else {
$pagenav = '';
}
-
- // View Table
- if ($numrows > 0)
- {
+
+ // View Table
+ if ($numrows > 0) {
echo "<table class='outer width100' cellspacing='1'>
<tr>
<th class='center width2'>"._AM_XNEWSLETTER_ACCOUNTS_ID."</th>
@@ -215,10 +223,9 @@
<th class='center width10'>"._AM_XNEWSLETTER_FORMACTION."</th>
</tr>";
- $class = "odd";
-
- foreach (array_keys($accounts_arr) as $i)
- {
+ $class = "odd";
+
+ foreach (array_keys($accounts_arr) as $i) {
echo "<tr class='".$class."'>";
$class = ($class == "even") ? "odd" : "even";
echo "<td class='center'>".$i."</td>";
@@ -229,11 +236,11 @@
_AM_ACCOUNTS_TYPE_VAL_SMTP=>_AM_ACCOUNTS_TYPE_SMTP,
_AM_ACCOUNTS_TYPE_VAL_GMAIL=>_AM_ACCOUNTS_TYPE_GMAIL);
echo "<td class='center'>". $arr_accounts_type[$accounts_arr[$i]->getVar("accounts_type")]."</td>";
- echo "<td class='center'>".$accounts_arr[$i]->getVar("accounts_name")."</td>";
- echo "<td class='center'>".$accounts_arr[$i]->getVar("accounts_yourname")."</td>";
+ echo "<td class='center'>".$accounts_arr[$i]->getVar("accounts_name")."</td>";
+ echo "<td class='center'>".$accounts_arr[$i]->getVar("accounts_yourname")."</td>";
echo "<td class='center'>".$accounts_arr[$i]->getVar("accounts_yourmail")."</td>";
$verif_accounts_default = ( $accounts_arr[$i]->getVar("accounts_default") == 1 ) ? _YES : _NO;
- echo "<td class='center'>".$verif_accounts_default."</td>";
+ echo "<td class='center'>".$verif_accounts_default."</td>";
echo "<td class='center width5'>";
echo " <a href='accounts.php?op=edit_account&accounts_id=".$i."'><img src=".XNEWSLETTER_ICONS_URL."/xn_edit.png alt='"._EDIT."' title='"._EDIT."' /></a>";
@@ -242,13 +249,13 @@
echo " <a href='accounts.php?op=check_account&accounts_id=".$i."'><img src=".XNEWSLETTER_ICONS_URL."/xn_check.png alt='"._AM_ACCOUNTS_TYPE_CHECK."' title='"._AM_ACCOUNTS_TYPE_CHECK."' /></a>";
}
echo "</td>";
- echo "</tr>";
- }
- echo "</table><br /><br />";
- echo "<br /><div class='center'>" . $pagenav . "</div><br />";
- } else {
- echo "<table class='outer width100' cellspacing='1'>
- <tr>
+ echo "</tr>";
+ }
+ echo "</table><br /><br />";
+ echo "<br /><div class='center'>" . $pagenav . "</div><br />";
+ } else {
+ echo "<table class='outer width100' cellspacing='1'>
+ <tr>
<th class='center width2'>"._AM_XNEWSLETTER_ACCOUNTS_ID."</th>
<th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_TYPE."</th>
<th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_NAME."</th>
@@ -265,89 +272,91 @@
<th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_DEFAULT."</th>
<th class='center width10'>"._AM_XNEWSLETTER_FORMACTION."</th>
</tr>";
- echo "</table><br /><br />";
- }
-
- break;
+ echo "</table><br /><br />";
+ }
- case "new_account":
- echo $indexAdmin->addNavigation("accounts.php");
- $indexAdmin->addItemButton(_AM_XNEWSLETTER_ACCOUNTSLIST, 'accounts.php?op=list', 'list');
- echo $indexAdmin->renderButton();
- $obj = $xnewsletter->getHandler('xNewsletter_accounts')->create();
- $obj = xNewsletter_setPost($obj,$_POST);
- $form = $obj->getForm();
- $form->display();
- break;
-
- case "save_accounts":
- if ( !$GLOBALS["xoopsSecurity"]->check() ) {
- redirect_header("accounts.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
- }
-
- $obj =& $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
- $_POST['accounts_id'] = $accounts_id;
- $obj = xNewsletter_setPost($obj,$_POST);
-
- $criteria = new CriteriaCompo();
- $criteria->add(new Criteria("accounts_default", 1));
- $count_accounts_default = $xnewsletter->getHandler('xNewsletter_accounts')->getCount($criteria);
- if ($count_accounts_default > 0) {
- if ($obj->getVar("accounts_default") == 1) {
- global $xoopsDB;
- $verif_accounts_default = "1";
- //reset old accounts_default
- $sql = "UPDATE `{$xoopsDB->prefix("mod_xnewsletter_accounts")}` SET `accounts_default` = '0'";
- $result= $xoopsDB->query($sql) or die ("MySQL-Error: " . mysql_error());
- } else {
- $verif_accounts_default = "0";
- }
- } else {
- $verif_accounts_default = "1";
- }
- $obj->setVar("accounts_default", $verif_accounts_default);
- if ($obj->getVar("accounts_yourmail") != "" && $obj->getVar("accounts_yourmail") != _AM_ACCOUNTS_TYPE_YOUREMAIL ) {
- if ($xnewsletter->getHandler('xNewsletter_accounts')->insert($obj)) {
- if ($save_and_check == 'none') {
- redirect_header("accounts.php?op=list", 2, _AM_XNEWSLETTER_FORMOK);
- } else {
- redirect_header("accounts.php?op=check_account&accounts_id=".$obj->getVar("accounts_id"), 2, _AM_XNEWSLETTER_FORMOK);
- }
- }
- } else {
- $obj->setErrors(_MA_XNEWSLETTER_SUBSCRIPTION_ERROR_NOEMAIL);
- }
+ break;
- echo $obj->getHtmlErrors();
- $form =& $obj->getForm();
- $form->display();
- break;
-
- case "edit_account":
- echo $indexAdmin->addNavigation("accounts.php");
- $indexAdmin->addItemButton(_AM_XNEWSLETTER_NEWACCOUNTS, 'accounts.php?op=new_account', 'add');
- $indexAdmin->addItemButton(_AM_XNEWSLETTER_ACCOUNTSLIST, 'accounts.php?op=list', 'list');
- echo $indexAdmin->renderButton();
- $obj = $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
- if ( !empty($_POST) ) xNewsletter_setPost($obj,$_POST);
- $form = $obj->getForm();
- $form->display();
+ case "new_account":
+ echo $indexAdmin->addNavigation("accounts.php");
+ $indexAdmin->addItemButton(_AM_XNEWSLETTER_ACCOUNTSLIST, 'accounts.php?op=list', 'list');
+ echo $indexAdmin->renderButton();
+ $accountObj = $xnewsletter->getHandler('xNewsletter_accounts')->create();
+ $accountObj = xNewsletter_setPost($accountObj, $_POST);
+ $form = $accountObj->getForm();
+ $form->display();
+ break;
+
+ case "save_accounts":
+ if ( !$GLOBALS["xoopsSecurity"]->check() ) {
+ redirect_header("accounts.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
+ }
+
+ $accountObj =& $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
+ $_POST['accounts_id'] = $accounts_id;
+ $accountObj = xNewsletter_setPost($accountObj, $_POST);
+
+ $criteria = new CriteriaCompo();
+ $criteria->add(new Criteria("accounts_default", 1));
+ $count_accounts_default = $xnewsletter->getHandler('xNewsletter_accounts')->getCount($criteria);
+ if ($count_accounts_default > 0) {
+ if ($accountObj->getVar("accounts_default") == 1) {
+ global $xoopsDB;
+ $verif_accounts_default = "1";
+ //reset old accounts_default
+ $sql = "UPDATE `{$xoopsDB->prefix("mod_xnewsletter_accounts")}` SET `accounts_default` = '0'";
+ $result= $xoopsDB->query($sql) or die ("MySQL-Error: " . mysql_error());
+ } else {
+ $verif_accounts_default = "0";
+ }
+ } else {
+ $verif_accounts_default = "1";
+ }
+ $accountObj->setVar("accounts_default", $verif_accounts_default);
+ if ($accountObj->getVar("accounts_yourmail") != "" && $accountObj->getVar("accounts_yourmail") != _AM_ACCOUNTS_TYPE_YOUREMAIL ) {
+ if ($xnewsletter->getHandler('xNewsletter_accounts')->insert($accountObj)) {
+ if ($save_and_check == 'none') {
+ redirect_header("accounts.php?op=list", 2, _AM_XNEWSLETTER_FORMOK);
+ } else {
+ redirect_header("accounts.php?op=check_account&accounts_id={$accountObj->getVar("accounts_id")}", 2, _AM_XNEWSLETTER_FORMOK);
+ }
+ }
+ } else {
+ $accountObj->setErrors(_MA_XNEWSLETTER_SUBSCRIPTION_ERROR_NOEMAIL);
+ }
+
+ echo $obj->getHtmlErrors();
+ $form = $accountObj->getForm();
+ $form->display();
+ break;
+
+ case "edit_account":
+ echo $indexAdmin->addNavigation("accounts.php");
+ $indexAdmin->addItemButton(_AM_XNEWSLETTER_NEWACCOUNTS, 'accounts.php?op=new_account', 'add');
+ $indexAdmin->addItemButton(_AM_XNEWSLETTER_ACCOUNTSLIST, 'accounts.php?op=list', 'list');
+ echo $indexAdmin->renderButton();
+ $accountObj = $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
+ if (!empty($_POST)) {
+ xNewsletter_setPost($accountObj, $_POST);
+ }
+ $form = $accountObj->getForm();
+ $form->display();
break;
-
- case "delete_account":
- $obj = $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
- if (isset($_POST["ok"]) && $_POST["ok"] == "1") {
- if ( !$GLOBALS["xoopsSecurity"]->check() ) {
- redirect_header("accounts.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
- }
- if ($xnewsletter->getHandler('xNewsletter_accounts')->delete($obj)) {
- redirect_header("accounts.php", 3, _AM_XNEWSLETTER_FORMDELOK);
- } else {
- echo $obj->getHtmlErrors();
- }
- } else {
- xoops_confirm(array("ok" => 1, "accounts_id" => $accounts_id, "op" => "delete_account"), "accounts.php", sprintf(_AM_XNEWSLETTER_FORMSUREDEL, $obj->getVar("accounts_name")));
- }
- break;
+
+ case "delete_account":
+ $accountObj = $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
+ if (i...
[truncated message content] |
|
From: <luc...@us...> - 2014-04-17 21:08:01
|
Revision: 12456
http://sourceforge.net/p/xoops/svn/12456
Author: luciorota
Date: 2014-04-17 21:07:56 +0000 (Thu, 17 Apr 2014)
Log Message:
-----------
import procedure: check if limit options are compatible with php.ini 'max_input_vars' setting
standardize (in progress)
Modified Paths:
--------------
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/import.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/blocks/blocks_catsubscr.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/blocks/blocks_letter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/blocks/blocks_subscrinfo.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_import.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/docs/changelog.txt
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/mailinglist.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/search.inc.php
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/import.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/import.php 2014-04-16 16:36:11 UTC (rev 12455)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/import.php 2014-04-17 21:07:56 UTC (rev 12456)
@@ -25,7 +25,7 @@
* Version : $Id $
* ****************************************************************************
*/
-
+$currentFile = basename(__FILE__);
include "admin_header.php";
xoops_cp_header();
@@ -43,32 +43,31 @@
$skipcatsubscrexist = xNewsletter_CleanVars($_REQUEST, 'skipcatsubscrexist', 1, 'int' );
$check_import = xNewsletter_CleanVars($_REQUEST, 'check_import', 0, 'int');
-// echo "<br/>op:$op plugin:$plugin cat_id:$cat_id action_after_read:$action_after_read start:$start limitcheck:$limitcheck skipcatsubscrexist:$skipcatsubscrexist<br/><br/>";
+echo $indexAdmin->addNavigation($currentFile);
-echo $indexAdmin->addNavigation("import.php");
-
switch ($op) {
case "show_formcheck":
- $indexAdmin->addItemButton(_AM_XNEWSLETTER_IMPORT_PLUGINS_AVAIL, 'import.php?op=default', 'list');
+ $indexAdmin->addItemButton(_AM_XNEWSLETTER_IMPORT_PLUGINS_AVAIL, $currentFile, 'list');
echo $indexAdmin->renderButton();
- $crit_import = new CriteriaCompo();
- $crit_import->setSort("import_id");
- $crit_import->setOrder("ASC");
- $numrows = $xnewsletter->getHandler('xNewsletter_import')->getCount($crit_import);
+ $import_criteria = new CriteriaCompo();
+ $import_criteria->setSort("import_id");
+ $import_criteria->setOrder("ASC");
+ $numrows = $xnewsletter->getHandler('xNewsletter_import')->getCount($import_criteria);
- $crit_import->setStart($start);
- $crit_import->setLimit($limitcheck);
- $import_arr = $xnewsletter->getHandler('xNewsletter_import')->getall($crit_import);
+ $import_criteria->setStart($start);
+ $import_criteria->setLimit($limitcheck);
+ $import_arr = $xnewsletter->getHandler('xNewsletter_import')->getall($import_criteria);
if ($numrows > 0) {
include_once(XOOPS_ROOT_PATH . "/class/xoopsformloader.php");
$action = $_SERVER["REQUEST_URI"];
$unique_id = uniqid(mt_rand());
- $form = "<br/><form name=\"form_import_".$unique_id."\" id=\"form_import_".$unique_id."\" action=\"import.php\" method=\"post\" enctype=\"multipart/form-data\">";
+ $form = "<br/>";
+ $form .= "<form name=\"form_import_{$unique_id}\" id=\"form_import_{$unique_id}\" action=\"{$currentFile}\" method=\"post\" enctype=\"multipart/form-data\">";
- $showlimit = str_replace("%s", $start+1, _AM_XNEWSLETTER_IMPORT_SHOW);
+ $showlimit = str_replace("%s", $start + 1, _AM_XNEWSLETTER_IMPORT_SHOW);
if ($limitcheck < $numrows) {
$showlimit = str_replace("%l", $limitcheck, $showlimit);
} else {
@@ -76,22 +75,23 @@
}
$showlimit = str_replace("%n", $numrows, $showlimit);
- $form .="<table width=\"100%\" cellspacing=\"1\" class=\"outer\">
+ $form .= "
+ <table width=\"100%\" cellspacing=\"1\" class=\"outer\">
<tr>
- <td align=\"left\" colspan='8'>".$showlimit."</td>
+ <td align=\"left\" colspan='8'>" . $showlimit . "</td>
</tr>";
$class = "odd";
- $form .="
+ $form .= "
<tr>
<th align=\"center\"> </th>
- <th align=\"center\">"._AM_XNEWSLETTER_SUBSCR_EMAIL."</th>
- <th align=\"center\">"._AM_XNEWSLETTER_SUBSCR_SEX."</th>
- <th align=\"center\">"._AM_XNEWSLETTER_SUBSCR_FIRSTNAME."</th>
- <th align=\"center\">"._AM_XNEWSLETTER_SUBSCR_LASTNAME."</th>
- <th align=\"center\">"._AM_XNEWSLETTER_IMPORT_EMAIL_EXIST."</th>
- <th align=\"center\">"._AM_XNEWSLETTER_IMPORT_CATSUBSCR_EXIST."</th>
- <th align=\"center\">"._AM_XNEWSLETTER_CAT_NAME."</th>
+ <th align=\"center\">" . _AM_XNEWSLETTER_SUBSCR_EMAIL . "</th>
+ <th align=\"center\">" . _AM_XNEWSLETTER_SUBSCR_SEX . "</th>
+ <th align=\"center\">" . _AM_XNEWSLETTER_SUBSCR_FIRSTNAME . "</th>
+ <th align=\"center\">" . _AM_XNEWSLETTER_SUBSCR_LASTNAME . "</th>
+ <th align=\"center\">" . _AM_XNEWSLETTER_IMPORT_EMAIL_EXIST . "</th>
+ <th align=\"center\">" . _AM_XNEWSLETTER_IMPORT_CATSUBSCR_EXIST . "</th>
+ <th align=\"center\">" . _AM_XNEWSLETTER_CAT_NAME . "</th>
</tr>";
$class = "odd";
@@ -105,7 +105,7 @@
foreach (array_keys($import_arr) as $i) {
$counter++;
- $form .= "<tr class=\"".$class."\">";
+ $form .= "<tr class=\"" . $class . "\">";
$class = ($class == "even") ? "odd" : "even";
$form .= "<td align=\"center\">".$counter;
$form .= "<input type='hidden' name='import_id_".$counter."' title='import_id_".$counter."' id='import_id_".$counter."' value='".$import_arr[$i]->getVar("import_id")."' />";
@@ -116,41 +116,48 @@
$form .= "<td align=\"center\">";
$sex = $import_arr[$i]->getVar("import_sex");
- $form .= "<select size=\"1\" name=\"sex_".$counter."\" id=\"sex_".$counter."\" title=\""._AM_XNEWSLETTER_SUBSCR_SEX."\" ";
- $form .= "value=\"".$sex."\">";
+ $form .= "<select size=\"1\" name=\"sex_" . $counter . "\" id=\"sex_" . $counter . "\" title=\"" . _AM_XNEWSLETTER_SUBSCR_SEX . "\" ";
+ $form .= "value=\"" . $sex . "\">";
$form .= "<option value=\"\"";
- if ($sex==_AM_XNEWSLETTER_SUBSCR_SEX_EMPTY) $form .= " selected=\"selected\"";
- $form .= ">"._AM_XNEWSLETTER_SUBSCR_SEX_EMPTY."</option>";
- $form .= "<option value=\""._AM_XNEWSLETTER_SUBSCR_SEX_FEMALE."\"";
- if ($sex==_AM_XNEWSLETTER_SUBSCR_SEX_FEMALE) $form .= " selected=\"selected\"";
- $form .= ">"._AM_XNEWSLETTER_SUBSCR_SEX_FEMALE."</option>";
- $form .= "<option value=\""._AM_XNEWSLETTER_SUBSCR_SEX_MALE."\"";
- if ($sex==_AM_XNEWSLETTER_SUBSCR_SEX_MALE) $form .= " selected=\"selected\"";
- $form .= ">"._AM_XNEWSLETTER_SUBSCR_SEX_MALE."</option>";
- $form .= "<option value=\""._AM_XNEWSLETTER_SUBSCR_SEX_COMP."\"";
- if ($sex==_AM_XNEWSLETTER_SUBSCR_SEX_COMP) $form .= " selected=\"selected\"";
- $form .= ">"._AM_XNEWSLETTER_SUBSCR_SEX_COMP."</option>";
+ if ($sex == _AM_XNEWSLETTER_SUBSCR_SEX_EMPTY)
+ $form .= " selected=\"selected\"";
+ $form .= ">" . _AM_XNEWSLETTER_SUBSCR_SEX_EMPTY . "</option>";
+ $form .= "<option value=\"" . _AM_XNEWSLETTER_SUBSCR_SEX_FEMALE . "\"";
+ if ($sex == _AM_XNEWSLETTER_SUBSCR_SEX_FEMALE)
+ $form .= " selected=\"selected\"";
+ $form .= ">" . _AM_XNEWSLETTER_SUBSCR_SEX_FEMALE . "</option>";
+ $form .= "<option value=\"" . _AM_XNEWSLETTER_SUBSCR_SEX_MALE . "\"";
+ if ($sex == _AM_XNEWSLETTER_SUBSCR_SEX_MALE)
+ $form .= " selected=\"selected\"";
+ $form .= ">"._AM_XNEWSLETTER_SUBSCR_SEX_MALE . "</option>";
+ $form .= "<option value=\"" . _AM_XNEWSLETTER_SUBSCR_SEX_COMP . "\"";
+ if ($sex == _AM_XNEWSLETTER_SUBSCR_SEX_COMP)
+ $form .= " selected=\"selected\"";
+ $form .= ">" . _AM_XNEWSLETTER_SUBSCR_SEX_COMP . "</option>";
$form .= "<option value=\""._AM_XNEWSLETTER_SUBSCR_SEX_FAMILY."\"";
- if ($sex==_AM_XNEWSLETTER_SUBSCR_SEX_FAMILY) $form .= " selected=\"selected\"";
- $form .= ">"._AM_XNEWSLETTER_SUBSCR_SEX_FAMILY."</option>";
+ if ($sex == _AM_XNEWSLETTER_SUBSCR_SEX_FAMILY)
+ $form .= " selected=\"selected\"";
+ $form .= ">" . _AM_XNEWSLETTER_SUBSCR_SEX_FAMILY . "</option>";
$form .= "</select>\n";
$form .= "</td>";
$form .= "<td align=\"center\">";
- $form .= "<input type='text' name='firstname_".$counter."' title='"._AM_XNEWSLETTER_SUBSCR_FIRSTNAME."' id='firstname_".$counter."' value='".$import_arr[$i]->getVar("import_firstname")."' />";
+ $form .= "<input type='text' name='firstname_" . $counter . "' title='"._AM_XNEWSLETTER_SUBSCR_FIRSTNAME."' id='firstname_".$counter."' value='".$import_arr[$i]->getVar("import_firstname")."' />";
$form .= "</td>";
$form .= "<td align=\"center\">";
- $form .= "<input type='text' name='lastname_".$counter."' title='"._AM_XNEWSLETTER_SUBSCR_LASTNAME."' id='lastname_".$counter."' value='".$import_arr[$i]->getVar("import_lastname")."' />";
+ $form .= "<input type='text' name='lastname_" . $counter . "' title='"._AM_XNEWSLETTER_SUBSCR_LASTNAME."' id='lastname_".$counter."' value='".$import_arr[$i]->getVar("import_lastname")."' />";
$form .= "</td>";
$form .= "<td align=\"center\">";
$subscr_id = $import_arr[$i]->getVar("import_subscr_id");
$form .= "<input type='hidden' name='subscr_id_".$counter."' title='subscr_id' id='subscr_id_".$counter."' value='".$subscr_id."' />";
- if ($subscr_id > 0) $form .= "<img src='".XNEWSLETTER_ICONS_URL."/xn_ok.png' alt='"._AM_XNEWSLETTER_IMPORT_EMAIL_EXIST."' title='"._AM_XNEWSLETTER_IMPORT_EMAIL_EXIST."' />";
+ if ($subscr_id > 0)
+ $form .= "<img src='".XNEWSLETTER_ICONS_URL."/xn_ok.png' alt='"._AM_XNEWSLETTER_IMPORT_EMAIL_EXIST."' title='"._AM_XNEWSLETTER_IMPORT_EMAIL_EXIST."' />";
$form .= "</td>";
$form .= "<td align=\"center\">";
$catsubscr_id = $import_arr[$i]->getVar("import_catsubscr_id");
$form .= "<input type='hidden' name='catsubscr_id_".$counter."' title='catsubscr_id' id='catsubscr_id_".$counter."' value='".$catsubscr_id."' />";
- if ($catsubscr_id > 0) $form .= "<img src='".XNEWSLETTER_ICONS_URL."/xn_ok.png' alt='"._AM_XNEWSLETTER_IMPORT_CATSUBSCR_EXIST."' title='"._AM_XNEWSLETTER_IMPORT_CATSUBSCR_EXIST."' />";
+ if ($catsubscr_id > 0)
+ $form .= "<img src='".XNEWSLETTER_ICONS_URL."/xn_ok.png' alt='"._AM_XNEWSLETTER_IMPORT_CATSUBSCR_EXIST."' title='"._AM_XNEWSLETTER_IMPORT_CATSUBSCR_EXIST."' />";
$form .= "</td>";
$form .= "</td>";
$form .= "<td align=\"center\">";
@@ -190,7 +197,7 @@
//update mod_xnewsletter with settings form_import
$counter = xNewsletter_CleanVars($_REQUEST, 'counter', 0, 'int');
- for ($i=1; $i < ($counter+1); $i++) {
+ for ($i=1; $i < ($counter + 1); $i++) {
$import_id = xNewsletter_CleanVars($_REQUEST, 'import_id_'.$i, 'default', 'string');
$subscr_firstname = xNewsletter_CleanVars($_REQUEST, 'firstname_'.$i, '', 'string');
$subscr_lastname = xNewsletter_CleanVars($_REQUEST, 'lastname_'.$i, '', 'string');
@@ -198,35 +205,41 @@
$cat_id = xNewsletter_CleanVars($_REQUEST, 'cat_id_'.$i, 0, 'int');
if ($cat_id > 0) {
- if ($subscr_id==0) {
+ if ($subscr_id == 0) {
//update sex, firstname, lastname
- $sql = "UPDATE ".$xoopsDB->prefix('mod_xnewsletter_import')." SET `import_sex`='$subscr_sex', `import_firstname`='$subscr_firstname', `import_lastname`='$subscr_lastname' WHERE `import_id`=$import_id";
+ $sql = "UPDATE {$xoopsDB->prefix('mod_xnewsletter_import')}";
+ $sql .= " SET `import_sex`='{$subscr_sex}', `import_firstname`='{$subscr_firstname}', `import_lastname`='{$subscr_lastname}'";
+ $sql .= " WHERE `import_id`={$import_id}";
$result=$xoopsDB->queryF($sql);
}
}
//update cat_id and import_status
- $sql = "UPDATE ".$xoopsDB->prefix('mod_xnewsletter_import')." SET `import_cat_id`='$cat_id', `import_status`=1 WHERE `import_id`=$import_id";
+ $sql = "UPDATE {$xoopsDB->prefix('mod_xnewsletter_import')}";
+ $sql .= " SET `import_cat_id`='{$cat_id}', `import_status`=1";
+ $sql.= " WHERE `import_id`={$import_id}";
$result=$xoopsDB->queryF($sql);
}
- redirect_header("import.php?op=exec_import_final&check_import=1&limitcheck=".$limitcheck, 0, "");
+ redirect_header("{$currentFile}?op=exec_import_final&check_import=1&limitcheck={$limitcheck}", 0, '');
break;
case "exec_import_final":
//execute final import of all data from mod_xnewsletter_import, where import_status = 1
//delete data from mod_xnewsletter_import, when imported (successful or not)
- $indexAdmin->addItemButton(_AM_XNEWSLETTER_IMPORT_PLUGINS_AVAIL, 'import.php?op=default', 'list');
+ $indexAdmin->addItemButton(_AM_XNEWSLETTER_IMPORT_PLUGINS_AVAIL, $currentFile, 'list');
echo $indexAdmin->renderButton();
$ip = xoops_getenv("REMOTE_ADDR");
$submitter = $xoopsUser->uid();
- $crit_import = new CriteriaCompo();
- $crit_import->add(new Criteria('import_status', "1"));
+ $import_criteria = new CriteriaCompo();
+ $import_criteria->add(new Criteria('import_status', '1'));
$numrows_total = $xnewsletter->getHandler('xNewsletter_import')->getCount();
- $numrows_act = $xnewsletter->getHandler('xNewsletter_import')->getCount($crit_import);
+ $numrows_act = $xnewsletter->getHandler('xNewsletter_import')->getCount($import_criteria);
if ( $numrows_act > 0 ) {
- $sql = "SELECT * FROM ".$xoopsDB->prefix("mod_xnewsletter_import")." WHERE ((import_status)=1)";
+ $sql = "SELECT *";
+ $sql .= " FROM {$xoopsDB->prefix("mod_xnewsletter_import")}";
+ $sql .= " WHERE ((import_status)=1)";
$sql .= " ORDER BY `import_id` ASC";
$counter = 0;
$users_import = $xoopsDB->queryF($sql) or die ("MySQL-Error: " . mysql_error());
@@ -242,47 +255,53 @@
$subscribe = 0;
if ($cat_id == 0) {
- create_prot ( str_replace("%e", $subscr_email, _AM_XNEWSLETTER_IMPORT_RESULT_SKIP), 1, $submitter);
+ createProtocol(str_replace("%e", $subscr_email, _AM_XNEWSLETTER_IMPORT_RESULT_SKIP), 1, $submitter);
} else {
//register email
if ($subscr_id==0) {
$subscr_uid = 0;
- $sql = "SELECT `uid` FROM ".$xoopsDB->prefix("users")." WHERE (`email`='";
- $sql .= $subscr_email;
- $sql .= "') LIMIT 1";
- if ( $user = $xoopsDB->queryF($sql) ) {
+ $sql = "SELECT `uid`";
+ $sql .= " FROM {$xoopsDB->prefix('users')}";
+ $sql .= " WHERE (`email`='{$subscr_email}') LIMIT 1";
+ if ($user = $xoopsDB->queryF($sql)) {
$row_user = mysql_fetch_array($user);
$subscr_uid = $row_user[0];
}
unset($row_user);
unset($user);
- $sql = "INSERT INTO `".$xoopsDB->prefix('mod_xnewsletter_subscr')."` (`subscr_email`, `subscr_firstname`, `subscr_lastname`, `subscr_uid`, `subscr_sex`, `subscr_submitter`, `subscr_created`, `subscr_ip`, `subscr_activated`, `subscr_actoptions`) VALUES ('".$subscr_email."','".$subscr_firstname."','".$subscr_lastname."',".intval($subscr_uid).",'".$subscr_sex."',".$submitter.",".time().",'".$ip."','1','')";
+ $sql = "INSERT";
+ $sql .= " INTO `{$xoopsDB->prefix('mod_xnewsletter_subscr')}`";
+ $sql .= " (`subscr_email`, `subscr_firstname`, `subscr_lastname`, `subscr_uid`, `subscr_sex`, `subscr_submitter`, `subscr_created`, `subscr_ip`, `subscr_activated`, `subscr_actoptions`)";
+ $sql .= " VALUES ('{$subscr_email}', '{$subscr_firstname}', '{$subscr_lastname}', " . intval($subscr_uid) . ", '{$subscr_sex}', {$submitter}, " . time() . ",'{$ip}', '1', '')";
if (!$xoopsDB->queryF($sql)) {
- create_prot ( str_replace("%e", $subscr_email, _AM_XNEWSLETTER_IMPORT_RESULT_FAILED), 0, $submitter);
+ createProtocol(str_replace("%e", $subscr_email, _AM_XNEWSLETTER_IMPORT_RESULT_FAILED), 0, $submitter);
} else {
//register email successful
- $resulttext = $subscr_email.": "._AM_XNEWSLETTER_IMPORT_RESULT_REG_OK." | ";
+ $resulttext = $subscr_email . ": " . _AM_XNEWSLETTER_IMPORT_RESULT_REG_OK . " | ";
$subscr_id = $xoopsDB->getInsertId();
$subscribe=1;
}
} else {
//email already registered
- $resulttext = $subscr_email.": "._AM_XNEWSLETTER_IMPORT_EMAIL_EXIST." | ";
+ $resulttext = $subscr_email . ": " ._AM_XNEWSLETTER_IMPORT_EMAIL_EXIST . " | ";
$subscribe=1;
}
if ($subscribe == 1) {
if ($catsubscr_id==0) {
//add subscription of this email
- $sql = "INSERT INTO `".$xoopsDB->prefix('mod_xnewsletter_catsubscr')."` (`catsubscr_catid`, `catsubscr_subscrid`, `catsubscr_submitter`, `catsubscr_created`) VALUES (".$cat_id.",".$subscr_id.",".$submitter.",".time().")";
+ $sql = "INSERT";
+ $sql .= " INTO `{$xoopsDB->prefix('mod_xnewsletter_catsubscr')}`";
+ $sql .= " (`catsubscr_catid`, `catsubscr_subscrid`, `catsubscr_submitter`, `catsubscr_created`)";
+ $sql .= " VALUES ({$cat_id}, {$subscr_id}, {$submitter}," . time() . ")";
if ($xoopsDB->queryF($sql)) {
- create_prot ( $resulttext._AM_XNEWSLETTER_IMPORT_RESULT_SUBSCR_OK, 1, $submitter);
+ createProtocol($resulttext . _AM_XNEWSLETTER_IMPORT_RESULT_SUBSCR_OK, 1, $submitter);
//handle mailinglists
$cat_mailinglist = 0;
- $sql = "SELECT `cat_mailinglist` FROM ".$xoopsDB->prefix("mod_xnewsletter_cat")." WHERE (`cat_id`=";
- $sql .= $cat_id;
- $sql .= ") LIMIT 1";
- if ( $cat_mls = $xoopsDB->queryF($sql) ) {
+ $sql = "SELECT `cat_mailinglist`";
+ $sql .= " FROM {$xoopsDB->prefix("mod_xnewsletter_cat")}";
+ $sql .= " WHERE (`cat_id`={$cat_id}) LIMIT 1";
+ if ($cat_mls = $xoopsDB->queryF($sql)) {
$cat_ml = mysql_fetch_array($cat_mls);
$cat_mailinglist = $cat_ml[0];
}
@@ -290,18 +309,20 @@
unset($cat_mls);
if ($cat_mailinglist > 0) {
- require_once( XOOPS_ROOT_PATH."/modules/xNewsletter/include/mailinglist.php" );
+ require_once(XOOPS_ROOT_PATH . "/modules/xNewsletter/include/mailinglist.php");
subscribingMLHandler(1, $subscr_id, $cat_mailinglist);
}
} else {
- create_prot ( str_replace("%e", $subscr_email, _AM_XNEWSLETTER_IMPORT_RESULT_FAILED), 0, $submitter);
+ createProtocol(str_replace("%e", $subscr_email, _AM_XNEWSLETTER_IMPORT_RESULT_FAILED), 0, $submitter);
}
} else {
- create_prot ( $resulttext._AM_XNEWSLETTER_IMPORT_CATSUBSCR_EXIST, 1, $submitter);
+ createProtocol($resulttext . _AM_XNEWSLETTER_IMPORT_CATSUBSCR_EXIST, 1, $submitter);
}
}
}
- $sql_del = "DELETE FROM ".$xoopsDB->prefix('mod_xnewsletter_import')." WHERE `import_id`=".$import_id;
+ $sql_del = "DELETE";
+ $sql_del .= " FROM {$xoopsDB->prefix('mod_xnewsletter_import')}";
+ $sql_del .= " WHERE `import_id`={$import_id}";
$result = $xoopsDB->queryF($sql_del);
}
@@ -314,7 +335,7 @@
$numrows_pend = $xnewsletter->getHandler('xNewsletter_import')->getCount();
if ($numrows_pend > 0) {
- $form_continue = "<form id='form_continue' enctype='multipart/form-data' method='post' action='import.php' name='form_continue'>";
+ $form_continue = "<form id='form_continue' enctype='multipart/form-data' method='post' action='{$currentFile}' name='form_continue'>";
$form_continue .= "<input id='submit' class='formButton' type='submit' title='"._AM_XNEWSLETTER_IMPORT_CONTINUE."' value='"._AM_XNEWSLETTER_IMPORT_CONTINUE."' name='submit'>";
$form_continue .= '<input id="limitcheck" type="hidden" value="'.$limitcheck.'" name="limitcheck">';
if ($check_import==1) {
@@ -344,8 +365,8 @@
//set cat_id as preselected, update information about existing registration/subscriptions
//if ($action_after_read==1) execute import else show form for check before executing import
- $pluginFile = XNEWSLETTER_ROOT_PATH . "/plugins/" . $plugin . '.php';
- if ( !file_exists($pluginFile) ) {
+ $pluginFile = XNEWSLETTER_ROOT_PATH . "/plugins/{$plugin}.php";
+ if (!file_exists($pluginFile)) {
echo str_replace("%p", $plugin, _AM_XNEWSLETTER_IMPORT_ERROR_NO_PLUGIN);
break;
}
@@ -353,14 +374,14 @@
$function = 'xnewsletter_plugin_getdata_' . $plugin;
if (!function_exists($function)) {
- echo "Error: require function 'xnewsletter_plugin_getdata_".$plugin."' doesn't exist";
+ echo "Error: require function 'xnewsletter_plugin_getdata_{$plugin}' doesn't exist";
echo str_replace("%f", $plugin, _AM_XNEWSLETTER_IMPORT_ERROR_NO_FUNCTION);
break;
}
//delete all existing data
$sql = "TRUNCATE TABLE ".$xoopsDB->prefix('mod_xnewsletter_import');
- $result=$xoopsDB->queryF($sql);
+ $result= $xoopsDB->queryF($sql);
//import data into mod_xnewsletter_import with plugin
if ($plugin == 'csv') {
@@ -379,37 +400,37 @@
}
if ($numData > 0) {
- if ($action_after_read==0) {
+ if ($action_after_read == 0) {
//execute import without check
- redirect_header("import.php?op=exec_import_final&action_after_read=0&limitcheck=".$limitcheck, 0, "");
+ redirect_header("{$currentFile}?op=exec_import_final&action_after_read=0&limitcheck={$limitcheck}", 0, '');
} else {
//show form for check before executing import
- redirect_header("import.php?op=show_formcheck&action_after_read=1&plugin=".$plugin."&limitcheck=".$limitcheck, 0, "");
+ redirect_header("{$currentFile}?op=show_formcheck&action_after_read=1&plugin={$plugin}&limitcheck={$limitcheck}", 0, '');
}
} else {
- redirect_header("import.php", 3, _AM_XNEWSLETTER_IMPORT_NODATA);
+ redirect_header($currentFile, 3, _AM_XNEWSLETTER_IMPORT_NODATA);
}
break;
case "form_additional":
//show form for additional settings
- $indexAdmin->addItemButton(_AM_XNEWSLETTER_IMPORT_PLUGINS_AVAIL, 'import.php?op=default', 'list');
+ $indexAdmin->addItemButton(_AM_XNEWSLETTER_IMPORT_PLUGINS_AVAIL, $currentFile, 'list');
echo $indexAdmin->renderButton();
- $pluginFile = XNEWSLETTER_ROOT_PATH . "/plugins/" . $plugin . '.php';
- if ( !file_exists($pluginFile) ) {
+ $pluginFile = XNEWSLETTER_ROOT_PATH . "/plugins/{$plugin}.php";
+ if (!file_exists($pluginFile)) {
echo str_replace("%p", $plugin, _AM_XNEWSLETTER_IMPORT_ERROR_NO_PLUGIN);
break;
}
require_once($pluginFile);
- $function = 'xnewsletter_plugin_getform_' . $plugin;
- if (!function_exists($function) ) {
+ $function = "xnewsletter_plugin_getform_{$plugin}";
+ if (!function_exists($function)) {
echo str_replace("%f", $plugin, _AM_XNEWSLETTER_IMPORT_ERROR_NO_FUNCTION);
break;
}
//$form = $function( $cat_id, $action_after_read, $limitcheck, $skipcatsubscrexist );
- $form = call_user_func($function, $cat_id, $action_after_read, $limitcheck, $skipcatsubscrexist );
+ $form = call_user_func($function, $cat_id, $action_after_read, $limitcheck, $skipcatsubscrexist);
$form->display();
break;
@@ -423,10 +444,12 @@
}
include "admin_footer.php";
-function create_prot($prot_text, $success, $submitter) {
+
+
+function createProtocol($prot_text, $success, $submitter) {
global $xoopsDB;
-
- $sql = "INSERT INTO `{$xoopsDB->prefix('mod_xnewsletter_protocol')}` (`protocol_letter_id`, `protocol_subscriber_id`, `protocol_status`, `protocol_success`, `protocol_submitter`, `protocol_created`)";
- $sql.= " VALUES (0,0,'{$prot_text}', {$success}, {$submitter}, " . time() . ")";
+ $sql = "INSERT INTO `{$xoopsDB->prefix('mod_xnewsletter_protocol')}`";
+ $sql .= " (`protocol_letter_id`, `protocol_subscriber_id`, `protocol_status`, `protocol_success`, `protocol_submitter`, `protocol_created`)";
+ $sql .= " VALUES (0,0,'{$prot_text}', {$success}, {$submitter}, " . time() . ")";
$xoopsDB->queryF($sql) or die ("MySQL-Error: " . mysql_error());
}
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/blocks/blocks_catsubscr.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/blocks/blocks_catsubscr.php 2014-04-16 16:36:11 UTC (rev 12455)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/blocks/blocks_catsubscr.php 2014-04-17 21:07:56 UTC (rev 12456)
@@ -1,8 +1,10 @@
<?php
/**
* ****************************************************************************
+ * - A Project by Developers TEAM For Xoops - ( http://www.xoops.org )
+ * ****************************************************************************
* XNEWSLETTER - MODULE FOR XOOPS
- * Copyright (c) 2012
+ * Copyright (c) 2007 - 2012
* Goffy ( wedega.com )
*
* You may not change or alter any portion of this comment or credits
@@ -23,22 +25,21 @@
* Version : 1 Mon 2012/11/05 14:31:32 : Exp $
* ****************************************************************************
*/
+defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
+include_once dirname(dirname(__FILE__)) . '/include/common.php';
-include_once XOOPS_ROOT_PATH . "/modules/xNewsletter/include/functions.php";
+
function b_xnewsletter_catsubscr($options) {
- include_once XOOPS_ROOT_PATH . "/modules/xNewsletter/class/xNewsletter_catsubscr.php";
- $myts =& MyTextSanitizer::getInstance();
+ global $xoopsUser;
+ $xnewsletter = xNewsletterxNewsletter::getInstance();
+ $myts = MyTextSanitizer::getInstance();
$catsubscr = array();
$type_block = $options[0];
$nb_catsubscr = $options[1];
$length_title = $options[2];
- $xnewsletter->getHandler('xNewsletter_catsubscr') =& xoops_getModuleHandler("xnewsletter_catsubscr", "xNewsletter");
- $xnewsletter->getHandler('xNewsletter_cat')=& xoops_getModuleHandler('xNewsletter_cat', 'xNewsletter');
- $xnewsletter->getHandler('xNewsletter_subscr')=& xoops_getModuleHandler('xNewsletter_subscr', 'xNewsletter');
-
$criteria = new CriteriaCompo();
array_shift($options);
array_shift($options);
@@ -76,29 +77,32 @@
if ($length_title > 0 && strlen($cat_name) > $length_title)
$cat_name = substr($cat_name, 0, $length_title) . "...";
$catsubscr[$i]["catsubscr_newsletter"] = $cat...
[truncated message content] |
|
From: <luc...@us...> - 2014-04-18 16:03:19
|
Revision: 12459
http://sourceforge.net/p/xoops/svn/12459
Author: luciorota
Date: 2014-04-18 16:03:16 +0000 (Fri, 18 Apr 2014)
Log Message:
-----------
Modified Paths:
--------------
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/xoops_version.php
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.php 2014-04-18 11:37:54 UTC (rev 12458)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.php 2014-04-18 16:03:16 UTC (rev 12459)
@@ -25,10 +25,9 @@
* Version : $Id $
* ****************************************************************************
*/
-
+$currentFile = basename(__FILE__);
include "admin_header.php";
xoops_cp_header();
-//global $indexAdmin;
// We recovered the value of the argument op in the URL$
$op = xNewsletter_CleanVars($_REQUEST, 'op', 'list', 'string');
@@ -43,14 +42,14 @@
$img_ok = "<img src='" . XNEWSLETTER_ICONS_URL . "/xn_ok.png' alt='" . _AM_XNEWSLETTER_OK . "' title='"._AM_XNEWSLETTER_OK . "' /> ";
$img_failed = "<img src='" . XNEWSLETTER_ICONS_URL . "/xn_failed.png' alt='" . _AM_XNEWSLETTER_FAILED . "' title='" . _AM_XNEWSLETTER_FAILED . "' /> ";
- echo $indexAdmin->addNavigation("accounts.php");
- $indexAdmin->addItemButton(_AM_XNEWSLETTER_ACCOUNTSLIST, 'accounts.php?op=list', 'list');
+ echo $indexAdmin->addNavigation($currentFile);
+ $indexAdmin->addItemButton(_AM_XNEWSLETTER_ACCOUNTSLIST, $currentFile, 'list');
echo $indexAdmin->renderButton();
if ($accounts_id == 0) {
- redirect_header("accounts.php", 3, _AM_XNEWSLETTER_ERROR_NO_VALID_ID);
+ redirect_header($currentFile, 3, _AM_XNEWSLETTER_ERROR_NO_VALID_ID);
} else {
- $accountObj =& $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
+ $accountObj = $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
}
$mailhost = $accountObj->getVar("accounts_server_in");
@@ -75,42 +74,43 @@
$accounts_hardbox = $accountObj->getVar("accounts_hardbox"); $accounts_hardbox_ok = 0;
$accounts_softbox = $accountObj->getVar("accounts_softbox"); $accounts_softbox_ok = 0;
- $command = $mailhost.":".$port;
+ $command = $mailhost . ":" . $port;
if ($service !='') $command .= '/' . $service;
if ($service_option !='') $command .= '/' . $service_option;
- echo "<table class='outer width100' cellspacing='1'>
- <tr>
- <th class='center width5'></th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK_INFO."</th>
- </tr>";
+ echo "
+ <table class='outer width100' cellspacing='1'>
+ <tr>
+ <th class='center width5'></th>
+ <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_INFO . "</th>
+ </tr>";
$mbox = @imap_open("{" . $command . "}", $accounts_username, $accounts_password); // or die ("can't connect: " . imap_last_error());
- if ( $mbox === false ) {
+ if ($mbox === false) {
echo "<tr>";
- echo "<td class='center width5'>".$img_failed."</td>";
+ echo "<td class='center width5'>" . $img_failed . "</td>";
echo "<td class='left'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_MAILBOX._AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED."</td>";
- echo "<td class='left'>".imap_last_error()."</td>";
+ echo "<td class='left'>" . imap_last_error() . "</td>";
echo "</tr>";
} else {
echo "<tr>";
- echo "<td class='center width5'>".$img_ok."</td>";
- echo "<td class='left'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_MAILBOX._AM_XNEWSLETTER_ACCOUNTS_CHECK_OK."</td>";
+ echo "<td class='center width5'>" . $img_ok . "</td>";
+ echo "<td class='left'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_MAILBOX._AM_XNEWSLETTER_ACCOUNTS_CHECK_OK . "</td>";
echo "<td class='left'></td>";
echo "</tr>";
$folders = imap_listmailbox($mbox, "{".$command."}", "*");
if ($folders == false) {
echo "<tr>";
- echo "<td class='center width5'>".$img_failed."</td>";
- echo "<td class='left'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_FOLDERS._AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED."</td>";
- echo "<td class='left'>".imap_last_error()."</td>";
+ echo "<td class='center width5'>" . $img_failed . "</td>";
+ echo "<td class='left'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_FOLDERS._AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED . "</td>";
+ echo "<td class='left'>" . imap_last_error() . "</td>";
echo "</tr>";
} else {
echo "<tr>";
- echo "<td class='center width5'>".$img_ok."</td>";
- echo "<td class='left'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_FOLDERS._AM_XNEWSLETTER_ACCOUNTS_CHECK_OK."</td>";
+ echo "<td class='center width5'>" . $img_ok . "</td>";
+ echo "<td class='left'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_FOLDERS._AM_XNEWSLETTER_ACCOUNTS_CHECK_OK . "</td>";
echo "<td class='left'>";
if (is_array($folders)) {
reset ($folders);
@@ -118,15 +118,15 @@
$foldercreated = 0;
while (list( $key, $val) = each ($folders)) {
echo "($key) ";
- echo imap_utf7_decode (str_replace("{".$command."}","",$val)) . "<br>\n";
- if ("{".$command."}".$accounts_inbox == $val) $accounts_inbox_ok = 1;
- if ("{".$command."}".$accounts_hardbox == $val) {
+ echo imap_utf7_decode(str_replace("{" . $command . "}", "", $val)) . "<br>\n";
+ if ("{" . $command . "}" . $accounts_inbox == $val) $accounts_inbox_ok = 1;
+ if ("{" . $command . "}" . $accounts_hardbox == $val) {
$accounts_hardbox_ok = 1;
} else {
@imap_createmailbox($mbox, imap_utf7_encode('{'.$command.'}' . $accounts_hardbox));
$foldercreated = 1;
}
- if ("{".$command."}".$accounts_softbox == $val) {
+ if ("{" . $command . "}" . $accounts_softbox == $val) {
$accounts_softbox_ok = 1;
} else {
@imap_createmailbox($mbox, imap_utf7_encode('{' . $command . '}' . $accounts_softbox));
@@ -135,9 +135,9 @@
}
if ($foldercreated == 1) {
$folders_recheck = imap_listmailbox($mbox, "{" . $command . "}", "*");
- while (list( $key, $val) = each ($folders_recheck)) {
- if ("{".$command."}".$accounts_hardbox == $val) $accounts_hardbox_ok = 1;
- if ("{".$command."}".$accounts_softbox == $val) $accounts_softbox_ok = 1;
+ while (list($key, $val) = each ($folders_recheck)) {
+ if ("{" . $command . "}" . $accounts_hardbox == $val) $accounts_hardbox_ok = 1;
+ if ("{" . $command . "}" . $accounts_softbox == $val) $accounts_softbox_ok = 1;
}
}
}
@@ -189,8 +189,8 @@
case "list":
default:
- echo $indexAdmin->addNavigation('accounts.php') ;
- $indexAdmin->addItemButton(_AM_XNEWSLETTER_NEWACCOUNTS, 'accounts.php?op=new_account', 'add');
+ echo $indexAdmin->addNavigation($currentFile) ;
+ $indexAdmin->addItemButton(_AM_XNEWSLETTER_NEWACCOUNTS, "{$currentFile}?op=new_account", 'add');
echo $indexAdmin->renderButton();
$limit = $GLOBALS['xoopsModuleConfig']['adminperpage'];
@@ -212,41 +212,42 @@
// View Table
if ($numrows > 0) {
- echo "<table class='outer width100' cellspacing='1'>
- <tr>
- <th class='center width2'>"._AM_XNEWSLETTER_ACCOUNTS_ID."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_TYPE."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_NAME."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_YOURNAME."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_YOURMAIL."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_DEFAULT."</th>
- <th class='center width10'>"._AM_XNEWSLETTER_FORMACTION."</th>
- </tr>";
+ echo "
+ <table class='outer width100' cellspacing='1'>
+ <tr>
+ <th class='center width2'>" . _AM_XNEWSLETTER_ACCOUNTS_ID . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_TYPE . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_NAME . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_YOURNAME . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_YOURMAIL . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_DEFAULT . "</th>
+ <th class='center width10'>" . _AM_XNEWSLETTER_FORMACTION . "</th>
+ </tr>";
$class = "odd";
foreach (array_keys($accounts_arr) as $i) {
- echo "<tr class='".$class."'>";
+ echo "<tr class='" . $class . "'>";
$class = ($class == "even") ? "odd" : "even";
- echo "<td class='center'>".$i."</td>";
+ echo "<td class='center'>" . $i . "</td>";
$arr_accounts_type=array(
_AM_ACCOUNTS_TYPE_VAL_PHP_MAIL=>_AM_ACCOUNTS_TYPE_PHPMAIL,
_AM_ACCOUNTS_TYPE_VAL_PHP_SENDMAIL=>_AM_ACCOUNTS_TYPE_PHPSENDMAIL,
_AM_ACCOUNTS_TYPE_VAL_POP3=>_AM_ACCOUNTS_TYPE_POP3,
_AM_ACCOUNTS_TYPE_VAL_SMTP=>_AM_ACCOUNTS_TYPE_SMTP,
_AM_ACCOUNTS_TYPE_VAL_GMAIL=>_AM_ACCOUNTS_TYPE_GMAIL);
- echo "<td class='center'>". $arr_accounts_type[$accounts_arr[$i]->getVar("accounts_type")]."</td>";
- echo "<td class='center'>".$accounts_arr[$i]->getVar("accounts_name")."</td>";
- echo "<td class='center'>".$accounts_arr[$i]->getVar("accounts_yourname")."</td>";
- echo "<td class='center'>".$accounts_arr[$i]->getVar("accounts_yourmail")."</td>";
- $verif_accounts_default = ( $accounts_arr[$i]->getVar("accounts_default") == 1 ) ? _YES : _NO;
- echo "<td class='center'>".$verif_accounts_default."</td>";
+ echo "<td class='center'>" . $arr_accounts_type[$accounts_arr[$i]->getVar("accounts_type")] . "</td>";
+ echo "<td class='center'>" . $accounts_arr[$i]->getVar("accounts_name") . "</td>";
+ echo "<td class='center'>" . $accounts_arr[$i]->getVar("accounts_yourname") . "</td>";
+ echo "<td class='center'>" . $accounts_arr[$i]->getVar("accounts_yourmail") . "</td>";
+ $verif_accounts_default = ($accounts_arr[$i]->getVar("accounts_default") == 1) ? _YES : _NO;
+ echo "<td class='center'>" . $verif_accounts_default . "</td>";
echo "<td class='center width5'>";
- echo " <a href='accounts.php?op=edit_account&accounts_id=".$i."'><img src=".XNEWSLETTER_ICONS_URL."/xn_edit.png alt='"._EDIT."' title='"._EDIT."' /></a>";
- echo " <a href='accounts.php?op=delete_account&accounts_id=".$i."'><img src=".XNEWSLETTER_ICONS_URL."/xn_delete.png alt='"._DELETE."' title='"._DELETE."' /></a>";
+ echo " <a href='" . $currentFile . "?op=edit_account&accounts_id=" . $i . "'><img src=" . XNEWSLETTER_ICONS_URL . "/xn_edit.png alt='" . _EDIT . "' title='" . _EDIT . "' /></a>";
+ echo " <a href='" . $currentFile . "?op=delete_account&accounts_id=" . $i . "'><img src=" . XNEWSLETTER_ICONS_URL . "/xn_delete.png alt='" . _DELETE . "' title='" . _DELETE . "' /></a>";
if ($accounts_arr[$i]->getVar("accounts_type") != _AM_ACCOUNTS_TYPE_VAL_PHP_MAIL && $accounts_arr[$i]->getVar("accounts_type") != _AM_ACCOUNTS_TYPE_VAL_PHP_SENDMAIL) {
- echo " <a href='accounts.php?op=check_account&accounts_id=".$i."'><img src=".XNEWSLETTER_ICONS_URL."/xn_check.png alt='"._AM_ACCOUNTS_TYPE_CHECK."' title='"._AM_ACCOUNTS_TYPE_CHECK."' /></a>";
+ echo " <a href='" . $currentFile . "?op=check_account&accounts_id=".$i."'><img src=" . XNEWSLETTER_ICONS_URL . "/xn_check.png alt='" . _AM_ACCOUNTS_TYPE_CHECK . "' title='" . _AM_ACCOUNTS_TYPE_CHECK . "' /></a>";
}
echo "</td>";
echo "</tr>";
@@ -278,8 +279,8 @@
break;
case "new_account":
- echo $indexAdmin->addNavigation("accounts.php");
- $indexAdmin->addItemButton(_AM_XNEWSLETTER_ACCOUNTSLIST, 'accounts.php?op=list', 'list');
+ echo $indexAdmin->addNavigation($currentFile);
+ $indexAdmin->addItemButton(_AM_XNEWSLETTER_ACCOUNTSLIST, $currentFile, 'list');
echo $indexAdmin->renderButton();
$accountObj = $xnewsletter->getHandler('xNewsletter_accounts')->create();
$accountObj = xNewsletter_setPost($accountObj, $_POST);
@@ -289,10 +290,10 @@
case "save_accounts":
if ( !$GLOBALS["xoopsSecurity"]->check() ) {
- redirect_header("accounts.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
+ redirect_header($currentFile, 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
}
- $accountObj =& $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
+ $accountObj = $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
$_POST['accounts_id'] = $accounts_id;
$accountObj = xNewsletter_setPost($accountObj, $_POST);
@@ -316,9 +317,9 @@
if ($accountObj->getVar("accounts_yourmail") != "" && $accountObj->getVar("accounts_yourmail") != _AM_ACCOUNTS_TYPE_YOUREMAIL ) {
if ($xnewsletter->getHandler('xNewsletter_accounts')->insert($accountObj)) {
if ($save_and_check == 'none') {
- redirect_header("accounts.php?op=list", 2, _AM_XNEWSLETTER_FORMOK);
+ redirect_header($currentFile, 2, _AM_XNEWSLETTER_FORMOK);
} else {
- redirect_header("accounts.php?op=check_account&accounts_id={$accountObj->getVar("accounts_id")}", 2, _AM_XNEWSLETTER_FORMOK);
+ redirect_header("{$currentFile}?op=check_account&accounts_id={$accountObj->getVar("accounts_id")}", 2, _AM_XNEWSLETTER_FORMOK);
}
}
} else {
@@ -331,9 +332,9 @@
break;
case "edit_account":
- echo $indexAdmin->addNavigation("accounts.php");
- $indexAdmin->addItemButton(_AM_XNEWSLETTER_NEWACCOUNTS, 'accounts.php?op=new_account', 'add');
- $indexAdmin->addItemButton(_AM_XNEWSLETTER_ACCOUNTSLIST, 'accounts.php?op=list', 'list');
+ echo $indexAdmin->addNavigation($currentFile);
+ $indexAdmin->addItemButton(_AM_XNEWSLETTER_NEWACCOUNTS, "{$currentFile}?op=new_account", 'add');
+ $indexAdmin->addItemButton(_AM_XNEWSLETTER_ACCOUNTSLIST, $currentFile, 'list');
echo $indexAdmin->renderButton();
$accountObj = $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
if (!empty($_POST)) {
@@ -347,15 +348,15 @@
$accountObj = $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
if (isset($_POST["ok"]) && $_POST["ok"] == "1") {
if ( !$GLOBALS["xoopsSecurity"]->check() ) {
- redirect_header("accounts.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
+ redirect_header($currentFile, 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
}
if ($xnewsletter->getHandler('xNewsletter_accounts')->delete($accountObj)) {
- redirect_header("accounts.php", 3, _AM_XNEWSLETTER_FORMDELOK);
+ redirect_header($currentFile, 3, _AM_XNEWSLETTER_FORMDELOK);
} else {
echo $accountObj->getHtmlErrors();
}
} else {
- xoops_confirm(array("ok" => 1, "accounts_id" => $accounts_id, "op" => "delete_account"), "accounts.php", sprintf(_AM_XNEWSLETTER_FORMSUREDEL, $accountObj->getVar("accounts_name")));
+ xoops_confirm(array("ok" => 1, "accounts_id" => $accounts_id, "op" => "delete_account"), $currentFile, sprintf(_AM_XNEWSLETTER_FORMSUREDEL, $accountObj->getVar("accounts_name")));
}
break;
}
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/xoops_version.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/xoops_version.php 2014-04-18 11:37:54 UTC (rev 12458)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/xoops_version.php 2014-04-18 16:03:16 UTC (rev 12459)
@@ -27,9 +27,9 @@
*/
defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
-
xoops_load('XoopsLists');
+
$modversion['name'] = _MI_XNEWSLETTER_NAME;
$modversion['version'] = 1.3;
$modversion['description'] = _MI_XNEWSLETTER_DESC;
@@ -58,7 +58,7 @@
$modversion['module_status'] = "Alpha";
$modversion['release_info'] = "";
$modversion['release_file'] = XOOPS_URL . "/modules/{$modversion['dirname']}/docs/";
-$modversion['release_date'] = "2014/04/16";
+$modversion['release_date'] = "2014/04/18";
$modversion['manual'] = "xNewsletter.txt";
$modversion['manual_file'] = XOOPS_URL . "/modules/{$modversion['dirname']}/docs/";
|
|
From: <luc...@us...> - 2014-05-27 20:48:57
|
Revision: 12552
http://sourceforge.net/p/xoops/svn/12552
Author: luciorota
Date: 2014-05-27 20:48:48 +0000 (Tue, 27 May 2014)
Log Message:
-----------
starting and fixing mamba work
fixed error in subscription.php
Modified Paths:
--------------
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/about.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/admin_header.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/attachment.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/bmh.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/bmh_callback_database.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/cat.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/catsubscr.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/import.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/letter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/mailinglist.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/maintenance.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/menu.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/protocol.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/sendletter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/subscr.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/task.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/blocks/blocks_catsubscr.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/blocks/blocks_letter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/blocks/blocks_subscrinfo.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/breadcrumb.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/request.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/session.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_accounts.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_attachment.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_bmh.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_cat.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_catsubscr.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_import.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_letter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_mailinglist.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_protocol.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_subscr.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xNewsletter_task.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xnewsletter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/cron.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/docs/changelog.txt
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/footer.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/common.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/config.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/constants.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/functions.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/install.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/mailinglist.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/onupdate.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/phpmailer_bmh/class.phpmailer-bmh.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/phpmailer_bmh/phpmailer-bmh_rules.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/search.inc.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/task.inc.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/index.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/blocks.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/common.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/main.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/modinfo.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/letter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/csv.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/evennews.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/rmbulletin.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/smartpartner.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/subscribers.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/weblinks.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/xoopsuser.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/print.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/protocol.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/sendletter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/subscription.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/xoops_version.php
Added Paths:
-----------
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/css/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/css/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/css/module.css
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/css/style.css
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/bookmarks/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/bookmarks/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/about.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/add.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/alert.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/arrow.gif
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/home.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/off.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/on.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_accounts.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_attachment.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_attachment_del.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_bmh.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_category.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_category_subscr.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_catsubscr_temp.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_check.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_clone.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_copy.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_delete.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_delete_2.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_details.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_edit.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_edit_2.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_failed.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_import.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_mailinglist.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_maintenance.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_newsletter.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_nothing.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_ok.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_preview.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_protocol.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_quit.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_resend.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_send.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_sendtest.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_subscribers.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xn_task.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/icons/xoopsmicrobutton.gif
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/letter_template/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/letter_template/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/letter_template/kletterfreaks.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/letter_template/nf_bg_green.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/letter_template/nf_bg_red.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/letter_template/nf_logo.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/letter_template/nf_logo_trans.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/letter_template/xoops-bg.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/letter_template/xoops-logo.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/images/xNewsletter.png
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/js/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/js/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/mail_template/info_change.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/templates/basic.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/templates/xoops.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/admin/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/admin/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/xNewsletter_catsubscr_block_day.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/xNewsletter_catsubscr_block_recent.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/xNewsletter_letter_block_day.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/xNewsletter_letter_block_random.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/xNewsletter_letter_block_recent.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/xNewsletter_subscrinfo_block.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_common_breadcrumb.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_footer.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_header.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_index.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_index_list_letters.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_letter.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_letter_list_letters.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_letter_list_subscrs.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_letter_preview.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_print.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_protocol.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_subscription.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_subscription_list_subscriptions.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_subscription_result.tpl
Removed Paths:
-------------
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/css/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/images/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/js/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/admin/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_common_breadcrumb.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_footer.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_header.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_index.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_index_list_letters.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_letter.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_letter_list_letters.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_letter_list_subscrs.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_letter_preview.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_print.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_protocol.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_subscription.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_subscription_list_subscriptions.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_subscription_result.html
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/about.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/about.php 2014-05-25 22:00:37 UTC (rev 12551)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/about.php 2014-05-27 20:48:48 UTC (rev 12552)
@@ -1,4 +1,4 @@
-<?php
+<?php
/**
* ****************************************************************************
* - A Project by Developers TEAM For Xoops - ( http://www.xoops.org )
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.php 2014-05-25 22:00:37 UTC (rev 12551)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.php 2014-05-27 20:48:48 UTC (rev 12552)
@@ -1,363 +1,362 @@
-<?php
-/**
- * ****************************************************************************
- * - A Project by Developers TEAM For Xoops - ( http://www.xoops.org )
- * ****************************************************************************
- * XNEWSLETTER - MODULE FOR XOOPS
- * Copyright (c) 2007 - 2012
- * Goffy ( wedega.com )
- *
- * You may not change or alter any portion of this comment or credits
- * of supporting developers from this source code or any supporting
- * source code which is considered copyrighted (c) material of the
- * original comment or credit authors.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * ---------------------------------------------------------------------------
- * @copyright Goffy ( wedega.com )
- * @license GPL 2.0
- * @package xNewsletter
- * @author Goffy ( web...@we... )
- *
- * Version : $Id $
- * ****************************************************************************
- */
-$currentFile = basename(__FILE__);
-include "admin_header.php";
-xoops_cp_header();
-
-// We recovered the value of the argument op in the URL$
-$op = xNewsletter_CleanVars($_REQUEST, 'op', 'list', 'string');
-$save_and_check = xNewsletter_CleanVars($_REQUEST, 'save_and_check', 'none', 'string');
-$accounts_id = xNewsletter_CleanVars($_REQUEST, 'accounts_id', 0, 'int');
-$post = xNewsletter_CleanVars($_REQUEST, 'post', '', 'string');
-
-if ($post == "" && $op == "save_accounts" && $save_and_check =="none" ) $op = "edit_account";
-
-switch ($op) {
- case "check_account" :
- $img_ok = "<img src='" . XNEWSLETTER_ICONS_URL . "/xn_ok.png' alt='" . _AM_XNEWSLETTER_OK . "' title='"._AM_XNEWSLETTER_OK . "' /> ";
- $img_failed = "<img src='" . XNEWSLETTER_ICONS_URL . "/xn_failed.png' alt='" . _AM_XNEWSLETTER_FAILED . "' title='" . _AM_XNEWSLETTER_FAILED . "' /> ";
-
- echo $indexAdmin->addNavigation($currentFile);
- $indexAdmin->addItemButton(_AM_XNEWSLETTER_ACCOUNTSLIST, $currentFile, 'list');
- echo $indexAdmin->renderButton();
-
- if ($accounts_id == 0) {
- redirect_header($currentFile, 3, _AM_XNEWSLETTER_ERROR_NO_VALID_ID);
- } else {
- $accountObj = $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
- }
-
- $mailhost = $accountObj->getVar("accounts_server_in");
- $port = $accountObj->getVar("accounts_port_in");
- switch ($accountObj->getVar("accounts_type")) {
- case _AM_ACCOUNTS_TYPE_VAL_POP3:
- $service = "pop3";
- break;
- case _AM_ACCOUNTS_TYPE_VAL_SMTP:
- case _AM_ACCOUNTS_TYPE_VAL_GMAIL:
- $service = "imap";
- break;
- case "default":
- default:
- $service = "";
- break;
- }
- $service_option = $accountObj->getVar("accounts_securetype_in");
- $accounts_password = $accountObj->getVar("accounts_password");
- $accounts_username = $accountObj->getVar("accounts_username");
- $accounts_inbox = $accountObj->getVar("accounts_inbox"); $accounts_inbox_ok = 0;
- $accounts_hardbox = $accountObj->getVar("accounts_hardbox"); $accounts_hardbox_ok = 0;
- $accounts_softbox = $accountObj->getVar("accounts_softbox"); $accounts_softbox_ok = 0;
-
- $command = $mailhost . ":" . $port;
- if ($service !='') $command .= '/' . $service;
- if ($service_option !='') $command .= '/' . $service_option;
-
- echo "
- <table class='outer width100' cellspacing='1'>
- <tr>
- <th class='center width5'></th>
- <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK . "</th>
- <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_INFO . "</th>
- </tr>";
-
- $mbox = @imap_open("{" . $command . "}", $accounts_username, $accounts_password); // or die ("can't connect: " . imap_last_error());
- if ($mbox === false) {
- echo "<tr>";
- echo "<td class='center width5'>" . $img_failed . "</td>";
- echo "<td class='left'>"._AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_MAILBOX._AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED."</td>";
- echo "<td class='left'>" . imap_last_error() . "</td>";
- echo "</tr>";
- } else {
- echo "<tr>";
- echo "<td class='center width5'>" . $img_ok . "</td>";
- echo "<td class='left'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_MAILBOX._AM_XNEWSLETTER_ACCOUNTS_CHECK_OK . "</td>";
- echo "<td class='left'></td>";
- echo "</tr>";
-
- $folders = imap_listmailbox($mbox, "{".$command."}", "*");
- if ($folders == false) {
- echo "<tr>";
- echo "<td class='center width5'>" . $img_failed . "</td>";
- echo "<td class='left'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_FOLDERS._AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED . "</td>";
- echo "<td class='left'>" . imap_last_error() . "</td>";
- echo "</tr>";
- } else {
- echo "<tr>";
- echo "<td class='center width5'>" . $img_ok . "</td>";
- echo "<td class='left'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_FOLDERS._AM_XNEWSLETTER_ACCOUNTS_CHECK_OK . "</td>";
- echo "<td class='left'>";
- if (is_array($folders)) {
- reset ($folders);
- sort ($folders);
- $foldercreated = 0;
- while (list( $key, $val) = each ($folders)) {
- echo "($key) ";
- echo imap_utf7_decode(str_replace("{" . $command . "}", "", $val)) . "<br>\n";
- if ("{" . $command . "}" . $accounts_inbox == $val) $accounts_inbox_ok = 1;
- if ("{" . $command . "}" . $accounts_hardbox == $val) {
- $accounts_hardbox_ok = 1;
- } else {
- @imap_createmailbox($mbox, imap_utf7_encode('{'.$command.'}' . $accounts_hardbox));
- $foldercreated = 1;
- }
- if ("{" . $command . "}" . $accounts_softbox == $val) {
- $accounts_softbox_ok = 1;
- } else {
- @imap_createmailbox($mbox, imap_utf7_encode('{' . $command . '}' . $accounts_softbox));
- $foldercreated = 1;
- }
- }
- if ($foldercreated == 1) {
- $folders_recheck = imap_listmailbox($mbox, "{" . $command . "}", "*");
- while (list($key, $val) = each ($folders_recheck)) {
- if ("{" . $command . "}" . $accounts_hardbox == $val) $accounts_hardbox_ok = 1;
- if ("{" . $command . "}" . $accounts_softbox == $val) $accounts_softbox_ok = 1;
- }
- }
- }
-
- echo "</td>";
- echo "</tr>";
- echo "<tr>";
- if ($accountObj->getVar("accounts_use_bmh") == '1') {
- if ($accounts_inbox_ok == 1 && $accounts_hardbox_ok == 1 && $accounts_softbox_ok == 1) {
- echo "<td class='center width5'>" . $img_ok . "</td>";
- } else {
- echo "<td class='center width5'>" . $img_failed . "</td>";
- }
- echo "<td class='left'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH . "</td>";
- echo "<td class='left'>";
- echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH_INBOX . " ";
- if ($accounts_inbox_ok == 1) {
- echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_OK . $img_ok;
- } else {
- echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED . $img_failed;
- }
- echo "<br />";
- echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH_HARDBOX." ";
- if ($accounts_hardbox_ok == 1) {
- echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_OK . $img_ok;
- } else {
- echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED . $img_failed;
- }
- echo "<br />";
- echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH_SOFTBOX . " ";
- if ($accounts_softbox_ok == 1) {
- echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_OK . $img_ok;
- } else {
- echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED . $img_failed;
- }
- echo "<br />";
- echo "</td>";
- } else {
- echo "<td class='center width5'>" . $img_ok . "</td>";
- echo "<td class='left'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH._AM_XNEWSLETTER_ACCOUNTS_CHECK_SKIPPED . "</td>";
- echo "<td class='center'></td>";
- }
- echo "</tr>";
- }
- imap_close($mbox);
- }
- echo "</table>";
- break;
-
- case "list":
- default:
- echo $indexAdmin->addNavigation($currentFile) ;
- $indexAdmin->addItemButton(_AM_XNEWSLETTER_NEWACCOUNTS, "{$currentFile}?op=new_account", 'add');
- echo $indexAdmin->renderButton();
-
- $limit = $GLOBALS['xoopsModuleConfig']['adminperpage'];
- $criteria = new CriteriaCompo();
- $criteria->setSort("accounts_id ASC, accounts_type");
- $criteria->setOrder("ASC");
- $numrows = $xnewsletter->getHandler('xNewsletter_accounts')->getCount();
- $start = xNewsletter_CleanVars ( $_REQUEST, 'start', 0, 'int' );
- $criteria->setStart($start);
- $criteria->setLimit($limit);
- $accounts_arr = $xnewsletter->getHandler('xNewsletter_accounts')->getall($criteria);
- if ( $numrows > $limit ) {
- include_once XOOPS_ROOT_PATH . "/class/pagenav.php";
- $pagenav = new XoopsPageNav($numrows, $limit, $start, 'start', 'op=list');
- $pagenav = $pagenav->renderNav(4);
- } else {
- $pagenav = '';
- }
-
- // View Table
- if ($numrows > 0) {
- echo "
- <table class='outer width100' cellspacing='1'>
- <tr>
- <th class='center width2'>" . _AM_XNEWSLETTER_ACCOUNTS_ID . "</th>
- <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_TYPE . "</th>
- <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_NAME . "</th>
- <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_YOURNAME . "</th>
- <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_YOURMAIL . "</th>
- <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_DEFAULT . "</th>
- <th class='center width10'>" . _AM_XNEWSLETTER_FORMACTION . "</th>
- </tr>";
-
- $class = "odd";
-
- foreach (array_keys($accounts_arr) as $i) {
- echo "<tr class='" . $class . "'>";
- $class = ($class == "even") ? "odd" : "even";
- echo "<td class='center'>" . $i . "</td>";
- $arr_accounts_type=array(
- _AM_ACCOUNTS_TYPE_VAL_PHP_MAIL=>_AM_ACCOUNTS_TYPE_PHPMAIL,
- _AM_ACCOUNTS_TYPE_VAL_PHP_SENDMAIL=>_AM_ACCOUNTS_TYPE_PHPSENDMAIL,
- _AM_ACCOUNTS_TYPE_VAL_POP3=>_AM_ACCOUNTS_TYPE_POP3,
- _AM_ACCOUNTS_TYPE_VAL_SMTP=>_AM_ACCOUNTS_TYPE_SMTP,
- _AM_ACCOUNTS_TYPE_VAL_GMAIL=>_AM_ACCOUNTS_TYPE_GMAIL);
- echo "<td class='center'>" . $arr_accounts_type[$accounts_arr[$i]->getVar("accounts_type")] . "</td>";
- echo "<td class='center'>" . $accounts_arr[$i]->getVar("accounts_name") . "</td>";
- echo "<td class='center'>" . $accounts_arr[$i]->getVar("accounts_yourname") . "</td>";
- echo "<td class='center'>" . $accounts_arr[$i]->getVar("accounts_yourmail") . "</td>";
- $verif_accounts_default = ($accounts_arr[$i]->getVar("accounts_default") == 1) ? _YES : _NO;
- echo "<td class='center'>" . $verif_accounts_default . "</td>";
-
- echo "<td class='center width5'>";
- echo " <a href='" . $currentFile . "?op=edit_account&accounts_id=" . $i . "'><img src=" . XNEWSLETTER_ICONS_URL . "/xn_edit.png alt='" . _EDIT . "' title='" . _EDIT . "' /></a>";
- echo " <a href='" . $currentFile . "?op=delete_account&accounts_id=" . $i . "'><img src=" . XNEWSLETTER_ICONS_URL . "/xn_delete.png alt='" . _DELETE . "' title='" . _DELETE . "' /></a>";
- if ($accounts_arr[$i]->getVar("accounts_type") != _AM_ACCOUNTS_TYPE_VAL_PHP_MAIL && $accounts_arr[$i]->getVar("accounts_type") != _AM_ACCOUNTS_TYPE_VAL_PHP_SENDMAI...
[truncated message content] |
|
From: <luc...@us...> - 2014-07-25 17:27:44
|
Revision: 12725
http://sourceforge.net/p/xoops/svn/12725
Author: luciorota
Date: 2014-07-25 17:27:29 +0000 (Fri, 25 Jul 2014)
Log Message:
-----------
code clean up
Modified Paths:
--------------
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/about.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/admin_footer.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/admin_header.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/attachment.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/bmh.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/bmh_callback_database.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/cat.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/catsubscr.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/import.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/index.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/letter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/mailinglist.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/maintenance.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/menu.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/protocol.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/sendletter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/subscr.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/task.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/css/module.css
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/assets/css/style.css
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/blocks/blocks_catsubscr.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/blocks/blocks_letter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/blocks/blocks_subscrinfo.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/breadcrumb.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/request.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/session.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/class/xnewsletter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/cron.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/docs/changelog.txt
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/docs/readme.txt
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/footer.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/header.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/common.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/config.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/constants.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/functions.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/html2text/epl-v10.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/html2text/html2text.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/install.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/mailinglist.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/module.css
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/onupdate.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/phpmailer_bmh/class.phpmailer-bmh.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/search.inc.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/include/task.inc.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/index.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/admin.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/blocks.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/common.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/help/help.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/help/help2.html
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/main.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/modinfo.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/language/english/templates/xoops.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/letter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/csv.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/evennews.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/rmbulletin.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/sample1col.csv
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/sample4col.csv
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/smartpartner.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/subscribers.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/weblinks.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/plugins/xoopsuser.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/print.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/protocol.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/sendletter.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/sql/mysql.sql
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/subscription.php
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/xNewsletter_catsubscr_block_day.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/xNewsletter_catsubscr_block_recent.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/xNewsletter_letter_block_day.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/xNewsletter_letter_block_random.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/xNewsletter_letter_block_recent.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/blocks/xNewsletter_subscrinfo_block.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_common_breadcrumb.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_index.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_index_list_letters.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_letter.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_letter_list_letters.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_letter_list_subscrs.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_letter_preview.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_print.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_protocol.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_subscription.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_subscription_list_subscriptions.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/templates/xNewsletter_subscription_result.tpl
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/xoops_version.php
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/about.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/about.php 2014-07-25 17:13:08 UTC (rev 12724)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/about.php 2014-07-25 17:27:29 UTC (rev 12725)
@@ -19,7 +19,7 @@
* ---------------------------------------------------------------------------
* @copyright Goffy ( wedega.com )
* @license GPL 2.0
- * @package xNewsletter
+ * @package xnewsletter
* @author Goffy ( web...@we... )
*
* Version : $Id $
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.php 2014-07-25 17:13:08 UTC (rev 12724)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/admin/accounts.php 2014-07-25 17:27:29 UTC (rev 12725)
@@ -19,48 +19,45 @@
* ---------------------------------------------------------------------------
* @copyright Goffy ( wedega.com )
* @license GPL 2.0
- * @package xNewsletter
+ * @package xnewsletter
* @author Goffy ( web...@we... )
*
* Version : $Id $
* ****************************************************************************
*/
+$currentFile = basename(__FILE__);
include "admin_header.php";
xoops_cp_header();
-//global $indexAdmin;
// We recovered the value of the argument op in the URL$
-$op = xNewsletter_CleanVars($_REQUEST, 'op', 'list', 'string');
-$save_and_check = xNewsletter_CleanVars($_REQUEST, 'save_and_check', 'none', 'string');
-$accounts_id = xNewsletter_CleanVars($_REQUEST, 'accounts_id', 0, 'int');
-$post = xNewsletter_CleanVars($_REQUEST, 'post', '', 'string');
+$op = xnewsletterRequest::getString('op', 'list');
+$save_and_check = xnewsletterRequest::getString('save_and_check', 'none');
+$accounts_id = xnewsletterRequest::getInt('accounts_id', 0);
+$post = xnewsletterRequest::getString('post', '');
if ($post == "" && $op == "save_accounts" && $save_and_check =="none" ) $op = "edit_account";
switch ($op) {
case "check_account" :
- $img_ok = "<img src='" . XNEWSLETTER_ICONS_URL . "/xn_ok.png' alt='" . _AM_XNEWSLETTER_OK . "' title='"._AM_XNEWSLETTER_OK . "' /> ";
- $img_failed = "<img src='" . XNEWSLETTER_ICONS_URL . "/xn_failed.png' alt='" . _AM_XNEWSLETTER_FAILED . "' title='" . _AM_XNEWSLETTER_FAILED . "' /> ";
-
- echo $indexAdmin->addNavigation("accounts.php");
- $indexAdmin->addItemButton(_AM_XNEWSLETTER_ACCOUNTSLIST, 'accounts.php?op=list', 'list');
+ echo $indexAdmin->addNavigation($currentFile);
+ $indexAdmin->addItemButton(_AM_XNEWSLETTER_ACCOUNTSLIST, '?op=list', 'list');
echo $indexAdmin->renderButton();
-
+ //
if ($accounts_id == 0) {
- redirect_header("accounts.php", 3, _AM_XNEWSLETTER_ERROR_NO_VALID_ID);
+ redirect_header($currentFile, 3, _AM_XNEWSLETTER_ERROR_NO_VALID_ID);
} else {
- $accountObj =& $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
+ $accountObj = $xnewsletter->getHandler('accounts')->get($accounts_id);
}
$mailhost = $accountObj->getVar("accounts_server_in");
$port = $accountObj->getVar("accounts_port_in");
switch ($accountObj->getVar("accounts_type")) {
- case _AM_ACCOUNTS_TYPE_VAL_POP3:
+ case _AM_XNEWSLETTER_ACCOUNTS_TYPE_VAL_POP3:
$service = "pop3";
break;
- case _AM_ACCOUNTS_TYPE_VAL_SMTP:
- case _AM_ACCOUNTS_TYPE_VAL_GMAIL:
+ case _AM_XNEWSLETTER_ACCOUNTS_TYPE_VAL_SMTP:
+ case _AM_XNEWSLETTER_ACCOUNTS_TYPE_VAL_GMAIL:
$service = "imap";
break;
case "default":
@@ -89,27 +86,27 @@
$mbox = @imap_open("{" . $command . "}", $accounts_username, $accounts_password); // or die ("can't connect: " . imap_last_error());
if ($mbox === false) {
echo "<tr>";
- echo "<td class='center width5'>" . $img_failed . "</td>";
+ echo "<td class='center width5'>" . XNEWSLETTER_IMG_FAILED . "</td>";
echo "<td class='left'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_MAILBOX._AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED . "</td>";
echo "<td class='left'>" . imap_last_error() . "</td>";
echo "</tr>";
} else {
echo "<tr>";
- echo "<td class='center width5'>" . $img_ok . "</td>";
+ echo "<td class='center width5'>" . XNEWSLETTER_IMG_OK . "</td>";
echo "<td class='left'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_MAILBOX._AM_XNEWSLETTER_ACCOUNTS_CHECK_OK . "</td>";
echo "<td class='left'></td>";
echo "</tr>";
- $folders = imap_listmailbox($mbox, "{".$command."}", "*");
+ $folders = imap_listmailbox($mbox, "{" . $command . "}", "*");
if ($folders == false) {
echo "<tr>";
- echo "<td class='center width5'>" . $img_failed . "</td>";
+ echo "<td class='center width5'>" . XNEWSLETTER_IMG_FAILED . "</td>";
echo "<td class='left'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_FOLDERS._AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED . "</td>";
echo "<td class='left'>" . imap_last_error() . "</td>";
echo "</tr>";
} else {
echo "<tr>";
- echo "<td class='center width5'>" . $img_ok . "</td>";
+ echo "<td class='center width5'>" . XNEWSLETTER_IMG_OK . "</td>";
echo "<td class='left'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_OPEN_FOLDERS._AM_XNEWSLETTER_ACCOUNTS_CHECK_OK . "</td>";
echo "<td class='left'>";
if (is_array($folders)) {
@@ -123,7 +120,7 @@
if ("{" . $command . "}" . $accounts_hardbox == $val) {
$accounts_hardbox_ok = 1;
} else {
- @imap_createmailbox($mbox, imap_utf7_encode('{' .$command . '}' . $accounts_hardbox));
+ @imap_createmailbox($mbox, imap_utf7_encode('{'.$command.'}' . $accounts_hardbox));
$foldercreated = 1;
}
if ("{" . $command . "}" . $accounts_softbox == $val) {
@@ -147,36 +144,36 @@
echo "<tr>";
if ($accountObj->getVar("accounts_use_bmh") == '1') {
if ($accounts_inbox_ok == 1 && $accounts_hardbox_ok == 1 && $accounts_softbox_ok == 1) {
- echo "<td class='center width5'>" . $img_ok . "</td>";
+ echo "<td class='center width5'>" . XNEWSLETTER_IMG_OK . "</td>";
} else {
- echo "<td class='center width5'>" . $img_failed . "</td>";
+ echo "<td class='center width5'>" . XNEWSLETTER_IMG_FAILED . "</td>";
}
echo "<td class='left'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH . "</td>";
echo "<td class='left'>";
echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH_INBOX . " ";
if ($accounts_inbox_ok == 1) {
- echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_OK . $img_ok;
+ echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_OK . XNEWSLETTER_IMG_OK;
} else {
- echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED . $img_failed;
+ echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED . XNEWSLETTER_IMG_FAILED;
}
echo "<br />";
- echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH_HARDBOX . " ";
+ echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH_HARDBOX." ";
if ($accounts_hardbox_ok == 1) {
- echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_OK . $img_ok;
+ echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_OK . XNEWSLETTER_IMG_OK;
} else {
- echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED . $img_failed;
+ echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED . XNEWSLETTER_IMG_FAILED;
}
echo "<br />";
echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH_SOFTBOX . " ";
if ($accounts_softbox_ok == 1) {
- echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_OK . $img_ok;
+ echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_OK . XNEWSLETTER_IMG_OK;
} else {
- echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED . $img_failed;
+ echo _AM_XNEWSLETTER_ACCOUNTS_CHECK_FAILED . XNEWSLETTER_IMG_FAILED;
}
echo "<br />";
echo "</td>";
} else {
- echo "<td class='center width5'>" . $img_ok . "</td>";
+ echo "<td class='center width5'>" . XNEWSLETTER_IMG_OK . "</td>";
echo "<td class='left'>" . _AM_XNEWSLETTER_ACCOUNTS_CHECK_BMH._AM_XNEWSLETTER_ACCOUNTS_CHECK_SKIPPED . "</td>";
echo "<td class='center'></td>";
}
@@ -189,64 +186,64 @@
case "list":
default:
- echo $indexAdmin->addNavigation('accounts.php') ;
- $indexAdmin->addItemButton(_AM_XNEWSLETTER_NEWACCOUNTS, 'accounts.php?op=new_account', 'add');
+ echo $indexAdmin->addNavigation($currentFile) ;
+ $indexAdmin->addItemButton(_AM_XNEWSLETTER_NEWACCOUNTS, '?op=new_account', 'add');
echo $indexAdmin->renderButton();
-
- $limit = $GLOBALS['xoopsModuleConfig']['adminperpage'];
- $criteria = new CriteriaCompo();
- $criteria->setSort("accounts_id ASC, accounts_type");
- $criteria->setOrder("ASC");
- $numrows = $xnewsletter->getHandler('xNewsletter_accounts')->getCount();
- $start = xNewsletter_CleanVars ( $_REQUEST, 'start', 0, 'int' );
- $criteria->setStart($start);
- $criteria->setLimit($limit);
- $accounts_arr = $xnewsletter->getHandler('xNewsletter_accounts')->getall($criteria);
- if ($numrows > $limit) {
+ //
+ $limit = $xnewsletter->getConfig('adminperpage');
+ $accountsCriteria = new CriteriaCompo();
+ $accountsCriteria->setSort("accounts_id ASC, accounts_type");
+ $accountsCriteria->setOrder("ASC");
+ $accountsCount = $xnewsletter->getHandler('accounts')->getCount();
+ $start = xnewsletterRequest::getInt('start', 0);
+ $accountsCriteria->setStart($start);
+ $accountsCriteria->setLimit($limit);
+ $accountsObjs = $xnewsletter->getHandler('accounts')->getAll($accountsCriteria);
+ if ($accountsCount > $limit) {
include_once XOOPS_ROOT_PATH . "/class/pagenav.php";
- $pagenav = new XoopsPageNav($numrows, $limit, $start, 'start', 'op=list');
+ $pagenav = new XoopsPageNav($accountsCount, $limit, $start, 'start', 'op=list');
$pagenav = $pagenav->renderNav(4);
} else {
$pagenav = '';
}
// View Table
- if ($numrows > 0) {
+ if ($accountsCount > 0) {
echo "<table class='outer width100' cellspacing='1'>
<tr>
- <th class='center width2'>" ._AM_XNEWSLETTER_ACCOUNTS_ID . "</th>
+ <th class='center width2'>" . _AM_XNEWSLETTER_ACCOUNTS_ID . "</th>
<th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_TYPE . "</th>
<th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_NAME . "</th>
<th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_YOURNAME . "</th>
<th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_YOURMAIL . "</th>
<th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_DEFAULT . "</th>
- <th class='center width10'>" . _AM_XNEWSLETTER_FORMACTION . "</th>
+ <th class='center width10'>"._AM_XNEWSLETTER_FORMACTION . "</th>
</tr>";
$class = "odd";
- foreach (array_keys($accounts_arr) as $i) {
- echo "<tr class='" . $class . "'>";
+ foreach ($accountsObjs as $accounts_id => $accountsObj) {
+ echo "<tr class='".$class."'>";
$class = ($class == "even") ? "odd" : "even";
- echo "<td class='center'>" . $i . "</td>";
+ echo "<td class='center'>" . $accounts_id . "</td>";
$arr_accounts_type=array(
- _AM_ACCOUNTS_TYPE_VAL_PHP_MAIL=>_AM_ACCOUNTS_TYPE_PHPMAIL,
- _AM_ACCOUNTS_TYPE_VAL_PHP_SENDMAIL=>_AM_ACCOUNTS_TYPE_PHPSENDMAIL,
- _AM_ACCOUNTS_TYPE_VAL_POP3=>_AM_ACCOUNTS_TYPE_POP3,
- _AM_ACCOUNTS_TYPE_VAL_SMTP=>_AM_ACCOUNTS_TYPE_SMTP,
- _AM_ACCOUNTS_TYPE_VAL_GMAIL=>_AM_ACCOUNTS_TYPE_GMAIL);
- echo "<td class='center'>" . $arr_accounts_type[$accounts_arr[$i]->getVar("accounts_type")] . "</td>";
- echo "<td class='center'>" . $accounts_arr[$i]->getVar("accounts_name") . "</td>";
- echo "<td class='center'>" . $accounts_arr[$i]->getVar("accounts_yourname") . "</td>";
- echo "<td class='center'>" . $accounts_arr[$i]->getVar("accounts_yourmail") . "</td>";
- $verif_accounts_default = ($accounts_arr[$i]->getVar("accounts_default") == 1) ? _YES : _NO;
+ _AM_XNEWSLETTER_ACCOUNTS_TYPE_VAL_PHP_MAIL => _AM_XNEWSLETTER_ACCOUNTS_TYPE_PHPMAIL,
+ _AM_XNEWSLETTER_ACCOUNTS_TYPE_VAL_PHP_SENDMAIL => _AM_XNEWSLETTER_ACCOUNTS_TYPE_PHPSENDMAIL,
+ _AM_XNEWSLETTER_ACCOUNTS_TYPE_VAL_POP3 => _AM_XNEWSLETTER_ACCOUNTS_TYPE_POP3,
+ _AM_XNEWSLETTER_ACCOUNTS_TYPE_VAL_SMTP => _AM_XNEWSLETTER_ACCOUNTS_TYPE_SMTP,
+ _AM_XNEWSLETTER_ACCOUNTS_TYPE_VAL_GMAIL => _AM_XNEWSLETTER_ACCOUNTS_TYPE_GMAIL);
+ echo "<td class='center'>" . $arr_accounts_type[$accountsObj->getVar("accounts_type")] . "</td>";
+ echo "<td class='center'>" . $accountsObj->getVar("accounts_name") . "</td>";
+ echo "<td class='center'>" . $accountsObj->getVar("accounts_yourname") . "</td>";
+ echo "<td class='center'>" . $accountsObj->getVar("accounts_yourmail") . "</td>";
+ $verif_accounts_default = ($accountsObj->getVar("accounts_default") == 1) ? _YES : _NO;
echo "<td class='center'>" . $verif_accounts_default . "</td>";
echo "<td class='center width5'>";
- echo " <a href='accounts.php?op=edit_account&accounts_id=" . $i . "'><img src=".XNEWSLETTER_ICONS_URL."/xn_edit.png alt='"._EDIT."' title='"._EDIT."' /></a>";
- echo " <a href='accounts.php?op=delete_account&accounts_id=" . $i . "'><img src=".XNEWSLETTER_ICONS_URL."/xn_delete.png alt='"._DELETE."' title='"._DELETE."' /></a>";
- if ($accounts_arr[$i]->getVar("accounts_type") != _AM_ACCOUNTS_TYPE_VAL_PHP_MAIL && $accounts_arr[$i]->getVar("accounts_type") != _AM_ACCOUNTS_TYPE_VAL_PHP_SENDMAIL) {
- echo " <a href='accounts.php?op=check_account&accounts_id=" . $i . "'><img src=".XNEWSLETTER_ICONS_URL."/xn_check.png alt='"._AM_ACCOUNTS_TYPE_CHECK."' title='"._AM_ACCOUNTS_TYPE_CHECK."' /></a>";
+ echo " <a href='?op=edit_account&accounts_id=" . $accounts_id . "'><img src=" . XNEWSLETTER_ICONS_URL . "/xn_edit.png alt='" . _EDIT . "' title='"._EDIT . "' /></a>";
+ echo " <a href='?op=delete_account&accounts_id=" . $accounts_id . "'><img src=" . XNEWSLETTER_ICONS_URL . "/xn_delete.png alt='" . _DELETE . "' title='" . _DELETE . "' /></a>";
+ if ($accountsObj->getVar("accounts_type") != _AM_XNEWSLETTER_ACCOUNTS_TYPE_VAL_PHP_MAIL && $accountsObj->getVar("accounts_type") != _AM_XNEWSLETTER_ACCOUNTS_TYPE_VAL_PHP_SENDMAIL) {
+ echo " <a href='?op=check_account&accounts_id=". $accounts_id . "'><img src=" . XNEWSLETTER_ICONS_URL . "/xn_check.png alt='" . _AM_XNEWSLETTER_ACCOUNTS_TYPE_CHECK . "' title='" . _AM_XNEWSLETTER_ACCOUNTS_TYPE_CHECK . "' /></a>";
}
echo "</td>";
echo "</tr>";
@@ -256,21 +253,21 @@
} else {
echo "<table class='outer width100' cellspacing='1'>
<tr>
- <th class='center width2'>"._AM_XNEWSLETTER_ACCOUNTS_ID."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_TYPE."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_NAME."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_YOURNAME."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_YOURMAIL."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_USERNAME."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_PASSWORD."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_SERVER_IN."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_PORT_IN."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_SECURETYPE_IN."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_SERVER_OUT."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_PORT_OUT."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_SECURETYPE_OUT."</th>
- <th class='center'>"._AM_XNEWSLETTER_ACCOUNTS_DEFAULT."</th>
- <th class='center width10'>"._AM_XNEWSLETTER_FORMACTION."</th>
+ <th class='center width2'>" . _AM_XNEWSLETTER_ACCOUNTS_ID . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_TYPE . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_NAME . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_YOURNAME . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_YOURMAIL . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_USERNAME . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_PASSWORD . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_SERVER_IN . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_PORT_IN . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_SECURETYPE_IN . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_SERVER_OUT . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_PORT_OUT . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_SECURETYPE_OUT . "</th>
+ <th class='center'>" . _AM_XNEWSLETTER_ACCOUNTS_DEFAULT . "</th>
+ <th class='center width10'>" . _AM_XNEWSLETTER_FORMACTION . "</th>
</tr>";
echo "</table><br /><br />";
}
@@ -278,34 +275,35 @@
break;
case "new_account":
- echo $indexAdmin->addNavigation("accounts.php");
- $indexAdmin->addItemButton(_AM_XNEWSLETTER_ACCOUNTSLIST, 'accounts.php?op=list', 'list');
+ echo $indexAdmin->addNavigation($currentFile);
+ $indexAdmin->addItemButton(_AM_XNEWSLETTER_ACCOUNTSLIST, '?op=list', 'list');
echo $indexAdmin->renderButton();
- $accountObj = $xnewsletter->getHandler('xNewsletter_accounts')->create();
- $accountObj = xNewsletter_setPost($accountObj, $_POST);
+ //
+ $accountObj = $xnewsletter->getHandler('accounts')->create();
+ $accountObj = xnewsletter_setPost($accountObj, $_POST);
$form = $accountObj->getForm();
$form->display();
break;
case "save_accounts":
if ( !$GLOBALS["xoopsSecurity"]->check() ) {
- redirect_header("accounts.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
+ redirect_header($currentFile, 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors()));
}
- $accountObj =& $xnewsletter->getHandler('xNewsletter_accounts')->get($accounts_id);
+ $accountObj = $xnewsletter->getHandler('accounts')->get($accounts_id);
$_POST['accounts_id'] = $accounts_id;
- $accountObj = xNewsletter_setPost($accountObj, $_POST);
+ $accountObj = xnewsletter_setPost($accountObj, $_POST);
- $criteria = new CriteriaCompo();
- $criteria->add(new Criteria("accounts_default", 1));
- $count_accounts_default = $xnewsletter->getHandler('xNewsletter_accounts')->getCount($criteria);
+ $accountsCriteria = new CriteriaCompo();
+ $accountsCriteria->add(new Criteria("accounts_default", 1));
+ $count_accounts_default = $xnewsletter->getHandler('accounts')->getCount($accountsCriteria);
if ($count_accounts_default > 0) {
if ($accountObj->getVar("accounts_default") == 1) {
global $xoopsDB;
$verif_accounts_default = "1";
//reset old accounts_default
- $sql = "UPDATE `{$xoopsDB->prefix("mod_xnewsletter_accounts")}` SET `accounts_default` = '0'";
- $result= $xoopsDB->query($sql) or die ("MySQL-Error: " . mysql_error());
+ $sql = "UPDATE `{$xoopsDB->prefix("xnewsletter_accounts")}` SET `accounts_default` = '0'";
+ if(!$result = $xoopsDB->query($sql)) die ("MySQL-Error: " . mysql_error());
} else {
$verif_accounts_default = "0";
}
@@ -313,12 +311,12 @@
$verif_accounts_default = "1";
}
$accountObj->setVar("accounts_default", $verif_accounts_default);
- if ($accountObj->getVar("accounts_yourmail") != "" && $accountObj->getVar("accounts_yourmail") != _AM_...
[truncated message content] |