• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CacheControl类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: perform

 /**
  * Carries out the specified action
  */
 function perform()
 {
     // fetch the category we're trying to update
     $this->_categoryId = $this->_request->getValue("linkCategoryId");
     $this->_categoryName = Textfilter::filterAllHTML($this->_request->getValue("linkCategoryName"));
     $categories = new MyLinksCategories();
     $category = $categories->getMyLinksCategory($this->_categoryId, $this->_blogInfo->getId());
     if (!$category) {
         $this->_view = new AdminLinkCategoriesListView($this->_blogInfo);
         $this->_view->setErrorMessage($this->_locale->tr("error_fetching_link_category"));
         $this->setCommonData();
         return false;
     }
     // update the fields
     $category->setName($this->_categoryName);
     $this->notifyEvent(EVENT_PRE_LINK_CATEGORY_UPDATE, array("linkcategory" => &$category));
     if (!$categories->updateMyLinksCategory($category)) {
         $this->_view = new AdminLinkCategoriesListView($this->_blogInfo);
         $this->_view->setErrorMessage($this->_locale->tr("error_updating_link_category"));
         $this->setCommonData();
         return false;
     }
     $this->notifyEvent(EVENT_POST_LINK_CATEGORY_UPDATE, array("linkcategory" => &$category));
     // clear the cache
     CacheControl::resetBlogCache($this->_blogInfo->getId(), false);
     $this->_view = new AdminLinkCategoriesListView($this->_blogInfo);
     $this->_view->setSuccessMessage($this->_locale->pr("link_category_updated_ok", $category->getName()));
     $this->setCommonData();
     // better to return true if everything fine
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:34,代码来源:adminupdatelinkcategoryaction.class.php


示例2: perform

 function perform()
 {
     // fetch the data
     $this->_newFilteredContent = $this->_request->getValue("filteredContent");
     $this->_reason = $this->_request->getValue("reason");
     // create the dao object and add the info to the db
     $filteredContents = new FilteredContents();
     $filteredContent = new FilteredContent($this->_newFilteredContent, $this->_blogInfo->getId(), $this->_reason);
     // throw the pre-event
     $this->notifyEvent(EVENT_PRE_FILTERED_CONTENT_ADD, array("content" => &$filteredContent));
     // and add the filtered content to the database
     $result = $filteredContents->addBlogFilteredContent($filteredContent);
     // and give some feedback to the user
     if (!$result) {
         $this->_view = new AdminNewBlogFilteredContentView($this->_blogInfo);
         $this->_view->setErrorMessage($this->_locale->tr("error_adding_blocked_content"));
         $this->setCommonData();
         return false;
     }
     $this->notifyEvent(EVENT_POST_FILTERED_CONTENT_ADD, array("content" => &$filteredContent));
     $this->_view = new AdminBlogFilteredContentView($this->_blogInfo);
     $this->_view->setSuccessMessage($this->_locale->tr("blocked_content_added_ok"));
     $this->setCommonData();
     // clear the cache
     CacheControl::resetBlogCache($this->_blogInfo->getId());
     // better to return true if everything fine
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:28,代码来源:adminaddblogfilteredcontentaction.class.php


示例3: perform

 /**
  * Carries out the specified action
  */
 function perform()
 {
     // load the resource
     $resourceId = $this->_request->getValue("resourceId");
     $resources = new GalleryResources();
     // initialize the view we're going to use
     $this->_view = new AdminResourcesListView($this->_blogInfo);
     // fetch the resource first, to get some info about it
     $resource = $resources->getResource($resourceId, $this->_blogInfo->getId());
     if (!$resource) {
         $this->_view->setErrorMessage($this->_locale->tr("error_fetching_resource"));
         $this->setCommonData();
         return false;
     }
     // if the resource was loaded ok...
     $this->notifyEvent(EVENT_PRE_RESOURCE_DELETE, array("resource" => &$resource));
     // remove it
     $res = $resources->deleteResource($resourceId, $this->_blogInfo->getId());
     if ($res) {
         $this->_view->setSuccessMessage($this->_locale->pr("resource_deleted_ok", $resource->getFileName()));
         $this->notifyEvent(EVENT_PRE_RESOURCE_DELETE, array("resource" => &$resource));
         // clear the cache if everything went fine
         CacheControl::resetBlogCache($this->_blogInfo->getId(), false);
     } else {
         $this->_view->setErrorMessage($this->_locale->pr("error_deleting_resource", $resource->getFileName()));
     }
     // return the view
     $this->setCommonData();
     // better to return true if everything fine
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:34,代码来源:admindeleteresourceaction.class.php


示例4: perform

 /**
  * Carries out the specified action
  */
 function perform()
 {
     // fetch our data
     $this->_albumName = Textfilter::filterAllHTML($this->_request->getValue("albumName"));
     $this->_albumDescription = Textfilter::filterAllHTML($this->_request->getValue("albumDescription"));
     $this->_parentId = $this->_request->getValue("parentId");
     $showAlbum = $this->_request->getValue("showAlbum") ? 1 : 0;
     // create the album
     $albums = new GalleryAlbums();
     $t = new Timestamp();
     $album = new GalleryAlbum($this->_blogInfo->getId(), $this->_albumName, $this->_albumDescription, GALLERY_RESOURCE_PREVIEW_AVAILABLE, $this->_parentId, $t->getTimestamp(), array(), $showAlbum);
     $this->notifyEvent(EVENT_PRE_ALBUM_ADD, array("album" => &$album));
     // and add it to the database
     $result = $albums->addAlbum($album);
     $this->_view = new AdminResourcesListView($this->_blogInfo, array("albumId" => $this->_parentId));
     if ($result) {
         $this->_view->setSuccessMessage($this->_locale->pr("album_added_ok", $album->getName()));
         $this->notifyEvent(EVENT_POST_ALBUM_ADD, array("album" => &$album));
         // clear the cache if everything went fine
         CacheControl::resetBlogCache($this->_blogInfo->getId(), false);
     } else {
         $this->_view->setErrorMessage($this->_locale->tr("error_adding_album"));
     }
     $this->setCommonData();
     // better to return true if everything fine
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:30,代码来源:adminaddresourcealbumaction.class.php


示例5: perform

 function perform()
 {
     // // update the plugin configurations to blog setting
     $blogSettings = $this->_blogInfo->getSettings();
     $blogSettings->setValue("plugin_authimage_enabled", $this->_pluginEnabled);
     $blogSettings->setValue("plugin_authimage_length", $this->_length);
     $blogSettings->setValue("plugin_authimage_key", $this->_key);
     $blogSettings->setValue("plugin_authimage_expiredtime", $this->_expiredTime);
     $blogSettings->setValue("plugin_authimage_default", $this->_default);
     $this->_blogInfo->setSettings($blogSettings);
     // save the blogs settings
     $blogs = new Blogs();
     if (!$blogs->updateBlog($this->_blogInfo->getId(), $this->_blogInfo)) {
         $this->_view = new PluginAuthImageConfigView($this->_blogInfo);
         $this->_view->setErrorMessage($this->_locale->tr("error_updating_settings"));
         $this->setCommonData();
         return false;
     }
     // if everything went ok...
     $this->_blogInfo->setSettings($blogSettings);
     $this->_session->setValue("blogInfo", $this->_blogInfo);
     $this->saveSession();
     $this->_view = new PluginAuthImageConfigView($this->_blogInfo);
     $this->_view->setSuccessMessage($this->_locale->tr("authimage_settings_saved_ok"));
     $this->setCommonData();
     // clear the cache
     CacheControl::resetBlogCache($this->_blogInfo->getId());
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:29,代码来源:pluginauthimageupdateconfigaction.class.php


示例6: perform

 function perform()
 {
     // update the plugin configurations to blog setting
     $config =& Config::getConfig();
     $config->setValue("plugin_moblog_mailserver", $this->_mailServer);
     $config->setValue("plugin_moblog_port", $this->_port);
     $config->setValue("plugin_moblog_username", $this->_userName);
     $config->setValue("plugin_moblog_password", $this->_password);
     $config->setValue("plugin_moblog_pseudobatch", $this->_pseudoBatch);
     if (!$config->save()) {
         $this->_view = new AdminMoblogBatchPluginSettingsView($this->_blogInfo);
         $this->_view->setErrorMessage($this->_locale->tr("error_updating_settings"));
         $this->setCommonData();
         return false;
     }
     // if everything went ok...
     $this->_session->setValue("blogInfo", $this->_blogInfo);
     $this->saveSession();
     $this->_view = new AdminMoblogBatchPluginSettingsView($this->_blogInfo);
     $this->_view->setSuccessMessage($this->_locale->tr("moblog_settings_saved_ok"));
     $this->setCommonData();
     // clear the cache
     CacheControl::resetBlogCache($this->_blogInfo->getId());
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:25,代码来源:adminmoblogbatchpluginupdatesettingsaction.class.php


示例7: perform

 function perform()
 {
     // fetch the data
     $this->_filteredContentRule = $this->_request->getValue("filteredContent");
     $this->_reason = $this->_request->getValue("reason");
     // create the dao object and add the info to the db
     $filteredContents = new FilteredContents();
     $content = $filteredContents->getBlogFilteredContent($this->_contentId, 0);
     // check if we could find the information, or give up otherwise...
     if (!$content) {
         $this->_view = new AdminFilteredContentView($this->_blogInfo);
         $this->_view->setErrorMessage($this->_locale->tr("error_fetching_filtered_content"));
         $this->setCommonData();
         return false;
     }
     $content->setRegExp($this->_filteredContentRule);
     $content->setReason($this->_reason);
     $this->notifyEvent(EVENT_PRE_FILTERED_CONTENT_UPDATE, array("content" => &$content));
     $result = $filteredContents->updateFilteredContent($content);
     // and give some feedback to the user
     if (!$result) {
         $this->_view = new AdminFilteredContentView($this->_blogInfo);
         $this->_view->setErrorMessage($this->_locale->tr("error_updating_blocked_content"));
         $this->setCommonData();
         return false;
     }
     $this->notifyEvent(EVENT_POST_FILTERED_CONTENT_UPDATE, array("content" => &$content));
     $this->_view = new AdminFilteredContentView($this->_blogInfo);
     $this->_view->setSuccessMessage($this->_locale->tr("blocked_content_updated_ok"));
     $this->setCommonData();
     // clear the cache
     CacheControl::resetBlogCache($this->_blogInfo->getId());
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:34,代码来源:adminupdatefilteredcontentaction.class.php


示例8: perform

 /**
  * Carries out the specified action
  */
 function perform()
 {
     // load the resource
     $this->_resourceDescription = Textfilter::filterAllHTML($this->_request->getValue("resourceDescription"));
     $this->_albumId = $this->_request->getValue("albumId");
     $this->_resourceId = $this->_request->getValue("resourceId");
     $resources = new GalleryResources();
     $resource = $resources->getResource($this->_resourceId, $this->_blogInfo->getId());
     // update the fields we'd like to update
     $resource->setAlbumId($this->_albumId);
     $resource->setDescription($this->_resourceDescription);
     // send the event
     $this->notifyEvent(EVENT_PRE_RESOURCE_UPDATE, array("resource" => &$resource));
     // and update it in the db
     $result = $resources->updateResource($resource);
     if (!$result) {
         $this->_view = new AdminResourcesListView($this->_blogInfo);
         $this->_view->setErrorMessage($this->_locale->tr("error_updating_resource"));
     } else {
         // check which submit button was pressed
         if ($this->_request->getValue("regenerate") != "") {
             return Controller::setForwardAction("regeneratePreview");
         }
         $this->_view = new AdminResourcesListView($this->_blogInfo);
         $this->_view->setSuccessMessage($this->_locale->pr("resource_updated_ok", $resource->getFileName()));
         $this->notifyEvent(EVENT_POST_RESOURCE_UPDATE, array("resource" => &$resource));
         // clear the cache
         CacheControl::resetBlogCache($this->_blogInfo->getId(), false);
     }
     $this->setCommonData();
     // better to return true if everything fine
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:36,代码来源:adminupdateresourceaction.class.php


示例9: perform

 /**
  * Carries out the specified action
  */
 function perform()
 {
     // // update the plugin configurations to blog setting
     $blogSettings = $this->_blogInfo->getSettings();
     $blogSettings->setValue("plugin_moderate_enabled", $this->_pluginEnabled);
     $this->_blogInfo->setSettings($blogSettings);
     // save the blogs settings
     $blogs = new Blogs();
     if (!$blogs->updateBlog($this->_blogInfo->getId(), $this->_blogInfo)) {
         $this->_view = new AdminModeratePluginSettingsView($this->_blogInfo);
         $this->_view->setErrorMessage($this->_locale->tr("error_updating_settings"));
         $this->setCommonData();
         return false;
     }
     // if everything went ok...
     $this->_blogInfo->setSettings($blogSettings);
     $this->_session->setValue("blogInfo", $this->_blogInfo);
     $this->saveSession();
     $this->_view = new AdminModeratePluginSettingsView($this->_blogInfo);
     $this->_view->setSuccessMessage($this->_locale->tr("moderate_settings_saved_ok"));
     $this->setCommonData();
     // clear the cache
     CacheControl::resetBlogCache($this->_blogInfo->getId());
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:28,代码来源:adminmoderatepluginupdatesettingsaction.class.php


示例10: perform

 function perform()
 {
     // fetch the data
     $this->_ip1 = $this->_request->getValue("ip1");
     $this->_ip2 = $this->_request->getValue("ip2");
     $this->_ip3 = $this->_request->getValue("ip3");
     $this->_ip4 = $this->_request->getValue("ip4");
     $this->_hostIp = $this->_ip1 . "." . $this->_ip2 . "." . $this->_ip3 . "." . $this->_ip4;
     $this->_mask = $this->_request->getValue("mask");
     $this->_blockType = $this->_request->getValue("blockType");
     $this->_reason = $this->_request->getValue("reason");
     // create the dao object and add the info to the db
     $blockedHosts = new BlockedHosts();
     $t = new Timestamp();
     $blockedHost = new BlockedHost($this->_hostIp, $this->_mask, $this->_reason, $t->getTimestamp(), GLOBALLY_BLOCKED_HOST, $this->_blockType, BLOCK_BLACKLIST);
     $this->notifyEvent(EVENT_PRE_BLOCK_HOST_ADD, array("host" => &$blockedHost));
     $result = $blockedHosts->add($blockedHost);
     // and give some feedback to the user
     if (!$result) {
         $this->_view = new AdminNewBlockedHostView($this->_blogInfo);
         $this->_view->setErrorMessage($this->_locale->tr("error_adding_blocked_host"));
         $this->setCommonData();
         return false;
     }
     $this->notifyEvent(EVENT_POST_BLOCK_HOST_ADD, array("host" => &$blockedHost));
     $this->_view = new AdminBlockedHostsView($this->_blogInfo);
     $this->_view->setSuccessMessage($this->_locale->tr("blocked_host_updated_ok"));
     $this->setCommonData();
     // clear the cache
     CacheControl::resetBlogCache($this->_blogInfo->getId());
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:32,代码来源:adminaddblockedhostaction.class.php


示例11: perform

 function perform()
 {
     // create the view
     $this->_view = new AdminResourcesListView($this->_blogInfo);
     // fetch the parameters
     $this->_resourceIds = $this->_request->getValue("resourceIds");
     $this->_albumIds = $this->_request->getValue("albumIds");
     // make sure that we're dealing with arrays!
     if (!is_array($this->_resourceIds)) {
         $this->_resourceIds = array();
     }
     if (!is_array($this->_albumIds)) {
         $this->_albumIds = array();
     }
     // remove the items, if any
     $this->_deleteAlbums();
     $this->_deleteResources();
     // put error and success messages (if any) into the view
     if ($this->_successMessage != "") {
         $this->_view->setSuccessMessage($this->_successMessage);
     }
     if ($this->_errorMessage != "") {
         $this->_view->setErrorMessage($this->_errorMessage);
     }
     $this->setCommonData();
     // clear the cache
     CacheControl::resetBlogCache($this->_blogInfo->getId(), false);
     // better to return true if everything fine
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:30,代码来源:admindeletegalleryitemsaction.class.php


示例12: perform

 /**
  * Carries out the specified action
  */
 function perform()
 {
     // fetch the data
     $this->_linkName = Textfilter::filterAllHTML($this->_request->getValue("linkName"));
     $this->_linkUrl = Textfilter::filterAllHTML($this->_request->getValue("linkUrl"));
     $this->_linkCategoryId = $this->_request->getValue("linkCategoryId");
     $this->_linkDescription = Textfilter::filterAllHTML($this->_request->getValue("linkDescription"));
     $this->_linkRss = Textfilter::filterAllHTML($this->_request->getValue("linkRssFeed"));
     $this->_properties = array();
     // adds the new link to the database
     $myLinks = new MyLinks();
     $myLink = new MyLink($this->_linkName, $this->_linkDescription, $this->_linkUrl, $this->_blogInfo->getId(), $this->_linkCategoryId, 0, $this->_linkRss, $this->_properties);
     $this->notifyEvent(EVENT_PRE_LINK_ADD, array("link" => &$link));
     if (!$myLinks->addMyLink($myLink, $this->_blogInfo->getId())) {
         $this->_view = new AdminNewLinkView($this->_blogInfo);
         $this->_view->setErrorMessage($this->_locale->tr("error_adding_link"));
         $this->setCommonData();
         return false;
     }
     $this->notifyEvent(EVENT_POST_LINK_ADD, array("link" => &$link));
     $this->_view = new AdminLinksListView($this->_blogInfo);
     $this->_view->setSuccessMessage($this->_locale->pr("link_added_ok", $myLink->getName()));
     $this->setCommonData();
     // clear the cache
     CacheControl::resetBlogCache($this->_blogInfo->getId(), false);
     // better to return true if everything fine
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:31,代码来源:adminaddlinkaction.class.php


示例13: deleteSidebarModuleOrderData

function deleteSidebarModuleOrderData($dataArray, $sidebarNumber, $modulePos)
{
    $gCacheStorage = globalCacheStorage::getInstance();
    if (!isset($dataArray[$sidebarNumber])) {
        $dataArray[$sidebarNumber] = array();
    }
    array_splice($dataArray[$sidebarNumber], $modulePos, 1);
    CacheControl::flushSkin();
    $gCacheStorage->purge();
    return $dataArray;
}
开发者ID:webhacking,项目名称:Textcube,代码行数:11,代码来源:sidebar.php


示例14: _rejectComments

 /**
  * rejects the comments, and removes from the database from the db
  */
 function _rejectComments()
 {
     $comments = new UnmoderatedComments();
     foreach ($this->_updateComments as $commentId) {
         $comments->deleteComment($commentId);
     }
     $this->_view = new AdminUnmoderatedCommentsview($this->_blogInfo);
     $this->_view->setSuccessMessage($this->_locale->tr("moderate_comments_rejected_ok"));
     $this->setCommonData();
     // clear the cache
     CacheControl::resetBlogCache($this->_blogInfo->getId());
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:16,代码来源:adminupdateunmoderatedcommentsaction.class.php


示例15: _deletePosts

 /**
  * Carries out the specified action
  */
 function _deletePosts()
 {
     // delete the post (it is not physically deleted but rather, we set
     // the status field to 'DELETED'
     $articles = new Articles();
     $errorMessage = "";
     $successMessage = "";
     $totalOk = 0;
     foreach ($this->_postIds as $postId) {
         // get the post
         $post = $articles->getBlogArticle($postId, $this->_blogInfo->getId());
         if ($post) {
             // fire the event
             $this->notifyEvent(EVENT_PRE_POST_DELETE, array("article" => &$post));
             //
             // the next if-else branch allows a site administrator or the blog owner to remove
             // anybody's articles. If not, then users can only remove their own articles
             //
             if ($this->_userInfo->isSiteAdmin() || $this->_blogInfo->getOwner() == $this->_userInfo->getId()) {
                 $result = $articles->deleteArticle($postId, $post->getUser(), $this->_blogInfo->getId(), false);
             } else {
                 $result = $articles->deleteArticle($postId, $this->_userInfo->getId(), $this->_blogInfo->getId(), false);
             }
             if (!$result) {
                 $errorMessage .= $this->_locale->pr("error_deleting_article", $post->getTopic()) . "<br/>";
             } else {
                 $totalOk++;
                 if ($totalOk < 2) {
                     $successMessage .= $this->_locale->pr("article_deleted_ok", $post->getTopic()) . "<br/>";
                 } else {
                     $successMessage = $this->_locale->pr("articles_deleted_ok", $totalOk);
                 }
                 // fire the post event
                 $this->notifyEvent(EVENT_POST_POST_DELETE, array("article" => &$post));
             }
         } else {
             $errorMessage .= $this->_locale->pr("error_deleting_article2", $postId) . "<br/>";
         }
     }
     // clean up the cache
     CacheControl::resetBlogCache($this->_blogInfo->getId());
     $this->_view = new AdminPostsListView($this->_blogInfo);
     if ($errorMessage != "") {
         $this->_view->setErrorMessage($errorMessage);
     }
     if ($successMessage != "") {
         $this->_view->setSuccessMessage($successMessage);
     }
     $this->setCommonData();
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:54,代码来源:admindeletepostaction.class.php


示例16: _deleteArticleCategories

 /**
  * @private
  * removes categories from the database
  */
 function _deleteArticleCategories()
 {
     $categories = new ArticleCategories();
     $errorMessage = "";
     $successMessage = "";
     $totalOk = 0;
     foreach ($this->_categoryIds as $categoryId) {
         // get the category
         $category = $categories->getCategory($categoryId, $this->_blogInfo->getId());
         if ($category) {
             // get how many articles it has
             //$numArticles = $categories->getNumArticlesCategory( $categoryId );
             $numArticles = $category->getNumArticles(POST_STATUS_ALL);
             // fire the pre-event
             $this->notifyEvent(EVENT_PRE_CATEGORY_DELETE, array("category" => &$category));
             // if it has at least one we can't delete it because then it would break the
             // integrity of our data in the database...
             if ($numArticles > 0) {
                 $errorMessage .= $this->_locale->pr("error_category_has_articles", $category->getName()) . "<br/>";
             } else {
                 // if everything correct, we can proceed and delete it
                 if (!$categories->deleteCategory($categoryId, $this->_blogInfo->getId())) {
                     $errorMessage .= $this->_locale->pr("error_deleting_category") . "<br/>";
                 } else {
                     if ($totalOk < 2) {
                         $successMessage .= $this->_locale->pr("category_deleted_ok", $category->getName()) . "<br/>";
                     } else {
                         $successMessage = $this->_locale->pr("categories_deleted_ok", $totalOk);
                     }
                     // fire the pre-event
                     $this->notifyEvent(EVENT_POST_CATEGORY_DELETE, array("category" => &$category));
                 }
             }
         } else {
             $errorMessage .= $this->_locale->pr("error_deleting_category2", $categoryId) . "<br/>";
         }
     }
     // prepare the view and all the information it needs to know
     $this->_view = new AdminArticleCategoriesListView($this->_blogInfo);
     if ($errorMessage != "") {
         $this->_view->setErrorMessage($errorMessage);
     }
     if ($successMessage != "") {
         // and clear the cache to avoid outdated information
         CacheControl::resetBlogCache($this->_blogInfo->getId(), false);
         $this->_view->setSuccessMessage($successMessage);
     }
     $this->setCommonData();
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:54,代码来源:admindeletearticlecategoryaction.class.php


示例17: perform

 /**
  * perform
  */
 function perform()
 {
     $userId = $this->createUser();
     if (!$userId) {
         return false;
     }
     $blogId = $this->createBlog($userId);
     if (!$blogId) {
         return false;
     }
     // let's assume that everything went fine at this point...
     $this->doneRegister();
     // reset the summary cache, since there's new information to show
     CacheControl::resetSummaryCache();
 }
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:18,代码来源:dofinishregister.class.php


示例18: _deleteReferrers

 /**
  * Carries out the specified action
  */
 function _deleteReferrers()
 {
     $referrers = new Referers();
     $errorMessage = "";
     $successMessage = "";
     $totalOk = 0;
     foreach ($this->_referrerIds as $referrerId) {
         // fetch the referrer
         $referrer = $referrers->getBlogReferer($referrerId, $this->_blogInfo->getId());
         // fire the pre-event
         $this->notifyEvent(EVEN_PRE_REFERRER_DELETE, array("referrer" => &$referrer));
         if (!$referrer) {
             $errorMessage .= $this->_locale->pr("error_deleting_referrer2", $referrerId) . "<br/>";
         } else {
             if (!$referrers->deleteBlogReferer($referrerId, $this->_blogInfo->getId())) {
                 $errorMessage .= $this->_locale->pr("error_deleting_referrer", $referrer->getUrl()) . "<br/>";
             } else {
                 $totalOk++;
                 if ($totalOk < 2) {
                     $successMessage = $this->_locale->pr("referrer_deleted_ok", $referrer->getUrl());
                 } else {
                     $successMessage = $this->_locale->pr("referrers_deleted_ok", $totalOk);
                 }
                 // fire the post-event
                 $this->notifyEvent(EVENT_POST_REFERRER_DELETE, array("referrer" => &$referrer));
                 $clearCache = true;
             }
         }
     }
     if ($clearCache) {
         // clear the cache if needed
         CacheControl::resetBlogCache($this->_blogInfo->getId(), false);
     }
     $this->_view = new AdminReferrersView($this->_blogInfo);
     if ($errorMessage != "") {
         $this->_view->setErrorMessage($errorMessage);
     }
     if ($successMessage != "") {
         $this->_view->setSuccessMessage($successMessage);
     }
     $this->setCommonData();
     // better to return true if everything fine
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:47,代码来源:admindeletereferreraction.class.php


示例19: perform

 /**
  * Carries out the specified action
  */
 function perform()
 {
     // data is fine, we have already validated it
     $this->_linkName = Textfilter::filterAllHTML($this->_request->getValue("linkName"));
     $this->_linkDescription = Textfilter::filterAllHTML($this->_request->getValue("linkDescription"));
     $this->_linkUrl = Textfilter::filterAllHTML($this->_request->getValue("linkUrl"));
     $this->_linkCategoryId = $this->_request->getValue("linkCategoryId");
     $this->_linkId = $this->_request->getValue("linkId");
     $this->_linkFeed = Textfilter::filterAllHTML($this->_request->getValue("linkRssFeed"));
     // fetch the link we're trying to update
     $links = new MyLinks();
     $link = $links->getMyLink($this->_linkId, $this->_blogInfo->getId());
     if (!$link) {
         $this->_view = new AdminLinksListView($this->_blogInfo);
         $this->_view->setErrorMessage($this->_locale->tr("error_fetching_link"));
         $this->setCommonData();
         return false;
     }
     // update the fields
     $link->setName($this->_linkName);
     $link->setDescription($this->_linkDescription);
     $link->setCategoryId($this->_linkCategoryId);
     $link->setUrl($this->_linkUrl);
     $link->setProperties($this->_properties);
     $link->setRssFeed($this->_linkFeed);
     $this->notifyEvent(EVENT_PRE_LINK_UPDATE, array("link" => &$link));
     // and now update it in the database
     if (!$links->updateMyLink($link)) {
         $this->_view = new AdminLinksListView($this->_blogInfo);
         $this->_view->setErrorMessage($this->_locale->tr("error_updating_link"));
         $this->setCommonData();
         return false;
     }
     $this->notifyEvent(EVENT_POST_LINK_UPDATE, array("link" => &$link));
     // clear the cache
     CacheControl::resetBlogCache($this->_blogInfo->getId(), false);
     // and go back to the view with the list of links
     $this->_view = new AdminLinksListView($this->_blogInfo);
     $this->_view->setSuccessMessage($this->_locale->pr("link_updated_ok", $link->getName()));
     $this->setCommonData();
     // better to return true if everything fine
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:46,代码来源:adminupdatelinkaction.class.php


示例20: perform

 /**
  * Carries out the specified action
  */
 function perform()
 {
     $this->_albumId = $this->_request->getValue("albumId");
     $this->_parentId = $this->_request->getValue("parentId");
     $this->_albumName = Textfilter::filterAllHTML($this->_request->getValue("albumName"));
     $this->_albumDescription = Textfilter::filterAllHTML($this->_request->getValue("albumDescription"));
     $this->_showAlbum = $this->_request->getValue("showAlbum");
     if ($this->_showAlbum == "") {
         $this->_showAlbum = 0;
     }
     // fetch the albums for this blog
     $albums = new GalleryAlbums();
     $album = $albums->getAlbum($this->_albumId, $this->_blogInfo->getId());
     if (!$album) {
         $this->_view = new AdminResourcesListView($this->_blogInfo);
         $this->_blogInfo;
         $this->_view->setErrorMessage($this->_locale->tr("error_updating_album"));
         $this->setCommonData();
         return false;
     }
     // update the fields in the object
     $album->setName($this->_albumName);
     $album->setDescription($this->_albumDescription);
     $album->setParentId($this->_parentId);
     $album->setShowAlbum($this->_showAlbum);
     $this->notifyEvent(EVENT_PRE_ALBUM_UPDATE, array("album" => &$album));
     // and update the data in the database
     if (!$albums->updateAlbum($album)) {
         $this->_view = new AdminResourcesListView($this->_blogInfo);
         $this->_blogInfo;
         $this->_view->setErrorMessage($this->_locale->tr("error_updating_album"));
         $this->setCommonData();
         return false;
     }
     $this->_view = new AdminResourcesListView($this->_blogInfo);
     $this->_view->setSuccessMessage($this->_locale->pr("album_updated_ok", $album->getName()));
     $this->notifyEvent(EVENT_POST_ALBUM_UPDATE, array("album" => &$album));
     $this->setCommonData();
     // clear the cache
     CacheControl::resetBlogCache($this->_blogInfo->getId(), false);
     // better to return true if everything fine
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:46,代码来源:adminupdateresourcealbumaction.class.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CacheCore类代码示例发布时间:2022-05-20
下一篇:
PHP Cache类代码示例发布时间:2022-05-20
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap