Returns the HTML code for insertion into the body.

@param string $uid Unique identifier for the output if the content is placed more than once on the same page
@return string HTML code
480069
public function getBody( $uid = '' )
	{
		$view = $this->getView();
		$step = $view->get( 'standardStepActive' );
		$onepage = $view->config( 'client/html/checkout/standard/onepage', [] );

		if( $step != 'summary' && !( in_array( 'summary', $onepage ) && in_array( $step, $onepage ) ) ) {
			return '';
		}

		$html = '';
		foreach( $this->getSubClients() as $subclient ) {
			$html .= $subclient->setView( $view )->getBody( $uid );
		}
		$view->summaryBody = $html;

		/** client/html/checkout/standard/summary/standard/template-body
		 * Relative path to the HTML body template of the checkout standard summary client.
		 *
		 * The template file contains the HTML code and processing instructions
		 * to generate the result shown in the body of the frontend. The
		 * configuration string is the path to the template file relative
		 * to the templates directory (usually in client/html/templates).
		 *
		 * You can overwrite the template file configuration in extensions and
		 * provide alternative templates. These alternative templates should be
		 * named like the default one but with the string "standard" replaced by
		 * an unique name. You may use the name of your project for this. If
		 * you've implemented an alternative client class as well, "standard"
		 * should be replaced by the name of the new class.
		 *
		 * @param string Relative path to the template creating code for the HTML page body
		 * @since 2014.03
		 * @category Developer
		 * @see client/html/checkout/standard/summary/standard/template-header
		 */
		$tplconf = 'client/html/checkout/standard/summary/standard/template-body';
		$default = 'checkout/standard/summary-body-standard';

		return $view->render( $view->config( $tplconf, $default ) );
	}
679313
public function getUserinfo($uid = null)
	{
		$ret = array();
		if (extension_loaded('posix')) {
			if (is_null($uid)) {
				$uid = posix_geteuid();	// get effective userid
			} elseif (is_string($uid)) {
				// username passed?
				$ret = posix_getpwnam($uid);
			}
			if (empty($ret)) {
				$ret = posix_getpwuid($uid);
			}
			$ret['group'] = posix_getgrgid($uid_info['gid']);
			unset($ret['gid']);	// is inside group array
		}
		return $ret;
	}
141436
public function getUserInfo($uid) {

        $userinfo = [];

        if (empty($this->userInfo)){

            $userinfo = $this->config['auth_cache'] ? Session::get($this->getUserKey($uid)) : [];

            if (empty($userinfo) || !is_array($userinfo)){
                $user = Db::name($this->config['users']);
                // 获取用户表主键
                $_pk = is_string($user->getPk()) ? $user->getPk() : 'id';

                $userinfo = $user->field($this->config['users_auth_fields'])->where($_pk, $uid)->find();

                if ($this->config['auth_cache'])
                    Session::set($this->getUserKey($uid),$userinfo);
            }


            $this->userInfo = $userinfo;
        }

        return $this->userInfo;
    }
1218795
public function getParentContentUidsByUids(array $uids)
    {
        $ids = array();

        $query  = 'SELECT j.parent_uid FROM content_has_subcontent j
                   LEFT JOIN content c ON c.uid = j.content_uid
                   WHERE classname != \'BackBee\ClassContent\Element\'';

        $where = array();
        foreach ($uids as $uid) {
            $where[] = $uid;
        }

        if (count($where) > 0) {
            $query .= ' AND j.content_uid  IN ("'.implode('","', $where).'")';
            $parents = $this->getEntityManager()
                ->getConnection()
                ->executeQuery($query)->fetchAll(\PDO::FETCH_COLUMN);
            if ($parents) {
                $ids = array_merge($ids, $parents, $this->getParentContentUidsByUids($parents));
            }
        }

        return array_unique($ids);
    }
911672
public function getHtmlBody()
    {
        $xpath = new DOMXPath($this->_doc);
        $bodyNodes = $xpath->query('/html/body')->item(0)->childNodes;

        $outputFragments = array();
        for ($count = 0; $count < $bodyNodes->length; $count++) {
            $outputFragments[] = $this->_doc->saveXML($bodyNodes->item($count));
        }

        return implode($outputFragments);
    }
