public function noticePackageUploaded(Package $pkg) { $app = $this->app; $package_url = mfwRequest::makeURL("/package?id={$pkg->getId()}"); ob_start(); include APP_ROOT . '/data/notice_mail_template.php'; $body = ob_get_clean(); $addresses = array(); foreach ($this->rows as $r) { if ($r['notify']) { $addresses[] = $r['mail']; } } if (empty($addresses)) { return; } $subject = "New Package Uploaded to {$app->getTitle()}"; $sender = Config::get('mail_sender'); $to = $sender; $header = "From: {$sender}" . "\nBcc: " . implode(', ', $addresses); mb_language('uni'); mb_internal_encoding('UTF-8'); if (!mb_send_mail($to, $subject, $body, $header)) { throw new RuntimeException("mb_send_mail faild (pkg={$pkg->getId()}, {$pkg->getTitle()})"); } }
protected function makePackageArray(Package $pkg) { $tags = array(); foreach ($pkg->getTags() as $t) { $tags[] = $t->getName(); } return array('package_url' => mfwRequest::makeUrl("/package?id={$pkg->getId()}"), 'application_url' => mfwRequest::makeUrl("/app?id={$pkg->getAppId()}"), 'id' => $pkg->getId(), 'platform' => $pkg->getPlatform(), 'title' => $pkg->getTitle(), 'description' => $pkg->getDescription(), 'ios_identifier' => $pkg->getIOSIdentifier(), 'original_file_name' => $pkg->getOriginalFileName(), 'file_size' => $pkg->getFileSize(), 'created' => $pkg->getCreated(), 'tags' => $tags, 'install_count' => $pkg->getInstallCount()); }
//$errors[] = "No title provided"; } else { $title = test_input($_POST['title']); } if (empty($_POST['description'])) { $errors[] = "No description provided"; } else { $description = test_input($_POST['description']); } if (empty($_POST['gear'])) { $errors[] = "No gear in package"; } else { $gearList = $_POST['gear']; } if (empty($errors)) { if (!empty($title) && $title != $pkg->getTitle()) { $pkg->setTitle($title); } if ($description != $pkg->getDescription()) { $pkg->setDescription($description); } $pkg->clearGearList(); foreach ($gearList as $gear) { $pkg->addToGearList($gear); } $pkg->finalizePackage(); $successes[] = "Package updated"; } } ?>
<!DOCTYPE html> <html lang="en"> <head> <!-- INCLUDE BS HEADER INFO --> <?php include 'templates/bs-head.php'; ?> <title>Package Details</title> </head> <body> <!-- IMPORT NAVIGATION & HEADER--> <?php include 'templates/bs-nav.php'; echo printHeader($pkg->getTitle(), NULL); ?> <div class="container"> <div class="row"> <div class="col-sm-8 col-sm-offset-2"> <?php echo "<a href='packages.php'><span class='glyphicon glyphicon-chevron-left'></span> Back to Packages</a>"; ?> <br /><br /> <div class="panel panel-default"> <div class="panel-heading text-center">Package Details</div> <div class="panel-body text-center"> <p> <?php echo "<strong>Package ID:</strong> " . $pkg_id . "<br /><br />";