<commit_before><?php

/*
 * This file is part of the Icybee package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Icybee\Modules\Images\Albums;

class ManageBlock extends \Icybee\Modules\Nodes\ManageBlock
{
	static protected function add_assets(\Brickrouge\Document $document)
	{
		parent::add_assets($document);

		$document->css->add('manage.css');
	}

	public function __construct(Module $module, array $attributes=array())
	{
		parent::__construct
		(
			$module, $attributes + array
			(
				self::T_COLUMNS_ORDER => array('title', 'is_online', 'photos', 'uid', 'modified')
			)
		);
	}

	protected function columns()
	{
		return parent::columns() + array
		(
			'photos' => array
			(
				'label' => 'Photos'
			)
		);
	}

	protected function render_cell_photos($record, $property)
	{
		global $core;

		$html = '';

		$photos = $core->models['images.albums/photos']->filter_by_nid($record->nid)->order('weight');
		$count = $photos->count;
		$photos = $photos->limit(10)->all;

		if ($photos)
		{
			$html .= '<div class="photos"><div class="photos-inner">';

			foreach ($photos as $photo)
			{
				/* @var $image \ICanBoogie\Modules\Images\Image */

				$image = $photo->image;

				$html .= $image->thumbnail('$icon')->to_element
				(
					array
					(
						'data-popover-image' => $image->thumbnail('$popup')->url,
						'class' => null
					)
				);
			}

			$html .= '</div>';

			if ($count > count($photos))
			{
				$html .= '&nbsp;…';<commit_msg> thumbnail version is renamed as<commit_after><?php

/*
 * This file is part of the Icybee package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Icybee\Modules\Images\Albums;

class ManageBlock extends \Icybee\Modules\Nodes\ManageBlock
{
	static protected function add_assets(\Brickrouge\Document $document)
	{
		parent::add_assets($document);

		$document->css->add('manage.css');
	}

	public function __construct(Module $module, array $attributes=array())
	{
		parent::__construct
		(
			$module, $attributes + array
			(
				self::T_COLUMNS_ORDER => array('title', 'is_online', 'photos', 'uid', 'modified')
			)
		);
	}

	protected function columns()
	{
		return parent::columns() + array
		(
			'photos' => array
			(
				'label' => 'Photos'
			)
		);
	}

	protected function render_cell_photos($record, $property)
	{
		global $core;

		$html = '';

		$photos = $core->models['images.albums/photos']->filter_by_nid($record->nid)->order('weight');
		$count = $photos->count;
		$photos = $photos->limit(10)->all;

		if ($photos)
		{
			$html .= '<div class="photos"><div class="photos-inner">';

			foreach ($photos as $photo)
			{
				/* @var $image \ICanBoogie\Modules\Images\Image */

				$image = $photo->image;

				$html .= $image->thumbnail('$icon')->to_element
				(
					array
					(
						'data-popover-image' => $image->thumbnail('$popover')->url,
						'class' => null
					)
				);
			}

			$html .= '</div>';

			if ($count > count($photos))
			{
				$html .= '&nbsp;…';
{'fraction_non_alphanumeric': 0.17847113884555382, 'fraction_numerical': 0.0012480499219968799, 'mean_word_length': 3.3207547169811322, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 55, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5134425', 'n_tokens_mistral': 1305, 'n_tokens_neox': 1080, 'n_words': 228}