產生自動/手動 POST 提交表單.

@author		https://www.ecpay.com.tw
@category	SDK_Misc
@param		string	$ButtonDesc	按鈕顯示名稱
@param		string	$Target		表單 action 目標
@return		string
@version		1.0.1012
502296
private function GenPostHTML($ButtonDesc = '', $Target = '_self')
        {
            $PostHTML = $this->AddNextLine('<div style="text-align:center;">');
            $PostHTML .= $this->AddNextLine('  <form id="ECPayForm" method="POST" action="'.$this->ServiceURL.'" target="'.$Target.'">');
            foreach ($this->PostParams as $Name => $Value) {
                $PostHTML .= $this->AddNextLine('    <input type="hidden" name="'.$Name.'" value="'.$Value.'" />');
            }
            if (! empty($ButtonDesc)) {
                // 手動
                $PostHTML .= $this->AddNextLine('    <input type="submit" id="__paymentButton" value="'.$ButtonDesc.'" />');
            } else {
                // 自動
                $PostHTML .= $this->AddNextLine('    <script>document.getElementById("ECPayForm").submit();</script>');
            }
            $PostHTML .= $this->AddNextLine('  </form>');
            $PostHTML .= $this->AddNextLine('</div>');

            return $PostHTML;
        }
881524
public function to(string $target): Date
    {
        $modifiedHandle = clone $this->originalDate->handle();
        $modifiedHandle->modify($target);
        return new Date($modifiedHandle);
    }
1311371
public function findActionAfterDate(
        $action,
        $date,
        $doerId = null,
        $resourceId = null,
        $workspaceId = null,
        $receiverId = null,
        $roleId = null,
        $groupId = null,
        $toolName = null,
        $userType = null
    ) {
        $queryBuilder = $this
            ->createQueryBuilder('log')
            ->orderBy('log.dateLog', 'DESC')

            ->andWhere('log.action = :action')
            ->setParameter('action', $action)

            ->andWhere('log.dateLog >= :date')
            ->setParameter('date', $date);

        if (null !== $doerId) {
            $queryBuilder
                ->leftJoin('log.doer', 'doer')
                ->andWhere('doer.id = :doerId')
                ->setParameter('doerId', $doerId);
        }

        if (null !== $resourceId) {
            $queryBuilder
                ->leftJoin('log.resource', 'resource')
                ->andWhere('resource.id = :resourceId')
                ->setParameter('resourceId', $resourceId);
        }

        if (null !== $workspaceId) {
            $queryBuilder
                ->leftJoin('log.workspace', 'workspace')
                ->andWhere('workspace.id = :workspaceId')
                ->setParameter('workspaceId', $workspaceId);
        }

        if (null !== $receiverId) {
            $queryBuilder
                ->leftJoin('log.receiver', 'receiver')
                ->andWhere('receiver.id = :receiverId')
                ->setParameter('receiverId', $receiverId);
        }

        if (null !== $roleId) {
            $queryBuilder
                ->leftJoin('log.role', 'role')
                ->andWhere('role.id = :roleId')
                ->setParameter('roleId', $roleId);
        }

        if (null !== $groupId) {
            $queryBuilder
                ->leftJoin('log.receiverGroup', 'receiverGroup')
                ->andWhere('receiverGroup.id = :groupId')
                ->setParameter('groupId', $groupId);
        }

        if (null !== $toolName) {
            $queryBuilder
                ->andWhere('log.toolName = :toolName')
                ->setParameter('toolName', $toolName);
        }

        $q = $queryBuilder->getQuery();
        $logs = $q->getResult();

        return $logs;
    }
619045
public static function extend($target, $source) 
    {
        switch($target) {
        case 'phpQueryObject':
            $targetRef = &self::$extendMethods;
            $targetRef2 = &self::$pluginsMethods;
            break;
        case 'phpQuery':
            $targetRef = &self::$extendStaticMethods;
            $targetRef2 = &self::$pluginsStaticMethods;
            break;
        default:
            throw new Exception("Unsupported \$target type");
        }
        if (is_string($source)) {
            $source = array($source => $source);
        }
        foreach($source as $method => $callback) {
            if (isset($targetRef[$method])) {
                //                throw new Exception
                self::debug("Duplicate method '{$method}', can\'t extend '{$target}'");
                continue;
            }
            if (isset($targetRef2[$method])) {
                //                throw new Exception
                self::debug(
                    "Duplicate method '{$method}' from plugin '{$targetRef2[$method]}',"
                    ." can\'t extend '{$target}'"
                );
                continue;
            }
            $targetRef[$method] = $callback;
        }
        return true;
    }
705313
public function link($href = '', $target = '_blank')
    {
        return $this->unescape()->as(function ($link) use ($href, $target) {
            $href = $href ?: $link;

            return "<a href='$href' target='{$target}'>{$link}</a>";
        });
    }
