Remove deprecated Articles factory and view classes
- Deleted the Articles factory class located at autoload/front/factory/class.Articles.php, which was a facade delegating calls to the ArticleRepository and Views for backward compatibility. - Removed the Articles view class located at autoload/front/view/class.Articles.php, which also served as a facade for similar functionality. - Updated the version file to reflect the removal of these classes.
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1,66 +0,0 @@
|
|||||||
<?php
|
|
||||||
namespace front\factory;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* FASADA — deleguje do \Domain\Article\ArticleRepository i \front\Views\Articles
|
|
||||||
* Zachowana dla wstecznej kompatybilności. Nowy kod powinien używać bezpośrednio repo + Views.
|
|
||||||
*/
|
|
||||||
class Articles
|
|
||||||
{
|
|
||||||
static public function generateTableOfContents( $content )
|
|
||||||
{
|
|
||||||
return \front\Views\Articles::generateTableOfContents( $content );
|
|
||||||
}
|
|
||||||
|
|
||||||
static public function processHeaders( $matches )
|
|
||||||
{
|
|
||||||
return \front\Views\Articles::processHeaders( $matches );
|
|
||||||
}
|
|
||||||
|
|
||||||
static public function generateHeadersIds( $text )
|
|
||||||
{
|
|
||||||
return \front\Views\Articles::generateHeadersIds( $text );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function get_image( $article )
|
|
||||||
{
|
|
||||||
return \front\Views\Articles::getImage( $article );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function article_noindex( $article_id )
|
|
||||||
{
|
|
||||||
global $lang;
|
|
||||||
$repo = new \Domain\Article\ArticleRepository( $GLOBALS['mdb'] );
|
|
||||||
return $repo->articleNoindex( (int)$article_id, $lang[0] );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function article_details( $article_id, $lang_id )
|
|
||||||
{
|
|
||||||
$repo = new \Domain\Article\ArticleRepository( $GLOBALS['mdb'] );
|
|
||||||
return $repo->articleDetailsFrontend( (int)$article_id, $lang_id );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function artciles_id( $page_id, $lang_id, $articles_limit, $sort_type, $from )
|
|
||||||
{
|
|
||||||
$repo = new \Domain\Article\ArticleRepository( $GLOBALS['mdb'] );
|
|
||||||
return $repo->articlesIds( (int)$page_id, $lang_id, (int)$articles_limit, (int)$sort_type, (int)$from );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function page_articles_count( $page_id, $lang_id )
|
|
||||||
{
|
|
||||||
$repo = new \Domain\Article\ArticleRepository( $GLOBALS['mdb'] );
|
|
||||||
return $repo->pageArticlesCount( (int)$page_id, $lang_id );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function page_articles( $page, $lang_id, $bs )
|
|
||||||
{
|
|
||||||
$repo = new \Domain\Article\ArticleRepository( $GLOBALS['mdb'] );
|
|
||||||
return $repo->pageArticles( $page, $lang_id, (int)$bs );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function news( $page_id, $limit = 6, $lang_id )
|
|
||||||
{
|
|
||||||
$repo = new \Domain\Article\ArticleRepository( $GLOBALS['mdb'] );
|
|
||||||
return $repo->news( (int)$page_id, (int)$limit, $lang_id );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
<?php
|
|
||||||
namespace front\view;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* FASADA — deleguje do \Domain\Article\ArticleRepository i \front\Views\Articles
|
|
||||||
* Zachowana dla wstecznej kompatybilności. Nowy kod powinien używać bezpośrednio repo + Views.
|
|
||||||
*/
|
|
||||||
class Articles
|
|
||||||
{
|
|
||||||
public static function news( $page_id, $articles )
|
|
||||||
{
|
|
||||||
return \front\Views\Articles::news( $page_id, $articles );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function full_article( $article_id, $lang_id )
|
|
||||||
{
|
|
||||||
$repo = new \Domain\Article\ArticleRepository( $GLOBALS['mdb'] );
|
|
||||||
$article = $repo->articleDetailsFrontend( (int)$article_id, $lang_id );
|
|
||||||
return \front\Views\Articles::fullArticle( $article );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function miniature_articles_list( $page, $lang_id, $bs = 1 )
|
|
||||||
{
|
|
||||||
$repo = new \Domain\Article\ArticleRepository( $GLOBALS['mdb'] );
|
|
||||||
$results = $repo->pageArticles( $page, $lang_id, (int)$bs );
|
|
||||||
|
|
||||||
$articles = [];
|
|
||||||
if ( is_array( $results['articles'] ) ) foreach ( $results['articles'] as $article_id )
|
|
||||||
$articles[] = $repo->articleDetailsFrontend( (int)$article_id, $lang_id );
|
|
||||||
|
|
||||||
return \front\Views\Articles::miniatureArticlesList( $articles, $results['ls'], $bs ?: 1, $page );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function entry_articles_list( $page, $lang_id, $bs = 1 )
|
|
||||||
{
|
|
||||||
$repo = new \Domain\Article\ArticleRepository( $GLOBALS['mdb'] );
|
|
||||||
$results = $repo->pageArticles( $page, $lang_id, (int)$bs );
|
|
||||||
|
|
||||||
$articles = [];
|
|
||||||
if ( is_array( $results['articles'] ) ) foreach ( $results['articles'] as $article_id )
|
|
||||||
$articles[] = $repo->articleDetailsFrontend( (int)$article_id, $lang_id );
|
|
||||||
|
|
||||||
return \front\Views\Articles::entryArticlesList( $articles, $results['ls'], $bs ?: 1, $page );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function full_articles_list( $page, $lang_id, $bs = 1 )
|
|
||||||
{
|
|
||||||
$repo = new \Domain\Article\ArticleRepository( $GLOBALS['mdb'] );
|
|
||||||
$results = $repo->pageArticles( $page, $lang_id, (int)$bs );
|
|
||||||
|
|
||||||
$articles = [];
|
|
||||||
if ( is_array( $results['articles'] ) ) foreach ( $results['articles'] as $article_id )
|
|
||||||
$articles[] = $repo->articleDetailsFrontend( (int)$article_id, $lang_id );
|
|
||||||
|
|
||||||
return \front\Views\Articles::fullArticlesList( $articles, $results['ls'], $bs ?: 1, $page );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,2 +1,4 @@
|
|||||||
F: ../autoload/class.Article.php
|
F: ../autoload/class.Article.php
|
||||||
F: ../autoload/front/factory/class.Settings.php
|
F: ../autoload/front/factory/class.Settings.php
|
||||||
|
F: ../autoload/front/factory/class.Articles.php
|
||||||
|
F: ../autoload/front/view/class.Articles.php
|
||||||
|
|||||||
Reference in New Issue
Block a user