52 lines
1.3 KiB
PHP
52 lines
1.3 KiB
PHP
<?php
|
|
/**
|
|
* @package CleverOgre
|
|
* @subpackage OgreIssuu
|
|
* @version 0.1.0
|
|
* @since 0.1.0
|
|
*/
|
|
|
|
namespace OgreIssuu\Api;
|
|
|
|
if (!defined('ABSPATH')) exit;
|
|
|
|
use stdClass;
|
|
use lasselehtinen\Issuu\Issuu;
|
|
|
|
class Publications {
|
|
|
|
private Issuu $issuu;
|
|
|
|
public function __construct(Issuu $issuu) {
|
|
$this->issuu = $issuu;
|
|
}
|
|
|
|
public function getPublicationAssetsBySlug(string $slug, array $args = []):stdClass {
|
|
$args = wp_parse_args($args, [
|
|
'assetType' => '',
|
|
'size' => 10,
|
|
'page' => 1,
|
|
'documentPageNumber' => 0.0,
|
|
]);
|
|
if (!$args['documentPageNumber']) unset($args['documentPageNumber']);
|
|
|
|
return $this->issuu->getResponse(method: 'GET', endpoint: "publications/{$slug}/assets", queryParameters: $args);
|
|
}
|
|
|
|
public function getPublicationEmbedBySlug(string $slug, array $args = []):stdClass {
|
|
$args = wp_parse_args($args, [
|
|
'responsive' => true,
|
|
'width' => '100%',
|
|
'height' => '100%',
|
|
'hideIssuuLogo' => false,
|
|
'hideShareButton' => false,
|
|
'showOtherPublications' => false,
|
|
'bgColor' => '',
|
|
'fullScreenShareBgColor' => '',
|
|
]);
|
|
|
|
return $this->issuu->getResponse(method: 'GET', endpoint: "publications/{$slug}/embed", queryParameters: $args);
|
|
}
|
|
|
|
}
|