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(); }
/** * 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(); }