Skip to content

Commit

Permalink
chore: Adds ChangeLog detailing
Browse files Browse the repository at this point in the history
  • Loading branch information
hellopablo committed Aug 19, 2024
1 parent c75cb81 commit dc29e20
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 10 deletions.
17 changes: 16 additions & 1 deletion src/Resource/Area.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

namespace Nails\Cms\Resource;

use Nails\Admin\Interfaces\ChangeLog;
use Nails\Cms\Constants;
use Nails\Cms\Exception\Widget\NotFoundException;
use Nails\Cms\Service\Widget;
Expand All @@ -23,7 +24,7 @@
*
* @package Nails\Cms\Resource
*/
class Area extends Entity
class Area extends Entity implements ChangeLog
{
/** @var string */
public $label;
Expand Down Expand Up @@ -76,4 +77,18 @@ public function render(): string

return $sOut;
}

// --------------------------------------------------------------------------

public static function getChageLogTypeLabel(): string
{
return 'CMS: Area';
}

// --------------------------------------------------------------------------

public static function getChageLogTypeUrl(): string
{
return \Nails\Cms\Admin\Controller\Area::url();
}
}
23 changes: 16 additions & 7 deletions src/Resource/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,16 @@

namespace Nails\Cms\Resource;

use Nails\Cms\Constants;
use Nails\Cms\Exception\Widget\NotFoundException;
use Nails\Admin\Interfaces\ChangeLog;
use Nails\Cms\Model;
use Nails\Cms\Service\Widget;
use Nails\Common\Exception\FactoryException;
use Nails\Common\Resource\Entity;
use Nails\Environment;
use Nails\Factory;

/**
* Class Block
*
* @package Nails\Cms\Resource
*/
class Block extends Entity
class Block extends Entity implements ChangeLog
{
/** @var string */
public $type;
Expand Down Expand Up @@ -62,4 +57,18 @@ public function render(): string
return $this->value ?? '';
}
}

// --------------------------------------------------------------------------

public static function getChageLogTypeLabel(): string
{
return 'CMS: Block';
}

// --------------------------------------------------------------------------

public static function getChageLogTypeUrl(): string
{
return \Nails\Cms\Admin\Controller\Block::url();
}
}
17 changes: 16 additions & 1 deletion src/Resource/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

namespace Nails\Cms\Resource;

use Nails\Admin\Interfaces\ChangeLog;
use Nails\Cms\Constants;
use Nails\Cms\Resource\Menu\Item;
use Nails\Common\Exception\FactoryException;
Expand All @@ -23,7 +24,7 @@
*
* @package Nails\Cms\Resource
*/
class Menu extends Entity
class Menu extends Entity implements ChangeLog
{
/** @var string */
public $slug;
Expand Down Expand Up @@ -59,4 +60,18 @@ public function items(): ?ExpandableField

return $this->items;
}

// --------------------------------------------------------------------------

public static function getChageLogTypeLabel(): string
{
return 'CMS: Menu';
}

// --------------------------------------------------------------------------

public static function getChageLogTypeUrl(): string
{
return \Nails\Cms\Admin\Controller\Menu::url();
}
}
17 changes: 16 additions & 1 deletion src/Resource/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

namespace Nails\Cms\Resource;

use Nails\Admin\Interfaces\ChangeLog;
use Nails\Cms\Constants;
use Nails\Cms\Exception\RenderException;
use Nails\Cms\Resource\Page\Data;
Expand All @@ -22,7 +23,7 @@
*
* @package Nails\Cms\Resource
*/
class Page extends Entity
class Page extends Entity implements ChangeLog
{
/** @var Data */
public $published;
Expand Down Expand Up @@ -126,4 +127,18 @@ public function render(bool $bRenderPublished = true): string
(array) ($bRenderPublished ? $this->published->template_options : $this->draft->template_options),
);
}

// --------------------------------------------------------------------------

public static function getChageLogTypeLabel(): string
{
return 'CMS: Page';
}

// --------------------------------------------------------------------------

public static function getChageLogTypeUrl(): string
{
return \Nails\Cms\Admin\Controller\Pages::url();
}
}

0 comments on commit dc29e20

Please sign in to comment.