function perform() { // save the settings $blogSettings = $this->_blogInfo->getSettings(); $blogSettings->setValue("plugin_moblog_article_category_id", $this->_categoryId); $blogSettings->setValue("plugin_moblog_gallery_resource_album_id", $this->_albumId); $blogSettings->setValue("plugin_moblog_resource_preview_type", $this->_previewType); $blogSettings->setValue("plugin_moblog_enabled", $this->_pluginEnabled); // update the settings in the database *and* in the session, otherwise we will // keep using the old settings!! $blogs = new Blogs(); $this->_blogInfo->setSettings($blogSettings); $blogs->updateBlogSettings($this->_blogInfo->getId(), $this->_blogInfo->getSettings()); $this->_session->setValue("blogInfo", $this->_blogInfo); $this->saveSession(); // show an informative message $this->_view = new AdminMoblogPluginSettingsView($this->_blogInfo, $this->_userInfo); $this->_view->setSuccessMessage($this->_locale->tr("atom_plugin_settings_saved_ok")); $this->setCommonData(); return true; }
/** * Adds a local template to the given blog. * * @param templateName Name that the template will use * @param blogId the identifier of the blog to which we're going to install * the new template. * @return True if successful or false otherwise. */ function addLocalTemplate($templateName, $blogId) { $blogs = new Blogs(); $blogSettings = $blogs->getBlogSettings($blogId); if ($blogSettings == "" || $blogSettings == false) { return false; } // get the array with the templates $blogTemplates = $blogSettings->getValue("blog_templates"); // add a new one unless it's already there if ($blogTemplates == "" || $blogTemplates == null) { $blogTemplates = array(); } if (in_array($templateName, $blogTemplates)) { return true; } array_push($blogTemplates, $templateName); $blogSettings->setValue("blog_templates", $blogTemplates); $blogs->updateBlogSettings($blogId, $blogSettings); return true; }