本文整理汇总了PHP中Sintattica\Atk\Core\Tools::atkDataDecode方法的典型用法代码示例。如果您正苦于以下问题:PHP Tools::atkDataDecode方法的具体用法?PHP Tools::atkDataDecode怎么用?PHP Tools::atkDataDecode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sintattica\Atk\Core\Tools
的用法示例。
在下文中一共展示了Tools::atkDataDecode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: _transformRow
/**
* Transform raw database row to node compatible row.
*
* @param array $row raw database row
* @param Query $query query object
* @param array $attrsByLoadType attributes by load type
*
* @return array node compatible row
*/
protected function _transformRow($row, Query $query, array $attrsByLoadType)
{
$query->deAlias($row);
Tools::atkDataDecode($row);
$result = [];
foreach ($attrsByLoadType[Attribute::ADDTOQUERY] as $attr) {
$result[$attr->fieldName()] = $attr->db2value($row);
}
if (!$this->m_ignorePrimaryKey) {
$result['atkprimkey'] = $this->_getNode()->primaryKey($result);
}
foreach ($attrsByLoadType[Attribute::POSTLOAD] as $attr) {
$result[$attr->fieldName()] = $attr->load($this->_getDb(), $result, $this->m_mode);
}
return $result;
}
示例3: registerGlobalOverrides
/**
* It's allowed to use the request variables atkstartat, atklimit, atksearch,
* atksmartsearch, atksearchmode, atkorderby, atkindex and atkcolcmd directly. If they
* are used directly we need to store their values in the datagrid session
* entry and override existing values if needed.
*/
protected function registerGlobalOverrides()
{
if ($this->isEmbedded()) {
return;
}
$request = array_merge($_GET, $_POST);
Tools::atkDataDecode($request);
$vars = array('atkstartat', 'atklimit', 'atksearch', 'atksmartsearch', 'atksearchmode', 'atkorderby', 'atkindex', 'atkcolcmd');
$sessions =& $GLOBALS['ATK_VARS']['atkdg'];
if ($sessions == null) {
$sessions = [];
}
foreach ($vars as $var) {
if (isset($request[$var])) {
$sessions[$this->getName()][$var] = $request[$var];
} else {
if (isset($request['atkdg'][$this->getName()][$var])) {
$sessions[$this->getName()][$var] = $request['atkdg'][$this->getName()][$var];
}
}
}
$this->getNode()->m_postvars['atkdg'] = $sessions;
if ($this->m_useSession) {
$this->m_sessionMgr->pageVar('atkdg', $sessions);
}
}