/** * show the contents of the view */ function render() { // load the comments and throw the correct event $comments = new ArticleComments(); $postComments = $comments->getPostComments($this->_article->getId(), COMMENT_ORDER_NEWEST_FIRST, $this->_commentStatus, $this->_page, DEFAULT_ITEMS_PER_PAGE); $this->notifyEvent(EVENT_COMMENTS_LOADED, array("comments", &$postComments)); // number of comments $numPostComments = $comments->getNumPostComments($this->_article->getId(), $this->_commentStatus); if ($this->_commentStatus > -1) { $pagerUrl = "?op=editComments&articleId=" . $this->_article->getId() . "&showStatus=" . $this->_commentStatus . "&page="; } else { $pagerUrl = "?op=editComments&articleId=" . $this->_article->getId() . "&page="; } // calculate the pager url $pager = new Pager($pagerUrl, $this->_page, $numPostComments, DEFAULT_ITEMS_PER_PAGE); // get a list with all the different comment status $statusList = ArticleCommentStatus::getStatusList(true); // and pass all the information to the templates $this->setValue("comments", $postComments); $this->setValue("commentstatus", $statusList); $this->setValue("currentstatus", $this->_commentStatus); // pass the pager to the view $this->setValue("pager", $pager); +$this->setValue("post", $this->_article); parent::render(); }
function render() { $ts = new TemplateSets(); // get all the template sets, without including the global ones $blogTemplateSets = $ts->getBlogTemplateSets($this->_blogInfo->getId(), false); $this->setValue("templates", $blogTemplateSets); parent::render(); }
function render() { // load all the locale files $locales = new Locales(); $siteLocales = $locales->getLocales(); $this->setValue("locales", $siteLocales); parent::render(); }
function render() { // load the list of blogs $blogs = new Blogs(); $siteBlogs = $blogs->getAllBlogs(); $this->setValue('siteblogs', $siteBlogs); $this->setValue('userStatusList', UserStatus::getStatusList()); parent::render(); }
function render() { // get all the users in the site $users = new Users(); $siteUsers = $users->getAllUsers(); $this->notifyEvent(EVENT_USERS_LOADED, array("users" => &$siteUsers)); $this->setValue("siteusers", $siteUsers); parent::render(); }
function render() { // get the users of the blog $users = new Users(); $blogUsers = $users->getBlogUsers($this->_blogInfo->getId(), false); $this->setValue("blogusers", $blogUsers); // no need to do anything else, so... transfer control to the parent view! parent::render(); }
function render() { // load the nested list of albums $albums = new GalleryAlbums(); $userAlbums = $albums->getNestedAlbumList($this->_blogInfo->getId()); $this->notifyEvent(EVENT_ALBUMS_LOADED, array("albums" => &$userAlbums)); $this->setValue("albums", $userAlbums); // let the parent view do its work parent::render(); }
function render() { // get all the albums $albums = new GalleryAlbums(); $userAlbums = $albums->getNestedAlbumList($this->_blogInfo->getId()); $this->notifyEvent(EVENT_ALBUMS_LOADED, array("albums" => &$userAlbums)); $this->setValue("albums", $userAlbums); // transfer control to the parent class parent::render(); }
function render() { // load the nested list of albums // fetch the albums for this blog $albums = new GalleryAlbums(); $blogAlbums = $albums->getNestedAlbumList($this->_blogInfo->getId()); $this->notifyEvent(EVENT_ALBUMS_LOADED, array("albums" => &$blogAlbums)); $this->setValue("albums", $blogAlbums); parent::render(); }
function render() { // get a list with all the global template sets $ts = new TemplateSets(); $globalTemplates = $ts->getGlobalTemplateSets(); $this->setValue("templates", $globalTemplates); $defaultTs = $ts->getDefaultTemplateSet(); $this->setValue("defaultTemplate", $defaultTs->getName()); parent::render(); }
/** * Carries out the specified action */ function render() { // get all the link categories but we have to respect the order that the user asked $order = $this->getValue("showOrder"); $linkCategories = new MyLinksCategories(); $blogLinkCategories = $linkCategories->getMyLinksCategories($this->_blogInfo->getId(), $order); $this->notifyEvent(EVENT_LINK_CATEGORIES_LOADED, array("linkcategories" => &$blogLinkCategories)); // put the data in the view $this->setValue("linkcategories", $blogLinkCategories); parent::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(); }
function render() { // fetch the blogs to which this user belongs $users = new Users(); $userBlogs = $users->getUsersBlogs($this->_user->getId()); $this->notifyEvent(EVENT_BLOGS_LOADED, array('blogs' => &$userBlogs)); // otherwise, transfer it to the template context and let the // template do the rest $this->setValue('edituser', $this->_user); $this->setValue('edituserblogs', $userBlogs); // list of available status $this->setValue('userStatusList', UserStatus::getStatusList()); parent::render(); }
function render() { $referers = new Referers(); $totalReferers = $referers->getBlogTotalReferers($this->_blogInfo->getId(), $this->_article->getId()); $postReferers = $referers->getArticleReferers($this->_article->getId(), $this->_blogInfo->getId(), $this->_page, DEFAULT_ITEMS_PER_PAGE); if (!$blogReferers) { $blogReferers = array(); } // calculate the links to the different pages $pager = new Pager("?op=postStats&postId=" . $this->_article->getId() . "&page=", $this->_page, $totalReferers, DEFAULT_ITEMS_PER_PAGE); $this->setValue("referrers", $postReferers); $this->setValue("pager", $pager); $this->setValue("post", $this->_article); parent::render(); }
/** * load the fields and pass them to the view */ function render() { // load the custom fields that have been defined so far $customFields = new CustomFields(); $blogFields = $customFields->getBlogCustomFields($this->_blogInfo->getId(), true, $this->_page, DEFAULT_ITEMS_PER_PAGE); $this->notifyEvent(EVENT_CUSTOM_FIELDS_LOADED, array("fields" => &$blogFields)); // and the total number of them too $numBlogFields = $customFields->getNumBlogCustomFields($this->_blogInfo->getId()); // create the pager $pager = new Pager("?op=blogCustomFields&page=", $this->_page, $numBlogFields, DEFAULT_ITEMS_PER_PAGE); // and show them $this->setValue("fields", $blogFields); $this->setValue("pager", $pager); return parent::render(); }
function render() { // get the page from the request $this->_page = $this->getCurrentPageFromRequest(); // and the current album $galleryAlbums = new GalleryAlbums(); $galleryResources = new GalleryResources(); if ($this->_albumId > ROOT_ALBUM_ID && $this->_page > 0) { $album = $galleryAlbums->getAlbum($this->_albumId, $this->_blogInfo->getId()); if (!$album || $album == "") { $this->_albumId = ROOT_ALBUM_ID; } else { //$resources = $album->getResources(); $resources = $galleryResources->getUserResources($this->_blogInfo->getId(), $this->_albumId, $this->_resourceType, $this->_page, DEFAULT_ITEMS_PER_PAGE); $numResources = $galleryResources->getNumUserResources($this->_blogInfo->getId(), $this->_albumId, $this->_resourceType); } } else { $albums = $galleryAlbums->getChildAlbums($this->_albumId, $this->_blogInfo->getId()); $resources = array(); } // get a list with the nested albums $userAlbums = $galleryAlbums->getNestedAlbumList($this->_blogInfo->getId()); // event about the albums we just loaded $this->notifyEvent(EVENT_ALBUMS_LOADED, array("albums" => &$userAlbums)); $this->setValue("albumsList", $userAlbums); // fetch some statistics and continue $quotaUsage = GalleryResourceQuotas::getBlogResourceQuotaUsage($this->_blogInfo->getId()); $totalResources = $galleryResources->getNumResources($this->_blogInfo->getId()); $currentQuota = GalleryResourceQuotas::getBlogResourceQuota($this->_blogInfo->getId()); $this->setValue("quotausage", $quotaUsage); $this->setValue("totalresources", $totalResources); $this->setValue("quota", $currentQuota); // and now export info about the albums and so on but only // if we're browsing the first page only (albums do not appear anymore after the first page) $this->setValue("album", $album); if ($this->_albumId > ROOT_ALBUM_ID && $this->_page < 2) { $this->setValue("albums", $album->getChildren()); } else { $this->setValue("albums", $albums); } // event about the resources $this->notifyEvent(EVENT_RESOURCES_LOADED, array("resources" => &$resources)); $this->setValue("resources", $resources); // finally, create and export the pager $pager = new Pager($this->_pagerUrl, $this->_page, $numResources, DEFAULT_ITEMS_PER_PAGE); $this->setValue("pager", $pager); parent::render(); }
function render() { $referers = new Referers(); $totalReferers = $referers->getBlogTotalReferers($this->_blogInfo->getId()); // get the current page $this->_page = $this->getCurrentPageFromRequest(); $blogReferers = $referers->getBlogReferers($this->_blogInfo->getId(), $this->_page, DEFAULT_ITEMS_PER_PAGE); if (!$blogReferers) { $blogReferers = array(); } // calculate the links to the different pages $pager = new Pager("?op=Stats&page=", $this->_page, $totalReferers, DEFAULT_ITEMS_PER_PAGE); $this->setValue("referrers", $blogReferers); $this->setValue("pager", $pager); parent::render(); }
/** * show the contents of the view */ function render() { $trackbacks = new Trackbacks(); // get the trackbacks $postTrackbacks = $trackbacks->getArticleTrackbacks($this->_article->getId(), $this->_page, DEFAULT_ITEMS_PER_PAGE); $this->notifyEvent(EVENT_TRACKBACKS_LOADED, array("trackbacks" => &$postTrackbacks)); $this->setValue("trackbacks", $postTrackbacks); // and the total number of trackbacks $numTrackbacks = $trackbacks->getNumTrackbacksArticle($this->_article->getId()); // create and export the pager to the view $pager = new Pager("?op=editTrackbacks&articleId=" . $this->_article->getId() . "&page=", $this->_page, $numTrackbacks, DEFAULT_ITEMS_PER_PAGE); $this->setValue("pager", $pager); // pass the common data to the templates $this->setValue("post", $this->_article); parent::render(); }
function render() { // fetch the child albums of the current top level album $galleryAlbums = new GalleryAlbums(); $albums = $galleryAlbums->getChildAlbums($this->_albumId, $this->_blogInfo->getId()); // get some info about the parent album if it's different from the // top level album if ($this->_albumId > 0) { $album = $galleryAlbums->getAlbum($this->_albumId, $this->_blogInfo->getId()); } // fetch the albums for this blog $this->setValue("albums", $albums); $this->setValue("albumid", $this->_albumId); $this->setValue("album", $album); parent::render(); }
function render() { // if the section is not correct, then use the default "general" if (!in_array($this->_section, $this->_sections)) { $this->_section = "general"; } // export all the config parameters $config =& Config::getConfig(); $settings = $config->getAsArray(); $this->setValue("settings", $settings); foreach ($settings as $key => $value) { $this->setValue($key, $value); } // set the section too $this->setValue("section", $this->_section); parent::render(); }
function render() { // fetch the categories $categories = new ArticleCategories(); $blogSettings = $this->_blogInfo->getSettings(); $categoriesOrder = $blogSettings->getValue("categories_order"); $blogCategories = $categories->getBlogCategories($this->_blogInfo->getId(), false, $categoriesOrder); // get some stuff for the time stamp of the post, which is changeable now //$t = new Timestamp(); $t = Timestamp::getBlogDate($this->_blogInfo); //$t->toUTC(); // // changes to make plog store its dates with the time difference already // applied, instead of applying it dynamically // $config =& Config::getConfig(); /*if( $config->getValue( "time_difference_calculation" == TIME_DIFFERENCE_CALCULATION_STATIC ) { $blogSettings = $this->_blogInfo->getSettings(); $difference = $blogSettings->getValue( "time_offset" ); $t->setDate( Timestamp::getDateWithOffset( $t->getDate(), $difference ), DATE_FORMAT_TIMESTAMP ); }*/ // fetch the custom fields, if any, but not including the ones that have been set to "hidden"... $customFields = new CustomFields(); $blogFields = $customFields->getBlogCustomFields($this->_blogInfo->getId(), false); // and put everything in the template $locale = $this->_blogInfo->getLocale(); $this->setValue("commentsEnabled", $blogSettings->getValue("comments_enabled")); $this->setValue("categories", $blogCategories); $this->setValue("today", $t); $this->setValue("months", $locale->getMonthNames()); $this->setValue("days", $locale->getDayNamesShort()); $this->setValue("years", Timestamp::getYears()); $this->setValue("hours", Timestamp::getAllHours()); $this->setValue("minutes", Timestamp::getAllMinutes()); $this->setValue("customfields", $blogFields); $this->setValue("poststatus", ArticleStatus::getStatusList()); $this->setValue("sendPings", $config->getValue("send_xmlrpc_pings_enabled_by_default", true)); $this->setValue("xmlRpcPingEnabled", $config->getValue("xmlrpc_ping_enabled", false)); $this->setValue("autoSaveNewDraftsTimeMillis", $config->getValue("autosave_new_drafts_time_millis")); $this->setValue("xmlHttpRequestSupportEnabled", $config->getValue("save_drafts_via_xmlhttprequest_enabled")); $this->setValue("postDateTime", $t->getDay() . "/" . $t->getMonth() . "/" . $t->getYear() . " " . $t->getHour() . ":" . $t->getMinutes()); parent::render(); }
function render() { // get all the link categories $blogSettings = $this->_blogInfo->getSettings(); $linkCategoriesOrder = $blogSettings->getValue("link_categories_order", MYLINKS_CATEGORIES_NO_ORDER); // get the link categories $linkCategories = new MyLinksCategories(); $blogLinkCategories = $linkCategories->getMyLinksCategories($this->_blogInfo->getId(), $linkCategoriesOrder, $this->_page, DEFAULT_ITEMS_PER_PAGE); // get the total number of link categories $numLinkCategories = $linkCategories->getNumMyLinksCategories($this->_blogInfo->getId()); // throw the event $this->notifyEvent(EVENT_LINK_CATEGORIES_LOADED, array("linkcategories" => &$blogLinkCategories)); // create the pager $pager = new Pager("?op=editLinkCategories&page=", $this->_page, $numLinkCategories, DEFAULT_ITEMS_PER_PAGE); // create the view and fill the template context $this->setValue("linkcategories", $blogLinkCategories); $this->setValue("pager", $pager); // transfer control to the parent class parent::render(); }
function render() { // we need to get all the blogs // get the data itself $this->_status = $this->getStatusFromRequest(); $blogs = new Blogs(); $siteBlogs = $blogs->getAllBlogs($this->_status, $this->_page, DEFAULT_ITEMS_PER_PAGE); $numBlogs = $blogs->getNumBlogs($this->_status); if (!$siteBlogs) { $siteBlogs = array(); } // throw the right event $this->notifyEvent(EVENT_BLOGS_LOADED, array("blogs" => &$siteBlogs)); // calculate the links to the different pages $pager = new Pager("?op=editSiteBlogs&status=" . $this->_status . "&page=", $this->_page, $numBlogs, DEFAULT_ITEMS_PER_PAGE); $this->setValue("siteblogs", $siteBlogs); $this->setValue("pager", $pager); $this->setValue("currentstatus", $this->_status); $this->setValue("blogstatus", BlogStatus::getStatusList(true)); // let the parent view do its job parent::render(); }
/** * Carries out the specified action */ function render() { // prepare a few parameters $categories = new ArticleCategories(); $blogSettings = $this->_blogInfo->getSettings(); $categoriesOrder = $blogSettings->getValue("categories_order"); // get the page too $this->_page = $this->getCurrentPageFromRequest(); // retrieve the categories in an paged fashion $totalCategories = $categories->getBlogNumCategories($this->_blogInfo->getId(), true); $blogCategories = $categories->getBlogCategoriesAdmin($this->_blogInfo->getId(), false, $categoriesOrder, $this->_page, DEFAULT_ITEMS_PER_PAGE); if (!$blogCategories) { $blogCategories = array(); } // throw the even in case somebody's waiting for it! $this->notifyEvent(EVENT_CATEGORIES_LOADED, array("categories" => &$blogCategories)); $this->setValue("categories", $blogCategories); // the pager that will be used $pager = new Pager("?op=editArticleCategories&page=", $this->_page, $totalCategories, DEFAULT_ITEMS_PER_PAGE); $this->setValue("pager", $pager); parent::render(); }
function render() { // get the current page $this->_page = $this->getCurrentPageFromRequest(); $this->_status = $this->getStatusFromRequest(); // get the users of the blog $users = new Users(); $siteUsers = $users->getAllUsers($this->_status, true, $this->_page, DEFAULT_ITEMS_PER_PAGE); $numUsers = $users->getNumUsers($this->_status); // in case of problems, empty array... if (!$siteUsers) { $siteUsers = array(); } // notify the event $this->notifyEvent(EVENT_USERS_LOADED, array("users" => &$blogUsers)); // calculate the links to the different pages $pager = new Pager("?op=editSiteUsers&&status=" . $this->_status . "&page=", $this->_page, $numUsers, DEFAULT_ITEMS_PER_PAGE); // and generate the view $this->setValue("siteusers", $siteUsers); $this->setValue("userstatus", UserStatus::getStatusList(true)); $this->setValue("pager", $pager); $this->setValue("currentstatus", $this->_status); parent::render(); }
/** * Carries out the specified action */ function render() { // get the parameters $order = $this->getValue("showOrder"); $categoryId = $this->getValue("showCategory"); // get all the links and throw the event $links = new MyLinks(); $blogLinks = $links->getLinks($this->_blogInfo->getId(), $categoryId, $this->_page, DEFAULT_ITEMS_PER_PAGE); $this->notifyEvent(EVENT_LINKS_LOADED, array("links" => &$blogLinks)); // get the number of links $numLinks = $links->getNumLinks($this->_blogInfo->getId(), $categoryId); // get all the link categories but we have to respect the order that the user asked $linkCategories = new MyLinksCategories(); $blogLinkCategories = $linkCategories->getMyLinksCategories($this->_blogInfo->getId(), $order); $this->notifyEvent(EVENT_LINK_CATEGORIES_LOADED, array("linkcategories" => &$blogLinkCategories)); // prepare the pager $pager = new Pager("?op=editLinks&showCategory={$categoryId}&page=", $this->_page, $numLinks, DEFAULT_ITEMS_PER_PAGE); // put the data in the view $this->setValue("links", $blogLinks); $this->setValue("linkscategories", $blogLinkCategories); $this->setValue("currentcategory", $categoryId); $this->setValue("pager", $pager); parent::render(); }
/** * renders the view */ function render() { // fetch all the articles for edition, but we need to know whether we are trying to // search for some of them or simply filter them based on certain criteria $articles = new Articles(); $posts = $articles->getBlogArticles($this->_blogInfo->getId(), $this->_showMonth, $this->_itemsPerPage, $this->_showCategory, $this->_showStatus, $this->_showUser, 0, $this->_searchTerms, $this->_page); // get the total number of posts $numPosts = $articles->getNumBlogArticles($this->_blogInfo->getId(), $this->_showMonth, $this->_itemsPerPage, $this->_showCategory, $this->_showStatus, $this->_showUser, 0, $this->_searchTerms, $this->_page); //print("number = $numPosts<br/>"); $pager = new Pager("?op=editPosts&showStatus={$this->_showStatus}&showCategory={$this->_showCategory}&showUser={$this->_showUser}&searchTerms={$this->_searchTerms}&page=", $this->_page, $numPosts, $this->_itemsPerPage); $this->setValue("posts", $posts); // throw the even in case somebody is listening to it $this->notifyEvent(EVENT_POSTS_LOADED, array("posts" => &$posts)); // and the categories $categories = new ArticleCategories(); $blogSettings = $this->_blogInfo->getSettings(); $categoriesOrder = $blogSettings->getValue("categories_order"); $blogCategories = $categories->getBlogCategories($this->_blogInfo->getId(), false, $categoriesOrder); $this->notifyEvent(EVENT_CATEGORIES_LOADED, array("categories" => &$blogCategories)); // and all the users that belong to this blog $users = new Users(); $blogUsers = $users->getBlogUsers($this->_blogInfo->getId()); // and all the post status available $postStatusList = ArticleStatus::getStatusList(true); $this->setValue("categories", $blogCategories); // values for the session, so that we can recover the status // of the filters later on in subsequent requests $this->setSessionValue("showCategory", $this->_showCategory); $this->setSessionValue("showStatus", $this->_showStatus); $this->setSessionValue("showUser", $this->_showUser); $this->setSessionValue("showMonth", $this->_showMonth); // values for the view $this->setValue("currentcategory", $this->_showCategory); $this->setValue("currentstatus", $this->_showStatus); $this->setValue("currentuser", $this->_showUser); $this->setValue("currentmonth", $this->_showMonth); $this->setValue("users", $blogUsers); $this->setValue("months", $this->_getMonths()); $this->setValue("poststatus", $postStatusList); $this->setValue("searchTerms", $this->_searchTerms); $this->setValue("pager", $pager); parent::render(); }
function render() { $this->setValue("user", $this->_userInfo); parent::render(); }