} CGUtils::renderCMDirectionSVG($Appearance['id'], $Appearance['cm_dir']); case 'json': CGUtils::getSwatchesAI($Appearance); case 'gpl': CGUtils::getSwatchesInkscape($Appearance); } # rendering functions internally call die(), so execution stops above # } $SafeLabel = Appearances::getSafeLabel($Appearance); CoreUtils::fixPath("{$CGPath}/v/{$Appearance['id']}-{$SafeLabel}"); $title = $heading = $Appearance['label']; if ($Appearance['id'] === 0 && $color !== 'color') { $title = str_replace('color', $color, $title); } $Changes = Updates::get($Appearance['id']); $settings = array('title' => "{$title} - {$Color} Guide", 'heading' => $heading, 'view' => "{$do}-single", 'css' => array($do, "{$do}-single"), 'js' => array('jquery.qtip', 'jquery.ctxmenu', $do, "{$do}-single")); if (Permission::sufficient('staff')) { $settings['css'] = array_merge($settings['css'], $GUIDE_MANAGE_CSS); $settings['js'] = array_merge($settings['js'], $GUIDE_MANAGE_JS); } CoreUtils::loadPage($settings); } 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(); }
/** * Returns the markup for the time of last update displayed under an appaerance * * @param int $PonyID * @param bool $wrap * * @return string */ static function getUpdatesHTML($PonyID, $wrap = WRAP) { global $Database; $update = Updates::get($PonyID, MOST_RECENT); if (!empty($update)) { $update = "Last updated " . Time::tag($update['timestamp']); } else { if (!Permission::sufficient('staff')) { return ''; } $update = ''; } return $wrap ? "<div class='update'>{$update}</div>" : $update; }