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


PHP Locales::getLocales方法代码示例

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


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

示例1: render

 function render()
 {
     // load all the locale files
     $locales = new Locales();
     $siteLocales = $locales->getLocales();
     $this->setValue("locales", $siteLocales);
     parent::render();
 }
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:8,代码来源:adminsitelocaleslistview.class.php

示例2: render

 function render()
 {
     // get the list of languages available, so that users can choose
     $locales = Locales::getLocales();
     $this->setValue("locales", $locales);
     $config =& Config::getConfig();
     // assign default Local to template
     $this->setValue("defaultLocale", $config->getValue("default_locale"));
     // and render the rest of the contents of the view
     parent::render();
 }
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:11,代码来源:doblogregistrationview.class.php

示例3: render

 function render()
 {
     $this->setValue("blogsettings", $this->_blogInfo->getSettings());
     $ts = new TemplateSets();
     $templates = $ts->getBlogTemplateSets($this->_blogInfo->getId(), true);
     $this->setValue("templates", $templates);
     // loading all the locales from disk is a pretty heavy task but doing so, we'll get
     // nice Locale object with things like the encoding, the description, etc... which looks
     // waaaay nicer than just showing the locale code
     $this->setValue("locales", Locales::getLocales());
     parent::render();
 }
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:12,代码来源:adminblogsettingsview.class.php

示例4: AdminEditSiteBlogView

 function AdminEditSiteBlogView($blogInfo, $editBlogInfo = null)
 {
     // fetch information about the blog we're editing
     if ($editBlogInfo == null) {
         $this->_editBlogInfo = $this->getSessionValue('editBlogInfo');
     } else {
         $this->_editBlogInfo = $editBlogInfo;
     }
     // this stuff is a bit weird but I couldn't find a better way to do it!
     if ($this->_editBlogInfo) {
         $this->AdminTemplatedView($blogInfo, 'editblog');
         $this->_error = false;
         $this->setSessionValue('editBlogInfo', $this->_editBlogInfo);
         // ...
         // export data to the view
         $this->setValue('editblog', $this->_editBlogInfo);
         $this->setValue('editblogsettings', $this->_editBlogInfo->getSettings());
         // blog settings...
         $blogTemplateSet = $this->_editBlogInfo->getTemplateSet();
         $this->setValue('blogTemplate', $blogTemplateSet->getName());
         $ts = new TemplateSets();
         // get the blog template sets
         $this->setValue('templates', $ts->getBlogTemplateSets($this->_editBlogInfo->getId(), true));
         // and the list of locale availables
         $this->setValue('locales', Locales::getLocales());
         $this->setValue('blogStatus', $this->_editBlogInfo->getStatus());
         $this->setValue('blogStatusList', BlogStatus::getStatusList());
         $blogSettings = $this->_editBlogInfo->getSettings();
         $this->setValue('blogTimeOffset', $blogSettings->getValue('time_offset'));
         $this->setValue('blogOwner', $this->_editBlogInfo->getOwner());
         $this->setValue('blogName', $this->_editBlogInfo->getBlog());
         $this->setValue('blogLocale', $blogSettings->getValue("locale"));
         $this->setValue('blogResourcesQuota', $this->_editBlogInfo->getResourcesQuota());
         // get all the users
         $users = new Users();
         $siteUsers = $users->getAllUsers();
         $this->notifyEvent(EVENT_USERS_LOADED, array('users' => &$siteUsers));
         // set the blog users and the available users
         $blogUsers = $users->getBlogUsers($this->_editBlogInfo->getId(), false);
         $this->setValue('availableusers', $this->filterAvailableUsers($siteUsers, $blogUsers));
         $this->setValue('blogusers', $blogUsers);
         $this->setValue('siteusers', $siteUsers);
     } else {
         $this->AdminTemplatedView($blogInfo, 'error');
         $this->setValue('message', 'Unexpected error loading blog!');
         $this->_error = true;
     }
 }
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:48,代码来源:admineditsiteblogview.class.php

示例5: perform

 function perform()
 {
     // retrieve the values from the view
     $this->_blogName = $this->_request->getValue("blogName");
     $this->_ownerId = $this->_request->getValue("ownerid");
     $this->_blogProperties = $this->_request->getValue("properties");
     $this->_blogTemplate = $this->_request->getValue("blogTemplate");
     $this->_blogLocale = $this->_request->getValue("blogLocale");
     // configure the blog
     $blogs = new Blogs();
     $blog = new BlogInfo($this->_blogName, $this->_ownerId, "", "");
     $blog->setProperties($this->_blogProperties);
     $blog->setStatus(BLOG_STATUS_ACTIVE);
     $blogSettings = $blog->getSettings();
     $blogSettings->setValue("locale", $this->_blogLocale);
     $blogSettings->setValue("template", $this->_blogTemplate);
     $blog->setSettings($blogSettings);
     // and now save it to the database
     $newblogId = $blogs->addBlog($blog);
     if (!$newblogId) {
         $this->_view = new WizardView("step4");
         $this->_view->setValue("siteLocales", Locales::getLocales());
         $ts = new TemplateSets();
         $this->_view->setValue("siteTemplates", $ts->getGlobalTemplateSets());
         $this->_view->setErrorMessage("There was an error creating the new blog");
         $this->setCommonData(true);
         return false;
     }
     // if the blog was created, we can add some basic information
     // add a category
     $articleCategories = new ArticleCategories();
     $articleCategory = new ArticleCategory("General", "", $newblogId, true);
     $catId = $articleCategories->addArticleCategory($articleCategory);
     // load the right locale
     $locale =& Locales::getLocale($this->_blogLocale);
     // and load the right text
     $articleTopic = $locale->tr("register_default_article_topic");
     $articleText = $locale->tr("register_default_article_text");
     $article = new Article($articleTopic, $articleText, array($catId), $this->_ownerId, $newblogId, POST_STATUS_PUBLISHED, 0, array(), "welcome");
     $t = new Timestamp();
     $article->setDateObject($t);
     $articles = new Articles();
     $articles->addArticle($article);
     // save a few things in the default configuration
     $config =& Config::getConfig();
     // default blog id
     $config->saveValue("default_blog_id", (int) $newblogId);
     // default locale
     $config->saveValue("default_locale", $this->_blogLocale);
     // and finally, the default template
     $config->saveValue("default_template", $this->_blogTemplate);
     //
     // detect wether we have GD available and set the blog to use it
     //
     if (GdDetector::detectGd()) {
         $config->saveValue("thumbnail_method", "gd");
         $message = "GD has been detected and set as the backend for dealing with images.";
     } else {
         $pathToConvert = $config->getValue("path_to_convert");
         if ($pathToConvert) {
             $config->saveValue("thumbnail_method", "imagemagick");
             $message = "ImageMagick has been detected and set as the backend for dealing with images.";
         } else {
             // nothing was found, so we'll have to do away with the 'null' resizer...
             $config->saveValue("thumbnail_method", "null");
             $message = "Neither GD nor ImageMagick have been detected in this host so it will not be possible to generate thumbnails from images.";
         }
     }
     $this->_view = new WizardView("step5");
     $this->_view->setValue("message", $message);
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:72,代码来源:wizard.php


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