当前位置: 首页>>代码示例>>PHP>>正文


PHP JRequest::getUint方法代码示例

本文整理汇总了PHP中JRequest::getUint方法的典型用法代码示例。如果您正苦于以下问题:PHP JRequest::getUint方法的具体用法?PHP JRequest::getUint怎么用?PHP JRequest::getUint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JRequest的用法示例。


在下文中一共展示了JRequest::getUint方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getRedirectToItemAppend

 /**
  * Gets the URL arguments to append to an item redirect.
  *
  * @param     integer    $id         The primary key id for the item.
  * @param     string     $url_var    The name of the URL variable for the id.
  *
  * @return    string                 The arguments to append to the redirect URL.
  */
 protected function getRedirectToItemAppend($id = null, $url_var = 'id')
 {
     $tmpl = JRequest::getCmd('tmpl');
     $layout = JRequest::getCmd('layout', 'edit');
     $project = JRequest::getUint('filter_project', 0);
     $context = JRequest::getCmd('filter_context');
     $item_id = JRequest::getUint('filter_item_id');
     $append = '';
     // Setup redirect info.
     if ($tmpl) {
         $append .= '&tmpl=' . $tmpl;
     }
     if ($layout) {
         $append .= '&layout=' . $layout;
     }
     if ($id) {
         $append .= '&' . $url_var . '=' . $id;
     }
     if ($project) {
         $append .= '&filter_project=' . $project;
     }
     if ($context) {
         $append .= '&filter_context=' . $context;
     }
     if ($item_id) {
         $append .= '&filter_item_id=' . $item_id;
     }
     return $append;
 }
开发者ID:gagnonjeanfrancois,项目名称:Projectfork,代码行数:37,代码来源:comment.php

示例2: populateState

 /**
  * Method to auto-populate the model state.
  * Note. Calling getState in this method will result in recursion.
  *
  * @return    void
  */
 protected function populateState($ordering = 'title', $direction = 'ASC')
 {
     // Item type
     $value = str_replace('form', '', JRequest::getCmd('view', 'taskform'));
     $this->setState('item.type', $value);
     // Item id
     $value = JRequest::getUint('id');
     $this->setState('item.id');
 }
开发者ID:gagnonjeanfrancois,项目名称:Projectfork,代码行数:15,代码来源:userrefs.php

示例3: display

 /**
  * Method to display a view.
  *
  * @param     boolean        If true, the view output will be cached
  * @param     array          An array of safe url parameters
  *
  * @return    jcontroller    This object to support chaining.
  */
 public function display($cachable = false, $urlparams = false)
 {
     $view = JRequest::getCmd('view', $this->default_view);
     $layout = JRequest::getCmd('layout');
     $id = JRequest::getUint('id');
     // Inject default view if not set
     if (empty($view)) {
         JRequest::setVar('view', $this->default_view);
         $view = $this->default_view;
     }
     if ($view == $this->default_view) {
         $parent_id = JRequest::getUInt('filter_parent_id');
         $project = PFApplicationHelper::getActiveProjectId('filter_project');
         if ($parent_id && $project === "") {
             $this->setRedirect('index.php?option=com_pfrepo&view=' . $this->default_view);
             return $this;
         } elseif ($parent_id > 1 && $project > 0) {
             // Check if the folder belongs to the project
             $db = JFactory::getDbo();
             $query = $db->getQuery(true);
             $query->select('project_id')->from('#__pf_repo_dirs')->where('id = ' . (int) $parent_id);
             $db->setQuery($query);
             $pid = $db->loadResult();
             if ($pid != $project) {
                 // No match, redirect to the project root dir
                 $query->clear();
                 $query->select('id, path')->from('#__pf_repo_dirs')->where('parent_id = 1')->where('project_id = ' . (int) $project);
                 $db->setQuery($query, 0, 1);
                 $dir = $db->loadObject();
                 if ($dir) {
                     $this->setRedirect('index.php?option=com_pfrepo&view=' . $this->default_view . '&filter_project=' . $project . '&filter_parent_id=' . $dir->id);
                     return $this;
                 }
             }
         }
     }
     // Check form edit access
     if ($layout == 'edit' && !$this->checkEditId('com_pfrepo.edit.' . $view, $id)) {
         $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
         $this->setMessage($this->getError(), 'error');
         $this->setRedirect(JRoute::_('index.php?option=com_pfrepo&view=' . $this->default_view, false));
         return false;
     }
     // Add the sub-menu
     PFrepoHelper::addSubmenu($view);
     // Display the view
     parent::display($cachable, $urlparams);
     return $this;
 }
