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


PHP HTTP::ReloadCurrentURL方法代码示例

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


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

示例1: LoginAction

 function LoginAction()
 {
     // Validate login
     $where = array("login = '" . $_POST['login'] . "'", "password = '" . $_POST['password'] . "'");
     if ($userInfo = Query::SingleRow($this->name, $where)) {
         // Login succeeded; create cookie and reload this page
         $_JAM->user->Login($userInfo['id']);
         HTTP::ReloadCurrentURL();
     } else {
         // Login failed
     }
 }
开发者ID:etienne,项目名称:jam,代码行数:12,代码来源:UsersModule.php

示例2: Connect

 function Connect()
 {
     global $_JAM;
     // Check whether user has submitted the login form
     if ($_POST['connect']) {
         // Validate login
         $where = array("login = '" . $_POST['login'] . "'", "password = '" . $_POST['password'] . "'");
         if ($userInfo = Query::SingleRow('users', $where)) {
             // Login succeeded; create cookie and reload this page
             $this->Login($userInfo['id']);
             HTTP::ReloadCurrentURL();
             return true;
         } else {
             print e('p', array('class' => 'error'), $_JAM->strings['admin']['incorrectLogin']);
         }
     }
     // Display form if login was incorrect or user has not yet submitted the form
     $form = new Form();
     $form->Open();
     print $form->Field('login', 40, $_JAM->strings['admin']['login']);
     print $form->Password('password', 40, $_JAM->strings['admin']['password']);
     print $form->Submit('connect', $_JAM->strings['admin']['connect']);
     $form->Close();
 }
开发者ID:etienne,项目名称:jam,代码行数:24,代码来源:User.php

示例3: RevertAction

 function RevertAction($module)
 {
     if ($_POST['revert']) {
         // Revert to specific version
         if ($module->Revert($_POST['revertID'])) {
             HTTP::ReloadCurrentURL('?a=edit&id=' . $_POST['master']);
         }
     } else {
         // Cancel; go back to item form
         HTTP::ReloadCurrentURL('?a=edit&id=' . $_POST['master']);
     }
 }
开发者ID:etienne,项目名称:jam,代码行数:12,代码来源:adminModule.php

示例4: ProcessData


//.........这里部分代码省略.........
                 }
                 // Keep ID of inserted item for path
                 $insertID = Database::GetLastInsertID();
             }
         } else {
             // Special update for tables with multiple versions support
             // Set item as current
             $insertData['current'] = true;
             // If we already have a creation date and one wasn't specified, use that
             if (!$insertData['created'] && $this->item['created']) {
                 $insertData['created'] = $this->item['created'];
             }
             if (!Database::Insert($this->name, $insertData)) {
                 trigger_error("Couldn't insert into module " . $this->name, E_USER_ERROR);
             } else {
                 // Keep ID of inserted item for path
                 $insertID = Database::GetLastInsertID();
                 // $this->postData now represents actual data
                 $this->LoadData($this->postData);
                 // Disable all other items with the same master
                 if ($insertData['master']) {
                     $updateParams['current'] = false;
                     $whereArray = array(array('master = ' . $insertData['master'], 'id = ' . $insertData['master']), 'id != ' . $insertID);
                     $where = Database::GetWhereString($whereArray);
                     if (!Database::Update($this->name, $updateParams, $where)) {
                         trigger_error("Couldn't update module " . $this->name, E_USER_ERROR);
                         return false;
                     }
                 }
             }
         }
     } else {
         // FIXME: Kuldgy. Added to make translations work.
         $insertID = $_GET['item'];
     }
     // Insert localized data
     if ($localizedData) {
         $tableName = $this->name . '_localized';
         $localizedData['item'] = $insertID;
         $localizedData['language'] = $this->postData['language'];
         $where = array('item = ' . $insertID, "language = '" . $localizedData['language'] . "'");
         if (Database::Update($tableName, $localizedData, $where)) {
             // Insert if no rows were affected
             if (Database::GetModifiedRows() == 0) {
                 if (Database::Insert($tableName, $localizedData)) {
                     $success = true;
                 } else {
                     trigger_error("Couldn't insert localized data for module " . $this->name, E_USER_ERROR);
                 }
             } else {
                 $success = true;
             }
             // Put data into module object to reflect changes in the database
             if ($success) {
                 $this->LoadData($localizedData);
             }
         } else {
             trigger_error("Couldn't update localized data for module " . $this->name, E_USER_ERROR);
             return false;
         }
     }
     if ($insertID) {
         // Update path
         $this->UpdatePath($insertID);
         // Get ID for this item
         $id = $_POST['master'] ? $_POST['master'] : $insertID;
         // Delete previous many-to-many relationships
         $where = array('frommodule = ' . $this->moduleID, 'fromid = ' . $insertID);
         if (!Database::DeleteFrom('_relationships', $where)) {
             trigger_error("Couldn't delete previous many-to-many relationships for module " . $this->name, E_USER_ERROR);
         }
         foreach ($this->schema as $name => $info) {
             switch ($info['type']) {
                 case 'multi':
                     // Insert many-to-many relationships
                     foreach ($this->postData[$name] as $targetID) {
                         // Insert each item into _relationships table
                         $targetModuleName = $info['relatedModule'];
                         $targetModuleID = array_search($targetModuleName, $_JAM->installedModules);
                         $params = array('frommodule' => $this->moduleID, 'fromid' => $insertID, 'tomodule' => $targetModuleID, 'toid' => $targetID);
                         if (!Database::Insert('_relationships', $params)) {
                             trigger_error("Couldn't insert many-to-many relationship for module " . $this->name, E_USER_ERROR);
                         }
                     }
                     break;
             }
         }
     }
     if (method_exists($this, 'PostProcessData')) {
         $this->PostProcessData($insertID);
     }
     // Check whether we need to redirect to a specific anchor
     $anchor = $this->config['redirectToAnchor'][$this->parentModule->name];
     // Reload page
     if ($_JAM->rootModuleName == 'admin' || !$this->config['postSubmitRedirect']) {
         HTTP::ReloadCurrentURL('?m=updated' . ($anchor ? '#' . $anchor : ''));
     } else {
         HTTP::RedirectLocal($this->config['postSubmitRedirect']);
     }
 }
开发者ID:noix,项目名称:qsprog,代码行数:101,代码来源:Module.php


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