本文整理汇总了PHP中XLite\Core\Converter::buildURL方法的典型用法代码示例。如果您正苦于以下问题:PHP Converter::buildURL方法的具体用法?PHP Converter::buildURL怎么用?PHP Converter::buildURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XLite\Core\Converter
的用法示例。
在下文中一共展示了Converter::buildURL方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getMarketplaceURL
protected function getMarketplaceURL($module)
{
list(, $limit) = $this->getWidget(array(), 'XLite\\View\\Pager\\Admin\\Module\\Install')->getLimitCondition()->limit;
$pageId = $module->getRepository()->getMarketplacePageId($module->getAuthor(), $module->getName(), $limit);
$params = array('clearCnd' => 1, 'clearSearch' => 1, \XLite\View\Pager\APager::PARAM_PAGE_ID => $pageId, \XLite\View\ItemsList\AItemsList::PARAM_SORT_BY => \XLite\View\ItemsList\Module\AModule::SORT_OPT_ALPHA);
return \XLite::getInstance()->getShopURL(sprintf('%s#%s', \XLite\Core\Converter::buildURL('addons_list_marketplace', '', $params), $module->getName()));
}
示例2: getOrderActions
/**
* Get order actions
*
* @param \XLite\Model\Order $entity Order
*
* @return array
*/
protected function getOrderActions(\XLite\Model\Order $entity)
{
$list = array();
foreach ($this->defineOrderActions($entity) as $action) {
$parameters = empty($action[static::ACTION_PARAMS]) || !is_array($action[static::ACTION_PARAMS]) ? array() : $action[static::ACTION_PARAMS];
$parameters['entity'] = $entity;
// Build URL
if (!empty($action[static::ACTION_ACTION]) && empty($action[static::ACTION_URL])) {
$action[static::ACTION_URL] = \XLite\Core\Converter::buildURL('order', $action[static::ACTION_ACTION], array('order_number' => $entity->getOrderNumber()));
}
if (!isset($action[static::ACTION_CLASS]) && !isset($action[static::ACTION_TEMPLATE])) {
// Define widget as link-button
$action[static::ACTION_CLASS] = 'XLite\\View\\Button\\Link';
$parameters['label'] = $action[static::ACTION_NAME];
$parameters['location'] = $action[static::ACTION_URL];
} elseif (!empty($action[static::ACTION_CLASS])) {
// Prepare widget parameters
if (!empty($action[static::ACTION_URL])) {
$parameters['url'] = $action[static::ACTION_URL];
}
if (!empty($action[static::ACTION_ACTION])) {
$parameters['action'] = $action[static::ACTION_ACTION];
}
}
if (!empty($action[static::ACTION_TEMPLATE])) {
$parameters['template'] = $action[static::ACTION_TEMPLATE];
}
$list[] = empty($action[static::ACTION_CLASS]) ? $this->getWidget($parameters) : $this->getWidget($parameters, $action[static::ACTION_CLASS]);
}
return $list;
}
示例3: doActionUpdate
/**
* Update coupon
*
* @return void
*/
public function doActionUpdate()
{
$this->getModelForm()->performAction('modify');
if ($this->getModelForm()->getModelObject()->getId()) {
$this->setReturnUrl(\XLite\Core\Converter::buildURL('roles'));
}
}
示例4: doActionUpdate
/**
* Update coupon
*
* @return void
*/
public function doActionUpdate()
{
$this->getModelForm()->performAction('modify');
if ($this->getModelForm()->isValid()) {
$this->setReturnUrl(\XLite\Core\Converter::buildURL('promotions', '', array('page' => \XLite\Controller\Admin\Promotions::PAGE_COUPONS)));
}
}
示例5: doNoAction
/**
* Preprocessor for no-action reaction
*
* @return void
*/
protected function doNoAction()
{
parent::doNoAction();
$content = \XLite\Core\Request::getInstance()->id ? \XLite\Core\Database::getRepo('XLite\\Model\\IframeContent')->find(\XLite\Core\Request::getInstance()->id) : null;
if ($content) {
$method = $content->getMethod();
$url = $content->getUrl();
$body = $this->assembleFormBody($content);
$html = <<<HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body onload="javascript: document.getElementById('payment_form').submit();">
<form method="{$method}" id="payment_form" name="payment_form" action="{$url}">
<fieldset style="display: none;">
{$body}
</fieldset>
</form>
</body>
</html>
HTML;
print $html;
exit;
} else {
$this->redirect(\XLite\Core\Converter::buildURL('checkout'));
}
}
示例6: getOrderActions
/**
* Get order aActions
*
* @param \XLite\Model\Order $entity Order
*
* @return array
*/
protected function getOrderActions(\XLite\Model\Order $entity)
{
$list = array();
foreach ($this->defineOrderActions($entity) as $action) {
$parameters = array('label' => ucfirst($action), 'location' => \XLite\Core\Converter::buildURL('order', $action, array('order_id' => $this->getOrder()->getOrderId())));
$list[] = $this->getWidget($parameters, 'XLite\\View\\Button\\Link');
}
return $list;
}
示例7: requestProbe
/**
* Request probe script
*
* @return void
*/
protected function requestProbe()
{
$url = \XLite::getInstance()->getShopURL(\XLite\Core\Converter::buildURL('', '', array('key' => \XLite\Core\Config::getInstance()->Internal->probe_key), 'probe.php'));
set_time_limit(0);
$request = new \XLite\Core\HTTP\Request($url);
$response = $request->sendRequest();
if (200 != $response->code) {
\XLite\Core\TopMessage::addError('Measuring productivity in manual mode failed.');
}
}
示例8: getIconURL
/**
* Return icon URL
*
* @return string
*/
public function getIconURL()
{
$url = $this->getMetadata('IconLink');
if (!$url) {
list($author, $name) = explode('\\', $this->getActualName());
$path = \Includes\Utils\ModulesManager::getModuleIconFile($author, $name);
if (\Includes\Utils\FileManager::isFileReadable($path)) {
$url = \XLite\Core\Converter::buildURL('module', null, array('author' => $author, 'name' => $name), 'image.php');
}
}
return $url ?: static::DEFAULT_ICON_URL;
}
示例9: doActionUpdate
/**
* Update model
*
* @return void
*/
protected function doActionUpdate()
{
if ($this->getModelForm()->performAction('modify')) {
if (\Xlite\Core\Request::getInstance()->isCreate) {
echo <<<HTML
<script type="text/javascript">window.opener.location.reload();window.close()</script>
HTML;
exit;
} else {
$this->setReturnUrl(\XLite\Core\Converter::buildURL('theme_tweaker_templates'));
}
}
}
示例10: getForbidInDemoModeRedirectURL
/**
* URL to redirect if action is forbidden
*
* @return string
*/
protected function getForbidInDemoModeRedirectURL()
{
if ('delete' == \XLite\Core\Request::getInstance()->action) {
// Redirect for delete action
$url = \XLite\Core\Converter::buildURL('users', '', array('mode' => 'search'));
} elseif ($this->getProfile()->getProfileId()) {
// Redirect if profile found
$url = \XLite\Core\Converter::buildURL('profile', '', array('profile_id' => $this->getProfile()->getProfileId()));
} else {
$url = \XLite\Core\Converter::buildURL('profile', '', array('mode' => 'register'));
}
return $url;
}
示例11: doActionLocate
/**
* Place URL into engine's endpoints
*
* @return void
*/
protected function doActionLocate()
{
$engines = \XLite\Core\Request::getInstance()->engines;
if ($engines) {
foreach ($this->getEngines() as $key => $engine) {
if (in_array($key, $engines)) {
$url = urlencode(\XLite::getInstance()->getShopURL(\XLite\Core\Converter::buildURL('sitemap', '', array(), \XLite::CART_SELF)));
$url = str_replace('%url%', $url, $engine['url']);
$request = new \XLite\Core\HTTP\Request($url);
$response = $request->sendRequest();
if (200 == $response->code) {
\XLite\Core\TopMessage::addInfo('Site map successfully registred on X', array('engine' => $key));
} else {
\XLite\Core\TopMessage::addWarning('Site map has not been registred in X', array('engine' => $key));
}
}
}
}
}
示例12: buildURL
/**
* Compose URL from target, action and additional params
*
* @param string $target Page identifier OPTIONAL
* @param string $action Action to perform OPTIONAL
* @param array $params Additional params OPTIONAL
* @param string $interface Interface script OPTIONAL
*
* @return string
*/
public static function buildURL($target = '', $action = '', array $params = array(), $interface = null, $forceCleanURL = false)
{
if ('' === $target) {
$target = \XLite::TARGET_DEFAULT;
}
if (\XLite\Module\CDev\DrupalConnector\Handler::getInstance()->checkCurrentCMS() || \XLite::CART_SELF == $interface && \XLite\Module\CDev\DrupalConnector\Core\Caller::getInstance()->isInitialized()) {
$portal = \XLite\Module\CDev\DrupalConnector\Handler::getInstance()->getPortalByTarget($target);
if ($portal) {
// Drupal URL (portal)
list($path, $args) = $portal->getDrupalArgs($target, $action, $params);
$result = static::normalizeDrupalURL($path, $args);
} else {
// Drupal URL
$result = static::buildDrupalURL($target, $action, $params);
}
} else {
// Standalone URL
$result = parent::buildURL($target, $action, $params, $interface);
}
return $result;
}
示例13: doActionLocate
/**
* Place URL into engine's endpoints
*
* @return void
*/
protected function doActionLocate()
{
$engines = \XLite\Core\Request::getInstance()->engines;
if ($engines) {
foreach ($this->getEngines() as $key => $engine) {
if (in_array($key, $engines)) {
$url = urlencode(\XLite::getInstance()->getShopURL(\XLite\Core\Converter::buildURL('sitemap', '', array(), \XLite::getCustomerScript())));
$url = str_replace('%url%', $url, $engine['url']);
$request = new \XLite\Core\HTTP\Request($url);
$response = $request->sendRequest();
if (200 == $response->code) {
\XLite\Core\TopMessage::addInfo('Site map successfully registred on X', array('engine' => $key));
} else {
\XLite\Core\TopMessage::addWarning('Site map has not been registred in X', array('engine' => $key));
}
}
}
}
$postedData = \XLite\Core\Request::getInstance()->getData();
$options = \XLite\Core\Database::getRepo('\\XLite\\Model\\Config')->findBy(array('category' => $this->getOptionsCategory()));
$isUpdated = false;
foreach ($options as $key => $option) {
$name = $option->getName();
$type = $option->getType();
if (isset($postedData[$name]) || 'checkbox' == $type) {
if ('checkbox' == $type) {
$option->setValue(isset($postedData[$name]) ? 'Y' : 'N');
} else {
$option->setValue($postedData[$name]);
}
$isUpdated = true;
\XLite\Core\Database::getEM()->persist($option);
}
}
if ($isUpdated) {
\XLite\Core\Database::getEM()->flush();
}
}
示例14: getFrontURL
/**
* Get front URL
*
* @return string
* @see ____func_see____
* @since 1.0.15
*/
public function getFrontURL()
{
return $this->getId() ? \XLite::getInstance()->getShopURL(\XLite\Core\Converter::buildURL('page', '', array('id' => $this->getId()), 'cart.php', true)) : null;
}
示例15: getFrontURL
/**
* Get front URL
*
* @return string
*/
public function getFrontURL()
{
$result = null;
if ($this->getId()) {
$result = \XLite\Core\Converter::makeURLValid(\XLite::getInstance()->getShopURL(\XLite\Core\Converter::buildURL('page', '', array('id' => $this->getId()), 'cart.php', true)));
}
return $result;
}