当前位置: 首页>>代码示例>>PHP>>正文


PHP FWLanguage::getLanguageParameter方法代码示例

本文整理汇总了PHP中FWLanguage::getLanguageParameter方法的典型用法代码示例。如果您正苦于以下问题:PHP FWLanguage::getLanguageParameter方法的具体用法?PHP FWLanguage::getLanguageParameter怎么用?PHP FWLanguage::getLanguageParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FWLanguage的用法示例。


在下文中一共展示了FWLanguage::getLanguageParameter方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: sendMail

 /**
  * Send a confirmation e-mail to the address specified in the form,
  * if any.
  * @param $id
  * @param unknown_type $email
  * @return unknown
  */
 function sendMail($feedId, $email)
 {
     global $_CONFIG, $objDatabase, $_ARRAYLANG, $objInit;
     $feedId = intval($feedId);
     $languageId = null;
     // Get the user ID and entry information
     $objResult = $objDatabase->Execute("\n            SELECT addedby, title, language\n              FROM " . DBPREFIX . "module_directory_dir\n             WHERE id='{$feedId}'");
     if ($objResult && !$objResult->EOF) {
         $userId = $objResult->fields['addedby'];
         $feedTitle = $objResult->fields['title'];
         $languageId = $objResult->fields['language'];
     }
     // Get user data
     if (is_numeric($userId)) {
         $objFWUser = new \FWUser();
         if ($objFWUser->objUser->getUser($userId)) {
             $userMail = $objFWUser->objUser->getEmail();
             $userFirstname = $objFWUser->objUser->getProfileAttribute('firstname');
             $userLastname = $objFWUser->objUser->getProfileAttribute('lastname');
             $userUsername = $objFWUser->objUser->getUsername();
         }
     }
     if (!empty($email)) {
         $sendTo = $email;
         $mailId = 2;
     } else {
         // FIXED:  The mail addresses may *both* be empty!
         // Adding the entry was sucessful, however.  So we can probably assume
         // that it was a success anyway?
         // Added:
         if (empty($userMail)) {
             return true;
         }
         // ...and a boolean return value below.
         $sendTo = $userMail;
         $mailId = 1;
     }
     //get mail content n title
     $objResult = $objDatabase->Execute("\n            SELECT title, content\n              FROM " . DBPREFIX . "module_directory_mail\n             WHERE id='{$mailId}'");
     if ($objResult && !$objResult->EOF) {
         $subject = $objResult->fields['title'];
         $message = $objResult->fields['content'];
     }
     if ($objInit->mode == 'frontend') {
         $link = "http://" . $_CONFIG['domainUrl'] . CONTREXX_SCRIPT_PATH . "?section=Directory&cmd=detail&id=" . $feedId;
     } else {
         $link = "http://" . $_CONFIG['domainUrl'] . ASCMS_PATH_OFFSET . '/' . \FWLanguage::getLanguageParameter($languageId, 'lang') . '/' . CONTREXX_DIRECTORY_INDEX . "?section=Directory&cmd=detail&id=" . $feedId;
     }
     // replace placeholders
     $array_1 = array('[[USERNAME]]', '[[FIRSTNAME]]', '[[LASTNAME]]', '[[TITLE]]', '[[LINK]]', '[[URL]]', '[[DATE]]');
     $array_2 = array($userUsername, $userFirstname, $userLastname, $feedTitle, $link, $_CONFIG['domainUrl'] . ASCMS_PATH_OFFSET, date(ASCMS_DATE_FORMAT));
     $subject = str_replace($array_1, $array_2, $subject);
     $message = str_replace($array_1, $array_2, $message);
     $sendTo = explode(';', $sendTo);
     if (@\Env::get('ClassLoader')->loadFile(ASCMS_LIBRARY_PATH . '/phpmailer/class.phpmailer.php')) {
         $objMail = new \phpmailer();
         if ($_CONFIG['coreSmtpServer'] > 0 && @\Env::get('ClassLoader')->loadFile(ASCMS_CORE_PATH . '/SmtpSettings.class.php')) {
             $arrSmtp = SmtpSettings::getSmtpAccount($_CONFIG['coreSmtpServer']);
             if ($arrSmtp !== false) {
                 $objMail->IsSMTP();
                 $objMail->Host = $arrSmtp['hostname'];
                 $objMail->Port = $arrSmtp['port'];
                 $objMail->SMTPAuth = true;
                 $objMail->Username = $arrSmtp['username'];
                 $objMail->Password = $arrSmtp['password'];
             }
         }
         $objMail->CharSet = CONTREXX_CHARSET;
         $objMail->From = $_CONFIG['coreAdminEmail'];
         $objMail->FromName = $_CONFIG['coreAdminName'];
         $objMail->AddReplyTo($_CONFIG['coreAdminEmail']);
         $objMail->Subject = $subject;
         $objMail->IsHTML(false);
         $objMail->Body = $message;
         foreach ($sendTo as $mailAdress) {
             $objMail->ClearAddresses();
             $objMail->AddAddress($mailAdress);
             $objMail->Send();
         }
     }
     return true;
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:89,代码来源:DirectoryLibrary.class.php

示例2: _showFeed

    /**
     * Show feed page
     * @todo Add proper docblock
     * @global array
     * @global integer
     * @return string Template output
     */
    private function _showFeed()
    {
        global $_ARRAYLANG, $_LANGID;
        $serverPort = $_SERVER['SERVER_PORT'] == 80 ? '' : ':' . intval($_SERVER['SERVER_PORT']);
        $rssFeedUrl = 'http://' . $_SERVER['SERVER_NAME'] . $serverPort . ASCMS_PATH_OFFSET . '/feed/news_headlines_' . \FWLanguage::getLanguageParameter($_LANGID, 'lang') . '.xml';
        $jsFeedUrl = 'http://' . $_SERVER['SERVER_NAME'] . $serverPort . ASCMS_PATH_OFFSET . '/feed/news_' . \FWLanguage::getLanguageParameter($_LANGID, 'lang') . '.js';
        $hostname = addslashes(htmlspecialchars($_SERVER['SERVER_NAME'], ENT_QUOTES, CONTREXX_CHARSET));
        $rss2jsCode = <<<RSS2JSCODE
&lt;script language="JavaScript" type="text/javascript"&gt;
&lt;!--
// {$_ARRAYLANG['TXT_NEWS_OPTIONAL_VARS']}
var rssFeedFontColor = '#000000'; // {$_ARRAYLANG['TXT_NEWS_FONT_COLOR']}
var rssFeedFontSize = 8; // {$_ARRAYLANG['TXT_NEWS_FONT_SIZE']}
var rssFeedFont = 'Arial, Verdana'; // {$_ARRAYLANG['TXT_NEWS_FONT']}
var rssFeedLimit = 10; // {$_ARRAYLANG['TXT_NEWS_DISPLAY_LIMIT']}
var rssFeedShowDate = true; // {$_ARRAYLANG['TXT_NEWS_SHOW_NEWS_DATE']}
var rssFeedTarget = '_blank'; // _blank | _parent | _self | _top
var rssFeedContainer = 'news_rss_feeds';
// --&gt;
&lt;/script&gt;
&lt;script type="text/javascript" language="JavaScript" src="{$jsFeedUrl}"&gt;&lt;/script&gt;
&lt;noscript&gt;
&lt;a href="{$rssFeedUrl}"&gt;{$hostname} - {$_ARRAYLANG['TXT_NEWS_SHOW_NEWS']}&lt;/a&gt;
&lt;/noscript&gt;
&lt;div id="news_rss_feeds"&gt;&nbsp;&lt;/div&gt;
RSS2JSCODE;
        $this->_objTpl->setVariable(array('NEWS_HOSTNAME' => $hostname, 'NEWS_RSS2JS_CODE' => $rss2jsCode, 'NEWS_RSS2JS_URL' => $jsFeedUrl, 'NEWS_RSS_FEED_URL' => $rssFeedUrl));
        return $this->_objTpl->get();
    }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:36,代码来源:News.class.php

示例3: getRssNewsLinks

 /**
  * Get the RSS News links
  * 
  * @param integer $langId
  * @param array   $newsCategoryIds list of category Ids
  * 
  * @global array $_CONFIG
  *
  */
 public function getRssNewsLinks($langId, $newsCategoryIds, $categoryDetails)
 {
     global $_CONFIG;
     $categories = array();
     $cmdDetail = '';
     foreach ($newsCategoryIds as $newsCategoryId) {
         $currentCmdDetail = $this->findCmdById('details', array($newsCategoryId));
         $cmdDetail = !empty($currentCmdDetail) ? $currentCmdDetail : $cmdDetail;
         $cmdOverview = $this->findCmdById('', array($newsCategoryId));
         $cmdOverview = !empty($cmdOverview) ? '&amp;cmd=' . $cmdOverview : '';
         $categories[] = array('domain' => 'http://' . $_CONFIG['domainUrl'] . ($_SERVER['SERVER_PORT'] == 80 ? '' : ':' . intval($_SERVER['SERVER_PORT'])) . ASCMS_PATH_OFFSET . '/' . \FWLanguage::getLanguageParameter($langId, 'lang') . '/' . CONTREXX_DIRECTORY_INDEX . '?section=news' . $cmdOverview . '&amp;category=' . $newsCategoryId, 'title' => contrexx_raw2xml($categoryDetails[$newsCategoryId]));
     }
     return array($cmdDetail, $categories);
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:23,代码来源:NewsManager.class.php

示例4: createRSS

 protected function createRSS($langId)
 {
     global $_CONFIG, $objDatabase;
     $_FRONTEND_LANGID = $langId;
     if (intval($this->arrSettings['news_feed_status']) == 1) {
         $arrNews = array();
         require_once ASCMS_FRAMEWORK_PATH . '/RSSWriter.class.php';
         $objRSSWriter = new RSSWriter();
         $objRSSWriter->characterEncoding = CONTREXX_CHARSET;
         $objRSSWriter->channelTitle = $this->arrSettings['news_feed_title'];
         $objRSSWriter->channelLink = 'http://' . $_CONFIG['domainUrl'] . ($_SERVER['SERVER_PORT'] == 80 ? "" : ":" . intval($_SERVER['SERVER_PORT'])) . ASCMS_PATH_OFFSET . '/' . FWLanguage::getLanguageParameter($_FRONTEND_LANGID, 'lang') . '/' . CONTREXX_DIRECTORY_INDEX . '?section=news';
         $objRSSWriter->channelDescription = $this->arrSettings['news_feed_description'];
         $objRSSWriter->channelLanguage = FWLanguage::getLanguageParameter($_FRONTEND_LANGID, 'lang');
         $objRSSWriter->channelCopyright = 'Copyright ' . date('Y') . ', http://' . $_CONFIG['domainUrl'];
         if (!empty($this->arrSettings['news_feed_image'])) {
             $objRSSWriter->channelImageUrl = 'http://' . $_CONFIG['domainUrl'] . ($_SERVER['SERVER_PORT'] == 80 ? "" : ":" . intval($_SERVER['SERVER_PORT'])) . $this->arrSettings['news_feed_image'];
             $objRSSWriter->channelImageTitle = $objRSSWriter->channelTitle;
             $objRSSWriter->channelImageLink = $objRSSWriter->channelLink;
         }
         $objRSSWriter->channelWebMaster = $_CONFIG['coreAdminEmail'];
         $itemLink = "http://" . $_CONFIG['domainUrl'] . ($_SERVER['SERVER_PORT'] == 80 ? "" : ":" . intval($_SERVER['SERVER_PORT'])) . ASCMS_PATH_OFFSET . '/' . FWLanguage::getLanguageParameter($_FRONTEND_LANGID, 'lang') . '/' . CONTREXX_DIRECTORY_INDEX . '?section=news&amp;cmd=details&amp;newsid=';
         $query = "\n                SELECT      tblNews.id,\n                            tblNews.date,\n                            tblNews.title,\n                            tblNews.text,\n                            tblNews.redirect,\n                            tblNews.source,\n                            tblNews.catid AS categoryId,\n                            tblNews.teaser_frames AS teaser_frames,\n                            tblNews.teaser_text,\n                            tblCategory.name AS category\n                FROM        " . DBPREFIX . "module_news AS tblNews\n                INNER JOIN  " . DBPREFIX . "module_news_categories AS tblCategory\n                USING       (catid)\n                WHERE       tblNews.status=1\n                    AND     tblNews.lang = " . $_FRONTEND_LANGID . "\n                    AND     (tblNews.startdate <= CURDATE() OR tblNews.startdate = '0000-00-00 00:00:00')\n                    AND     (tblNews.enddate >= CURDATE() OR tblNews.enddate = '0000-00-00 00:00:00')" . ($this->arrSettings['news_message_protection'] == '1' ? " AND tblNews.frontend_access_id=0 " : '') . "ORDER BY tblNews.date DESC";
         if (($objResult = $objDatabase->SelectLimit($query, 20)) !== false && $objResult->RecordCount() > 0) {
             while (!$objResult->EOF) {
                 if (empty($objRSSWriter->channelLastBuildDate)) {
                     $objRSSWriter->channelLastBuildDate = date('r', $objResult->fields['date']);
                 }
                 $arrNews[$objResult->fields['id']] = array('date' => $objResult->fields['date'], 'title' => $objResult->fields['title'], 'text' => empty($objResult->fields['redirect']) ? (!empty($objResult->fields['teaser_text']) ? nl2br($objResult->fields['teaser_text']) . '<br /><br />' : '') . $objResult->fields['text'] : (!empty($objResult->fields['teaser_text']) ? nl2br($objResult->fields['teaser_text']) : ''), 'redirect' => $objResult->fields['redirect'], 'source' => $objResult->fields['source'], 'category' => $objResult->fields['category'], 'teaser_frames' => explode(';', $objResult->fields['teaser_frames']), 'categoryId' => $objResult->fields['categoryId']);
                 $objResult->MoveNext();
             }
         }
         // create rss feed
         $objRSSWriter->xmlDocumentPath = ASCMS_FEED_PATH . '/news_' . FWLanguage::getLanguageParameter($_FRONTEND_LANGID, 'lang') . '.xml';
         foreach ($arrNews as $newsId => $arrNewsItem) {
             $objRSSWriter->addItem(contrexx_raw2xml($arrNewsItem['title']), empty($arrNewsItem['redirect']) ? $itemLink . $newsId . (isset($arrNewsItem['teaser_frames'][0]) ? '&amp;teaserId=' . $arrNewsItem['teaser_frames'][0] : '') : htmlspecialchars($arrNewsItem['redirect'], ENT_QUOTES, CONTREXX_CHARSET), contrexx_raw2xml($arrNewsItem['text']), '', array('domain' => "http://" . $_CONFIG['domainUrl'] . ($_SERVER['SERVER_PORT'] == 80 ? "" : ":" . intval($_SERVER['SERVER_PORT'])) . ASCMS_PATH_OFFSET . '/' . FWLanguage::getLanguageParameter($_FRONTEND_LANGID, 'lang') . '/' . CONTREXX_DIRECTORY_INDEX . '?section=news&amp;category=' . $arrNewsItem['categoryId'], 'title' => $arrNewsItem['category']), '', '', '', $arrNewsItem['date'], array('url' => htmlspecialchars($arrNewsItem['source'], ENT_QUOTES, CONTREXX_CHARSET), 'title' => contrexx_raw2xml($arrNewsItem['title'])));
         }
         $status = $objRSSWriter->write();
         // create headlines rss feed
         $objRSSWriter->removeItems();
         $objRSSWriter->xmlDocumentPath = ASCMS_FEED_PATH . '/news_headlines_' . FWLanguage::getLanguageParameter($_FRONTEND_LANGID, 'lang') . '.xml';
         foreach ($arrNews as $newsId => $arrNewsItem) {
             $objRSSWriter->addItem(contrexx_raw2xml($arrNewsItem['title']), $itemLink . $newsId . (isset($arrNewsItem['teaser_frames'][0]) ? "&amp;teaserId=" . $arrNewsItem['teaser_frames'][0] : ""), '', '', array('domain' => 'http://' . $_CONFIG['domainUrl'] . ($_SERVER['SERVER_PORT'] == 80 ? '' : ':' . intval($_SERVER['SERVER_PORT'])) . ASCMS_PATH_OFFSET . '/' . FWLanguage::getLanguageParameter($_FRONTEND_LANGID, 'lang') . '/' . CONTREXX_DIRECTORY_INDEX . '?section=news&amp;category=' . $arrNewsItem['categoryId'], 'title' => $arrNewsItem['category']), '', '', '', $arrNewsItem['date']);
         }
         $statusHeadlines = $objRSSWriter->write();
         $objRSSWriter->feedType = 'js';
         $objRSSWriter->xmlDocumentPath = ASCMS_FEED_PATH . '/news_' . FWLanguage::getLanguageParameter($_FRONTEND_LANGID, 'lang') . '.js';
         $objRSSWriter->write();
         /*
         if (count($objRSSWriter->arrErrorMsg) > 0) {
             $this->strErrMessage .= implode('<br />', $objRSSWriter->arrErrorMsg);
         }
         if (count($objRSSWriter->arrWarningMsg) > 0) {
             $this->strErrMessage .= implode('<br />', $objRSSWriter->arrWarningMsg);
         }
         */
     } else {
         @unlink(ASCMS_FEED_PATH . '/news_' . FWLanguage::getLanguageParameter($_FRONTEND_LANGID, 'lang') . '.xml');
         @unlink(ASCMS_FEED_PATH . '/news_headlines_' . FWLanguage::getLanguageParameter($_FRONTEND_LANGID, 'lang') . '.xml');
         @unlink(ASCMS_FEED_PATH . '/news_' . FWLanguage::getLanguageParameter($_FRONTEND_LANGID, 'lang') . '.js');
     }
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:61,代码来源:news.php

示例5: getTreeCode

 private function getTreeCode()
 {
     if (count($this->arrMigrateLangIds) === 1) {
         return true;
     }
     $jsSimilarPages = array();
     $this->similarPages = $this->findSimilarPages();
     foreach ($this->similarPages as $nodeId => $arrPageIds) {
         $jsSimilarPages[$nodeId] = array_values($arrPageIds);
         foreach ($this->arrMigrateLangIds as $migrateLangId) {
             if (!isset($arrPageIds[$migrateLangId])) {
                 $this->similarPages[$nodeId][$migrateLangId] = 0;
             }
         }
         ksort($this->similarPages[$nodeId]);
     }
     $objCx = \ContrexxJavascript::getInstance();
     $objCx->setVariable('similarPages', json_encode($jsSimilarPages), 'update/contentMigration');
     $objTemplate = new \HTML_Template_Sigma(UPDATE_TPL);
     $objTemplate->setErrorHandling(PEAR_ERROR_DIE);
     $objTemplate->loadTemplateFile('page_grouping.html');
     $groupedBorderWidth = count($this->arrMigrateLangIds) * 325 - 48;
     $objTemplate->setGlobalVariable(array('USERNAME' => $_SESSION['contrexx_update']['username'], 'PASSWORD' => $_SESSION['contrexx_update']['password'], 'CMS_VERSION' => $_SESSION['contrexx_update']['version'], 'MIGRATE_LANG_IDS' => $this->migrateLangIds, 'LANGUAGE_WRAPPER_WIDTH' => 'width: ' . count($this->arrMigrateLangIds) * 330 . 'px;', 'GROUPED_SCROLL_WIDTH' => 'width: ' . count($this->arrMigrateLangIds) * 325 . 'px;', 'GROUPED_BORDER_WIDTH' => 'width: ' . $groupedBorderWidth . 'px;'));
     $cl = \Env::get('ClassLoader');
     $cl->loadFile(ASCMS_CORE_PATH . '/Tree.class.php');
     $cl->loadFile(UPDATE_CORE . '/UpdateTree.class.php');
     $pageRepo = self::$em->getRepository('Cx\\Core\\ContentManager\\Model\\Entity\\Page');
     $nodeRepo = self::$em->getRepository('Cx\\Core\\ContentManager\\Model\\Entity\\Node');
     foreach ($this->arrMigrateLangIds as $lang) {
         $objContentTree = new \UpdateContentTree($lang);
         foreach ($objContentTree->getTree() as $arrPage) {
             $pageId = $arrPage['catid'];
             $nodeId = $arrPage['node_id'];
             $langId = $arrPage['lang'];
             $level = $arrPage['level'];
             $title = $arrPage['catname'];
             $sort = $nodeRepo->find($nodeId)->getLft();
             $grouped = $this->isGrouppedPage($this->similarPages, $pageId) ? 'grouped' : '';
             $objTemplate->setVariable(array('TITLE' => $title, 'ID' => $pageId, 'NODE' => $nodeId, 'LANG' => strtoupper(\FWLanguage::getLanguageCodeById($langId)), 'LEVEL' => $level + 1, 'SORT' => $sort, 'GROUPED' => $grouped, 'MARGIN' => 'margin-left: ' . $level * 15 . 'px;'));
             $objTemplate->parse('page');
         }
         $langFull = \FWLanguage::getLanguageParameter($lang, 'name');
         $langShort = strtoupper(\FWLanguage::getLanguageParameter($lang, 'lang'));
         $objTemplate->setVariable(array('LANG_FULL' => $langFull, 'LANG_SHORT' => $langShort));
         $objTemplate->parse('language');
     }
     $groupedBorderWidth -= 2;
     foreach ($this->similarPages as $nodeId => $arrPageIds) {
         $node = $nodeRepo->find($nodeId);
         $margin = ($node->getLvl() - 1) * 15;
         $nodeWidth = $groupedBorderWidth - $margin;
         $width = ($groupedBorderWidth - 10) / count($this->arrMigrateLangIds);
         $index = 0;
         $last = count($arrPageIds) - 1;
         foreach ($arrPageIds as $pageLangId => $pageId) {
             if ($index === 0) {
                 $pageWidth = $width - 24;
             } elseif ($index === $last) {
                 $pageWidth = $width - $margin;
             } else {
                 $pageWidth = $width;
             }
             $index++;
             $page = $pageRepo->find($pageId);
             if ($page) {
                 $langCode = strtoupper(\FWLanguage::getLanguageCodeById($page->getLang()));
                 $objTemplate->setVariable(array('CLASS' => '', 'DATA_ID' => 'data-id="' . $pageId . '"', 'DATA_LANG' => 'data-lang="' . $langCode . '"', 'TITLE' => $page->getTitle(), 'LANG' => $langCode, 'WIDTH' => 'width: ' . $pageWidth . 'px;'));
             } else {
                 $langCode = strtoupper(\FWLanguage::getLanguageCodeById($pageLangId));
                 $objTemplate->setVariable(array('CLASS' => 'no-page', 'DATA_ID' => '', 'DATA_LANG' => '', 'TITLE' => 'Keine Seite', 'LANG' => $langCode, 'WIDTH' => 'width: ' . $pageWidth . 'px;'));
             }
             $objTemplate->parse('groupedPage');
         }
         $objTemplate->setVariable(array('ID' => $nodeId, 'LEVEL' => $node->getLvl(), 'SORT' => $node->getLft(), 'STYLE' => 'width: ' . $nodeWidth . 'px; margin-left: ' . $margin . 'px;'));
         $objTemplate->parse('groupedNode');
     }
     return $objTemplate->get();
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:78,代码来源:ContentMigration.class.php

示例6: _configModifyMails

 function _configModifyMails($copy = false)
 {
     global $_ARRAYLANG;
     if (empty($_REQUEST['type'])) {
         return $this->_configMails();
     }
     $objFWUser = \FWUser::getFWUserObject();
     $objUserMail = $objFWUser->getMail();
     if ($copy) {
         $objUserMail->load(contrexx_addslashes($_REQUEST['type']));
         $objUserMail->setLangId(!empty($_REQUEST['access_mail_lang']) ? intval($_REQUEST['access_mail_lang']) : 0);
     } elseif (!$objUserMail->load(contrexx_addslashes($_REQUEST['type']), !empty($_REQUEST['access_mail_lang']) ? intval($_REQUEST['access_mail_lang']) : null)) {
         return $this->_configMails();
     }
     if (isset($_POST['access_save_mail']) || isset($_GET['access_change_format'])) {
         // only administrators are allowed to modify the config
         if (!\Permission::hasAllAccess()) {
             \Permission::noAccess();
         }
         $objUserMail->setFormat(!empty($_POST['access_mail_format']) ? $_POST['access_mail_format'] : null);
         $objUserMail->setSubject(!empty($_POST['access_mail_subject']) ? contrexx_stripslashes($_POST['access_mail_subject']) : '');
         $objUserMail->setSenderMail(!empty($_POST['access_mail_sender_address']) ? contrexx_stripslashes($_POST['access_mail_sender_address']) : '');
         $objUserMail->setSenderName(!empty($_POST['access_mail_sender_name']) ? contrexx_stripslashes($_POST['access_mail_sender_name']) : '');
         $objUserMail->setBodyText(!empty($_POST['access_mail_body_text']) ? contrexx_stripslashes($_POST['access_mail_body_text']) : '');
         $objUserMail->setBodyHtml(!empty($_POST['access_mail_body_html']) ? contrexx_stripslashes($_POST['access_mail_body_html']) : '');
         if (isset($_POST['access_save_mail'])) {
             if ($objUserMail->store()) {
                 self::$arrStatusMsg['ok'][] = $_ARRAYLANG['TXT_ACCESS_MAIL_STORED_SUCCESSFULLY'];
                 return $this->_configMails();
             } else {
                 self::$arrStatusMsg['error'] = array_merge(self::$arrStatusMsg['error'], $objUserMail->getErrorMsg());
             }
         }
     }
     $this->_objTpl->addBlockfile('ACCESS_CONFIG_TEMPLATE', 'module_access_config_mail_modify', 'module_access_config_mail_modify.html');
     $this->_objTpl->setVariable(array('TXT_ACCESS_MODIFY_EMAIL' => $_ARRAYLANG['TXT_ACCESS_MODIFY_EMAIL'], 'TXT_ACCESS_MAIL_SUBJECT' => $_ARRAYLANG['TXT_ACCESS_MAIL_SUBJECT'], 'TXT_ACCESS_SEND_AS' => $_ARRAYLANG['TXT_ACCESS_SEND_AS'], 'TXT_ACCESS_SENDER_ADDRESS' => $_ARRAYLANG['TXT_ACCESS_SENDER_ADDRESS'], 'TXT_ACCESS_SENDER_NAME' => $_ARRAYLANG['TXT_ACCESS_SENDER_NAME'], 'TXT_ACCESS_TEXT_BODY' => $_ARRAYLANG['TXT_ACCESS_TEXT_BODY'], 'TXT_ACCESS_CANCEL' => $_ARRAYLANG['TXT_ACCESS_CANCEL'], 'TXT_ACCESS_SAVE' => $_ARRAYLANG['TXT_ACCESS_SAVE'], 'TXT_ACCESS_TYPE' => $_ARRAYLANG['TXT_ACCESS_TYPE'], 'TXT_ACCESS_LANGUAGE' => $_ARRAYLANG['TXT_ACCESS_LANGUAGE'], 'TXT_ACCESS_PLACEHOLDER_DIRECTORY' => $_ARRAYLANG['TXT_ACCESS_PLACEHOLDER_DIRECTORY']));
     if ($copy) {
         if (($language = $this->getMailLanguageMenu($objUserMail->getType(), $objUserMail->getLangId(), 'name="access_mail_lang" style="width:400px;"')) === false) {
             return $this->_configMails();
         }
     } elseif (!$objUserMail->getLangId()) {
         $language = '-';
     } else {
         $language = '<input type="hidden" name="access_mail_lang" value="' . $objUserMail->getLangId() . '" />' . \FWLanguage::getLanguageParameter($objUserMail->getLangId(), 'name');
     }
     $this->_objTpl->setVariable(array('ACCESS_MAIL_ACTION' => $copy ? 'copyMail' : 'modifyMail', 'ACCESS_MAIL_TYPE' => $objUserMail->getType(), 'ACCESS_MAIL_TYPE_TXT' => $objUserMail->getTypeDescription(), 'ACCESS_MAIL_LANGUAGE' => $language, 'ACCESS_MAIL_SUBJECT' => htmlentities($objUserMail->getSubject(), ENT_QUOTES, CONTREXX_CHARSET), 'ACCESS_MAIL_FORMAT' => $this->getMailFormatMenu($objUserMail->getFormat(), 'name="access_mail_format" onchange="document.getElementById(\'access_mail_form\').action=\'index.php?cmd=Access&amp;act=config&amp;tpl=' . ($copy ? 'copyMail' : 'modifyMail') . '&amp;type=' . $objUserMail->getType() . '&amp;access_mail_lang=\'+(typeof(document.getElementsByName(\'access_mail_lang\')[0]) != \'undefined\' ? document.getElementsByName(\'access_mail_lang\')[0].value : 0)+\'&amp;access_change_format=1\';document.getElementById(\'access_mail_form\').submit()" size="1" style="width:400px;"'), 'ACCESS_MAIL_SENDER_ADDRESS' => htmlentities($objUserMail->getSenderMail(), ENT_QUOTES, CONTREXX_CHARSET), 'ACCESS_MAIL_SENDER_NAME' => htmlentities($objUserMail->getSenderName(), ENT_QUOTES, CONTREXX_CHARSET), 'ACCESS_MAIL_BODY_TEXT' => htmlentities($objUserMail->getBodyText(), ENT_QUOTES, CONTREXX_CHARSET), 'ACCESS_MAIL_BODY_HTML' => $objUserMail->getFormat() != 'text' ? new \Cx\Core\Wysiwyg\Wysiwyg('access_mail_body_html', $objUserMail->getBodyHtml(), 'fullpage') : '<input type="hidden" name="access_mail_body_html" value="' . htmlentities($objUserMail->getBodyHtml(), ENT_QUOTES, CONTREXX_CHARSET) . '" />', 'ACCESS_MAIL_HTML_BODY_STAUTS' => $objUserMail->getFormat() != 'text' ? 'block' : 'none', 'ACCESS_MAIL_TEXT_BODY_STAUTS' => $objUserMail->getFormat() == 'text' ? 'block' : 'none', 'ACCESS_MAIL_HTML_BODY_CLASS' => $objUserMail->getFormat() != 'text' ? 'active' : '', 'ACCESS_MAIL_TEXT_BODY_CLASS' => $objUserMail->getFormat() == 'text' ? 'active' : ''));
     if ($objUserMail->getFormat() == 'text') {
         $this->_objTpl->setVariable('TXT_ACCESS_TEXT', $_ARRAYLANG['TXT_ACCESS_TEXT']);
         $this->_objTpl->touchBlock('access_mail_text_body');
         $this->_objTpl->hideBlock('access_mail_html_body');
     } elseif ($objUserMail->getFormat() == 'html') {
         $this->_objTpl->setVariable('TXT_ACCESS_HTML_UC', $_ARRAYLANG['TXT_ACCESS_HTML_UC']);
         $this->_objTpl->touchBlock('access_mail_html_body');
         $this->_objTpl->hideBlock('access_mail_text_body');
     } else {
         $this->_objTpl->setVariable(array('TXT_ACCESS_HTML_UC' => $_ARRAYLANG['TXT_ACCESS_HTML_UC'], 'TXT_ACCESS_TEXT' => $_ARRAYLANG['TXT_ACCESS_TEXT']));
         $this->_objTpl->touchBlock('access_mail_html_body');
         $this->_objTpl->touchBlock('access_mail_text_body');
     }
     $nr = 0;
     foreach ($objUserMail->getPlaceholders() as $placeholder => $placeholderTxt) {
         $this->_objTpl->setVariable(array('ACCESS_CLASS_ROW_NR' => $nr++ % 2 ? 2 : 1, 'ACCESS_PLACEHOLDER_TXT' => $placeholderTxt, 'ACCESS_PLACEHOLDER' => $placeholder));
         $this->_objTpl->parse('access_placeholder_list');
     }
     $this->_objTpl->parse('module_access_config_mail_modify');
     return true;
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:67,代码来源:AccessManager.class.php

示例7: _overview

 /**
  * Overview over all dirs
  *
  * @global array
  * @global ADONewConnection
  * @access private
  */
 function _overview()
 {
     global $_ARRAYLANG, $objDatabase;
     $this->_objTpl->loadTemplateFile('module_memberdir_overview.html', true, true);
     $this->pageTitle = $_ARRAYLANG['TXT_OVERVIEW'];
     $this->_objTpl->setGlobalVariable(array("TXT_CONFIRM_DELETE_DATA" => $_ARRAYLANG['TXT_CONFIRM_DELETE_DATA'], "TXT_ACTION_IS_IRREVERSIBLE" => $_ARRAYLANG['TXT_ACTION_IS_IRREVERSIBLE'], "TXT_DELETE_CATEGORY_ALL" => $_ARRAYLANG['TXT_DELETE_CATEGORY_ALL'], "TXT_MANAGE_ENTRIES" => $_ARRAYLANG['TXT_OVERVIEW'], "TXT_SUBMIT_SELECT" => $_ARRAYLANG['TXT_SUBMIT_SELECT'], "TXT_SUBMIT_DELETE" => $_ARRAYLANG['TXT_SUBMIT_DELETE'], "TXT_SUBMIT_EXPORT" => $_ARRAYLANG['TXT_SUBMIT_EXPORT'], "TXT_SELECT_ALL" => $_ARRAYLANG['TXT_SELECT_ALL'], "TXT_DESELECT_ALL" => $_ARRAYLANG['TXT_DESELECT_ALL'], "TXT_NAME" => $_ARRAYLANG['TXT_NAME'], "TXT_ACTIONS" => $_ARRAYLANG['TXT_ACTION'], "TXT_DESCRIPTION" => $_ARRAYLANG['TXT_DESCRIPTION'], "TXT_ENTRIES" => $_ARRAYLANG['TXT_ENTRIES'], "TXT_FILTER" => $_ARRAYLANG['TXT_FILTER'], "DIRECTORY_LIST" => $this->dirList('id', null, 100), "TXT_SEARCH" => $_ARRAYLANG['TXT_SEARCH'], "TXT_KEYWORD" => empty($_GET['keyword']) ? "" : $_GET['keyword'], "TXT_STATUS" => $_ARRAYLANG['TXT_STATUS'], "TXT_CSV_FILE" => $_ARRAYLANG['TXT_CSV_FILE'], "TXT_DOWNLOAD" => $_ARRAYLANG['TXT_DOWNLOAD'], "TXT_ID" => $_ARRAYLANG['TXT_ID'], "TXT_DOWNLOAD_QUESTION" => $_ARRAYLANG['TXT_DOWNLOAD_QUESTION'], 'TXT_MEMBERDIR_LANGUAGE' => $_ARRAYLANG['TXT_MEMBERDIR_LANGUAGE']));
     $rowid = 2;
     foreach ($this->directories as $key => $value) {
         $query = "SELECT id FROM " . DBPREFIX . "module_memberdir_values\n                      WHERE dirid = '" . $key . "'";
         $objResult = $objDatabase->Execute($query);
         $entryCount = $objResult->RecordCount();
         $margin = 0;
         for ($i = 1; $i <= $value['level']; $i++) {
             $margin += 20;
         }
         $parentdir = $value['parentdir'];
         $parentdirlist = "";
         while ($parentdir > 0) {
             $parentdirlist = "p" . $parentdir . " " . $parentdirlist;
             $parentdir = $this->directories[$parentdir]['parentdir'];
         }
         if ($value['lang'] == 0) {
             $lang = $_ARRAYLANG['TXT_ALL_LANGUAGES'];
         } else {
             $lang = \FWLanguage::getLanguageParameter($value['lang'], 'lang');
         }
         $this->_objTpl->setVariable(array("MEMBERDIR_DIRID" => $key, "MEMBERDIR_DIRNAME" => $value['name'], "MEMBERDIR_ROW" => "row" . $rowid, "MEMBERDIR_DESC" => nl2br($value['description']), "MEMBERDIR_ENTRYCOUNT" => $entryCount, "MEMBERDIR_ACTIVE" => $value['active'] ? "green" : "red", "MEMBERDIR_MARGIN" => $margin, "MEMBERDIR_PARENTS" => $parentdirlist, "MEMBERDIR_DISPLAY" => $value['parentdir'] == 0 ? "table-row" : "none", "MEMBERDIR_HAS_CHILDREN" => $value['has_children'], "MEMBERDIR_LEVEL" => $value['level'], 'MEMBERDIR_LANGUAGE' => htmlentities(\FWLanguage::getLanguageParameter($value['lang'], 'name'), ENT_QUOTES, CONTREXX_CHARSET) . ' (' . $lang . ')'));
         if ($value['has_children']) {
             $this->_objTpl->touchBlock("treeimg");
             $this->_objTpl->parse("treeimg");
         } else {
             $this->_objTpl->hideBlock("treeimg");
             $this->_objTpl->touchBlock("spacer");
             $this->_objTpl->parse("spacer");
         }
         $this->_objTpl->setVariable(array("MEMBERDIR_DIRID" => $key));
         $this->_objTpl->parse("dirlist_row");
         $rowid = $rowid == 2 ? 1 : 2;
     }
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:47,代码来源:MemberDirManager.class.php

示例8: writeCategoryRSS

 /**
  * Writes RSS feed containing the latest N messages of each category the feed-directory. This is done for every language seperately.
  *
  * @global  array
  * @global  array
  * @global  FWLanguage
  */
 function writeCategoryRSS()
 {
     global $_CONFIG, $_ARRAYLANG;
     if (intval($this->_arrSettings['blog_rss_activated'])) {
         $arrCategories = $this->createCategoryArray();
         //Iterate over all languages
         foreach ($this->_arrLanguages as $intLanguageId => $arrLanguageValues) {
             $strItemLink = 'http://' . $_CONFIG['domainUrl'] . ($_SERVER['SERVER_PORT'] == 80 ? '' : ':' . intval($_SERVER['SERVER_PORT'])) . ASCMS_PATH_OFFSET . '/' . \FWLanguage::getLanguageParameter($intLanguageId, 'lang') . '/' . CONTREXX_DIRECTORY_INDEX . '?section=Blog&amp;cmd=details&amp;id=';
             $arrEntries = $this->createEntryArray($intLanguageId);
             //If there exist entries in this language go on, otherwise skip
             if (count($arrEntries) > 0) {
                 //Iterate over all categories
                 foreach ($arrCategories as $intCategoryId => $arrCategoryTranslation) {
                     //If the category is activated in this language, find assigned messages
                     if ($arrCategoryTranslation[$intLanguageId]['is_active']) {
                         $intNumberOfMessages = 0;
                         //Counts found messages for this category
                         $objRSSWriter = new \RSSWriter();
                         $objRSSWriter->characterEncoding = CONTREXX_CHARSET;
                         $objRSSWriter->channelTitle = $_CONFIG['coreGlobalPageTitle'] . ' - ' . $_ARRAYLANG['TXT_BLOG_LIB_RSS_MESSAGES_TITLE'];
                         $objRSSWriter->channelLink = 'http://' . $_CONFIG['domainUrl'] . ($_SERVER['SERVER_PORT'] == 80 ? '' : ':' . intval($_SERVER['SERVER_PORT'])) . ASCMS_PATH_OFFSET . '/' . \FWLanguage::getLanguageParameter($intLanguageId, 'lang') . '/' . CONTREXX_DIRECTORY_INDEX . '?section=Blog';
                         $objRSSWriter->channelDescription = $_CONFIG['coreGlobalPageTitle'] . ' - ' . $_ARRAYLANG['TXT_BLOG_LIB_RSS_MESSAGES_TITLE'] . ' (' . $arrCategoryTranslation[$intLanguageId]['name'] . ')';
                         $objRSSWriter->channelCopyright = 'Copyright ' . date('Y') . ', http://' . $_CONFIG['domainUrl'];
                         //Function doesn't exist
                         //$objRSSWriter->channelLanguage = \FWLanguage::getLanguageParameter($intLanguageId, 'lang');
                         $objRSSWriter->channelWebMaster = $_CONFIG['coreAdminEmail'];
                         //Find assigned messages
                         foreach ($arrEntries as $intEntryId => $arrEntryValues) {
                             if ($this->categoryMatches($intCategoryId, $arrEntryValues['categories'][$intLanguageId])) {
                                 //Message is in category, add to feed
                                 $objRSSWriter->addItem(html_entity_decode($arrEntryValues['subject'], ENT_QUOTES, CONTREXX_CHARSET), $strItemLink . $intEntryId, htmlspecialchars($arrEntryValues['translation'][$intLanguageId]['content'], ENT_QUOTES, CONTREXX_CHARSET), htmlspecialchars($arrEntryValues['user_name'], ENT_QUOTES, CONTREXX_CHARSET), '', '', '', '', $arrEntryValues['time_created_ts'], '');
                                 $intNumberOfMessages++;
                                 //Check for message-limit
                                 if ($intNumberOfMessages >= intval($this->_arrSettings['blog_rss_messages'])) {
                                     break;
                                 }
                             }
                         }
                         $objRSSWriter->xmlDocumentPath = \Env::get('cx')->getWebsiteFeedPath() . '/blog_category_' . $intCategoryId . '_' . $arrLanguageValues['short'] . '.xml';
                         $objRSSWriter->write();
                         \Cx\Lib\FileSystem\FileSystem::makeWritable(\Env::get('cx')->getWebsiteFeedPath() . '/blog_category_' . $intCategoryId . '_' . $arrLanguageValues['short'] . '.xml');
                     }
                 }
             }
         }
     }
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:54,代码来源:BlogLibrary.class.php

示例9: _showFeed

    /**
     * Show feed page
     * @todo Add proper docblock
     * @global array
     * @global integer
     * @return string Template output
     */
    private function _showFeed()
    {
        global $_ARRAYLANG, $_LANGID;
        $documentRoot = \Cx\Core\Routing\Url::fromDocumentRoot();
        $documentRoot->setMode('backend');
        $documentRoot->setPath('feed/news_headlines_' . \FWLanguage::getLanguageParameter($_LANGID, 'lang') . '.xml');
        $rssFeedUrl = $documentRoot->toString();
        $documentRoot->setPath('feed/news_' . \FWLanguage::getLanguageParameter($_LANGID, 'lang') . '.js');
        $jsFeedUrl = $documentRoot->toString();
        $hostname = addslashes(htmlspecialchars(\Env::get('config')['domainUrl'], ENT_QUOTES, CONTREXX_CHARSET));
        $rss2jsCode = <<<RSS2JSCODE
&lt;script language="JavaScript" type="text/javascript"&gt;
&lt;!--
// {$_ARRAYLANG['TXT_NEWS_OPTIONAL_VARS']}
var rssFeedFontColor = '#000000'; // {$_ARRAYLANG['TXT_NEWS_FONT_COLOR']}
var rssFeedFontSize = 8; // {$_ARRAYLANG['TXT_NEWS_FONT_SIZE']}
var rssFeedFont = 'Arial, Verdana'; // {$_ARRAYLANG['TXT_NEWS_FONT']}
var rssFeedLimit = 10; // {$_ARRAYLANG['TXT_NEWS_DISPLAY_LIMIT']}
var rssFeedShowDate = true; // {$_ARRAYLANG['TXT_NEWS_SHOW_NEWS_DATE']}
var rssFeedTarget = '_blank'; // _blank | _parent | _self | _top
var rssFeedContainer = 'news_rss_feeds';
// --&gt;
&lt;/script&gt;
&lt;script type="text/javascript" language="JavaScript" src="{$jsFeedUrl}"&gt;&lt;/script&gt;
&lt;noscript&gt;
&lt;a href="{$rssFeedUrl}"&gt;{$hostname} - {$_ARRAYLANG['TXT_NEWS_SHOW_NEWS']}&lt;/a&gt;
&lt;/noscript&gt;
&lt;div id="news_rss_feeds"&gt;&nbsp;&lt;/div&gt;
RSS2JSCODE;
        $this->_objTpl->setVariable(array('NEWS_HOSTNAME' => $hostname, 'NEWS_RSS2JS_CODE' => $rss2jsCode, 'NEWS_RSS2JS_URL' => $jsFeedUrl, 'NEWS_RSS_FEED_URL' => $rssFeedUrl));
        return $this->_objTpl->get();
    }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:39,代码来源:News.class.php

示例10: GetProfileURL

 /**
  * Return link to the profile of a user
  */
 function GetProfileURL($code, $email, $type = self::USER_TYPE_NEWSLETTER)
 {
     global $_ARRAYLANG, $_CONFIG;
     if ($type == self::USER_TYPE_CORE) {
         // recipients that will receive the newsletter through the selection of their user group don't have a profile
         return '';
     }
     $profileURI = '?section=Newsletter&cmd=profile&code=' . $code . '&mail=' . urlencode($email);
     $uri = ASCMS_PROTOCOL . '://' . $_CONFIG['domainUrl'] . ($_SERVER['SERVER_PORT'] == 80 ? NULL : ':' . intval($_SERVER['SERVER_PORT'])) . ASCMS_PATH_OFFSET . '/' . \FWLanguage::getLanguageParameter(\FWLanguage::getDefaultLangId(), 'lang') . '/' . CONTREXX_DIRECTORY_INDEX . $profileURI;
     return '<a href="' . $uri . '">' . $_ARRAYLANG['TXT_EDIT_PROFILE'] . '</a>';
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:14,代码来源:NewsletterManager.class.php

示例11: view_detail

 /**
  * Set up the detail view of the selected order
  * @access  public
  * @param   \Cx\Core\Html\Sigma $objTemplate    The Template, by reference
  * @param   boolean             $edit           Edit if true, view otherwise
  * @global  ADONewConnection    $objDatabase    Database connection object
  * @global  array               $_ARRAYLANG     Language array
  * @return  boolean                             True on success,
  *                                              false otherwise
  * @static
  * @author  Reto Kohli <reto.kohli@comvation.com> (parts)
  * @version 3.1.0
  */
 static function view_detail(&$objTemplate = null, $edit = false)
 {
     global $objDatabase, $_ARRAYLANG, $objInit;
     $backend = $objInit->mode == 'backend';
     if ($objTemplate->blockExists('order_list')) {
         $objTemplate->hideBlock('order_list');
     }
     $have_option = false;
     // The order total -- in the currency chosen by the customer
     $order_sum = 0;
     // recalculated VAT total
     $total_vat_amount = 0;
     $order_id = intval($_REQUEST['order_id']);
     if (!$order_id) {
         return \Message::error($_ARRAYLANG['TXT_SHOP_ORDER_ERROR_INVALID_ORDER_ID']);
     }
     if (!$objTemplate) {
         $template_name = $edit ? 'module_shop_order_edit.html' : 'module_shop_order_details.html';
         $objTemplate = new \Cx\Core\Html\Sigma(\Cx\Core\Core\Controller\Cx::instanciate()->getCodeBaseModulePath() . '/Shop/View/Template/Backend');
         //DBG::log("Orders::view_list(): new Template: ".$objTemplate->get());
         $objTemplate->loadTemplateFile($template_name);
         //DBG::log("Orders::view_list(): loaded Template: ".$objTemplate->get());
     }
     $objOrder = Order::getById($order_id);
     if (!$objOrder) {
         //DBG::log("Shop::shopShowOrderdetails(): Failed to find Order ID $order_id");
         return \Message::error(sprintf($_ARRAYLANG['TXT_SHOP_ORDER_NOT_FOUND'], $order_id));
     }
     // lsv data
     $query = "\n            SELECT `holder`, `bank`, `blz`\n              FROM " . DBPREFIX . "module_shop" . MODULE_INDEX . "_lsv\n             WHERE order_id={$order_id}";
     $objResult = $objDatabase->Execute($query);
     if (!$objResult) {
         return self::errorHandler();
     }
     if ($objResult->RecordCount() == 1) {
         $objTemplate->setVariable(array('SHOP_ACCOUNT_HOLDER' => contrexx_raw2xhtml($objResult->fields['holder']), 'SHOP_ACCOUNT_BANK' => contrexx_raw2xhtml($objResult->fields['bank']), 'SHOP_ACCOUNT_BLZ' => contrexx_raw2xhtml($objResult->fields['blz'])));
     }
     $customer_id = $objOrder->customer_id();
     if (!$customer_id) {
         //DBG::log("Shop::shopShowOrderdetails(): Invalid Customer ID $customer_id");
         \Message::error(sprintf($_ARRAYLANG['TXT_SHOP_INVALID_CUSTOMER_ID'], $customer_id));
     }
     $objCustomer = Customer::getById($customer_id);
     if (!$objCustomer) {
         //DBG::log("Shop::shopShowOrderdetails(): Failed to find Customer ID $customer_id");
         \Message::error(sprintf($_ARRAYLANG['TXT_SHOP_CUSTOMER_NOT_FOUND'], $customer_id));
         $objCustomer = new Customer();
         // No editing allowed!
         $have_option = true;
     }
     Vat::is_reseller($objCustomer->is_reseller());
     Vat::is_home_country(\Cx\Core\Setting\Controller\Setting::getValue('country_id', 'Shop') == $objOrder->country_id());
     $objTemplate->setGlobalVariable($_ARRAYLANG + array('SHOP_CURRENCY' => Currency::getCurrencySymbolById($objOrder->currency_id())));
     //DBG::log("Order sum: ".Currency::formatPrice($objOrder->sum()));
     $objTemplate->setVariable(array('SHOP_CUSTOMER_ID' => $customer_id, 'SHOP_ORDERID' => $order_id, 'SHOP_DATE' => date(ASCMS_DATE_FORMAT_INTERNATIONAL_DATETIME, strtotime($objOrder->date_time())), 'SHOP_ORDER_STATUS' => $edit ? Orders::getStatusMenu($objOrder->status(), false, null, 'swapSendToStatus(this.value)') : $_ARRAYLANG['TXT_SHOP_ORDER_STATUS_' . $objOrder->status()], 'SHOP_SEND_MAIL_STYLE' => $objOrder->status() == Order::STATUS_CONFIRMED ? 'display: inline;' : 'display: none;', 'SHOP_SEND_MAIL_STATUS' => $edit ? $objOrder->status() != Order::STATUS_CONFIRMED ? \Html::ATTRIBUTE_CHECKED : '' : '', 'SHOP_ORDER_SUM' => Currency::formatPrice($objOrder->sum()), 'SHOP_DEFAULT_CURRENCY' => Currency::getDefaultCurrencySymbol(), 'SHOP_GENDER' => $edit ? Customer::getGenderMenu($objOrder->billing_gender(), 'billing_gender') : $_ARRAYLANG['TXT_SHOP_' . strtoupper($objOrder->billing_gender())], 'SHOP_COMPANY' => $objOrder->billing_company(), 'SHOP_FIRSTNAME' => $objOrder->billing_firstname(), 'SHOP_LASTNAME' => $objOrder->billing_lastname(), 'SHOP_ADDRESS' => $objOrder->billing_address(), 'SHOP_ZIP' => $objOrder->billing_zip(), 'SHOP_CITY' => $objOrder->billing_city(), 'SHOP_COUNTRY' => $edit ? \Cx\Core\Country\Controller\Country::getMenu('billing_country_id', $objOrder->billing_country_id()) : \Cx\Core\Country\Controller\Country::getNameById($objOrder->billing_country_id()), 'SHOP_PHONE' => $objOrder->billing_phone(), 'SHOP_FAX' => $objOrder->billing_fax(), 'SHOP_EMAIL' => $objOrder->billing_email(), 'SHOP_SHIP_GENDER' => $edit ? Customer::getGenderMenu($objOrder->gender(), 'shipPrefix') : $_ARRAYLANG['TXT_SHOP_' . strtoupper($objOrder->gender())], 'SHOP_SHIP_COMPANY' => $objOrder->company(), 'SHOP_SHIP_FIRSTNAME' => $objOrder->firstname(), 'SHOP_SHIP_LASTNAME' => $objOrder->lastname(), 'SHOP_SHIP_ADDRESS' => $objOrder->address(), 'SHOP_SHIP_ZIP' => $objOrder->zip(), 'SHOP_SHIP_CITY' => $objOrder->city(), 'SHOP_SHIP_COUNTRY' => $edit ? \Cx\Core\Country\Controller\Country::getMenu('shipCountry', $objOrder->country_id()) : \Cx\Core\Country\Controller\Country::getNameById($objOrder->country_id()), 'SHOP_SHIP_PHONE' => $objOrder->phone(), 'SHOP_PAYMENTTYPE' => Payment::getProperty($objOrder->payment_id(), 'name'), 'SHOP_CUSTOMER_NOTE' => $objOrder->note(), 'SHOP_COMPANY_NOTE' => $objCustomer->companynote(), 'SHOP_SHIPPING_TYPE' => $objOrder->shipment_id() ? Shipment::getShipperName($objOrder->shipment_id()) : '&nbsp;'));
     if ($backend) {
         $objTemplate->setVariable(array('SHOP_CUSTOMER_IP' => $objOrder->ip() ? '<a href="index.php?cmd=NetTools&amp;tpl=whois&amp;address=' . $objOrder->ip() . '" title="' . $_ARRAYLANG['TXT_SHOW_DETAILS'] . '">' . $objOrder->ip() . '</a>' : '&nbsp;', 'SHOP_CUSTOMER_HOST' => $objOrder->host() ? '<a href="index.php?cmd=NetTools&amp;tpl=whois&amp;address=' . $objOrder->host() . '" title="' . $_ARRAYLANG['TXT_SHOW_DETAILS'] . '">' . $objOrder->host() . '</a>' : '&nbsp;', 'SHOP_CUSTOMER_LANG' => \FWLanguage::getLanguageParameter($objOrder->lang_id(), 'name'), 'SHOP_CUSTOMER_BROWSER' => $objOrder->browser() ? $objOrder->browser() : '&nbsp;', 'SHOP_LAST_MODIFIED' => $objOrder->modified_on() && $objOrder->modified_on() != '0000-00-00 00:00:00' ? $objOrder->modified_on() . '&nbsp;' . $_ARRAYLANG['TXT_EDITED_BY'] . '&nbsp;' . $objOrder->modified_by() : $_ARRAYLANG['TXT_ORDER_WASNT_YET_EDITED']));
     } else {
         // Frontend: Order history ONLY.  Repeat the Order, go to cart
         $objTemplate->setVariable(array('SHOP_ACTION_URI_ENCODED' => \Cx\Core\Routing\Url::fromModuleAndCmd('Shop', 'cart')));
     }
     $ppName = '';
     $psp_id = Payment::getPaymentProcessorId($objOrder->payment_id());
     if ($psp_id) {
         $ppName = PaymentProcessing::getPaymentProcessorName($psp_id);
     }
     $objTemplate->setVariable(array('SHOP_SHIPPING_PRICE' => $objOrder->shipment_amount(), 'SHOP_PAYMENT_PRICE' => $objOrder->payment_amount(), 'SHOP_PAYMENT_HANDLER' => $ppName, 'SHOP_LAST_MODIFIED_DATE' => $objOrder->modified_on()));
     if ($edit) {
         // edit order
         $strJsArrShipment = Shipment::getJSArrays();
         $objTemplate->setVariable(array('SHOP_SEND_TEMPLATE_TO_CUSTOMER' => sprintf($_ARRAYLANG['TXT_SEND_TEMPLATE_TO_CUSTOMER'], $_ARRAYLANG['TXT_ORDER_COMPLETE']), 'SHOP_SHIPPING_TYP_MENU' => Shipment::getShipperMenu($objOrder->country_id(), $objOrder->shipment_id(), "calcPrice(0);"), 'SHOP_JS_ARR_SHIPMENT' => $strJsArrShipment, 'SHOP_PRODUCT_IDS_MENU_NEW' => Products::getMenuoptions(null, null, $_ARRAYLANG['TXT_SHOP_PRODUCT_MENU_FORMAT']), 'SHOP_JS_ARR_PRODUCT' => Products::getJavascriptArray($objCustomer->group_id(), $objCustomer->is_reseller())));
     }
     $options = $objOrder->getOptionArray();
     if (!empty($options[$order_id])) {
         $have_option = true;
     }
     // Order items
     $total_weight = $i = 0;
     $total_net_price = $objOrder->view_items($objTemplate, $edit, $total_weight, $i);
     // Show VAT with the individual products:
     // If VAT is enabled, and we're both in the same country
     // ($total_vat_amount has been set above if both conditions are met)
     // show the VAT rate.
     // If there is no VAT, the amount is 0 (zero).
     //if ($total_vat_amount) {
     // distinguish between included VAT, and additional VAT added to sum
     $tax_part_percentaged = Vat::isIncluded() ? $_ARRAYLANG['TXT_TAX_PREFIX_INCL'] : $_ARRAYLANG['TXT_TAX_PREFIX_EXCL'];
//.........这里部分代码省略.........
开发者ID:Niggu,项目名称:cloudrexx,代码行数:101,代码来源:Order.class.php

示例12: validateLanguageId

 /**
  * Validate language id
  *
  * Checks if the language ids frontend_lang_id and backend_lang_id are valid language IDs.
  * In the case that the specified language isn't valid, the ID 0 is taken instead.
  * $scope could either be 'frontend' or 'backend'
  *
  * @param string $scope
  */
 private function validateLanguageId($scope)
 {
     $this->{$scope . '_language'} = FWLanguage::getLanguageParameter($this->{$scope . '_language'}, $scope) ? $this->{$scope . '_language'} : 0;
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:13,代码来源:User.class.php

示例13: createRSS

 /**
  * Create the RSS-Feed
  */
 function createRSS()
 {
     global $_CONFIG, $objDatabase, $_FRONTEND_LANGID;
     // languages
     $arrLanguages = \FWLanguage::getLanguageArray();
     if (intval($this->arrSettings['news_feed_status']) == 1) {
         if (count($arrLanguages > 0)) {
             $categoryDetails = $this->getCategoryLocale(null, array_keys($arrLanguages));
             foreach ($arrLanguages as $LangId => $arrLanguage) {
                 if ($arrLanguage['frontend'] == 1) {
                     $objRSSWriter = new \RSSWriter();
                     $query = "\n                            SELECT      tblNews.id,\n                                        tblNews.date,\n                                        tblNews.redirect,\n                                        tblNews.source,\n                                        tblNews.teaser_frames AS teaser_frames,\n                                        tblLocale.lang_id,\n                                        tblLocale.title,\n                                        tblLocale.text,\n                                        tblLocale.teaser_text\n                            FROM        " . DBPREFIX . "module_news AS tblNews\n                            INNER JOIN  " . DBPREFIX . "module_news_locale AS tblLocale ON tblLocale.news_id = tblNews.id\n                            WHERE       tblNews.status=1\n                                AND     tblLocale.is_active = 1\n                                AND     tblLocale.lang_id = " . $LangId . "\n                                AND     (tblNews.startdate <= '" . date(ASCMS_DATE_FORMAT_INTERNATIONAL_DATETIME) . "' OR tblNews.startdate = '0000-00-00 00:00:00')\n                                AND     (tblNews.enddate >= '" . date(ASCMS_DATE_FORMAT_INTERNATIONAL_DATETIME) . "' OR tblNews.enddate = '0000-00-00 00:00:00')" . ($this->arrSettings['news_message_protection'] == '1' ? " AND tblNews.frontend_access_id=0 " : '') . " ORDER BY tblNews.date DESC";
                     $arrNews = array();
                     if (($objResult = $objDatabase->SelectLimit($query, 20)) !== false && $objResult->RecordCount() > 0) {
                         while (!$objResult->EOF) {
                             if (empty($objRSSWriter->channelLastBuildDate)) {
                                 $objRSSWriter->channelLastBuildDate = date('r', $objResult->fields['date']);
                             }
                             $teaserText = preg_replace('/\\[\\[([A-Z0-9_-]+)\\]\\]/', '{\\1}', $objResult->fields['teaser_text']);
                             $text = preg_replace('/\\[\\[([A-Z0-9_-]+)\\]\\]/', '{\\1}', $objResult->fields['text']);
                             $redirect = preg_replace('/\\[\\[([A-Z0-9_-]+)\\]\\]/', '{\\1}', $objResult->fields['redirect']);
                             \LinkGenerator::parseTemplate($teaserText, true);
                             \LinkGenerator::parseTemplate($text, true);
                             \LinkGenerator::parseTemplate($redirect, true);
                             $arrNews[$objResult->fields['id']] = array('date' => $objResult->fields['date'], 'title' => $objResult->fields['title'], 'text' => empty($redirect) ? (!empty($teaserText) ? nl2br($teaserText) . '<br /><br />' : '') . $text : (!empty($teaserText) ? nl2br($teaserText) : ''), 'redirect' => $redirect, 'source' => $objResult->fields['source'], 'teaser_frames' => explode(';', $objResult->fields['teaser_frames']), 'categoryIds' => $this->getNewsRelCategories($objResult->fields['id']));
                             $objResult->MoveNext();
                         }
                     } else {
                         continue;
                     }
                     $objRSSWriter->characterEncoding = CONTREXX_CHARSET;
                     $objRSSWriter->channelTitle = contrexx_raw2xml($this->arrSettings['news_feed_title'][$LangId]);
                     $objRSSWriter->channelDescription = contrexx_raw2xml($this->arrSettings['news_feed_description'][$LangId]);
                     $objRSSWriter->channelLink = \Cx\Core\Routing\Url::fromModuleAndCmd('News', '', $LangId)->toString();
                     $objRSSWriter->channelLanguage = \FWLanguage::getLanguageParameter($LangId, 'lang');
                     $objRSSWriter->channelCopyright = 'Copyright ' . date('Y') . ', http://' . $_CONFIG['domainUrl'];
                     if (!empty($this->arrSettings['news_feed_image'])) {
                         $channelImageUrl = \Cx\Core\Routing\Url::fromDocumentRoot();
                         $channelImageUrl->setMode('backend');
                         $channelImageUrl->setPath(substr($this->arrSettings['news_feed_image'], strlen(\Cx\Core\Core\Controller\Cx::instanciate()->getWebsiteOffsetPath()) + 1));
                         $objRSSWriter->channelImageUrl = $channelImageUrl;
                         $objRSSWriter->channelImageTitle = $objRSSWriter->channelTitle;
                         $objRSSWriter->channelImageLink = $objRSSWriter->channelLink;
                     }
                     $objRSSWriter->channelWebMaster = $_CONFIG['coreAdminEmail'];
                     // create rss feed
                     $objRSSWriter->xmlDocumentPath = \Env::get('cx')->getWebsiteFeedPath() . '/news_' . \FWLanguage::getLanguageParameter($LangId, 'lang') . '.xml';
                     foreach ($arrNews as $newsId => $arrNewsItem) {
                         list($cmdDetail, $categories) = $this->getRssNewsLinks($LangId, $arrNewsItem['categoryIds'], $categoryDetails[$LangId]);
                         $itemUrl = \Cx\Core\Routing\Url::fromModuleAndCmd('News', $cmdDetail, $LangId, array('newsid' => $newsId));
                         if (isset($arrNewsItem['teaser_frames'][0])) {
                             $itemUrl->setParam('teaserId', $arrNewsItem['teaser_frames'][0]);
                         }
                         $objRSSWriter->addItem(contrexx_raw2xml($arrNewsItem['title']), empty($arrNewsItem['redirect']) ? contrexx_raw2xml($itemUrl->toString()) : htmlspecialchars($arrNewsItem['redirect'], ENT_QUOTES, CONTREXX_CHARSET), contrexx_raw2xml($arrNewsItem['text']), '', $categories, '', '', '', $arrNewsItem['date'], array('url' => htmlspecialchars($arrNewsItem['source'], ENT_QUOTES, CONTREXX_CHARSET), 'title' => contrexx_raw2xml($arrNewsItem['title'])));
                     }
                     $objRSSWriter->write();
                     // create headlines rss feed
                     $objRSSWriter->removeItems();
                     $objRSSWriter->xmlDocumentPath = \Env::get('cx')->getWebsiteFeedPath() . '/news_headlines_' . \FWLanguage::getLanguageParameter($LangId, 'lang') . '.xml';
                     foreach ($arrNews as $newsId => $arrNewsItem) {
                         list($cmdDetail, $categories) = $this->getRssNewsLinks($LangId, $arrNewsItem['categoryIds'], $categoryDetails[$LangId]);
                         $itemUrl = \Cx\Core\Routing\Url::fromModuleAndCmd('News', $cmdDetail, $LangId, array('newsid' => $newsId));
                         if (isset($arrNewsItem['teaser_frames'][0])) {
                             $itemUrl->setParam('teaserId', $arrNewsItem['teaser_frames'][0]);
                         }
                         $objRSSWriter->addItem(contrexx_raw2xml($arrNewsItem['title']), contrexx_raw2xml($itemUrl->toString()), '', '', $categories, '', '', '', $arrNewsItem['date']);
                     }
                     $objRSSWriter->write();
                     $objRSSWriter->feedType = 'js';
                     $objRSSWriter->xmlDocumentPath = \Env::get('cx')->getWebsiteFeedPath() . '/news_' . \FWLanguage::getLanguageParameter($LangId, 'lang') . '.js';
                     $objRSSWriter->write();
                     if (count($objRSSWriter->arrErrorMsg) > 0) {
                         $this->strErrMessage .= implode('<br />', $objRSSWriter->arrErrorMsg);
                     }
                     if (count($objRSSWriter->arrWarningMsg) > 0) {
                         $this->strErrMessage .= implode('<br />', $objRSSWriter->arrWarningMsg);
                     }
                 }
             }
         }
     } else {
         if (count($arrLanguages > 0)) {
             foreach ($arrLanguages as $LangId => $arrLanguage) {
                 if ($arrLanguage['frontend'] == 1) {
                     @unlink(\Env::get('cx')->getWebsiteFeedPath() . '/news_' . \FWLanguage::getLanguageParameter($LangId, 'lang') . '.xml');
                     @unlink(\Env::get('cx')->getWebsiteFeedPath() . '/news_headlines_' . \FWLanguage::getLanguageParameter($LangId, 'lang') . '.xml');
                     @unlink(\Env::get('cx')->getWebsiteFeedPath() . '/news_' . \FWLanguage::getLanguageParameter($LangId, 'lang') . '.js');
                 }
             }
         }
     }
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:95,代码来源:NewsManager.class.php


注:本文中的FWLanguage::getLanguageParameter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。