function __construct() { $salutationNameArray = CjwNewsletterUser::getAvailableSalutationNameArrayFromIni(); $this->CjwNewsletterFilterType('cjwnl_salutation', ezpI18n::tr('cjw_newsletter/filtertypes', 'Salutation', 'Filtertype name'), array()); $this->setValues(array()); $this->setValuesAvailable(array('1' => $salutationNameArray[1], '2' => $salutationNameArray[2])); $this->setOperation('eq'); $this->setOperationsAvailable(array('eq' => ezpI18n::tr('cjw_newsletter/filtertypes', 'equal', 'Filtertype condition'), 'ne' => ezpI18n::tr('cjw_newsletter/filtertypes', 'not equal', 'Filtertype condition'))); }
if ($contextCreateNewsletterUser === true && $redirectUrlStore === false) { $newNewsletterUserObject = CjwNewsletterUser::fetchByEmail($subscriptionDataArr['email']); if (is_object($newNewsletterUserObject)) { $redirectUrlStore = '/newsletter/user_view/' . $newNewsletterUserObject->attribute('id'); } } elseif ($redirectUrlStore === false) { $redirectUrlStore = '/newsletter/user_list/'; } // if all is ok $module->redirectTo($redirectUrlStore); } elseif ($module->isCurrentAction('Cancel')) { if ($redirectUrlCancel === false) { $redirectUrlCancel = '/newsletter/user_list/'; } $module->redirectTo($redirectUrlCancel); } //$newsletterUserObject = CjwNewsletterUser::fetch( $newsletterUserId ); $tpl->setVariable('add_subscription_for_list_id', $addSubscriptionForListId); $tpl->setVariable('newsletter_user_subscription_array', $newsletter_user_subscription_array); $tpl->setVariable('subscription_data_array', $subscriptionDataArr); $tpl->setVariable('newsletter_user_id', $newsletterUserId); $tpl->setVariable('warning_array', $warningArr); $tpl->setVariable('message_feedback', $messageFeedback); $tpl->setVariable('newsletter_user', $newsletterUserObject); $tpl->setVariable('available_salutation_array', CjwNewsletterUser::getAvailableSalutationNameArrayFromIni()); $tpl->setVariable('redirect_url_action_cancel', $redirectUrlCancel); $tpl->setVariable('redirect_url_action_store', $redirectUrlStore); $Result = array(); //$Result[ 'ui_context' ] = 'edit'; $Result['content'] = $tpl->fetch($templateFile); $Result['path'] = array(array('url' => false, 'text' => ezi18n('cjw_newsletter/path', 'Newsletter')), array('url' => false, 'text' => ezi18n('cjw_newsletter/user_list', 'Users')), array('url' => false, 'text' => $newsletterUserObject->attribute('name')));
/** * attribute( 'available_salutation_name_array' ) * @return array[salutation_id]=>i18n */ public function getAvailableSalutationNameArray() { return CjwNewsletterUser::getAvailableSalutationNameArrayFromIni(); }
if (count($warningArr) == 0) { // subscribe to all selected lists $subscriptionResultArray = CjwNewsletterSubscription::createSubscriptionByArray($subscriptionDataArr, CjwNewsletterUser::STATUS_PENDING, true, $context); $newNewsletterUser = CjwNewsletterUser::fetchByEmail($subscriptionDataArr['email']); $mailSendResult = $newNewsletterUser->sendSubcriptionConfirmationMail(); $tpl->setVariable('user_email_already_exists', false); $tpl->setVariable('mail_send_result', $mailSendResult); $tpl->setVariable('newsletter_user', $newNewsletterUser); $tpl->setVariable('subscription_result_array', $subscriptionResultArray); $tpl->setVariable('back_url_input', $backUrl); $templateFile = 'design:newsletter/subscribe_success.tpl'; } } } } if ($user) { $tpl->setVariable('user', $user); } if (isset($existingNewsletterUserObject)) { $tpl->setVariable('newsletter_user', $existingNewsletterUserObject); } $tpl->setVariable('subscription_data_array', $subscriptionDataArr); $tpl->setVariable('warning_array', $warningArr); $salutationArray = CjwNewsletterUser::getAvailableSalutationNameArrayFromIni(); $tpl->setVariable('available_salutation_array', $salutationArray); // for backwardcompatibility $tpl->setVariable('available_saluation_array', $salutationArray); $Result = array(); //$Result['content'] = $tpl->fetch( "design:newsletter/subscribe.tpl" ); $Result['content'] = $tpl->fetch($templateFile); $Result['path'] = array(array('url' => false, 'text' => ezi18n('cjw_newsletter/path', 'Newsletter')), array('url' => false, 'text' => ezi18n('cjw_newsletter/subscribe', 'Subscription form')));