Using geshi

2006-03-04 @ 18:52 in Ankapobeny

I will put slowly codes here since this accept geshi

SiteAdminAction( $actionInfo, $request ); // data validation $this->registerFieldValidator( "blogName", new StringValidator()); $this->registerFieldValidator( "blogOwner", new IntegerValidator()); $this->setValidationErrorView( new AdminCreateBlogView( $this->_blogInfo )); } function perform() { // fetch the validated data $this->_blogName = Textfilter::filterAllHTML($this->_request->getValue( "blogName" )); $this->_ownerId = $this->_request->getValue( "blogOwner" ); $this->_blogProperties = $this->_request->getValue( "properties" ); // check that the user really exists $users = new Users(); $userInfo = $users->getUserInfoFromId( $this->_ownerId ); if( !$userInfo ) { $this->_view = new AdminCreateBlogView( $this->_blogInfo ); $this->_form->setFieldValidationStatus( "blogOwner", false ); $this->setCommonData( true ); return false; } // now that we have validated the data, we can proceed to create the user, making // sure that it doesn't already exists $blogs = new Blogs(); $blog = new BlogInfo( $this->_blogName, $this->_ownerId, "", "" ); $blog->setProperties( $this->_blogProperties ); $this->notifyEvent( EVENT_PRE_BLOG_ADD, Array( "blog" => &$blog )); $newBlogId = $blogs->addBlog( $blog ); if( !$newBlogId) { $this->_view = new AdminCreateBlogView( $this->_blogInfo ); $this->_form->setFieldValidationStatus( "blogName", false ); $this->setCommonData(); return false; } // add a default category and a default post $articleCategories = new ArticleCategories(); $articleCategory = new ArticleCategory( "General", "", $newBlogId, true ); $catId = $articleCategories->addArticleCategory( $articleCategory ); $config =& Config::getConfig(); $locale =& Locales::getLocale( $config->getValue( "default_locale" )); $articleTopic = $locale->pr( "register_default_article_topic", $userInfo->user); //$articleTopic = $locale->tr( "register_default_article_topic" ); $articleText = $locale->tr( "register_default_article_text" ); $article = new Article( $articleTopic, $articleText, Array( $catId ), $this->_ownerId, $newBlogId, POST_STATUS_PUBLISHED, 0, Array(), "welcome" ); $t = new Timestamp(); $article->setDateObject( $t ); $articles = new Articles(); $articles->addArticle( $article ); // and inform everyone that everything went ok $this->notifyEvent( EVENT_POST_BLOG_ADD, Array( "blog" => &$blog )); $this->_view = new AdminSiteBlogsListView( $this->_blogInfo ); $this->_view->setSuccessMessage($this->_locale->pr("blog_added_ok", $blog->getBlog())); $this->setCommonData(); return true; } } ?>

Verindrohy (trackback)

Momba ahy
hery

Ho hitanao ato ny isandroko. Angoniko ato mba hovakiako indray any aoriana any :-)

calendar
« Martsa 2020 »
At Ta Ar Ak Zo As Ah
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Rohy
  • Blogroll
Tahiry