function listSubscriptions($offset, $count) { $extension = 'eznewsletter'; $base = eZExtension::baseDirectory(); $baseDir = "{$base}/{$extension}/classes/"; return array('result' => eZSubscriptionList::fetchList($offset, $count)); }
if (isset($Params['BrowseSelected']) && $Params['BrowseSelected'] == 'article') { if ($http->hasPostVariable('SelectedObjectIDArray')) { $articlePoolNodeID = $http->postVariable('SelectedObjectIDArray'); if (isset($articlePoolNodeID) && !$http->hasPostVariable('BrowseCancelButton')) { $newsletterType->setAttribute('article_pool_object_id', $articlePoolNodeID[0]); $newsletterType->store(); } } } else { if (isset($Params['BrowseSelected']) && $Params['BrowseSelected'] == 'inbox') { if ($http->hasPostVariable('SelectedObjectIDArray')) { $inboxNodeID = $http->postVariable('SelectedObjectIDArray'); if (isset($inboxNodeID) && !$http->hasPostVariable('BrowseCancelButton')) { $newsletterType->setAttribute('inbox_id', $inboxNodeID[0]); $newsletterType->store(); } } } } $tpl = eZNewsletterTemplateWrapper::templateInit(); $tpl->setVariable('warning', $warning); $tpl->setVariable('newsletter_type', $newsletterType); $tpl->setVariable('contentclass_list', eZNewsletterType::unserializeArray($newsletterType->attribute('contentclass_list'))); $tpl->setVariable('selected_designs', eZNewsletterType::unserializeArray($newsletterType->attribute('allowed_designs'))); // countAll(eZSendNewsletterItem::definition()) ) ) erzeugt einen sql fehler $tpl->setVariable('subscription_list_array', eZSubscriptionList::fetchList(0, eZSubscriptionList::countAll(eZSubscriptionList::StatusPublished))); $Result = array(); $Result['newsletter_menu'] = 'design:parts/content/newsletter_menu.tpl'; $Result['left_menu'] = 'design:parts/content/eznewsletter_menu.tpl'; $Result['content'] = $tpl->fetch("design:{$extension}/edit_newslettertype.tpl"); $Result['path'] = array(array('url' => false, 'text' => ezpI18n::tr('eznewsletter/edit_newslettertype', 'Edit newsletter type')));
$tpl = eZNewsletterTemplateWrapper::templateInit(); $Result = array(); $Result['left_menu'] = 'design:parts/content/eznewsletter_menu.tpl'; $Result['content'] = $tpl->fetch("design:ezsubscribe/no_subscription.tpl"); $Result['path'] = array(array('url' => false, 'text' => ezpI18n::tr('eznewsletter/modify_subscription', 'No subscription'))); return $Result; } else { $subscriptionList = eZSubscription::fetchListByEmail($userData->attribute('email'), eZSubscription::VersionStatusPublished, array(array(eZSubscription::StatusPending, eZSubscription::StatusApproved, eZSubscription::StatusConfirmed, eZSubscription::StatusRemovedSelf, eZSubscription::StatusRemovedAdmin))); $allowedStatusList = array(eZSubscription::StatusApproved, eZSubscription::StatusPending, eZSubscription::StatusConfirmed, eZSubscription::StatusRemovedSelf, eZSubscription::StatusRemovedAdmin); } } //get new data //all subscriptions $found = false; $additionalLists = array(); $allSubscriptionList = eZSubscriptionList::fetchList(0, 100); foreach ($allSubscriptionList as $addList) { foreach ($subscriptionList as $userList) { if ($addList->attribute('id') === $userList->attribute('subscriptionlist_id')) { $found = true; } } if (!$found) { $additionalLists[] = $addList; } $found = false; } //$tpl = templateInit(); //$tpl->setVariable( 'user', $user ); if (isset($warning)) { $tpl->setVariable('warning', $warning);
function get_list_ids() { $ids = array(); $lists = eZSubscriptionList::fetchList(); for ($i = 0; $i < count($lists); $i++) { $ids[] = strtolower($lists[$i]->urlAlias()); } return $ids; }
function objectAttributeContent($contentObjectAttribute) { newsletterlistType::storeSession($contentObjectAttribute); $return = array(); $lists = eZSubscriptionList::fetchList(); $userID = $contentObjectAttribute->attribute('contentobject_id'); $selection = unserialize($contentObjectAttribute->attribute("data_text")); $subscriptions = eZPersistentObject::fetchObjectList(eZSubscription::definition(), null, array('user_id' => $userID, 'version_status' => eZSubscription::VersionStatusPublished), true); foreach ($lists as $list) { $attribute_filter = array(array('newsletter_group/newsletter_id', '=', $list->attribute('url'))); $treeParameters = array('OnlyTranslated' => true, 'AttributeFilter' => $attribute_filter, 'ClassFilterType' => 'include', 'ClassFilterArray' => array('newsletter_group'), 'IgnoreVisibility' => false, 'MainNodeOnly' => true); $listitem = array(); $listitem['list'] = $list; if (in_array($list->attribute('id'), $selection['register'])) { $listitem['selected'] = true; } elseif (in_array($list->attribute('id'), $selection['unregister'])) { $listitem['selected'] = false; } $nodesList = eZContentObjectTreeNode::fetch(2)->subTree($treeParameters); foreach ($subscriptions as $subscription) { $listitem['disabled'] = false; if ($subscription->attribute('subscriptionlist_id') == $list->attribute('id')) { $listitem['subscription'] = $subscription; if ($listitem['subscription']->attribute('status') == eZSubscription::StatusPending or $listitem['subscription']->attribute('status') == eZSubscription::StatusConfirmed or $listitem['subscription']->attribute('status') == eZSubscription::StatusRemovedAdmin) { $listitem['disabled'] = true; } if (!array_key_exists('selected', $listitem)) { if ($listitem['subscription']->attribute('status') == eZSubscription::StatusApproved) { $listitem['selected'] = true; } else { $listitem['selected'] = false; } } break; } } if (isset($nodesList[0]) and is_object($nodesList[0])) { $listitem['node'] = $nodesList[0]; } if (count($listitem) > 0) { $return['list'][] = $listitem; } unset($listitem); } if ($selection['show_newsletter_tab']) { $return['show_newsletter_tab'] = true; } else { $return['show_newsletter_tab'] = false; } return $return; }
*/ $Module = $Params['Module']; $http = eZHTTPTool::instance(); if ($http->hasPostVariable('CreateSubscriptionListButton')) { $subscriptionList = eZSubscriptionList::create(); return $Module->redirectToView('edit_subscription_list', array($subscriptionList->attribute('id'))); } else { if ($http->hasPostVariable('RemoveSubscriptionListButton')) { if (is_array($http->postVariable('SubscriptionListIDArray'))) { foreach ($http->postVariable('SubscriptionListIDArray') as $subscriptionID) { eZSubscriptionList::removeAll($subscriptionID); } } } } $userParameters = $Params['UserParameters']; $offset = isset($userParameters['offset']) ? $userParameters['offset'] : 0; $limitKey = isset($userParameters['limit']) ? $userParameters['limit'] : '1'; $limitList = array('1' => 10, '2' => 25, '3' => 50); $limit = isset($limitList[$limitKey]) ? $limitList[$limitKey] : 1; $viewParameters = array('offset' => $offset, 'limit' => $limitKey); $subscriptionListArray = eZSubscriptionList::fetchList($offset, $limit, true, eZSubscriptionList::StatusPublished, true); $tpl = eZNewsletterTemplateWrapper::templateInit(); $tpl->setVariable('view_parameters', $viewParameters); $tpl->setVariable('limit', $limit); $tpl->setVariable('subscriptionlist_array', $subscriptionListArray); $Result = array(); $Result['newsletter_menu'] = 'design:parts/content/robinson_menu.tpl'; $Result['left_menu'] = 'design:parts/content/eznewsletter_menu.tpl'; $Result['content'] = $tpl->fetch("design:eznewsletter/list_subscriptions.tpl"); $Result['path'] = array(array('url' => false, 'text' => ezpI18n::tr('eznewsletter/list_subscriptions', 'Subscription lists')));