Пример #1
0
 }
 $colorError = false;
 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);
     }