开发者ID:gagnonjeanfrancois,项目名称:Projectfork,代码行数:57,代码来源:controller.php

示例4: migrate

 public function migrate()
 {
     $app = JFactory::getApplication();
     $passed = JRequest::getUint('check_passed');
     if (!$passed) {
         $app->enqueueMessage(JText::_('COM_PFMIGRATOR_WARNING_CHECK'), 'error');
         $app->redirect('index.php?option=com_pfmigrator&view=intro');
         return $this;
     }
     $data = PFmigratorHelper::getCustomData();
     if ($data->get('run')) {
         $app->enqueueMessage(JText::_('COM_PFMIGRATOR_WARNING_RERUN'), 'error');
         $app->redirect('index.php?option=com_pfmigrator&view=intro');
         return $this;
     }
     $data->set('run', 1);
     PFmigratorHelper::setCustomData($data);
     $app->enqueueMessage(JText::_('COM_PFMIGRATOR_WARNING_NO_LEAVE'));
     $app->redirect('index.php?option=com_pfmigrator&view=migrate');
     return $this;
 }
开发者ID:bellodox,项目名称:Migrator,代码行数:21,代码来源:controller.php

示例5: populateState

 /**
  * Method to auto-populate the model state.
  * Note. Calling getState in this method will result in recursion.
  *
  * @return    void
  */
 protected function populateState($ordering = null, $direction = null)
 {
     // Get potential form data
     $form = JRequest::getVar('jform', array(), 'post', 'array');
     // Item id
     $value = JRequest::getUint('id');
     if (!$value) {
         if (isset($form['id'])) {
             $value = (int) $form['id'];
         }
     }
     $this->setState('item.id', $value);
     // Project id
     $value = (int) $this->getUserStateFromRequest('com_projectfork.project.active.id', 'filter_project', '');
     if (!$value) {
         if (isset($form['project_id'])) {
             $value = (int) $form['project_id'];
         }
     }
     $this->setState('item.project', $value);
 }
开发者ID:gagnonjeanfrancois,项目名称:Projectfork,代码行数:27,代码来源:taskrefs.php

示例6: getRedirectToListAppend

 /**
  * Gets the URL arguments to append to a list redirect.
  *
  * @return    string    The arguments to append to the redirect URL.
  */
 protected function getRedirectToListAppend()
 {
     $tmpl = JRequest::getCmd('tmpl');
     $project = JRequest::getUint('filter_project');
     $parent = JRequest::getUint('filter_parent_id');
     $id = JRequest::getUint('id');
     $rev = JRequest::getUint('rev');
     $append = '';
     // Setup redirect info.
     if ($project) {
         $append .= '&filter_project=' . $project;
     }
     if ($parent) {
         $append .= '&filter_parent_id=' . $parent;
     }
     if ($id && $rev) {
         $append .= '&id=' . $id;
     }
     if ($tmpl) {
         $append .= '&tmpl=' . $tmpl;
     }
     return $append;
 }
开发者ID:gagnonjeanfrancois,项目名称:Projectfork,代码行数:28,代码来源:note.php

示例7: populateState

 /**
  * Method to auto-populate the model state.
  * Note: Calling getState in this method will result in recursion.
  *
  * @return    void
  */
 protected function populateState($ordering = 'a.ordering', $direction = 'desc')
 {
     // Initialise variables.
     $params = JComponentHelper::getParams('com_pfrepo');
     $app = JFactory::getApplication();
     // Adjust the context to support modal layouts.
     if ($layout = JRequest::getVar('layout')) {
         $this->context .= '.' . $layout;
     }
     // Filter - Search
     $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
     $this->setState('filter.search', $search);
     // Filter - Author
     $author_id = $app->getUserStateFromRequest($this->context . '.filter.author_id', 'filter_author_id');
     $this->setState('filter.author_id', $author_id);
     // Filter - File id
     $id = JRequest::getUint('id');
     $this->setState('filter.id', $id);
     // List state information.
     parent::populateState($ordering, $direction);
 }
