• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP FWUser类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了FWUser类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
     }
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:31,代码来源:ComponentController.class.php


示例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;
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:12,代码来源:permission.class.php


示例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();
         }
     }
 }
开发者ID:Niggu,项目名称:cloudrexx,代码行数:33,代码来源:MediaDirectoryMail.class.php


示例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;
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:35,代码来源:MediaDirectoryPlaceholder.class.php


示例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();
 }
开发者ID:Niggu,项目名称:cloudrexx,代码行数:12,代码来源:ComponentController.class.php


示例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();
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:14,代码来源:JsonCalendar.class.php


示例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();
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:56,代码来源:NewsTop.class.php


示例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();
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:56,代码来源:NewsHeadlines.class.php


示例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();
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:16,代码来源:U2uAdmin.class.php


示例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();
         }
     }
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:54,代码来源:Teasers.class.php


示例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));
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:16,代码来源:ViewGeneratorJsonController.class.php


示例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;
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:12,代码来源:UploadLib.class.php


示例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);
         }
     }
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:14,代码来源:PageEventListener.class.php


示例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();
     }
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:55,代码来源:CalendarFeed.class.php


示例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;
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:22,代码来源:User.class.php


示例16: 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 $_CORELANG, $subMenuTitle, $objTemplate;
     switch ($this->cx->getMode()) {
         case \Cx\Core\Core\Controller\Cx::MODE_BACKEND:
             $this->cx->getTemplate()->addBlockfile('CONTENT_OUTPUT', 'content_master', 'LegacyContentMaster.html');
             $cachedRoot = $this->cx->getTemplate()->getRoot();
             $this->cx->getTemplate()->setRoot($this->getDirectory() . '/View/Template/Backend');
             $objTemplate->setVariable('CONTAINER_DASHBOARD_CLASS', 'dashboard');
             $objFWUser = \FWUser::getFWUserObject();
             $subMenuTitle = $_CORELANG['TXT_WELCOME_MESSAGE'] . ", <a href='index.php?cmd=Access&amp;act=user&amp;tpl=modify&amp;id=" . $objFWUser->objUser->getId() . "' title='" . $objFWUser->objUser->getId() . "'>" . ($objFWUser->objUser->getProfileAttribute('firstname') || $objFWUser->objUser->getProfileAttribute('lastname') ? htmlentities($objFWUser->objUser->getProfileAttribute('firstname'), ENT_QUOTES, CONTREXX_CHARSET) . ' ' . htmlentities($objFWUser->objUser->getProfileAttribute('lastname'), ENT_QUOTES, CONTREXX_CHARSET) : htmlentities($objFWUser->objUser->getUsername(), ENT_QUOTES, CONTREXX_CHARSET)) . "</a>";
             $objAdminNav = new Home();
             $objAdminNav->getPage();
             $this->cx->getTemplate()->setRoot($cachedRoot);
             break;
     }
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:22,代码来源:ComponentController.class.php


