本文整理汇总了PHP中Sintattica\Atk\Core\Tools::atkurldecode方法的典型用法代码示例。如果您正苦于以下问题:PHP Tools::atkurldecode方法的具体用法?PHP Tools::atkurldecode怎么用?PHP Tools::atkurldecode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sintattica\Atk\Core\Tools
的用法示例。
在下文中一共展示了Tools::atkurldecode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handleMultiselect
/**
* Parse atkselectors in postvars into atktarget using atktargetvartpl and atktargetvar
* Then redirect to atktarget.
*/
public function handleMultiselect()
{
$node = $this->getNode();
$columnConfig = $node->getColumnConfig();
$recordset = $node->select(implode(' OR ', $this->m_postvars['atkselector']))->orderBy($columnConfig->getOrderByStatement())->excludes($node->m_listExcludes)->mode('multiselect')->getAllRows();
// loop recordset to parse atktargetvar
$atktarget = Tools::atkurldecode($node->m_postvars['atktarget']);
$atktargetvar = $node->m_postvars['atktargetvar'];
$atktargettpl = $node->m_postvars['atktargetvartpl'];
for ($i = 0; $i < count($recordset); ++$i) {
if ($i == 0 && strpos($atktarget, '&') === false) {
$atktarget .= '?';
} else {
$atktarget .= '&';
}
$atktarget .= $atktargetvar . '[]=' . $this->parseString($atktargettpl, $recordset[$i]);
}
$node->redirect($atktarget);
}
示例2: autoSelectRecord
/**
* If the auto-select flag is set and only one record exists we immediately
* return with the selected record.
*
* @param DataGrid $grid data grid
*
* @return bool auto-select active?
*/
protected function autoSelectRecord($grid)
{
$node = $this->getNode();
if (!$node->hasFlag(Node::NF_AUTOSELECT)) {
return false;
}
$grid->loadRecords();
if ($grid->getCount() != 1) {
return false;
}
$sm = SessionManager::getInstance();
if ($sm->atkLevel() > 0 && $grid->getPostvar('atkprevlevel', 0) > $sm->atkLevel()) {
$backUrl = $sm->sessionUrl(Config::getGlobal('dispatcher') . '?atklevel=' . $sm->newLevel(SessionManager::SESSION_BACK));
$node->redirect($backUrl);
} else {
$records = $grid->getRecords();
// There's only one record and the autoselect flag is set, so we
// automatically go to the target.
$parser = new StringParser(rawurldecode(Tools::atkurldecode($grid->getPostvar('atktarget'))));
// For backwardscompatibility reasons, we also support the '[pk]' var.
$records[0]['pk'] = $node->primaryKey($records[0]);
$target = $parser->parse($records[0], true);
$node->redirect($sm->sessionUrl($target, SessionManager::SESSION_NESTED));
}
return true;
}
示例3: start
/**
* Initializes the sessionmanager.
*
* @return bool
*/
public function start()
{
global $ATK_VARS;
if (php_sapi_name() == 'cli') {
return false;
// command-line
}
if (isset($_REQUEST['atklevel'])) {
$this->atklevel = trim($_REQUEST['atklevel']);
}
if (isset($_REQUEST['atkprevlevel'])) {
$this->atkprevlevel = trim($_REQUEST['atkprevlevel']);
}
if (isset($_REQUEST['atkstackid'])) {
$this->atkstackid = trim($_REQUEST['atkstackid']);
}
//session init
$cookie_params = session_get_cookie_params();
$cookiepath = Config::getGlobal('cookie_path');
$cookiedomain = Config::getGlobal('cookiedomain') != '' ? Config::getGlobal('cookiedomain') : null;
session_set_cookie_params($cookie_params['lifetime'], $cookiepath, $cookiedomain);
// set cache expire (if function exists, or show upgrade hint if not)
if (function_exists('session_cache_expire')) {
session_cache_expire(Config::getGlobal('session_cache_expire'));
} else {
Tools::atkdebug('session_cache_expire function does not exist, please upgrade to the latest stable php version (at least 4.2.x)', Tools::DEBUG_WARNING);
}
// set the cache limiter (used for caching)
session_cache_limiter(Config::getGlobal('session_cache_limiter'));
// If somehow the sessionid is unclean (searchengine bots have been known to mangle sessionids)
// we don't have a session...
if (self::isValidSessionId()) {
$sessionname = Config::getGlobal('session_name');
if (!$sessionname) {
$sessionname = Config::getGlobal('identifier');
}
session_name($sessionname);
session_start();
} else {
Tools::atkwarning('Not a valid session!');
return false;
}
//decode data
Tools::atkDataDecode($_REQUEST);
$ATK_VARS = array_merge($_GET, $_POST);
Tools::atkDataDecode($ATK_VARS);
if (array_key_exists('atkfieldprefix', $ATK_VARS) && $ATK_VARS['atkfieldprefix'] != '') {
$ATK_VARS = $ATK_VARS[$ATK_VARS['atkfieldprefix']];
}
$this->session_read($ATK_VARS);
// Escape check
if (isset($_REQUEST['atkescape']) && $_REQUEST['atkescape'] != '') {
Tools::redirect(Tools::atkurldecode($_REQUEST['atkescape']));
} else {
if (isset($_REQUEST['atknested']) && $_REQUEST['atknested'] != '') {
Tools::redirect($this->sessionUrl($_REQUEST['atknested'], self::SESSION_NESTED));
} else {
if (isset($ATK_VARS['atkback']) && $ATK_VARS['atkback'] != '') {
// When we go back, we go one level deeper than the level we came from.
Tools::redirect($this->sessionUrl(Config::getGlobal('dispatcher') . '?atklevel=' . ($this->atkprevlevel - 1)));
}
}
}
return true;
}