788004
public function getBody( $uid = '' )
	{
		$view = $this->getView();

		$html = '';
		foreach( $this->getSubClients() as $subclient ) {
			$html .= $subclient->setView( $view )->getBody( $uid );
		}
		$view->attributeBody = $html;

		/** client/html/catalog/filter/attribute/standard/template-body
		 * Relative path to the HTML body template of the catalog filter attribute client.
		 *
		 * The template file contains the HTML code and processing instructions
		 * to generate the result shown in the body of the frontend. The
		 * configuration string is the path to the template file relative
		 * to the templates directory (usually in client/html/templates).
		 *
		 * You can overwrite the template file configuration in extensions and
		 * provide alternative templates. These alternative templates should be
		 * named like the default one but with the string "standard" replaced by
		 * an unique name. You may use the name of your project for this. If
		 * you've implemented an alternative client class as well, "standard"
		 * should be replaced by the name of the new class.
		 *
		 * @param string Relative path to the template creating code for the HTML page body
		 * @since 2014.03
		 * @category Developer
		 * @see client/html/catalog/filter/attribute/standard/template-header
		 */
		$tplconf = 'client/html/catalog/filter/attribute/standard/template-body';
		$default = 'catalog/filter/attribute-body-standard';

		return $view->render( $view->config( $tplconf, $default ) );
	}
31774
public function getRuleIds($uid){
        
        $groups = $this->getGroup($uid);
        
        $rules = [];
        foreach ($groups as $g){
            $rule = $g['rules'] ? explode(',', $g['rules']) : '';
            if ($rule){
                $rules = array_merge($rules , $rule);
            } 
        }
        
        return $rules;
    }
361175
public function getPage(int $uid, int $languageUid = null) {
    $page   = null;
    $record = $this->pageRepository->getPage($uid);

    if (is_array($record) && !empty($record)) {
      if (in_array($record['doktype'], self::PAGE_DOKTYPES)) {
        $page        = $record;
        $languageUid = isset($languageUid) ? $languageUid : $this->languageService->getLanguageUid();

        if ($languageUid > 0) {
          $page = $this->pageRepository->getPageOverlay($page, $languageUid);
        }
      }
    }

    return $page;
  }
744709
public function render(int $uid, int $languageUid = null) {
    return static::renderStatic(
      [
        'uid'         => $uid,
        'languageUid' => $languageUid
      ],
      $this->buildRenderChildrenClosure(),
      $this->renderingContext
    );
  }
1121671
public function userIdToFid($uid) {
        $value = Cache::redis()->hGet('user_id_#_fid', $uid);
        Cache::release();
        return $value;
    }
971601
protected function createInsert($uid)
    {
        $field1 = rand(1, 2);
        $field2 = rand(0, 1);
        return [
            'user_id' => $uid,
            'name'    => $this->faker->text(20),
            'value'   => '{"field_1":"' . $field1 . '","field_2":"' . $field2 . '"}'
        ];
    }
751022
public function getBody( $uid = '' )
	{
		$view = $this->getObject()->addData( $this->getView() );

		$content = '';
		foreach( $this->getSubClients() as $subclient ) {
			$content .= $subclient->setView( $view )->getBody( $uid );
		}
		$view->voucherBody = $content;

		/** client/html/email/voucher/standard/template-body
		 * Relative path to the HTML body template of the voucher e-mail client.
		 *
		 * The template file contains the HTML code and processing instructions
		 * to generate the result shown in the body of the frontend. The
		 * configuration string is the path to the template file relative
		 * to the templates directory (usually in client/html/templates).
		 *
		 * You can overwrite the template file configuration in extensions and
		 * provide alternative templates. These alternative templates should be
		 * named like the default one but with the string "standard" replaced by
		 * an unique name. You may use the name of your project for this. If
		 * you've implemented an alternative client class as well, "standard"
		 * should be replaced by the name of the new class.
		 *
		 * The product notification e-mail HTML client allows to use a different template for
		 * each voucher status value. You can create a template for each voucher
		 * status and store it in the "email/voucher/<status number>/" directory
		 * below the "templates" directory (usually in client/html/templates). If no
		 * specific layout template is found, the common template in the
		 * "email/voucher/" directory is used.
		 *
		 * @param string Relative path to the template creating code for the HTML page body
		 * @since 2018.07
		 * @category Developer
		 * @see client/html/email/voucher/standard/template-header
		 */
		$tplconf = 'client/html/email/voucher/standard/template-body';

		return $view->render( $view->config( $tplconf, 'email/voucher/body-standard' ) );
	}
548044
public function getLayoutsAction($uid)
    {
        if (!$this->isGranted("ROLE_API_USER")) {
            throw new AccessDeniedHttpException("Your account's api access is disabled");
        }

        $site = $this->getEntityManager()->getRepository('BackBee\Site\Site')->find($uid);

        if (!$site) {
            return $this->create404Response(sprintf('Site not found: %s', $uid));
        }

        if (!$this->isGranted('VIEW', $site)) {
            throw new AccessDeniedHttpException(sprintf('You are not authorized to view site %s', $site->getLabel()));
        }

        $layouts = array();

        foreach ($site->getLayouts() as $layout) {
            if ($this->isGranted('VIEW', $layout)) {
                $layouts[] = [
                    'uid' => $layout->getUid(),
                    'site' => [
                        'uid' => $layout->getSite()->getUid(),
                    ],
                    'label' => $layout->getLabel(),
                    'path' => $layout->getPath(),
                    'data' => json_decode($layout->getData(), true),
                    'picpath' => $layout->getPicpath(),
                ];
            }
        }

        return new Response($this->formatCollection($layouts), 200, ['Content-Type' => 'application/json']);
    }
