當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Locales::getDefaultLocale方法代碼示例

本文整理匯總了PHP中Locales::getDefaultLocale方法的典型用法代碼示例。如果您正苦於以下問題:PHP Locales::getDefaultLocale方法的具體用法?PHP Locales::getDefaultLocale怎麽用?PHP Locales::getDefaultLocale使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Locales的用法示例。


在下文中一共展示了Locales::getDefaultLocale方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: perform

 function perform()
 {
     $this->_userName = $this->_request->getValue("userName");
     $this->_userPassword = $this->_request->getValue("userPassword");
     $this->_confirmPassword = $this->_request->getValue("userPasswordCheck");
     $this->_userEmail = $this->_request->getValue("userEmail");
     $this->_userFullName = $this->_request->getValue("userFullName");
     $db = connectDb();
     if (!$db) {
         $this->_view = new WizardView("step3");
         $this->_view->setErrorMessage("There was an error connecting to the database. Please check your settings.");
         $this->setCommonData();
         return false;
     }
     if ($this->_confirmPassword != $this->_userPassword) {
         $this->_view = new WizardView("step3");
         $this->_form->setFieldValidationStatus("userPasswordCheck", false);
         $this->setCommonData(true);
         return false;
     }
     $dbPrefix = Db::getPrefix();
     $users = new Users();
     $user = new UserInfo($this->_userName, $this->_userPassword, $this->_userEmail, "", $this->_userFullName);
     $userId = $users->addUser($user);
     if (!$userId) {
         $this->_view = new WizardView("step3");
         $message = "There was an error adding the user. Make sure that the user does not already exist in the database (" . $users->DbError() . ")";
         $this->_view->setErrorMessage($message);
         $this->setCommonData();
         return false;
     }
     // we also have to execute the code to give administrator privileges to this user
     $query = "INSERT INTO {$dbPrefix}users_permissions(user_id,blog_id,permission_id) VALUES( {$userId}, 0, 1 );";
     $db->Execute($query);
     $this->_view = new Wizardview("step4");
     $this->_view->setValue("ownerid", $userId);
     $this->_view->setValue("siteLocales", Locales::getLocales());
     $this->_view->setValue("defaultLocale", Locales::getDefaultLocale());
     $ts = new TemplateSets();
     $this->_view->setValue("siteTemplates", $ts->getGlobalTemplateSets());
     $this->setCommonData();
     return true;
 }
開發者ID:BackupTheBerlios,項目名稱:plogfr-svn,代碼行數:43,代碼來源:wizard.php


注:本文中的Locales::getDefaultLocale方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。