开发者ID:gagnonjeanfrancois,项目名称:Projectfork,代码行数:27,代码来源:noterevisions.php

示例8: getRedirectToListAppend

 /**
  * Gets the URL arguments to append to a list redirect.
  *
  * @return    string    The arguments to append to the redirect URL.
  */
 protected function getRedirectToListAppend()
 {
     // Need to override the parent method completely.
     $tmpl = JRequest::getCmd('tmpl');
     $project = JRequest::getUint('filter_project', 0);
     $topic = JRequest::getUint('filter_topic', 0);
     $append = '';
     // Setup redirect info.
     if ($project) {
         $append .= '&filter_project=' . $project;
     }
     if ($topic) {
         $append .= '&filter_topic=' . $topic;
     }
     if ($tmpl) {
         $append .= '&tmpl=' . $tmpl;
     }
     return $append;
 }
开发者ID:gagnonjeanfrancois,项目名称:Projectfork,代码行数:24,代码来源:replyform.php

示例9: getRedirectToListAppend

 /**
  * Gets the URL arguments to append to a list redirect.
  *
  * @return    string    The arguments to append to the redirect URL.
  */
 protected function getRedirectToListAppend()
 {
     $tmpl = JRequest::getCmd('tmpl');
     $project = JRequest::getUint('filter_project');
     $parent = JRequest::getUint('filter_parent_id');
     $layout = JRequest::getCmd('layout');
     $func = JRequest::getCmd('function');
     $append = '';
     // Setup redirect info.
     if ($project) {
         $append .= '&filter_project=' . $project;
     }
     if ($parent) {
         $append .= '&filter_parent_id=' . $parent;
     }
     if ($tmpl) {
         $append .= '&tmpl=' . $tmpl;
     }
     if ($layout) {
         $append .= '&layout=' . $layout;
     }
     if ($func) {
         $append .= '&function=' . $func;
     }
     return $append;
 }
开发者ID:sgershen,项目名称:Projectfork,代码行数:31,代码来源:file.php

示例10: getReturnPage

 /**
  * Get the return URL.
  * If a "return" variable has been passed in the request
  *
  * @return    string    The return URL.
  */
 protected function getReturnPage()
 {
     $return = JRequest::getVar('return', null, 'default', 'base64');
     $parent = JRequest::getUint('filter_parent_id');
     $project = JRequest::getUint('filter_project');
     $append = '';
     if ($project) {
         $append .= '&filter_project=' . $project;
     }
     if ($parent) {
         $append .= '&filter_parent_id=' . $parent;
     }
     if (empty($return) || !JUri::isInternal(base64_decode($return))) {
         return JRoute::_('index.php?option=com_pfrepo&view=' . $this->view_list . $append, false);
     } else {
         return base64_decode($return);
     }
 }
开发者ID:gagnonjeanfrancois,项目名称:Projectfork,代码行数:24,代码来源:directoryform.php

示例11: populateState

 /**
  * Method to auto-populate the model state.
  * Note. Calling getState in this method will result in recursion.
  *
  * @return    void
  */
 protected function populateState()
 {
     // Load state from the request.
     $pk = JRequest::getUint('id');
     $this->setState($this->getName() . '.id', $pk);
     // Load the parameters.
     $params = JFactory::getApplication('site')->getParams();
     $this->setState('params', $params);
 }
开发者ID:gagnonjeanfrancois,项目名称:Projectfork,代码行数:15,代码来源:file.php

示例12: getRedirectToListAppend

 /**
  * Gets the URL arguments to append to a list redirect.
  *
  * @return  string  The arguments to append to the redirect URL.
  */
 protected function getRedirectToListAppend()
 {
     $tmpl = JRequest::getCmd('tmpl');
     $parent = JRequest::getUint('filter_parent_id', 0);
     $append = '';
     // Setup redirect info.
     if ($parent) {
         $append .= '&filter_parent_id=' . $parent;
     }
     if ($tmpl) {
         $append .= '&tmpl=' . $tmpl;
     }
     return $append;
 }