1010833
public function getBody( $uid = '' )
	{
		$view = $this->getView();

		$content = '';
		foreach( $this->getSubClients() as $subclient ) {
			$content .= $subclient->setView( $view )->getBody( $uid );
		}
		$view->summaryBody = $content;

		/** client/html/email/payment/text/summary/standard/template-body
		 * Relative path to the text body template of the email payment text summary client.
		 *
		 * The template file contains the text and processing instructions
		 * to generate the result shown in the body of the e-mail. The
		 * configuration string is the path to the template file relative
		 * to the templates directory (usually in client/html/templates).
		 *
		 * You can overwrite the template file configuration in extensions and
		 * provide alternative templates. These alternative templates should be
		 * named like the default one but with the string "standard" replaced by
		 * an unique name. You may use the name of your project for this. If
		 * you've implemented an alternative client class as well, "standard"
		 * should be replaced by the name of the new class.
		 *
		 * @param string Relative path to the template creating code for the e-mail body
		 * @since 2014.03
		 * @category Developer
		 * @see client/html/email/payment/text/summary/standard/template-header
		 */
		$tplconf = 'client/html/email/payment/text/summary/standard/template-body';
		$default = 'email/common/text-summary-body-standard';

		return $view->render( $view->config( $tplconf, $default ) );
	}