658101
public function cloneTo(DataObjectScaffolder $target)
    {
        $inst = $target->getDataObjectInstance();

        foreach ($this->getFields() as $field) {
            if (StaticSchema::inst()->isValidFieldName($inst, $field->Name)) {
                $target->addField($field->Name, $field->Description);
            }
        }
        foreach ($this->getOperations() as $op) {
            $identifier = OperationScaffolder::getIdentifier($op);
            $target->operation($identifier);
        }

        return $target;
    }
517163
public function validateTarget($target)
    {
        if ($target instanceof Application) {
            $validator = new ApplicationValidator();
            $response = $validator->validate($target);
        } elseif ($target instanceof ApplicationGroup) {
            $validator = new ApplicationGroupValidator();
            $response = $validator->validate($target);
        } else {
            $this->addError('target', 'Target must be a valid instance of Application or ApplicationGroup');
            return false;
        }

        if (!$response) {
            $this->addError('target', 'Target must be a valid instance of Application or ApplicationGroup class - ' . $validator->getErrorsAsString());
        }

        return $response;
    }
692381
public function appendTo($target)
    {
        $target_result = $this->getTargetResult($target);

        $target_result->append($this);
        $this->remove();

        return $target_result;
    }
860733
protected function hasTargetedBinding(string $interface, string $target = null) : bool
    {
        return isset($this->bindings[$target][$interface]);
    }
694833
public function CvsMap($ButtonDesc = '電子地圖', $Target = '_self')
        {
            // 參數初始化
            $ParamList = [
                'MerchantID' => '',
                'MerchantTradeNo' => '',
                'LogisticsSubType' => '',
                'IsCollection' => '',
                'ServerReplyURL' => '',
                'ExtraData' => '',
                'Device' => Device::PC,
            ];
            $this->PostParams = $this->GetPostParams($this->Send, $ParamList);
            $this->PostParams['LogisticsType'] = LogisticsType::CVS;

            // 參數檢查
            $this->ValidateID('MerchantID', $this->PostParams['MerchantID'], 10);
            $this->ServiceURL = $this->GetURL('CVS_MAP');
            $this->ValidateLogisticsSubType();
            $this->ValidateIsCollection();
            $this->ValidateURL('ServerReplyURL', $this->PostParams['ServerReplyURL']);
            $this->ValidateString('ExtraData', $this->PostParams['ExtraData'], 20, true);
            $this->ValidateDevice(true);

            return $this->GenPostHTML($ButtonDesc, $Target);
        }
797851
public function process_action($target, $action) {
        return self::do_process_action($target, $action, $this->course->id);
    }
179217
public function GetNamedLink($name, $link, $target = null)
    {
        $result = '';
        if (strlen($name) != 0) {
            $result = $name;
            if (strlen($link) != 0) {
                $result = "<a href=\"".$link."\"".(is_null($target) ? "" : " target=\"".$target."\"").">".$result."</a>";
            }
        }
        return $result;
    }
944571
public static function navbarCollapseLink($target, $htmlOptions = array())
    {
        self::addCssClass('btn btn-navbar', $htmlOptions);
        $htmlOptions['type'] = 'button';
        $htmlOptions['data-toggle'] = 'collapse';
        $htmlOptions['data-target'] = $target;
        self::addCssClass('navbar-toggle', $htmlOptions);
        $content = self::tag('span', array('class' => 'sr-only'), 'Toggle navigation');
        $content .= '<span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span>';
        return self::tag('button', $htmlOptions, $content);
    }
391228
public function befriendMember(MembershipInterface $target): PodiumResponse
    {
        return $this->getPodium()->member->befriend($this->ensureMembership(), $target);
    }
752304
protected function dataGet($target, $key)
    {
        foreach (explode('.', $key) as $segment) {
            if (is_object($target) && in_array(Revisionable::class, class_uses_recursive(get_class($target)))) {
                $target = $this->passThroughRevisionable($target, $segment);
            } elseif ($target instanceof self || $target instanceof Revision) {
                $target = $this->passThroughRevision($target, $segment);
            } elseif ($target instanceof Model) {
                $target = $this->passThroughModel($target, $segment);
            } else {
                $target = null;
            }

            if (!$target) {
                return;
            }
        }

        return $target;
    }
154394
public function createRedirectUrl($targetUrl, $events)
    {
        $query_params = $this->getHttpRequestHeaders('analytics', '*');
        $query_params['api_key'] = $this->api_key;
        $query_params['url'] = $targetUrl;
        $query_params['auth_type'] = 'jwt';
        $query_params['authorization'] = $query_params['Authorization'];
        $query_params['events'] = json_encode($events);

        unset(
            $query_params['Authorization'],
            $query_params['stream-auth-type'],
            $query_params['Content-Type'],
            $query_params['X-Stream-Client']
        );

        return static::API_ENDPOINT . 'redirect/?' . http_build_query($query_params);
    }
320638
protected function _createSymlink($target, $link)
    {
        // @codingStandardsIgnoreStart
        $result = @symlink($target, $link);
        // @codingStandardsIgnoreEnd

        if ($result) {
            $this->out('Created symlink ' . $link);

            return true;
        }

        return false;
    }