Exemplo n.º 1
0
use App\ColorGroups;
use App\CoreUtils;
/** @var $heading string */
/** @var $Appearance array */
/** @var $Colors array */
/** @var $Map array */
/** @var $AllColors array */
/** @var $ColorGroups array */
?>
<div id="content">
	<h1>Sprite Color Checker</h1>
	<p><a href="/cg/v/<?php 
echo $Appearance['id'];
?>
"><span class="typcn typcn-arrow-back"></span> Back to appearrance page</a></p>

	<section class="checker">
		<div id="svg-cont"></div>
		<div id="input-cont"><h3>JavaScript is required to use the viewer</h3></div>
	</section>
	<section class="color-list">
		<ul id="colors" class="colors"><?php 
foreach ($ColorGroups as $cg) {
    echo ColorGroups::getHTML($cg, $AllColors, WRAP, NO_COLON, OUTPUT_COLOR_NAMES, FORCE_EXTRA_INFO);
}
?>
</ul>
	</section>
</div>
<?php 
echo CoreUtils::exportVars(array('AppearanceID' => $Appearance['id'], 'AppearanceColors' => $Colors, 'SpriteColorList' => $Map['colors']));
Exemplo n.º 2
0
 foreach ($colors as $c) {
     $c['groupid'] = $Group['groupid'];
     if (!$CGDb->insert('colors', $c)) {
         $colorError = true;
         error_log("Database error triggered by user {$currentUser->id} ({$currentUser->name}) while saving colors: " . $CGDb->getLastError());
     }
 }
 if ($colorError) {
     Response::fail("There were some issues while saving some of the colors. Please let the developer know about this error, so he can look into why this might've happened.");
 }
 $colon = !$AppearancePage;
 $outputNames = $AppearancePage;
 if ($adding) {
     $response = array('cgs' => Appearances::getColorsHTML($Appearance, NOWRAP, $colon, $outputNames));
 } else {
     $response = array('cg' => ColorGroups::getHTML($Group['groupid'], null, NOWRAP, $colon, $outputNames));
 }
 $AppearanceID = $adding ? $Appearance['id'] : $Group['ponyid'];
 if ($major) {
     Logs::action('color_modify', array('ponyid' => $AppearanceID, 'reason' => $reason));
     if ($AppearancePage) {
         $FullChangesSection = isset($_POST['FULL_CHANGES_SECTION']);
         $response['changes'] = CGUtils::getChangesHTML(Updates::get($AppearanceID), $FullChangesSection);
         if ($FullChangesSection) {
             $response['changes'] = str_replace('@', $response['changes'], CGUtils::CHANGES_SECTION);
         }
     } else {
         $response['update'] = Appearances::getUpdatesHTML($AppearanceID);
     }
 }
 CGUtils::clearRenderedImages($AppearanceID, array(CGUtils::CLEAR_PALETTE, CGUtils::CLEAR_PREVIEW));
Exemplo n.º 3
0
		</section>
<?  } ?>
		<section class="color-list">
			<h2 class="admin">Color groups</h2>
			<div class="admin">
				<button class="darkblue typcn typcn-arrow-unsorted reorder-cgs">Re-order groups</button>
				<button class="green typcn typcn-plus create-cg">Create group</button>
			</div>
<?  if ($placehold = Appearances::getPendingPlaceholderFor($Appearance))
		echo $placehold;
	else { ?>
			<ul id="colors" class="colors"><?php
		$CGs = ColorGroups::get($Appearance['id']);
		$AllColors = ColorGroups::getColorsForEach($CGs);
		foreach ($CGs as $cg)
			echo ColorGroups::getHTML($cg, $AllColors, WRAP, NO_COLON, OUTPUT_COLOR_NAMES);
			?></ul>
		</section>
		<?=Appearances::getRelatedHTML(Appearances::getRelated($Appearance['id']))?>
	</div>
<?  } ?>
</div>

<?  $export = array(
		'Color' => $Color,
		'color' => $color,
		'EQG' => $EQG,
		'AppearancePage' => true,
	);
	if (Permission::sufficient('staff'))
		$export = array_merge($export, array(
Exemplo n.º 4
0
 /**
  * Returns the markup of the color list for a specific appearance
  *
  * @param array $Appearance
  * @param bool  $wrap
  * @param bool  $colon
  * @param bool  $colorNames
  *
  * @return string
  */
 static function getColorsHTML($Appearance, bool $wrap = WRAP, $colon = true, $colorNames = false)
 {
     global $CGDb;
     if ($placehold = self::getPendingPlaceholderFor($Appearance)) {
         return $placehold;
     }
     $ColorGroups = ColorGroups::get($Appearance['id']);
     $AllColors = ColorGroups::getColorsForEach($ColorGroups);
     $HTML = '';
     if (!empty($ColorGroups)) {
         foreach ($ColorGroups as $cg) {
             $HTML .= ColorGroups::getHTML($cg, $AllColors, WRAP, $colon, $colorNames);
         }
     }
     return $wrap ? "<ul class='colors'>{$HTML}</ul>" : $HTML;
 }