[ Index ] |
|
Code source de LifeType 1.2.4 |
1 <?php 2 3 lt_include( PLOG_CLASS_PATH."class/view/admin/admintemplatedview.class.php" ); 4 lt_include( PLOG_CLASS_PATH."class/dao/blogs.class.php" ); 5 lt_include( PLOG_CLASS_PATH."class/dao/articlecategories.class.php" ); 6 lt_include( PLOG_CLASS_PATH."class/dao/globalarticlecategories.class.php" ); 7 lt_include( PLOG_CLASS_PATH."class/dao/customfields/customfields.class.php" ); 8 lt_include( PLOG_CLASS_PATH."class/config/config.class.php" ); 9 lt_include( PLOG_CLASS_PATH."class/data/timestamp.class.php" ); 10 11 /** 12 * \ingroup View 13 * @private 14 */ 15 class AdminNewPostView extends AdminTemplatedView 16 { 17 18 function AdminNewPostView( $blogInfo ) 19 { 20 $this->AdminTemplatedView( $blogInfo, "newpost" ); 21 } 22 23 function render() 24 { 25 lt_include( PLOG_CLASS_PATH."class/dao/articlestatus.class.php" ); 26 27 // fetch the categories 28 $categories = new ArticleCategories(); 29 $blogSettings = $this->_blogInfo->getSettings(); 30 $categoriesOrder = $blogSettings->getValue( "categories_order" ); 31 $blogCategories = $categories->getBlogCategories( $this->_blogInfo->getId(), 32 false, $categoriesOrder ); 33 34 // global article categories 35 $globalArticleCategories = new GlobalArticleCategories(); 36 $globalCategories = $globalArticleCategories->getGlobalArticleCategories(); 37 38 // get some stuff for the time stamp of the post, which is changeable now 39 //$t = new Timestamp(); 40 $t = Timestamp::getBlogDate( $this->_blogInfo ); 41 $config =& Config::getConfig(); 42 43 // fetch the custom fields, if any, but not including the ones that have been set to "hidden"... 44 $customFields = new CustomFields(); 45 $blogFields = $customFields->getBlogCustomFields( $this->_blogInfo->getId(), false); 46 47 // and put everything in the template 48 $locale = $this->_blogInfo->getLocale(); 49 $this->setValue( "commentsEnabled", $blogSettings->getValue( "comments_enabled" )); 50 $this->setValue( "categories", $blogCategories ); 51 $this->setValue( "globalcategories", $globalCategories ); 52 $this->setValue( "today", $t ); 53 $this->setValue( "months", $locale->getMonthNames()); 54 $this->setValue( "days", $locale->getDayNamesShort()); 55 $this->setValue( "years", Timestamp::getYears()); 56 $this->setValue( "hours", Timestamp::getAllHours()); 57 $this->setValue( "minutes", Timestamp::getAllMinutes()); 58 $this->setValue( "customfields", $blogFields ); 59 $this->setValue( "poststatus", ArticleStatus::getStatusList()); 60 $this->setValue( "sendPings", $config->getValue( "send_xmlrpc_pings_enabled_by_default", true )); 61 $this->setValue( "xmlRpcPingEnabled", $config->getValue( "xmlrpc_ping_enabled", false )); 62 $this->setValue( "autoSaveNewDraftsTimeMillis", $config->getValue( "autosave_new_drafts_time_millis" )); 63 $this->setValue( "xmlHttpRequestSupportEnabled", $config->getValue( "save_drafts_via_xmlhttprequest_enabled" )); 64 if(!$this->getValue("postDateTime")) 65 $this->setValue( "postDateTime", $t->getDay()."/".$t->getMonth()."/".$t->getYear()." ".$t->getHour().":".$t->getMinutes()); 66 67 parent::render(); 68 } 69 } 70 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Nov 26 21:04:15 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |