本文整理汇总了PHP中FWUser类的典型用法代码示例。如果您正苦于以下问题:PHP FWUser类的具体用法?PHP FWUser怎么用?PHP FWUser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FWUser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: load
/**
* Load your component.
*
* @param \Cx\Core\ContentManager\Model\Entity\Page $page The resolved page
*/
public function load(\Cx\Core\ContentManager\Model\Entity\Page $page)
{
global $objTemplate, $sessionObj;
switch ($this->cx->getMode()) {
case \Cx\Core\Core\Controller\Cx::MODE_FRONTEND:
if (!isset($sessionObj) || !is_object($sessionObj)) {
$sessionObj = \cmsSession::getInstance();
}
$objLogin = new \Cx\Core_Modules\Login\Controller\Login(\Env::get('cx')->getPage()->getContent());
$pageTitle = \Env::get('cx')->getPage()->getTitle();
$pageMetaTitle = \Env::get('cx')->getPage()->getMetatitle();
\Env::get('cx')->getPage()->setContent($objLogin->getContent($pageMetaTitle, $pageTitle));
break;
case \Cx\Core\Core\Controller\Cx::MODE_BACKEND:
if (\FWUser::getFWUserObject()->objUser->login(true)) {
\Cx\Core\Csrf\Controller\Csrf::header('location: index.php');
}
$this->cx->getTemplate()->addBlockfile('CONTENT_OUTPUT', 'content_master', 'LegacyContentMaster.html');
$objTemplate = $this->cx->getTemplate();
$objLoginManager = new \Cx\Core_Modules\Login\Controller\LoginManager();
$objLoginManager->getPage();
break;
default:
break;
}
}
示例2: noAccess
/**
* Redirects the browser to the noaccess webpage.
*
* @return void
*/
public static function noAccess($redirect = null)
{
global $objInit;
$objFWUser = FWUser::getFWUserObject();
\Cx\Core\Csrf\Controller\Csrf::header('Location: ' . CONTREXX_DIRECTORY_INDEX . '?' . ($objInit->mode == 'backend' ? '' : 'section=Login&' . (!empty($redirect) ? 'redirect=' . $redirect . '&' : '')) . ($objFWUser->objUser->login() ? 'cmd=noaccess' : ''));
exit;
}
示例3: __construct
/**
* Constructor
*/
function __construct($intAction, $intEntryId, $name)
{
global $objDatabase, $_CONFIG;
parent::__construct('.', $name);
$this->intAction = intval($intAction);
$this->intEntryId = intval($intEntryId);
$objRSCheckAction = $objDatabase->Execute("SELECT default_recipient, need_auth FROM " . DBPREFIX . "module_" . $this->moduleTablePrefix . "_mail_actions WHERE id='" . $this->intAction . "' LIMIT 1");
if ($objRSCheckAction !== false) {
$this->intNeedAuth = $objRSCheckAction->fields['need_auth'];
$objRSEntryUserId = $objDatabase->Execute("SELECT added_by FROM " . DBPREFIX . "module_" . $this->moduleTablePrefix . "_entries WHERE id='" . $this->intEntryId . "' LIMIT 1");
$objFWUser = \FWUser::getFWUserObject();
if (!($this->objUser = $objFWUser->objUser->getUser($id = intval($objRSEntryUserId->fields['added_by'])))) {
$this->objUser = false;
}
if ($objRSCheckAction->fields['default_recipient'] == 'admin') {
$this->arrRecipients[] = $_CONFIG['coreAdminEmail'];
} else {
if ($this->objUser != false) {
$this->arrRecipients[] = $this->objUser->getEmail();
}
}
}
if (!empty($this->arrRecipients)) {
self::loadTemplate();
if (!empty($this->strTemplate) && !empty($this->strTitle)) {
self::parsePlaceholders();
self::sendMail();
}
}
}
示例4: __getAccessUserPlaceholder
function __getAccessUserPlaceholder($strPlaceHolder)
{
global $objDatabase, $objInit;
if ($objInit->mode == 'frontend') {
if (!\FWUser::getFWUserObject()->objUser->login()) {
return;
}
$objFWUser = \FWUser::getFWUserObject();
$objUser = $objFWUser->objUser;
$strFieldName = substr($strPlaceHolder, 14);
$strFieldName = strtolower(substr($strFieldName, 0, -2));
if ($objUser->getId()) {
$intUserId = intval($objUser->getId());
switch ($strFieldName) {
case 'email':
$strValue = $objUser->getEmail() != "" ? $objUser->getEmail() : '';
break;
case 'username':
$strValue = $objUser->getUsername() != "" ? $objUser->getUsername() : '';
break;
case 'country':
//if(intval($strFieldName) != 0) {
$strValue = $objUser->getProfileAttribute($strFieldName);
//} else {
// $strValue = $objFWUser->objUser->objAttribute->getById('country_'.$objUser->getProfileAttribute($strFieldName))->getId();
//}
break;
default:
$strValue = $objUser->getProfileAttribute($strFieldName) != "" ? $objUser->getProfileAttribute($strFieldName) : '';
break;
}
}
}
return $strValue;
}
示例5: preResolve
/**
* Sets the user's and the database timezone
* @param \Cx\Core\Routing\Url $request Request URL
*/
public function preResolve(\Cx\Core\Routing\Url $request)
{
$databaseTimezoneString = $this->cx->getDb()->getDb()->getTimezone();
$this->databaseTimezone = new \DateTimeZone($databaseTimezoneString);
$internalTimezoneString = \Cx\Core\Setting\Controller\Setting::getValue('timezone', 'Config');
$this->internalTimezone = new \DateTimeZone($internalTimezoneString);
$this->userTimezone = \FWUser::getFWUserObject()->objUser->getTimezone();
}
示例6: getExeceptionDates
/**
* Returns all series dates from the given post data
*
* @return array Array of dates
*/
public function getExeceptionDates()
{
global $objInit, $_CORELANG;
if (!\FWUser::getFWUserObject()->objUser->login() || $objInit->mode != 'backend') {
throw new \Exception($_CORELANG['TXT_ACCESS_DENIED_DESCRIPTION']);
}
$calendarLib = new \Cx\Modules\Calendar\Controller\CalendarLibrary();
return $calendarLib->getExeceptionDates();
}
示例7: getHomeTopNews
function getHomeTopNews($catId = 0)
{
global $_CORELANG, $objDatabase;
$catId = intval($catId);
$i = 0;
$this->_objTemplate->setTemplate($this->_pageContent, true, true);
if ($this->_objTemplate->blockExists('newsrow')) {
$this->_objTemplate->setCurrentBlock('newsrow');
} else {
return null;
}
$newsLimit = intval($this->arrSettings['news_top_limit']);
if ($newsLimit > 50) {
//limit to a maximum of 50 news
$newsLimit = 50;
}
if ($newsLimit < 1) {
//do not get any news if 0 was specified as the limit.
$objResult = false;
} else {
//fetch news
$objResult = $objDatabase->SelectLimit("\n SELECT DISTINCT(tblN.id) AS id,\n tblN.`date`, \n tblN.teaser_image_path,\n tblN.teaser_image_thumbnail_path,\n tblN.redirect,\n tblN.publisher,\n tblN.publisher_id,\n tblN.author,\n tblN.author_id,\n tblL.title AS title, \n tblL.teaser_text\n FROM " . DBPREFIX . "module_news AS tblN\n INNER JOIN " . DBPREFIX . "module_news_locale AS tblL ON tblL.news_id=tblN.id\n INNER JOIN " . DBPREFIX . "module_news_rel_categories AS tblC ON tblC.news_id=tblL.news_id\n WHERE tblN.status=1" . ($catId > 0 ? " AND tblC.category_id={$catId}" : '') . "\n AND tblN.teaser_only='0'\n AND tblL.lang_id=" . FRONTEND_LANG_ID . "\n AND (startdate<='" . date('Y-m-d H:i:s') . "' OR startdate='0000-00-00 00:00:00')\n AND (enddate>='" . date('Y-m-d H:i:s') . "' OR enddate='0000-00-00 00:00:00')" . ($this->arrSettings['news_message_protection'] == '1' && !\Permission::hasAllAccess() ? ($objFWUser = \FWUser::getFWUserObject()) && $objFWUser->objUser->login() ? " AND (frontend_access_id IN (" . implode(',', array_merge(array(0), $objFWUser->objUser->getDynamicPermissionIds())) . ") OR userid=" . $objFWUser->objUser->getId() . ") " : " AND frontend_access_id=0 " : '') . "ORDER BY\n (SELECT COUNT(*) FROM " . DBPREFIX . "module_news_stats_view WHERE news_id=tblN.id AND time>'" . date_format(date_sub(date_create('now'), date_interval_create_from_date_string(intval($this->arrSettings['news_top_days']) . ' day')), 'Y-m-d H:i:s') . "') DESC", $newsLimit);
}
if ($objResult !== false && $objResult->RecordCount()) {
while (!$objResult->EOF) {
$newsid = $objResult->fields['id'];
$newstitle = $objResult->fields['title'];
$author = \FWUser::getParsedUserTitle($objResult->fields['author_id'], $objResult->fields['author']);
$publisher = \FWUser::getParsedUserTitle($objResult->fields['publisher_id'], $objResult->fields['publisher']);
$newsCategories = $this->getCategoriesByNewsId($newsid);
$newsUrl = empty($objResult->fields['redirect']) ? \Cx\Core\Routing\Url::fromModuleAndCmd('News', $this->findCmdById('details', self::sortCategoryIdByPriorityId(array_keys($newsCategories), array($catId))), FRONTEND_LANG_ID, array('newsid' => $newsid)) : $objResult->fields['redirect'];
$htmlLink = self::parseLink($newsUrl, $newstitle, contrexx_raw2xhtml($newstitle));
list($image, $htmlLinkImage, $imageSource) = self::parseImageThumbnail($objResult->fields['teaser_image_path'], $objResult->fields['teaser_image_thumbnail_path'], $newstitle, $newsUrl);
$this->_objTemplate->setVariable(array('NEWS_ID' => $newsid, 'NEWS_CSS' => 'row' . ($i % 2 + 1), 'NEWS_LONG_DATE' => date(ASCMS_DATE_FORMAT, $objResult->fields['date']), 'NEWS_DATE' => date(ASCMS_DATE_FORMAT_DATE, $objResult->fields['date']), 'NEWS_TIME' => date(ASCMS_DATE_FORMAT_TIME, $objResult->fields['date']), 'NEWS_TITLE' => contrexx_raw2xhtml($newstitle), 'NEWS_TEASER' => nl2br($objResult->fields['teaser_text']), 'NEWS_LINK' => $htmlLink, 'NEWS_LINK_URL' => contrexx_raw2xhtml($newsUrl), 'NEWS_AUTHOR' => contrexx_raw2xhtml($author), 'NEWS_PUBLISHER' => contrexx_raw2xhtml($publisher)));
if (!empty($image)) {
$this->_objTemplate->setVariable(array('NEWS_IMAGE' => $image, 'NEWS_IMAGE_SRC' => contrexx_raw2xhtml($imageSource), 'NEWS_IMAGE_ALT' => contrexx_raw2xhtml($newstitle), 'NEWS_IMAGE_LINK' => $htmlLinkImage));
if ($this->_objTemplate->blockExists('news_image')) {
$this->_objTemplate->parse('news_image');
}
} else {
if ($this->_objTemplate->blockExists('news_image')) {
$this->_objTemplate->hideBlock('news_image');
}
}
self::parseImageBlock($this->_objTemplate, $objResult->fields['teaser_image_thumbnail_path'], $newstitle, $newsUrl, 'image_thumbnail');
self::parseImageBlock($this->_objTemplate, $objResult->fields['teaser_image_path'], $newstitle, $newsUrl, 'image_detail');
$this->_objTemplate->parseCurrentBlock();
$i++;
$objResult->MoveNext();
}
} else {
$this->_objTemplate->hideBlock('newsrow');
}
$this->_objTemplate->setVariable("TXT_MORE_NEWS", $_CORELANG['TXT_MORE_NEWS']);
return $this->_objTemplate->get();
}
示例8: getHomeHeadlines
function getHomeHeadlines($catId = 0)
{
global $_CORELANG, $objDatabase, $_LANGID;
$i = 0;
$catId = intval($catId);
$this->_objTemplate->setTemplate($this->_pageContent, true, true);
$newsLimit = intval($this->arrSettings['news_headlines_limit']);
if ($newsLimit > 50) {
//limit to a maximum of 50 news
$newsLimit = 50;
}
if ($newsLimit < 1) {
//do not get any news if 0 was specified as the limit.
$objResult = false;
} else {
//fetch news
$objResult = $objDatabase->SelectLimit("\n SELECT DISTINCT(tblN.id) AS id,\n tblN.`date`, \n tblN.teaser_image_path,\n tblN.teaser_image_thumbnail_path,\n tblN.redirect,\n tblN.publisher,\n tblN.publisher_id,\n tblN.author,\n tblN.author_id,\n tblL.text NOT REGEXP '^(<br type=\"_moz\" />)?\$' AS newscontent,\n tblL.title AS title, \n tblL.teaser_text\n FROM " . DBPREFIX . "module_news AS tblN\n INNER JOIN " . DBPREFIX . "module_news_locale AS tblL ON tblL.news_id=tblN.id\n INNER JOIN " . DBPREFIX . "module_news_rel_categories AS tblC ON tblC.news_id=tblL.news_id\n WHERE tblN.status=1" . ($catId > 0 ? " AND tblC.category_id={$catId}" : '') . "\n AND tblN.teaser_only='0'\n AND tblL.lang_id=" . $_LANGID . "\n AND tblL.is_active=1\n AND (startdate<='" . date('Y-m-d H:i:s') . "' OR startdate='0000-00-00 00:00:00')\n AND (enddate>='" . date('Y-m-d H:i:s') . "' OR enddate='0000-00-00 00:00:00')" . ($this->arrSettings['news_message_protection'] == '1' && !\Permission::hasAllAccess() ? ($objFWUser = \FWUser::getFWUserObject()) && $objFWUser->objUser->login() ? " AND (frontend_access_id IN (" . implode(',', array_merge(array(0), $objFWUser->objUser->getDynamicPermissionIds())) . ") OR userid=" . $objFWUser->objUser->getId() . ") " : " AND frontend_access_id=0 " : '') . "ORDER BY date DESC", $newsLimit);
}
if ($objResult !== false && $objResult->RecordCount() >= 0) {
while (!$objResult->EOF) {
$newsid = $objResult->fields['id'];
$newstitle = $objResult->fields['title'];
$newsCategories = $this->getCategoriesByNewsId($newsid);
$newsUrl = empty($objResult->fields['redirect']) ? empty($objResult->fields['newscontent']) ? '' : \Cx\Core\Routing\Url::fromModuleAndCmd('News', $this->findCmdById('details', self::sortCategoryIdByPriorityId(array_keys($newsCategories), array($catId))), FRONTEND_LANG_ID, array('newsid' => $newsid)) : $objResult->fields['redirect'];
$htmlLink = self::parseLink($newsUrl, $newstitle, contrexx_raw2xhtml($newstitle), 'headlineLink');
$htmlLinkTitle = self::parseLink($newsUrl, $newstitle, contrexx_raw2xhtml($newstitle));
// in case that the message is a stub, we shall just display the news title instead of a html-a-tag with no href target
if (empty($htmlLinkTitle)) {
$htmlLinkTitle = contrexx_raw2xhtml($newstitle);
}
list($image, $htmlLinkImage, $imageSource) = self::parseImageThumbnail($objResult->fields['teaser_image_path'], $objResult->fields['teaser_image_thumbnail_path'], $newstitle, $newsUrl);
$author = \FWUser::getParsedUserTitle($objResult->fields['author_id'], $objResult->fields['author']);
$publisher = \FWUser::getParsedUserTitle($objResult->fields['publisher_id'], $objResult->fields['publisher']);
$this->_objTemplate->setVariable(array('NEWS_ID' => $newsid, 'NEWS_CSS' => 'row' . ($i % 2 + 1), 'NEWS_LONG_DATE' => date(ASCMS_DATE_FORMAT, $objResult->fields['date']), 'NEWS_DATE' => date(ASCMS_DATE_FORMAT_DATE, $objResult->fields['date']), 'NEWS_TIME' => date(ASCMS_DATE_FORMAT_TIME, $objResult->fields['date']), 'NEWS_TITLE' => contrexx_raw2xhtml($newstitle), 'NEWS_TEASER' => nl2br($objResult->fields['teaser_text']), 'NEWS_LINK_TITLE' => $htmlLinkTitle, 'NEWS_LINK' => $htmlLink, 'NEWS_LINK_URL' => contrexx_raw2xhtml($newsUrl), 'NEWS_AUTHOR' => contrexx_raw2xhtml($author), 'NEWS_PUBLISHER' => contrexx_raw2xhtml($publisher), 'HEADLINE_ID' => $newsid, 'HEADLINE_DATE' => date(ASCMS_DATE_FORMAT_DATE, $objResult->fields['date']), 'HEADLINE_TEXT' => nl2br($objResult->fields['teaser_text']), 'HEADLINE_LINK' => $htmlLinkTitle, 'HEADLINE_AUTHOR' => contrexx_raw2xhtml($author)));
if (!empty($image)) {
$this->_objTemplate->setVariable(array('NEWS_IMAGE' => $image, 'NEWS_IMAGE_SRC' => contrexx_raw2xhtml($imageSource), 'NEWS_IMAGE_ALT' => contrexx_raw2xhtml($newstitle), 'NEWS_IMAGE_LINK' => $htmlLinkImage, 'HEADLINE_IMAGE_PATH' => contrexx_raw2xhtml($objResult->fields['teaser_image_path']), 'HEADLINE_THUMBNAIL_PATH' => contrexx_raw2xhtml($imageSource)));
if ($this->_objTemplate->blockExists('news_image')) {
$this->_objTemplate->parse('news_image');
}
} else {
if ($this->_objTemplate->blockExists('news_image')) {
$this->_objTemplate->hideBlock('news_image');
}
}
self::parseImageBlock($this->_objTemplate, $objResult->fields['teaser_image_thumbnail_path'], $newstitle, $newsUrl, 'image_thumbnail');
self::parseImageBlock($this->_objTemplate, $objResult->fields['teaser_image_path'], $newstitle, $newsUrl, 'image_detail');
$this->_objTemplate->parse('headlines_row');
$i++;
$objResult->MoveNext();
}
} else {
$this->_objTemplate->hideBlock('headlines_row');
}
$this->_objTemplate->setVariable("TXT_MORE_NEWS", $_CORELANG['TXT_MORE_NEWS']);
return $this->_objTemplate->get();
}
示例9: __construct
/**
* Constructor -> Create the module-menu and an internal template-object
* @global object $objInit
* @global object $objTemplate
* @global array $_CORELANG
*/
function __construct()
{
global $objInit, $objTemplate, $_ARRAYLANG, $_CORELANG;
$this->_objTpl = new \Cx\Core\Html\Sigma(ASCMS_MODULE_PATH . '/U2u/View/Template/Backend');
\Cx\Core\Csrf\Controller\Csrf::add_placeholder($this->_objTpl);
$this->_objTpl->setErrorHandling(PEAR_ERROR_DIE);
$this->_intLanguageId = $objInit->userFrontendLangId;
$objFWUser = \FWUser::getFWUserObject();
$this->_intCurrentUserId = $objFWUser->objUser->getId();
}
示例10: initializeTeasers
function initializeTeasers()
{
global $objDatabase, $_CORELANG;
$this->arrTeasers = array();
$this->getSettings();
$objResult = $objDatabase->Execute("\n SELECT tblN.id,\n tblN.date,\n tblN.userid,\n tblN.teaser_frames,\n tblN.redirect,\n tblN.teaser_show_link,\n tblN.teaser_image_path,\n tblN.teaser_image_thumbnail_path,\n tblL.title,\n tblL.text AS teaser_full_text,\n tblL.teaser_text\n FROM " . DBPREFIX . "module_news AS tblN\n INNER JOIN " . DBPREFIX . "module_news_locale AS tblL ON tblL.news_id=tblN.id\n WHERE tblL.lang_id=" . FRONTEND_LANG_ID . ($this->administrate == false ? " AND tblN.validated='1'\n AND tblN.status='1'\n AND tblL.is_active=1\n AND (tblN.startdate<='" . date('Y-m-d H:i:s') . "' OR tblN.startdate='0000-00-00 00:00:00') AND (tblN.enddate>='" . date('Y-m-d H:i:s') . "' OR tblN.enddate='0000-00-00 00:00:00')" : "") . ($this->arrSettings['news_message_protection'] == '1' && !\Permission::hasAllAccess() ? ($objFWUser = \FWUser::getFWUserObject()) && $objFWUser->objUser->login() ? " AND (tblN.frontend_access_id IN (" . implode(',', array_merge(array(0), $objFWUser->objUser->getDynamicPermissionIds())) . ") OR userid = " . $objFWUser->objUser->getId() . ") " : " AND tblN.frontend_access_id=0 " : '') . "\n ORDER BY date DESC");
if ($objResult !== false) {
while (!$objResult->EOF) {
$arrFrames = explode(';', $objResult->fields['teaser_frames']);
foreach ($arrFrames as $frameId) {
if (!isset($this->arrFrameTeaserIds[$frameId])) {
$this->arrFrameTeaserIds[$frameId] = array();
}
array_push($this->arrFrameTeaserIds[$frameId], $objResult->fields['id']);
}
if (!empty($objResult->fields['redirect'])) {
$extUrl = substr($objResult->fields['redirect'], 7);
$tmp = explode('/', $extUrl);
$extUrl = "(" . $tmp[0] . ")";
} else {
$extUrl = "";
}
if ($this->administrate == false) {
$objFWUser = \FWUser::getFWUserObject();
$objUser = $objFWUser->objUser->getUser($objResult->fields['userid']);
if ($objUser) {
$firstname = $objUser->getProfileAttribute('firstname');
$lastname = $objUser->getProfileAttribute('lastname');
if (!empty($firstname) && !empty($lastname)) {
$author = contrexx_raw2xhtml($firstname . ' ' . $lastname);
} else {
$author = contrexx_raw2xhtml($objUser->getUsername());
}
} else {
$author = $_CORELANG['TXT_ANONYMOUS'];
}
} else {
$author = '';
}
if (!empty($objResult->fields['teaser_image_thumbnail_path'])) {
$image = $objResult->fields['teaser_image_thumbnail_path'];
} elseif (!empty($objResult->fields['teaser_image_path']) && file_exists(ASCMS_PATH . \ImageManager::getThumbnailFilename($objResult->fields['teaser_image_path']))) {
$image = \ImageManager::getThumbnailFilename($objResult->fields['teaser_image_path']);
} elseif (!empty($objResult->fields['teaser_image_path'])) {
$image = $objResult->fields['teaser_image_path'];
} else {
$image = ASCMS_CORE_MODULE_WEB_PATH . '/News/View/Media/pixel.gif';
}
$newsCategories = $this->getCategoriesByNewsId($objResult->fields['id']);
$this->arrTeasers[$objResult->fields['id']] = array('id' => $objResult->fields['id'], 'date' => $objResult->fields['date'], 'title' => $objResult->fields['title'], 'teaser_frames' => $objResult->fields['teaser_frames'], 'redirect' => $objResult->fields['redirect'], 'ext_url' => $extUrl, 'category' => implode(', ', contrexx_raw2xhtml($newsCategories)), 'category_id' => array_keys($newsCategories), 'teaser_full_text' => $objResult->fields['teaser_full_text'], 'teaser_text' => $objResult->fields['teaser_text'], 'teaser_show_link' => $objResult->fields['teaser_show_link'], 'author' => $author, 'teaser_image_path' => $image);
$objResult->MoveNext();
}
}
}
示例11: getAccessableMethods
/**
* Returns an array of method names accessable from a JSON request
* @return array List of method names
*/
public function getAccessableMethods()
{
// at the moment we only allow backend users to edit ViewGenerator over json/ajax.
// As soon as we have permissions on entity level we can change this, so getViewOverJson can also be used from frontend
$objBackendGroups = \FWUser::getFWUserObject()->objGroup->getGroups(array('is_active' => true, 'type' => 'backend'), null, array('group_id'));
$backendGroups = array();
while (!$objBackendGroups->EOF) {
$backendGroups[] = $objBackendGroups->getId();
$objBackendGroups->next();
}
return array('getViewOverJson' => new \Cx\Core_Modules\Access\Model\Entity\Permission(null, null, true, $backendGroups), 'updateOrder' => new \Cx\Core_Modules\Access\Model\Entity\Permission(array('http', 'https'), array('post'), true));
}
示例12: jumpUploaderL10n
public function jumpUploaderL10n($langCode)
{
//the messages are sent via request because of basic auth problems with a path for the .zip-file that is different from the path the browser authenticated himself against.
require_once ASCMS_LIBRARY_PATH . '/PEAR/Download.php';
$download = new HTTP_Download();
//load correct language file
$objFWUser = \FWUser::getFWUserObject();
$download->setFile(ASCMS_CORE_MODULE_PATH . '/Upload/ressources/uploaders/jump/messages_' . $langCode . '.zip');
$download->setContentType('application/zip');
$download->send();
die;
}
示例13: setUpdatedByCurrentlyLoggedInUser
protected function setUpdatedByCurrentlyLoggedInUser($eventArgs)
{
$entity = $eventArgs->getEntity();
$em = $eventArgs->getEntityManager();
$uow = $em->getUnitOfWork();
if ($entity instanceof \Cx\Core\ContentManager\Model\Entity\Page) {
$entity->setUpdatedBy(\FWUser::getFWUserObject()->objUser->getUsername());
if (\Env::get('em')->contains($entity)) {
$uow->recomputeSingleEntityChangeSet($em->getClassMetadata('Cx\\Core\\ContentManager\\Model\\Entity\\Page'), $entity);
} else {
$uow->computeChangeSet($em->getClassMetadata('Cx\\Core\\ContentManager\\Model\\Entity\\Page'), $entity);
}
}
}
示例14: creatFeed
/**
* Create's new rss feed for the calendar module
*
* @global array $_CONFIG
* @global object $objDatabase
*/
function creatFeed()
{
global $_CONFIG, $objDatabase;
parent::getFrontendLanguages();
parent::getSettings();
$this->objEventManager->getEventlist();
foreach ($this->arrFrontendLanguages as $langKey => $arrFrontendLanguage) {
$objRSSWriter = new \RSSWriter();
$objRSSWriter->characterEncoding = CONTREXX_CHARSET;
$objRSSWriter->channelTitle = contrexx_raw2xml($this->arrSettings['rssFeedTitle']);
$objRSSWriter->channelLink = contrexx_raw2xml($this->domainUrl . 'index.php?section=' . $this->moduleName);
$objRSSWriter->channelDescription = contrexx_raw2xml($this->arrSettings['rssFeedDescription']);
$objRSSWriter->channelLanguage = contrexx_raw2xml($arrFrontendLanguage['lang']);
$objRSSWriter->channelCopyright = contrexx_raw2xml('Copyright ' . date('Y') . ', ' . $this->domainUrl);
if (!empty($this->arrSettings['rssFeedImage'])) {
$objRSSWriter->channelImageUrl = $this->arrSettings['rssFeedImage'];
$objRSSWriter->channelImageTitle = $objRSSWriter->channelTitle;
$objRSSWriter->channelImageLink = $objRSSWriter->channelLink;
}
$objRSSWriter->channelWebMaster = $_CONFIG['coreAdminEmail'];
$objRSSWriter->channelLastBuildDate = date('r', mktime());
foreach ($this->objEventManager->eventList as $eventKey => $objEvent) {
$objFWUser = \FWUser::getFWUserObject();
$showIn = explode(',', $objEvent->showIn);
if (in_array($arrFrontendLanguage['id'], $showIn)) {
$itemTitle = contrexx_raw2xml(html_entity_decode($objEvent->arrData['title'][$arrFrontendLanguage['id']], ENT_QUOTES, CONTREXX_CHARSET));
$itemLink = $objEvent->type == 0 ? $this->domainUrl . $this->objEventManager->_getDetailLink($objEvent) : $objEvent->arrData['redirect'][$arrFrontendLanguage['id']];
$itemLink = contrexx_raw2xml(html_entity_decode($itemLink));
$itemDescription = contrexx_raw2xml($objEvent->arrData['description'][$arrFrontendLanguage['id']]);
if ($objUser = $objFWUser->objUser->getUser(intval($objEvent->author))) {
$itemAuthor = $objUser->getEmail();
} else {
$itemAuthor = "unknown";
}
$itemAuthor = contrexx_raw2xml($itemAuthor);
$itemCategory = array();
$itemComments = null;
$itemEnclosure = array();
$itemGuid = array();
$itemPubDate = contrexx_raw2xml($objEvent->startDate);
$itemSource = array();
$objRSSWriter->addItem($itemTitle, $itemLink, $itemDescription, $itemAuthor, $itemCategory, $itemComments, $itemEnclosure, $itemGuid, $itemPubDate, $itemSource);
}
}
$objRSSWriter->feedType = 'xml';
$objRSSWriter->xmlDocumentPath = \Env::get('cx')->getWebsiteFeedPath() . '/calendar_all_' . $arrFrontendLanguage['lang'] . '.' . $objRSSWriter->feedType;
$objRSSWriter->write();
}
}
示例15: getUpdatedUserName
/**
* Get the user name
*
* @param integer $userId
*
* @return string
*/
public function getUpdatedUserName($userId, $currentUser)
{
$objFwUser = \FWUser::getFWUserObject();
if (!empty($userId)) {
$objUser = $objFwUser->objUser->getUser($userId);
if ($objUser) {
return $objUser->getUsername();
}
} else {
if (empty($userId) && $currentUser) {
return array('id' => $objFwUser->objUser->getId(), 'name' => $objFwUser->objUser->getUsername());
}
}
return false;
}