本文整理汇总了PHP中JSession::get方法的典型用法代码示例。如果您正苦于以下问题:PHP JSession::get方法的具体用法?PHP JSession::get怎么用?PHP JSession::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSession
的用法示例。
在下文中一共展示了JSession::get方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get
/**
* Get cached data by id and group
*
* @param string $key The cache data id
* @param string $group The cache data group
* @param boolean $checkTime True to verify cache time expiration threshold
*
* @return mixed Boolean false on failure or a cached data object
*/
public function get($key, $group, $checkTime = true)
{
$value = $this->session->get('cache.' . $group . '.' . $key);
if (!$value) {
return false;
}
return $value;
}
示例2: getQueue
/**
* Get the inner queue.
*
* @return array The queue.
*/
public function getQueue()
{
$queue = $this->session->get($this->sessionVariable, null, 'rbrowser');
if (is_array($queue)) {
end($queue);
return $queue;
}
$queue = array();
$this->setQueue($queue);
return $queue;
}
示例3: onContentAfterSave
/**
* Sends message if possible
*
* @param type $context
* @param type $article
* @param type $isNew
* @return type
*/
public function onContentAfterSave($context, &$article, $isNew)
{
if (0 !== strpos($context, 'com_content')) {
return;
}
$message = $this->session->get('asar.message');
if (!empty($message)) {
$this->app->enqueueMessage($message);
$this->session->clear('asar.message');
}
}
示例4: getGroup
/**
* {@inheritdoc}
*/
public function getGroup($group = self::GROUP_DFAULT, $default = array())
{
$data = $this->_session->get($group, $default, $this->_namespace);
return $data;
}
示例5: getHeadings
/**
* Returns the table headings, separated from writable function as
* when group_by is selected multiple tables are written
* 09/07/2011 moved headingClass into array rather than string
*
* @return array (table headings, array columns, $aLinkElements)
*/
public function getHeadings()
{
$package = $this->app->getUserState('com_fabrik.package', 'fabrik');
$item = $this->getTable();
$item->order_dir = JString::strtolower($item->order_dir);
$aTableHeadings = array();
$headingClass = array();
$cellClass = array();
$params = $this->getParams();
$w = new FabrikWorker();
$formModel = $this->getFormModel();
$oldLinksToForms = $this->getLinksToThisKey();
$linksToForms = array();
foreach ($oldLinksToForms as $join) {
// $$$ hugh - another issue with getLinksToThisKey() now returning false for some joins.
if ($join) {
$k = $join->list_id . '-' . $join->form_id . '-' . $join->element_id;
$linksToForms[$k] = $join;
}
}
$groups = $formModel->getGroupsHiarachy();
$groupHeadings = array();
$orderBys = json_decode($item->order_by, true);
if (!isset($orderBys)) {
$orderBys = array();
}
// Responsive element classes
$listClasses = json_decode($params->get('list_responsive_elements'));
if (!isset($listClasses->responsive_elements)) {
$listClasses = new stdClass();
$listClasses->responsive_elements = array();
}
$showInList = $this->showInList();
if (!in_array($this->outputFormat, array('pdf', 'csv'))) {
if ($this->canSelectRows() && $params->get('checkboxLocation', 'end') !== 'end') {
$this->addCheckBox($aTableHeadings, $headingClass, $cellClass);
}
if ($params->get('checkboxLocation', 'end') !== 'end') {
$this->actionHeading($aTableHeadings, $headingClass, $cellClass);
}
}
foreach ($groups as $groupModel) {
$groupHeadingKey = $w->parseMessageForPlaceHolder($groupModel->getGroup()->label, array(), false);
$groupHeadings[$groupHeadingKey] = 0;
$elementModels = $groupModel->getPublishedListElements();
if ($groupModel->canView('list') === false) {
continue;
}
foreach ($elementModels as $key => $elementModel) {
$element = $elementModel->getElement();
// If we define the elements to show in the list - e.g in admin list module then only show those elements
if (!empty($showInList) && !in_array($element->id, $showInList)) {
continue;
}
$groupHeadings[$groupHeadingKey]++;
$key = $elementModel->getFullName(true, false);
$compositeKey = !empty($showInList) ? array_search($element->id, $showInList) . ':' . $key : $key;
$orderKey = $elementModel->getOrderbyFullName(false);
$elementParams = $elementModel->getParams();
$label = $elementModel->getListHeading();
$label = $w->parseMessageForPlaceHolder($label, array());
$elementId = $elementModel->getId();
if ($elementParams->get('can_order') == '1' && $this->outputFormat != 'csv') {
$context = 'com_' . $package . '.list' . $this->getRenderContext() . '.order.' . $elementId;
$orderDir = $this->session->get($context);
// No user set order so get it from the list properties
if (is_null($orderDir)) {
$orderDirs = (array) json_decode($item->order_dir);
$orderEls = (array) json_decode($item->order_by);
$ix = array_search($elementId, $orderEls);
if ($ix !== false) {
$orderDir = FArrayHelper::getValue($orderDirs, $ix, '');
} else {
// nothing set, make an executive decision!
$orderDir = '';
}
}
$displayData = new stdClass();
$displayData->tmpl = $this->getTmpl();
$displayData->orderDir = $orderDir;
$displayData->class = '';
$displayData->key = $key;
$displayData->orderBys = $orderBys;
$displayData->item = $item;
$displayData->elementParams = $elementParams;
$displayData->label = $label;
$layout = $this->getLayout('list.fabrik-order-heading');
$heading = $layout->render($displayData);
} else {
$heading = $label;
}
$aTableHeadings[$compositeKey] = $heading;
// Check responsive class
//.........这里部分代码省略.........
示例6: getGroup
/**
* Get group data from session
* @param string $group
* @param mixed $default
* @return JSONData
*/
public function getGroup($group = 'default', $default = array())
{
$data = $this->_session->get($group, $default, $this->_namespace);
return $data;
}
示例7: saveByPost
/**
* Save history that associated with form data
*
* @param JSession $session
* @param mixed $post
* @param string $pageKey
* @param string $title
*
* @return int ID of saved history
*/
private function saveByPost($session, $post, $pageKey, $title)
{
if (!$session->has($post['postSessionKey'])) {
return;
}
$formData = $session->get($post['postSessionKey']);
$formHash = md5($formData);
$form = json_decode($formData);
$id = $form->cid;
if (is_array($id)) {
$id = array_shift($id);
}
$userId = JFactory::getUser()->id;
$history = JTable::getInstance('History', 'PowerAdminTable');
$history->load(array('user_id' => $userId, 'object_key' => $pageKey, 'object_id' => $id));
if ($history->id == null) {
$history->bind(array('user_id' => $userId, 'object_key' => $pageKey, 'object_id' => $id));
}
$history->bind(array('title' => $title, 'visited' => time(), 'form' => $formData, 'form_hash' => $formHash, 'component' => empty($history->component) && !empty($post['parent']) ? $post['parent'] : $history->component, 'list_page' => empty($history->list_page) && !empty($post['name']) ? $post['name'] : $history->list_page, 'list_page_params' => empty($history->list_page_params) && !empty($post['params']) ? $post['params'] : $history->list_page_params, 'icon' => empty($history->icon) && !empty($post['iconPath']) ? $post['iconPath'] : $history->icon, 'css' => empty($history->css) && !empty($post['iconCss']) ? $post['iconCss'] : $history->css));
$history->description = $post['description'];
$history->store();
return $history->id;
}