示例17: __construct

 /**
  * Constructor
  *
  * @param  string
  * @access public
  */
 function __construct()
 {
     global $_CORELANG, $objTemplate;
     $administratorsOnline = '';
     if ($objUser = \FWUser::getFWUserObject()->objUser->getUsers($filter = array('is_admin' => true, 'active' => true, 'last_activity' => array('>' => time() - 3600)))) {
         $arrAdministratorsOnline = array();
         $i = 0;
         while (!$objUser->EOF) {
             $arrAdministratorsOnline[$i]['id'] = $objUser->getId();
             $arrAdministratorsOnline[$i++]['username'] = $objUser->getUsername();
             $objUser->next();
         }
         for ($i = 0; $i < count($arrAdministratorsOnline); $i++) {
             $administratorsOnline .= '<a href="index.php?cmd=Access&amp;act=user&amp;tpl=modify&amp;id=' . $arrAdministratorsOnline[$i]['id'] . '">' . $arrAdministratorsOnline[$i]['username'] . ($i == count($arrAdministratorsOnline) - 1 ? '' : ',') . '</a>';
         }
     }
     $objTemplate->setVariable('CONTENT_NAVIGATION', '<span id="administrators_online">' . $_CORELANG['TXT_ADMINISTSRATORS_ONLINE'] . ': </span>' . $administratorsOnline);
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:24,代码来源:Home.class.php


示例18: showFeedBackForm

 /**
  * FeedBack Form
  * 
  * @global array $_ARRAYLANG
  */
 public function showFeedBackForm()
 {
     global $_ARRAYLANG;
     $objUser = \FWUser::getFWUserObject();
     //feed back types
     $feedBackTypes = array($_ARRAYLANG['TXT_SUPPORT_FEEDBACK_SELECT_FEEDBACK'], $_ARRAYLANG['TXT_SUPPORT_FEEDBACK_BUG_REPORT'], $_ARRAYLANG['TXT_SUPPORT_FEEDBACK_FEATURE_REQUEST'], $_ARRAYLANG['TXT_SUPPORT_FEEDBACK_HAVE_QUESTION']);
     \Cx\Core\Setting\Controller\Setting::init('Support', 'setup', 'Yaml');
     $faqUrl = \Cx\Core\Setting\Controller\Setting::getValue('faqUrl', 'Support');
     $recipientMailAddress = \Cx\Core\Setting\Controller\Setting::getValue('recipientMailAddress', 'Support');
     $faqLink = '<a target="_blank" title="click to FAQ page" href=' . $faqUrl . '>' . $_ARRAYLANG['TXT_SUPPORT_FEEDBACK_FAQ'] . '</a>';
     //Get License information
     $license = \Env::get('cx')->getLicense();
     $licenseName = $license->getEditionName();
     $licenseValid = date(ASCMS_DATE_FORMAT_DATE, $license->getValidToDate());
     $licenseVersion = $license->getVersion()->getNumber();
     //get the input datas
     $feedBackType = isset($_POST['feedBackType']) ? contrexx_input2raw($_POST['feedBackType']) : '';
     $feedBackSubject = isset($_POST['feedBackSubject']) ? contrexx_input2raw($_POST['feedBackSubject']) : '';
     $feedBackComment = isset($_POST['feedBackComment']) ? contrexx_input2raw($_POST['feedBackComment']) : '';
     $customerName = isset($_POST['customerName']) ? contrexx_input2raw($_POST['customerName']) : '';
     $customerEmailId = isset($_POST['customerEmailId']) ? contrexx_input2raw($_POST['customerEmailId']) : '';
     $feedBackUrl = isset($_POST['feedBackUrl']) ? contrexx_input2raw($_POST['feedBackUrl']) : '';
     if (isset($_POST['sendAndSave'])) {
         if (!empty($feedBackSubject) && !empty($feedBackComment)) {
             //get the hostname domain
             $domainRepo = new \Cx\Core\Net\Model\Repository\DomainRepository();
             $domain = $domainRepo->findOneBy(array('id' => 0));
             $arrFields = array('name' => contrexx_raw2xhtml($customerName), 'fromEmail' => contrexx_raw2xhtml($customerEmailId), 'feedBackType' => $feedBackType != 0 ? contrexx_raw2xhtml($feedBackTypes[$feedBackType]) : '', 'url' => $faqUrl, 'comments' => contrexx_raw2xhtml($feedBackComment), 'subject' => contrexx_raw2xhtml($feedBackSubject), 'firstName' => $objUser->objUser->getProfileAttribute('firstname'), 'lastName' => $objUser->objUser->getProfileAttribute('lastname'), 'phone' => !$objUser->objUser->getProfileAttribute('phone_office') ? $objUser->objUser->getProfileAttribute('phone_mobile') : $objUser->objUser->getProfileAttribute('phone_office'), 'company' => $objUser->objUser->getProfileAttribute('company'), 'toEmail' => $recipientMailAddress, 'licenseName' => $licenseName, 'licenseValid' => $licenseValid, 'licenseVersion' => $licenseVersion, 'domainName' => $domain ? $domain->getName() : '');
             //send the feedBack mail
             $this->sendMail($arrFields) ? \Message::ok($_ARRAYLANG['TXT_SUPPORT_FEEDBACK_EMAIL_SEND_SUCESSFULLY']) : \Message::error($_ARRAYLANG['TXT_SUPPORT_FEEDBACK_EMAIL_SEND_FAILED']);
         } else {
             \Message::error($_ARRAYLANG['TXT_SUPPORT_ERROR_MSG_FIELDS_EMPTY']);
             $this->template->setVariable(array('TXT_SUPPORT_ERROR_CLASS_SUBJECT' => !empty($feedBackSubject) ? "" : "errBoxStyle", 'TXT_SUPPORT_ERROR_CLASS_COMMENT' => !empty($feedBackComment) ? "" : "errBoxStyle", 'SUPPORT_FEEDBACK_SUBJECT' => contrexx_raw2xhtml($feedBackSubject), 'SUPPORT_FEEDBACK_COMMENT' => contrexx_raw2xhtml($feedBackComment)));
         }
     }
     //show FeedBack Types
     foreach ($feedBackTypes as $key => $feedbackType) {
         $this->template->setVariable(array('SUPPORT_FEEDBACK_TYPES' => $feedbackType, 'SUPPORT_FEEDBACK_SELECTED_TYPE' => !empty($feedBackType) && $feedBackType == $key ? 'selected' : '', 'SUPPORT_FEEDBACK_ID' => $key));
         $this->template->parse('showFeedBackTypes');
     }
     $this->template->setVariable(array('SUPPORT_FEEDBACK_FAQ' => $faqLink, 'SUPPORT_FEEDBACK_CUSTOMER_NAME' => $objUser->objUser->getUsername(), 'SUPPORT_FEEDBACK_CUSTOMER_EMAIL' => $objUser->objUser->getEmail()));
     $this->template->setVariable(array('TXT_SUPPORT_FEEDBACK' => $_ARRAYLANG['TXT_SUPPORT_FEEDBACK'], 'TXT_SUPPORT_FEEDBACK_SUBJECT' => $_ARRAYLANG['TXT_SUPPORT_FEEDBACK_SUBJECT'], 'TXT_SUPPORT_FEEDBACK_COMMENTS' => $_ARRAYLANG['TXT_SUPPORT_FEEDBACK_COMMENTS']));
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:48,代码来源:DefaultController.class.php


示例19: init

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP FWValidator类代码示例发布时间:2022-05-23
下一篇:
PHP FWLanguage类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap