/** * */ function output() { global $application; loadCoreFile('html_form.php'); $this->_messageResources =& Subscriptions::getMessageResources(); $this->_tmplFiller = new TmplFiller(dirname(dirname(__FILE__)) . '/templates_az/'); $this->_topic_id = modApiFunc('Request', 'getValueByKey', 'topic'); if (!empty($this->_topic_id)) { $this->_mode = SM_SHOW_TOPIC; $this->initShowTopic(); if (empty($this->_topic)) { return $this->_tmplFiller->fill('', 'errors/no_topic_manage.tpl.html', array('Message' => $this->_messageResources->getMessage(new ActionMessage(array('TOPIC_DOESNT_EXISTS', $this->_topic_id))))); } } else { $this->_mode = SM_SHOW_TOPICS_LIST; $this->topics = modApiFunc('Subscriptions', 'getTopicsList'); } $this->initFormData(); $this->_templateContents = array('ToolbarTop', 'ToolbarBottom', 'FormErrors', 'ItemsList', 'EmailsPaginator', 'EmailSearchForm', 'LinkResetSearchEmail'); $application->registerAttributes($this->_templateContents); $request = new Request(); $request->setView(CURRENT_REQUEST_URL); $vars = array('FormAction' => $request->getURL(), 'AddTopicURL' => $this->urlAddTopic(), 'EditTopicURL' => $this->urlEditTopic(), 'SortTopicsURL' => $this->urlSortTopic(), 'DeleteTopicsURL' => $this->urlDeleteTopics(), 'SubscribeURL' => $this->urlSubscribe(), 'UnsubscribeURL' => $this->urlUnsubscribe(), 'ExportURL' => $this->urlExport()); $result = $this->_tmplFiller->fill('', 'manage.tpl.html', $vars); return $result; }
function output() { global $application; loadCoreFile('html_form.php'); $this->_messageResources =& Subscriptions::getMessageResources(); $this->_tmplFiller = new TmplFiller(dirname(dirname(__FILE__)) . '/templates_az/'); $this->_topic_id = modApiFunc('Request', 'getValueByKey', 'topic'); if (!empty($this->_topic_id)) { $this->_mode = SM_EDIT_TOPIC; } else { $this->_mode = SM_NEW_TOPIC; } $this->initFormData(); if (@$this->ViewState['hasCloseScript'] == 'true') { modApiFunc("application", "closeChild_UpdateParent"); return; } $this->_templateContents = array('ErrorsBox', 'AscAction'); $application->registerAttributes($this->_templateContents); if ($this->_mode == SM_EDIT_TOPIC && empty($this->_topic)) { return $this->_tmplFiller->fill('', 'errors/no_topic_edit.tpl.html', array('Message' => $this->_messageResources->getMessage(new ActionMessage(array('TOPIC_DOESNT_EXISTS', $this->_topic_id))))); } $request = new Request(); $request->setView(CURRENT_REQUEST_URL); $vars = array('FormAction' => $request->getURL(), 'AscAction' => $this->_mode == SM_NEW_TOPIC ? 'create_topic' : 'update_topic', 'TopicId' => $this->_topic_id, 'WinTitle' => $this->_messageResources->getMessage($this->_mode == SM_NEW_TOPIC ? 'TITLE_ADD_TOPIC' : 'TITLE_EDIT_TOPIC'), 'TopicName' => @$this->POST['topic_name'], 'TopicStatusSelect' => $this->getTopicStatusSelect('topic_status', @$this->POST['topic_status']), 'TopicAccessSelect' => $this->getTopicAccessSelect('topic_access', @$this->POST['topic_access']), 'TopicAutosubscribeSelect' => $this->getTopicAutoSubscribeSelect('topic_auto', @$this->POST['topic_auto'])); $result = $this->_tmplFiller->fill('', 'edit_topic.tpl.html', $vars); return $result; }
function output($mode) { global $application; loadCoreFile('html_form.php'); $this->_prefix = _ml_strtolower($mode); $this->_Prefix = _ml_strtoupper($mode[0]) . _ml_substr($this->_prefix, 1); $this->_PREFIX = _ml_strtoupper($mode); $this->_messageResources =& Subscriptions::getMessageResources(); $this->_tmplFiller = new TmplFiller(dirname(dirname(__FILE__)) . '/templates_az/'); $this->initFormData(); $result = ''; //$action = modApiFunc('Request', 'getValueByKey', 'asc_action'); $action = @$this->POST['asc_action']; $has_errors = sizeof($this->ErrorsArray) > 0; $stage = modApiFunc('Request', 'getValueByKey', 'stage'); if (empty($stage)) { $result = $this->outputAskEmails(); } elseif ($stage == 'confirm') { $result = $this->outputAskConfirmation(); } elseif ($stage == 'finish') { // @ show errors if were modApiFunc("application", "closeChild_UpdateParent"); } return $result; }
function output() { global $application; $this->_messageResources =& Subscriptions::getMessageResources(); $this->_tmplFiller = new TmplFiller(dirname(dirname(__FILE__)) . '/templates_az/'); $this->initFormData(); $this->fetchTopics(); if ($this->ViewState["hasCloseScript"] == "true") { modApiFunc("application", "closeChild_UpdateParent"); return; } $application->registerAttributes(array('TopicsList', 'TopicsIdsStr')); $vars = array('FormAction' => $this->urlSaveOrder()); $retval = $this->_tmplFiller->fill('', 'sort_topics.tpl.html', $vars); return $retval; }
function output() { global $application; loadCoreFile('html_form.php'); $this->_messageResources =& Subscriptions::getMessageResources(); $this->_tmplFiller = new TmplFiller(dirname(dirname(__FILE__)) . '/templates_az/'); $this->_topics_ids = modApiFunc('Request', 'getValueByKey', 'topics'); $this->initFormData(); if (@$this->ViewState['hasCloseScript'] == 'true') { modApiFunc("application", "closeChild_UpdateParent"); return; } $this->_templateContents = array('ErrorsBox', 'TopicsList'); $application->registerAttributes($this->_templateContents); $vars = array('FormAction' => $this->urlSelf(), 'TopicsIds' => $this->_topics_ids); $result = $this->_tmplFiller->fill('delete_topics/', 'delete_topics.tpl.html', $vars); return $result; }
function output() { global $application; $this->_messageResources =& Subscriptions::getMessageResources(); $this->_tmplFiller = new TmplFiller(dirname(dirname(__FILE__)) . '/templates_az/'); $this->initFormData(); if ($this->ViewState['hasCloseScript'] == 'true') { modApiFunc('application', 'closeChild'); return; } $config_array = LayoutConfigurationManager::static_get_cz_layouts_list(); $config = reset($config_array); $url = $config['SITE_URL'] . 'unsubscribe.php?key=%KEY_UNSUBSCRIBE%'; $signature = modApiFunc('Configuration', 'getValue', SYSCONFIG_NEWSLETTERS_SIGNATURE); $vars = array('FormAction' => $this->urlSaveSignature(), 'SignatureHtml' => htmlspecialchars($signature), 'TipUnsubscribe' => getMsg('SUBSCR', 'TIP_SIGNATURE', $url)); $retval = $this->_tmplFiller->fill('', 'signature.tpl.html', $vars); return $retval; }
function getTopicAutoSubscribeName($topic_auto) { $_messageResources =& Subscriptions::getMessageResources(); $names = Subscriptions::getTopicAutoSubscribeNames(); return isset($names[$topic_auto]) ? $names[$topic_auto] : $_messageResources->getMessage('TOPIC_AUTOSUBSCRIBE_UNKNOWN'); }