Пример #1
0
//   GNU General Public License for more details.
//
//   You should have received a copy of version 2.0 of the GNU General
//   Public License along with this program; if not, write to the Free
//   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
//   MA 02110-1301, USA.
//
//
// ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
//
/*! \file subscription_import.php
*/
$Module = $Params['Module'];
$http = eZHTTPTool::instance();
$robinsonlistEntryId = $Params['RobinsonEntryID'];
$robinsonlistEntry = eZRobinsonListEntry::fetchById($robinsonlistEntryId);
if (!$robinsonlistEntryId) {
    $robinsonlistEntry = eZRobinsonListEntry::create();
}
if ($http->hasPostVariable('StoreButton')) {
    if ($http->postVariable('RobinsonlistEntry_Value') != "" && $http->postVariable('RobinsonlistEntry_Type') != "" && $http->postVariable('RobinsonlistEntry_Global') != "") {
        if ($http->postVariable('RobinsonlistEntry_Type') == eZRobinsonListEntry::EMAIL) {
            if (eZMail::validate($http->postVariable('RobinsonlistEntry_Value'))) {
                $robinsonlistEntry->setAttribute('value', $http->postVariable('RobinsonlistEntry_Value'));
                $robinsonlistEntry->setAttribute('type', $http->postVariable('RobinsonlistEntry_Type'));
                $robinsonlistEntry->setAttribute('global', $http->postVariable('RobinsonlistEntry_Global'));
                $robinsonlistEntry->store();
                return $Module->redirectToView('robinson_show', array());
            } else {
                $warning = ezpI18n::tr('eznewsletter/robinson_edit', 'Please enter a valid email.');
            }