Пример #1
0
} else {
    if (preg_match(new RegExp('^sprite(?:-colou?rs)?/(\\d+)(?:-.*)?$'), $data, $_match)) {
        if (!Permission::sufficient('staff')) {
            CoreUtils::notFound();
        }
        $Appearance = $CGDb->where('id', intval($_match[1], 10))->getOne('appearances', 'id,label');
        if (empty($Appearance)) {
            CoreUtils::notFound();
        }
        $Map = CGUtils::getSpriteImageMap($Appearance['id']);
        if (empty($Map)) {
            CoreUtils::notFound();
        }
        $Colors = array();
        foreach (array(0, $Appearance['id']) as $AppearanceID) {
            $ColorGroups = ColorGroups::get($AppearanceID);
            $SortedColorGroups = array();
            foreach ($ColorGroups as $cg) {
                $SortedColorGroups[$cg['groupid']] = $cg;
            }
            $AllColors = ColorGroups::getColorsForEach($ColorGroups);
            foreach ($AllColors as $cg) {
                foreach ($cg as $c) {
                    $Colors[] = array('hex' => $c['hex'], 'label' => $SortedColorGroups[$c['groupid']]['label'] . ' | ' . $c['label']);
                }
            }
        }
        $Colors = array_merge($Colors, array(array('hex' => '#D8D8D8', 'label' => 'Mannequin | Outline'), array('hex' => '#E6E6E6', 'label' => 'Mannequin | Fill'), array('hex' => '#BFBFBF', 'label' => 'Mannequin | Shadow Outline'), array('hex' => '#CCCCCC', 'label' => 'Mannequin | Shdow Fill')));
        $SafeLabel = Appearances::getSafeLabel($Appearance);
        CoreUtils::fixPath("{$CGPath}/sprite/{$Appearance['id']}-{$SafeLabel}");
        CoreUtils::loadPage(array('view' => "{$do}-sprite", 'title' => "Sprite of {$Appearance['label']}", 'css' => "{$do}-sprite", 'js' => "{$do}-sprite"));
Пример #2
0
				$Vector = DeviantArt::getCachedSubmission($Appearance['cm_favme']);
				echo Users::get($Vector['author'],'name','name, avatar_url')->getProfileLink(User::LINKFORMAT_FULL);
			?> and shows which way the cutie mark should be facing.</p>
		</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,
Пример #3
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;
 }