开发者ID:MrJookie,项目名称:pm,代码行数:19,代码来源:revision.php

示例13: delete

 /**
  * Method to remove items from the recorder
  *
  * @return    void
  */
 public function delete()
 {
     $data = array();
     $data['success'] = "true";
     $data['messages'] = array();
     $data['data'] = array();
     // Check for request forgeries
     if (!JSession::checkToken()) {
         $data['success'] = "false";
         $data['messages'][] = JText::_('JINVALID_TOKEN');
         $this->sendResponse($data);
     }
     // Get the input
     $pks = JRequest::getVar('cid', null, 'post', 'array');
     $c = JRequest::getUint('complete');
     if (empty($pks)) {
         $data['success'] = "false";
         $data['messages'][] = JText::_($this->text_prefix . '_NO_ITEM_SELECTED');
     } else {
         // Get the model.
         $model = $this->getModel();
         // Make sure the item ids are integers
         JArrayHelper::toInteger($pks);
         // Publish the items.
         if (!$model->delete($pks, $c)) {
             $data['success'] = "false";
             $data['messages'][] = $model->getError();
         } else {
             $data['success'] = "true";
         }
     }
     $this->sendResponse($data);
 }
开发者ID:gagnonjeanfrancois,项目名称:Projectfork,代码行数:38,代码来源:recorder.json.php

示例14: getRedirectToItemAppend

 /**
  * Gets the URL arguments to append to an item redirect.
  *
  * @param     int       $id         The primary key id for the item.
  * @param     string    $url_var    The name of the URL variable for the id.
  *
  * @return    string                The arguments to append to the redirect URL.
  */
 protected function getRedirectToItemAppend($id = null, $url_var = 'id')
 {
     // Need to override the parent method completely.
     $tmpl = JRequest::getCmd('tmpl');
     $layout = JRequest::getCmd('layout', 'edit');
     $item_id = JRequest::getUInt('Itemid');
     $project = JRequest::getUint('filter_project', 0);
     $parent = JRequest::getUint('filter_parent_id', 0);
     $return = $this->getReturnPage();
     $append = '';
     // Setup redirect info.
     if ($tmpl) {
         $append .= '&tmpl=' . $tmpl;
     }
     $append .= '&layout=edit';
     if ($id) {
         $append .= '&' . $url_var . '=' . $id;
     }
     if ($project) {
         $append .= '&filter_project=' . $project;
     }
     if ($parent) {
         $append .= '&filter_parent_id=' . $parent;
     }
     if ($item_id) {
         $append .= '&Itemid=' . $item_id;
     }
     if ($return) {
         $append .= '&return=' . base64_encode($return);
     }
     return $append;
 }
开发者ID:MrJookie,项目名称:pm,代码行数:40,代码来源:revisionform.php

示例15: populateState

 /**
  * Method to auto-populate the model state.
  * Note: Calling getState in this method will result in recursion.
  *
  * @return    void
  */
 protected function populateState($ordering = 'a.title', $direction = 'asc')
 {
     // Initialise variables.
     $params = JComponentHelper::getParams('com_pfrepo');
     $app = JFactory::getApplication();
     // Adjust the context to support modal layouts.
     if ($layout = JRequest::getVar('layout')) {
         $this->context .= '.' . $layout;
     }
     // Config - Count elements
     $this->setState('list.count_elements', (int) $params->get('show_element_count'));
     // Filter - Search
     $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
     $this->setState('filter.search', $search);
     // Filter - Author
     $author_id = $app->getUserStateFromRequest($this->context . '.filter.author_id', 'filter_author_id');
     $this->setState('filter.author_id', $author_id);
     // Filter - Access
     $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', '');
     $this->setState('filter.access', $access);
     // Filter - Project
     $project = PFApplicationHelper::getActiveProjectId('filter_project');
     $this->setState('filter.project', $project);
     // Filter - Directory
     $parent_id = JRequest::getUint('filter_parent_id', 1);
     $this->setState('filter.parent_id', $parent_id);
     // List state information.
     parent::populateState($ordering, $direction);
 }
开发者ID:gagnonjeanfrancois,项目名称:Projectfork,代码行数:35,代码来源:directories.php


注:本文中的JRequest::getUint方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。