当前位置: 首页>>代码示例>>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;未经允许,请勿转载。