Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/monara/public_html/test.athavaneng.com/themes.php on line 99
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 226
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 227
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 228
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 229
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 230
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 231
index.php 0000644 00000000006 15073230107 0006356 0 ustar 00 post_author, // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
$args['authorPrecededBy']
);
}
if (isset($args['showCategories']) && $args['showCategories'] === $positionField) {
$text[] = self::getPostCategories(
$post->ID,
$post->post_type, // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
$args['categoriesPrecededBy']
);
}
if (!empty($text)) {
$text = '
' . implode(' ', $text) . '
';
if ($position === 'above') $content = $text . $content;
else if ($position === 'below') $content .= $text;
}
}
return $content;
}
private static function getPostCategories($postId, $postType, $precededBy) {
$precededBy = trim($precededBy);
// Get categories
$categories = WPFunctions::get()->wpGetPostTerms(
$postId,
['category'],
['fields' => 'names']
);
if (!empty($categories)) {
// check if the user specified a label to be displayed before the author's name
if (strlen($precededBy) > 0) {
$content = stripslashes($precededBy) . ' ';
} else {
$content = '';
}
return $content . join(', ', $categories);
} else {
return '';
}
}
private static function getPostAuthor($authorId, $precededBy) {
$authorName = WPFunctions::get()->getTheAuthorMeta('display_name', (int)$authorId);
$precededBy = trim($precededBy);
if (strlen($precededBy) > 0) {
$authorName = stripslashes($precededBy) . ' ' . $authorName;
}
return $authorName;
}
}
PostTransformer.php 0000644 00000012206 15073230107 0010424 0 ustar 00 args = $args;
$this->withLayout = isset($args['withLayout']) ? (bool)filter_var($args['withLayout'], FILTER_VALIDATE_BOOLEAN) : false;
$this->imagePosition = 'left';
if ($extractor === null) {
$extractor = new PostTransformerContentsExtractor($args);
}
$this->extractor = $extractor;
}
public function getDivider() {
if (empty($this->withLayout)) {
return $this->args['divider'];
}
return LayoutHelper::row([
LayoutHelper::col([$this->args['divider']]),
]);
}
public function transform($post) {
if (empty($this->withLayout)) {
return $this->getStructure($post);
}
return $this->getStructureWithLayout($post);
}
private function getStructure($post) {
$content = $this->extractor->getContent($post, true, $this->args['displayType']);
$title = $this->extractor->getTitle($post);
$featuredImage = $this->extractor->getFeaturedImage($post);
$featuredImagePosition = $this->getFeaturedImagePosition($this->extractor->isProduct($post));
if (
$featuredImage
&& $featuredImagePosition === 'belowTitle'
&& (
$this->args['displayType'] !== 'titleOnly'
|| $this->extractor->isProduct($post)
)
) {
array_unshift($content, $title, $featuredImage);
return $content;
}
if ($content[0]['type'] === 'text') {
$content[0]['text'] = $title['text'] . $content[0]['text'];
} else {
array_unshift($content, $title);
}
if ($featuredImage && $this->args['displayType'] !== 'titleOnly') {
array_unshift($content, $featuredImage);
}
return $content;
}
private function getStructureWithLayout($post) {
$withPostClass = $this->args['displayType'] === 'full' || $this->args['displayType'] === 'excerpt';
$content = $this->extractor->getContent($post, $withPostClass, $this->args['displayType']);
$title = $this->extractor->getTitle($post);
$featuredImage = $this->extractor->getFeaturedImage($post);
$featuredImagePosition = $this->getFeaturedImagePosition($this->extractor->isProduct($post));
if (
!$featuredImage
|| $featuredImagePosition === 'none'
|| (
$this->args['displayType'] === 'titleOnly'
&& !$this->extractor->isProduct($post)
)
) {
array_unshift($content, $title);
return [
LayoutHelper::row([
LayoutHelper::col($content),
]),
];
}
$titlePosition = isset($this->args['titlePosition']) ? $this->args['titlePosition'] : '';
if ($featuredImagePosition === 'aboveTitle' || $featuredImagePosition === 'belowTitle') {
$featuredImagePosition = 'centered';
}
if ($featuredImagePosition === 'centered') {
if ($titlePosition === 'aboveExcerpt') {
array_unshift($content, $featuredImage, $title);
} else {
array_unshift($content, $title, $featuredImage);
}
return [
LayoutHelper::row([
LayoutHelper::col($content),
]),
];
}
if ($titlePosition === 'aboveExcerpt') {
array_unshift($content, $title);
}
if ($featuredImagePosition === 'alternate') {
$featuredImagePosition = $this->nextImagePosition();
}
$content = ($featuredImagePosition === 'left')
? [
LayoutHelper::col([$featuredImage]),
LayoutHelper::col($content),
]
: [
LayoutHelper::col($content),
LayoutHelper::col([$featuredImage]),
];
$result = [
LayoutHelper::row($content),
];
if ($titlePosition !== 'aboveExcerpt') {
array_unshift(
$result,
LayoutHelper::row(
[
LayoutHelper::col([$title]),
]
)
);
}
return $result;
}
private function nextImagePosition() {
$this->imagePosition = ($this->imagePosition === 'left') ? 'right' : 'left';
return $this->imagePosition;
}
private function getFeaturedImagePosition(bool $isProduct) {
if ($this->args['displayType'] !== 'full') {
return $this->args['featuredImagePosition'];
}
// For products with display type 'full' use 'featuredImagePosition' if 'fullPostFeaturedImagePosition' not set.
// This is because products always supported images, even for 'full' post display type.
if ($isProduct && empty($this->args['fullPostFeaturedImagePosition'])) {
return $this->args['featuredImagePosition'];
}
// For posts with display type 'full' use 'fullPostFeaturedImagePosition'. This is for back compatibility
// with posts that don't have featured image but contain some value for 'featuredImagePosition' in the DB.
return $this->args['fullPostFeaturedImagePosition'] ?? 'none';
}
}
LayoutHelper.php 0000644 00000001463 15073230107 0007674 0 ustar 00 'container',
'orientation' => 'horizontal',
'styles' => ['block' => $styles],
'blocks' => $blocks,
];
}
public static function col($blocks, $styles = []) {
if (empty($styles['backgroundColor'])) {
$styles['backgroundColor'] = 'transparent';
}
return [
'type' => 'container',
'orientation' => 'vertical',
'styles' => ['block' => $styles],
'blocks' => $blocks,
];
}
}
TitleListTransformer.php 0000644 00000002400 15073230107 0011407 0 ustar 00 args = $args;
}
public function transform($posts) {
$results = array_map(function($post) {
return $this->getPostTitle($post);
}, $posts);
return [
$this->wrap([
'type' => 'text',
'text' => '