621324
public function getHeader( $uid = '' )
	{
		$view = $this->getObject()->addData( $this->getView() );

		$content = '';
		foreach( $this->getSubClients() as $subclient ) {
			$content .= $subclient->setView( $view )->getHeader( $uid );
		}
		$view->paymentHeader = $content;


		$addr = $view->extAddressItem;

		$msg = $view->mail();
		$msg->addHeader( 'X-MailGenerator', 'Aimeos' );
		$msg->addTo( $addr->getEMail(), $addr->getFirstName() . ' ' . $addr->getLastName() );


		/** client/html/email/from-name
		 * @see client/html/email/payment/from-email
		 */
		$fromName = $view->config( 'client/html/email/from-name' );

		/** client/html/email/payment/from-name
		 * Name used when sending payment e-mails
		 *
		 * The name of the person or e-mail account that is used for sending all
		 * shop related payment e-mails to customers. This configuration option
		 * overwrite the name set in "client/html/email/from-name".
		 *
		 * @param string Name shown in the e-mail
		 * @since 2014.03
		 * @category User
		 * @see client/html/email/from-name
		 * @see client/html/email/from-email
		 * @see client/html/email/reply-email
		 * @see client/html/email/bcc-email
		 */
		$fromNamePayment = $view->config( 'client/html/email/payment/from-name', $fromName );

		/** client/html/email/from-email
		 * @see client/html/email/payment/from-email
		 */
		$fromEmail = $view->config( 'client/html/email/from-email' );

		/** client/html/email/payment/from-email
		 * E-Mail address used when sending payment e-mails
		 *
		 * The e-mail address of the person or account that is used for sending
		 * all shop related payment emails to customers. This configuration option
		 * overwrites the e-mail address set via "client/html/email/from-email".
		 *
		 * @param string E-mail address
		 * @since 2014.03
		 * @category User
		 * @see client/html/email/payment/from-name
		 * @see client/html/email/from-email
		 * @see client/html/email/reply-email
		 * @see client/html/email/bcc-email
		 */
		if( ( $fromEmailPayment = $view->config( 'client/html/email/payment/from-email', $fromEmail ) ) != null ) {
			$msg->addFrom( $fromEmailPayment, $fromNamePayment );
		}


		/** client/html/email/reply-name
		 * @see client/html/email/payment/reply-email
		 */
		$replyName = $view->config( 'client/html/email/reply-name', $fromName );

		/** client/html/email/payment/reply-name
		 * Recipient name displayed when the customer replies to payment e-mails
		 *
		 * The name of the person or e-mail account the customer should
		 * reply to in case of payment related questions or problems. This
		 * configuration option overwrites the name set via
		 * "client/html/email/reply-name".
		 *
		 * @param string Name shown in the e-mail
		 * @since 2014.03
		 * @category User
		 * @see client/html/email/payment/reply-email
		 * @see client/html/email/reply-name
		 * @see client/html/email/reply-email
		 * @see client/html/email/from-email
		 * @see client/html/email/bcc-email
		 */
		$replyNamePayment = $view->config( 'client/html/email/payment/reply-name', $replyName );

		/** client/html/email/reply-email
		 * @see client/html/email/payment/reply-email
		 */
		$replyEmail = $view->config( 'client/html/email/reply-email', $fromEmail );

		/** client/html/email/payment/reply-email
		 * E-Mail address used by the customer when replying to payment e-mails
		 *
		 * The e-mail address of the person or e-mail account the customer
		 * should reply to in case of payment related questions or problems.
		 * This configuration option overwrites the e-mail address set via
		 * "client/html/email/reply-email".
		 *
		 * @param string E-mail address
		 * @since 2014.03
		 * @category User
		 * @see client/html/email/payment/reply-name
		 * @see client/html/email/reply-email
		 * @see client/html/email/from-email
		 * @see client/html/email/bcc-email
		 */
		if( ( $replyEmailPayment = $view->config( 'client/html/email/payment/reply-email', $replyEmail ) ) != null ) {
			$msg->addReplyTo( $replyEmailPayment, $replyNamePayment );
		}


		/** client/html/email/bcc-email
		 * @see client/html/email/payment/bcc-email
		 */
		$bccEmail = $view->config( 'client/html/email/bcc-email' );

		/** client/html/email/payment/bcc-email
		 * E-Mail address all payment e-mails should be also sent to
		 *
		 * Using this option you can send a copy of all payment related e-mails
		 * to a second e-mail account. This can be handy for testing and checking
		 * the e-mails sent to customers.
		 *
		 * It also allows shop owners with a very small volume of orders to be
		 * notified about payment changes. Be aware that this isn't useful if the
		 * order volumne is high or has peeks!
		 *
		 * This configuration option overwrites the e-mail address set via
		 * "client/html/email/bcc-email".
		 *
		 * @param string|array E-mail address or list of e-mail addresses
		 * @since 2014.03
		 * @category User
		 * @category Developer
		 * @see client/html/email/bcc-email
		 * @see client/html/email/reply-email
		 * @see client/html/email/from-email
		 */
		if( ( $bccEmailPayment = $view->config( 'client/html/email/payment/bcc-email', $bccEmail ) ) != null )
		{
			foreach( (array) $bccEmailPayment as $emailAddr ) {
				$msg->addBcc( $emailAddr );
			}
		}


		/** client/html/email/payment/standard/template-header
		 * Relative path to the HTML header template of the email payment client.
		 *
		 * The template file contains the HTML code and processing instructions
		 * to generate the HTML code that is inserted into the HTML page header
		 * of the rendered page in the frontend. The configuration string is the
		 * path to the template file relative to the templates directory (usually
		 * in client/html/templates).
		 *
		 * You can overwrite the template file configuration in extensions and
		 * provide alternative templates. These alternative templates should be
		 * named like the default one but with the string "standard" replaced by
		 * an unique name. You may use the name of your project for this. If
		 * you've implemented an alternative client class as well, "standard"
		 * should be replaced by the name of the new class.
		 *
		 * The email payment HTML client allows to use a different template for
		 * each payment status value. You can create a template for each payment
		 * status and store it in the "email/payment/<status number>/" directory
		 * below the "templates" directory (usually in client/html/templates). If no
		 * specific layout template is found, the common template in the
		 * "email/payment/" directory is used.
		 *
		 * @param string Relative path to the template creating code for the HTML page head
		 * @since 2014.03
		 * @category Developer
		 * @see client/html/email/payment/standard/template-body
		 */
		$tplconf = 'client/html/email/payment/standard/template-header';

		$status = $view->extOrderItem->getPaymentStatus();
		$default = array( 'email/payment/' . $status . '/header-standard', 'email/payment/header-standard' );

		return $view->render( $view->config( $tplconf, $default ) ); ;
	}
329822
private function &getEntryForGuid( $guid )
	{
		if ( ! isset( $this->uniqueFactIds[ $guid ] ) )
		{
			return false;
		}

		// Get the element
		$facts = $this->getElement( $this->uniqueFactIds[ $guid ] );

		// And find the entry with the corresponding guid
		foreach ( $facts as $key => &$entry )
		{
			if ( $entry['guid'] == $guid ) return $entry;
		}

		return false;
	}
1280989
protected function searchUid($uid)
    {
        if (empty($uid)) return false;
        foreach ($this->map as $node_name => $set) {
            if ($set->contains($uid)) {
                return $node_name;
            }
        }
        return false;
    }