Returns the HTML string for insertion into the header.

@param string $uid Unique identifier for the output if the content is placed more than once on the same page
@return string|null String including HTML tags for the header on error
556039
public function getHeader( $uid = '' )
	{
		$view = $this->getView();

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

		/** client/html/catalog/lists/items/standard/template-header
		 * Relative path to the HTML header template of the catalog list items 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.
		 *
		 * It's also possible to create a specific template for each type, e.g.
		 * for the grid, list or whatever view you want to offer your users. In
		 * that case, you can configure the template by adding "-<type>" to the
		 * configuration key. To configure an alternative list view template for
		 * example, use the key
		 *
		 * client/html/catalog/lists/items/standard/template-header-list = catalog/lists/items-header-list.php
		 *
		 * The argument is the relative path to the new template file. The type of
		 * the view is determined by the "l_type" parameter (allowed characters for
		 * the types are a-z and 0-9), which is also stored in the session so users
		 * will keep the view during their visit. The catalog list type subpart
		 * contains the template for switching between list types.
		 *
		 * @param string Relative path to the template creating code for the HTML page head
		 * @since 2014.03
		 * @category Developer
		 * @see client/html/catalog/lists/items/standard/template-body
		 * @see client/html/catalog/lists/type/standard/template-body
		 */
		$tplconf = 'client/html/catalog/lists/items/standard/template-header';
		$default = 'catalog/lists/items-header-standard';

		return $view->render( $this->getTemplatePath( $tplconf, $default ) );
	}
611106
public function render(): string
    {
        $string = str_repeat('#', intval($this->attributes['header'])) . ' ';
        if ($this->hasChildren() === true) {

            foreach ($this->children() as $child) {
                $string .= $child->render();
            }
        }
        $string .= "{$this->escape($this->insert)}";

        return $string;



        /*return str_repeat('#', intval($this->attributes['header'])) .
            " {$this->escape($this->insert)}";*/
    }
1261599
public function getHtml() {
	   if ($this->getPageTotal() < 2) {
	       return null;
       }
       return str_ireplace(array(
				'{total}',
				'{pageSize}',
				'{start}',
				'{end}',
				'{pageTotal}',
				'{previous}',
				'{next}', 
				'{list}',
				'{goto}',
		), array(
				$this->get('total'),
				$this->setPageSize(),
				$this->getStart(),
				$this->getEnd(),
				$this->pageTotal,
				$this->getPrevious(),
				$this->getNext(),
				$this->getPageList(),
				$this->getGoToPage(),
		), $this->get('template'));
	}
563318
public function getHeader( $uid = '' )
	{
		$view = $this->getObject()->addData( $this->getView() );

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


		$addr = $view->extAddressItem;

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

		$addresses = $view->extOrderBaseItem->getAddress( \Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_PAYMENT );

		if( ( $billAddr = current( $addresses ) ) !== false && $billAddr->getEMail() != $addr->getEmail() ) {
			$msg->addCc( $billAddr->getEMail(), $billAddr->getFirstName() . ' ' . $billAddr->getLastName() );
		}

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

		/** client/html/email/delivery/from-name
		 * Name used when sending delivery e-mails
		 *
		 * The name of the person or e-mail account that is used for sending all
		 * shop related delivery e-mails to customers. This configuration option
		 * overwrites 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
		 */
		$fromNameDelivery = $view->config( 'client/html/email/delivery/from-name', $fromName );

		/** client/html/email/from-email
		 * E-Mail address used when sending e-mails
		 *
		 * The e-mail address of the person or account that is used for sending
		 * all shop related emails to customers.
		 *
		 * @param string E-mail address
		 * @since 2014.03
		 * @category User
		 * @see client/html/email/from-name
		 * @see client/html/email/delivery/from-email
		 * @see client/html/email/reply-email
		 * @see client/html/email/bcc-email
		 */
		$fromEmail = $view->config( 'client/html/email/from-email' );

		/** client/html/email/delivery/from-email
		 * E-Mail address used when sending delivery e-mails
		 *
		 * The e-mail address of the person or account that is used for sending
		 * all shop related delivery 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/delivery/from-name
		 * @see client/html/email/from-email
		 * @see client/html/email/reply-email
		 * @see client/html/email/bcc-email
		 */
		if( ( $fromEmailDelivery = $view->config( 'client/html/email/delivery/from-email', $fromEmail ) ) != null ) {
			$msg->addFrom( $fromEmailDelivery, $fromNameDelivery );
		}


		/** client/html/email/reply-name
		 * Recipient name displayed when the customer replies to e-mails
		 *
		 * The name of the person or e-mail account the customer should
		 * reply to in case of questions or problems. If no reply name is
		 * configured, the name person or e-mail account set via
		 * "client/html/email/from-name" is used.
		 *
		 * @param string Name shown in the e-mail
		 * @since 2014.03
		 * @category User
		 * @see client/html/email/reply-email
		 * @see client/html/email/delivery/reply-email
		 * @see client/html/email/from-email
		 * @see client/html/email/from-name
		 * @see client/html/email/bcc-email
		 */
		$replyName = $view->config( 'client/html/email/reply-name', $fromName );

		/** client/html/email/delivery/reply-name
		 * Recipient name displayed when the customer replies to delivery e-mails
		 *
		 * The name of the person or e-mail account the customer should
		 * reply to in case of 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/delivery/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
		 */
		$replyNameDelivery = $view->config( 'client/html/email/delivery/reply-name', $replyName );

		/** client/html/email/reply-email
		 * E-Mail address used by the customer when replying to e-mails
		 *
		 * The e-mail address of the person or e-mail account the customer
		 * should reply to in case of questions or problems.
		 *
		 * @param string E-mail address
		 * @since 2014.03
		 * @category User
		 * @see client/html/email/reply-name
		 * @see client/html/email/delivery/reply-email
		 * @see client/html/email/from-email
		 * @see client/html/email/bcc-email
		 */
		$replyEmail = $view->config( 'client/html/email/reply-email', $fromEmail );

		/** client/html/email/delivery/reply-email
		 * E-Mail address used by the customer when replying to delivery e-mails
		 *
		 * The e-mail address of the person or e-mail account the customer
		 * should reply to in case of 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/delivery/reply-name
		 * @see client/html/email/reply-email
		 * @see client/html/email/from-email
		 * @see client/html/email/bcc-email
		 */
		if( ( $replyEmailDelivery = $view->config( 'client/html/email/delivery/reply-email', $replyEmail ) ) != null ) {
			$msg->addReplyTo( $replyEmailDelivery, $replyNameDelivery );
		}


		/** client/html/email/bcc-email
		 * E-Mail address all e-mails should be also sent to
		 *
		 * Using this option you can send a copy of all shop 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 new orders. Be aware that this isn't useful if the
		 * order volumne is high or has peeks!
		 *
		 * @param string E-mail address
		 * @since 2014.03
		 * @category User
		 * @category Developer
		 * @see client/html/email/delivery/bcc-email
		 * @see client/html/email/reply-email
		 * @see client/html/email/from-email
		 */
		$bccEmail = $view->config( 'client/html/email/bcc-email' );

		/** client/html/email/delivery/bcc-email
		 * E-Mail address all delivery e-mails should be also sent to
		 *
		 * Using this option you can send a copy of all delivery 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 new orders. 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( ( $bccEmailDelivery = $view->config( 'client/html/email/delivery/bcc-email', $bccEmail ) ) != null )
		{
			foreach( (array) $bccEmailDelivery as $emailAddr ) {
				$msg->addBcc( $emailAddr );
			}
		}


		/** client/html/email/delivery/standard/template-header
		 * Relative path to the text header template of the email delivery client.
		 *
		 * The template file contains the text and processing instructions
		 * to generate the text that is inserted into the header
		 * 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.
		 *
		 * The email payment text 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 e-mail header
		 * @since 2014.03
		 * @category Developer
		 * @see client/html/email/delivery/standard/template-body
		 */
		$tplconf = 'client/html/email/delivery/standard/template-header';

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

		return $view->render( $view->config( $tplconf, $default ) ); ;
	}
