本文整理汇总了PHP中XLite::getFormId方法的典型用法代码示例。如果您正苦于以下问题:PHP XLite::getFormId方法的具体用法?PHP XLite::getFormId怎么用?PHP XLite::getFormId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XLite
的用法示例。
在下文中一共展示了XLite::getFormId方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFormButtons
/**
* Return list of the "Button" widgets
*
* @return array
*/
protected function getFormButtons()
{
$result = parent::getFormButtons();
if ($this->getModule() && 'CDev\\Bestsellers' == $this->getModule()->getActualName()) {
$result['sales_calculation'] = new \XLite\View\Button\Link(array(\XLite\View\Button\AButton::PARAM_LABEL => 'Sales calculation', \XLite\View\Button\Link::PARAM_LOCATION => $this->buildURL('sales_calculation', 'sales', array(\XLite::FORM_ID => \XLite::getFormId())), \XLite\View\Button\AButton::PARAM_STYLE => 'action always-enabled'));
}
return $result;
}
示例2: getDefaultFieldValue
/**
* getDefaultFieldValue
*
* @param string $name Field name
*
* @return mixed
*/
public function getDefaultFieldValue($name)
{
$value = parent::getDefaultFieldValue($name);
switch ($name) {
case 'added':
case 'last_login':
if (0 < $value) {
$value = date('r', $value);
} else {
$value = 'never';
}
break;
case 'referer':
$value = $value ?: 'unknown';
break;
case 'orders_count':
if ($value) {
$url = $this->buildURL('order_list', 'searchByCustomer', array('profileId' => $this->getModelObject()->getProfileId(), \XLite::FORM_ID => \XLite::getFormId()));
$value = '<a href="' . $url . '">' . $value . '</a>';
} else {
$value = 'n/a';
}
break;
case 'language':
$lng = $value ? \XLite\Core\Database::getRepo('XLite\\Model\\Language')->findOneByCode($value) : null;
$value = isset($lng) ? $lng->getName() : $value;
break;
case 'pending_membership_id':
$value = 0 < $value ? $this->getModelObject()->getPendingMembership()->getName() : static::t('none');
break;
case 'roles':
if ($this->getModelObject() && \XLite\Core\Auth::getInstance()->isPermissionAllowed(\XLite\Model\Role\Permission::ROOT_ACCESS) && \XLite\Core\Auth::getInstance()->getProfile()->getProfileId() == $this->getModelObject()->getProfileId()) {
if ($value) {
$roles = array();
/** @var \XLite\Model\Role $role */
foreach ($value as $role) {
$roles[] = $role->getPublicName();
}
$value = implode(', ', $roles);
}
}
break;
case 'forceChangePassword':
$value = $this->isRegisterMode() ? true : $this->getModelObject()->getForceChangePassword();
break;
default:
}
return $value;
}
示例3: prepareURLParams
/**
* Return URL parameters to use in AJAX popup
*
* @return array
*/
protected function prepareURLParams()
{
return array('target' => 'addon_install', 'action' => 'select_installation_type', \XLite::FORM_ID => \XLite::getFormId(true), 'widget' => '\\XLite\\View\\ModulesManager\\InstallationType', 'moduleIds' => $this->getModuleIds());
}
示例4: getXliteFormIDText
protected function getXliteFormIDText()
{
static $formId = null;
if (!isset($formId)) {
$formId = \XLite::getFormId();
}
return $formId;
}
示例5: 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 boolean $forceCuFlag Force flag - use Clean URL OPTIONAL
*
* @return string
*/
public function buildURL($target = '', $action = '', array $params = array(), $forceCuFlag = null)
{
if ('' !== $target && ('' !== $action || isset($params['action']) && '' !== $params['action'])) {
$class = \XLite\Core\Converter::getControllerClass($target);
$paramAction = isset($params['action']) ? $params['action'] : $action;
if ($class && $class::needFormId() && !in_array($paramAction, $class::defineFreeFormIdActions())) {
$params[\XLite::FORM_ID] = \XLite::getFormId(empty($params['static_form_id']));
}
}
return \XLite\Core\Converter::buildURL($target, $action, $params, null, false, $forceCuFlag);
}
示例6: doActionUpdate
/**
* Save search conditions
*
* @return void
*/
protected function doActionUpdate()
{
$select = array();
foreach ((array) \XLite\Core\Request::getInstance()->select as $key => $value) {
$select[] = 'select[]=' . $key;
}
$this->setHardRedirect();
$this->setReturnURL(\XLite\Core\Request::getInstance()->{\XLite\View\Button\PopupProductSelector::PARAM_REDIRECT_URL} . '&' . implode('&', $select) . '&' . \XLite::FORM_ID . '=' . \XLite::getFormId(true));
}
示例7: getFormParams
/**
* Return list of additional params
*
* @return array
*/
protected function getFormParams()
{
$params = array_merge($this->getCommonFormParams(), $this->getParam(self::PARAM_FORM_PARAMS));
if ($this->hasFormId()) {
$params[\XLite::FORM_ID] = \XLite::getFormId();
}
if ('post' === $this->getParam(self::PARAM_FORM_METHOD)) {
$this->setReturnURLParam($params);
}
return $params;
}
示例8: getValue
/**
* Return field value
*
* @return mixed
*/
public function getValue()
{
return \XLite::getFormId();
}