1111476
public static function getRootPid($uid = null)
    {
        static $cache = array();
        $ret = null;

        if ($uid === null) {
            #################
            # Current root PID
            #################
            $rootline = self::getRootLine();
            if (!empty($rootline[0])) {
                $ret = $rootline[0]['uid'];
            }
        } else {
            #################
            # Other root PID
            #################
            if (!isset($cache[$uid])) {
                $cache[$uid] = null;
                $rootline    = self::getRootLine($uid);

                if (!empty($rootline[0])) {
                    $cache[$uid] = $rootline[0]['uid'];
                }
            }

            $ret = $cache[$uid];
        }

        return $ret;
    }
629888
public function getID()
    {
        $idAttribute = $this->idAttribute;
        return (is_string($idAttribute) && !empty($idAttribute)) ? $this->$idAttribute : null;
    }
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 ) );
	}
1271041
public function getPidFromUid($uid = 0)
    {
        $queryBuilder = self::getQueryBuilder();
        $triggerElement = $queryBuilder
            ->select('pid')
            ->from('tt_content')
            ->where(
                $queryBuilder->expr()->eq(
                    'uid',
                    $queryBuilder->createNamedParameter(abs($uid), \PDO::PARAM_INT)
                )
            )
            ->execute()
            ->fetch();
        $pid = (int)$triggerElement['pid'];
        return is_array($triggerElement) && $pid ? $pid : 0;
    }
1041699
public function generate(string $content = null): string
    {
        if (empty($content)) {
            $guid = Uuid::uuid4();
        } else {
            $guid = Uuid::uuid5(Uuid::NAMESPACE_DNS, $content);
        }

        return $guid->toString();
    }
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 . '"}'
        ];
    }
623472
protected function getInsertString(): string
    {
        $statement = '';
        if (!$this->builder->getInsert()) {
            return $statement;
        }

        $statement .= $this->getInsert();
        if (!empty($statement)) {
            $statement = sprintf('INSERT INTO `%s`', $statement);
        }

        return $statement;
    }
766680
public function clientGetByUid($uid)
  {
    foreach($this->clientList() as $client)
    {
      if($client["client_unique_identifier"] == $uid) return $client;
    }

    throw new Exception("invalid clientID", 0x200);
  }
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 ) ); ;
	}
744709
public function render(int $uid, int $languageUid = null) {
    return static::renderStatic(
      [
        'uid'         => $uid,
        'languageUid' => $languageUid
      ],
      $this->buildRenderChildrenClosure(),
      $this->renderingContext
    );
  }
282227
public static function gentoken($uid = '')
    {
        $str = microtime() . (isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : 'unknow') . 
            $uid . '7200';

        $md5 = md5($str);

        $crypt = crypt($md5, 'CRYPT_SHA256');

        $md5 = md5($crypt);

        return substr(strrev($md5), 1);
    }
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']);
    }
1138464
public function getPageByUid(int $uid, int $languageUid = null) {
    return $this->getPage($uid, $languageUid);
  }