public function testRenderWithRelatedArticles() { $footer = Footer::create()->withCopyright('2016 Facebook')->withRelatedArticles(RelatedArticles::create()->addRelated(RelatedItem::create()->withURL('http://related.com/1'))->addRelated(RelatedItem::create()->withURL('http://related.com/2'))->addRelated(RelatedItem::create()->withURL('http://sponsored.com/1')->enableSponsored())); $expected = '<footer>' . '<small>' . '2016 Facebook' . '</small>' . '<ul class="op-related-articles">' . '<li><a href="http://related.com/1"></a></li>' . '<li><a href="http://related.com/2"></a></li>' . '<li data-sponsored="true"><a href="http://sponsored.com/1"></a></li>' . '</ul>' . '</footer>'; $rendered = $footer->render(); $this->assertEquals($expected, $rendered); }
public function printHTML() { $this->renderPage(); require_once "/Classes/footer.php"; $Footer = new Footer(); $Footer->renderFooter(); }
public static function isDestroyed(\PDO $pdo_db, string $lang, Reg $tkireg, array $langvars, Smarty $template, array $playerinfo) : bool { // Check for destroyed ship if ($playerinfo['ship_destroyed'] === 'Y') { // if the player has an escapepod, set the player up with a new ship if ($playerinfo['dev_escapepod'] === 'Y') { $sql = "UPDATE ::prefix::ships SET hull=0, engines=0, power=0," . "computer=0, sensors=0, beams=0, torp_launchers=0, torps=0, armor=0, " . "armor_pts=100, cloak=0, shields=0, sector=1, ship_ore=0, " . "ship_organics=0, ship_energy=1000, ship_colonists=0, ship_goods=0, " . "ship_fighters=100, ship_damage=0, on_planet='N', dev_warpedit=0, " . "dev_genesis=0, dev_beacon=0, dev_emerwarp=0, dev_escapepod='N', " . "dev_fuelscoop='N', dev_minedeflector=0, ship_destroyed='N', " . "dev_lssd='N' WHERE email=:email"; $stmt = $pdo_db->prepare($sql); $stmt->bindParam(':email', $_SESSION['username']); $stmt->execute(); Db::logDbErrors($pdo_db, $sql, __LINE__, __FILE__); // $error_status = str_replace('[here]', "<a href='main.php'>" . $langvars['l_here'] . '</a>', $langvars['l_login_died']); Error status is not used anywhere } else { // if the player doesn't have an escapepod - they're dead, delete them. // But we can't delete them yet. (This prevents the self-distruct inherit bug) $error_status = str_replace('[here]', "<a href='log.php'>" . ucfirst($langvars['l_here']) . '</a>', $langvars['l_global_died']) . '<br><br>' . $langvars['l_global_died2']; $error_status .= str_replace('[logout]', "<a href='logout.php'>" . $langvars['l_logout'] . '</a>', $langvars['l_die_please']); $title = $langvars['l_error']; Header::display($pdo_db, $lang, $template, $title); echo $error_status; Footer::display($pdo_db, $lang, $tkireg, $template); die; } } else { return false; } }
function foot() { require_once "foot.php"; //$footer = new Footer; return Footer::format(); //$footer->format();//strict standards prefers <- over -> Footer::format(); for some reason }
public function testInstantArticleAlmostEmpty() { $article = InstantArticle::create()->withCanonicalUrl('')->withHeader(Header::create())->addChild(Paragraph::create()->appendText('Some text to be within a paragraph for testing.'))->addChild(Paragraph::create())->addChild(Paragraph::create()->appendText(" \n \t "))->addChild(Image::create())->addChild(Image::create()->withURL(''))->addChild(SlideShow::create()->addImage(Image::create()->withURL('https://jpeg.org/images/jpegls-home.jpg'))->addImage(Image::create()))->addChild(Ad::create())->addChild(Paragraph::create()->appendText('Other text to be within a second paragraph for testing.'))->addChild(Analytics::create())->withFooter(Footer::create()); $expected = '<!doctype html>' . '<html>' . '<head>' . '<link rel="canonical" href=""/>' . '<meta charset="utf-8"/>' . '<meta property="op:generator" content="facebook-instant-articles-sdk-php"/>' . '<meta property="op:generator:version" content="' . InstantArticle::CURRENT_VERSION . '"/>' . '<meta property="op:markup_version" content="v1.0"/>' . '</head>' . '<body>' . '<article>' . '<p>Some text to be within a paragraph for testing.</p>' . '<figure class="op-slideshow">' . '<figure>' . '<img src="https://jpeg.org/images/jpegls-home.jpg"/>' . '</figure>' . '</figure>' . '<p>Other text to be within a second paragraph for testing.</p>' . '</article>' . '</body>' . '</html>'; $result = $article->render(); $this->assertEquals($expected, $result); }
public static function isGameClosed(\PDO $pdo_db, Reg $tkireg, string $lang, Smarty $template, array $langvars) : bool { if ($tkireg->game_closed) { $title = $langvars['l_login_closed_message']; Header::display($pdo_db, $lang, $template, $title); echo $langvars['l_login_closed_message']; Footer::display($pdo_db, $lang, $tkireg, $template); die; } else { return false; } }
public function init(){ $header = Header::model()->findByPk(1); $footer = Footer::model()->findByPk(1); $this->logoURL = Yii::app()->request->baseUrl.$header->logoURL; $this->smallLogoURL = Yii::app()->request->baseUrl.$header->smallLogoURL; $this->link1 = Yii::app()->request->baseUrl.$header->item1Link; $this->link2 = Yii::app()->request->baseUrl.$header->item2Link; $this->link3 = Yii::app()->request->baseUrl.$header->item3Link; $this->link4 = Yii::app()->request->baseUrl.$header->item4Link; $this->link5 = Yii::app()->request->baseUrl.'/graduate'; //$this->imageSotial = Yii::app()->request->baseUrl.$footer->imageSotial; $this->imageUp = Yii::app()->request->baseUrl.$footer->imageUp; $app = Yii::app(); if (isset($app->session['lg'])) { $app->language = $app->session['lg']; } }
if (!empty($server->tags)) { ?> <div class="tags"> <?php foreach (explode(",", $server->tags) as $tag) { echo '<span class="label">' . $tag . '</span> '; } ?> </div> <?php } ?> <a class="ssh-status btn btn-mini disabled"></a> <div class="container-server-add-ssh-key-instructions"> <a class="btn btn-danger btn-mini btn-server-add-ssh-key-instructions" style="float: right;">Add Public SSH Key</a> </div> </div> <?php } ?> </div> <?php } ?> </div> </div> <?php Footer::render(array("chosen", "code-pretty", "tagsinput", "bootbox", "servers"));
public function save_footer() { $input = Input::all(); $rules = array('footer_preset' => 'required'); $validator = Validator::make(Input::all(), $rules); if ($validator->passes()) { $lastObj = Footer::saveFooter($input); Session::flash('success', 'Save Successfully'); return Response::json(array('success' => TRUE, 'id' => $lastObj, 'label' => $input['footer_preset']), 200); } else { return Redirect::to('objective')->withErrors($validator)->withInput(); } }
echo ucfirst($recipe->interpreter); ?> </td> <td><span class="badge badge-info"><?php echo $recipe->number_of_versions; ?> </span></td> <td><?php echo $recipe->added; ?> </td> <td><?php echo $recipe->modified; ?> </td> </tr> <?php } ?> </tbody> </table> </div> <?php } ?> </div> </div> </div> <?php Footer::render(array("bootbox", "recipes"));
include_once "../footer.php"; exit; } else { $vals = array(); $exist = $_COOKIE["viewasadmin"]; if ($exist != "") { $filecontent = preg_replace("/<{Admin_mode_Setup(.*?)}>/s", "", $filecontent); } else { $filecontent = preg_replace("/<{Admin_mode_Setup}>(.*)<{Admin_mode_Setup}>/s", "", $filecontent); } if ($user_id == 1) { $filecontent = preg_replace("/<{admins_area_(.*?)}>/s", "", $filecontent); } else { $filecontent = preg_replace("/<{admins_area_start}>(.*?)<{admins_area_end}>/s", "", $filecontent); } $path = $common->path; $filecontent = $common->is_module_purchased($db_object, $path, $filecontent, $common->lfvar); $filecontent = $common->is_module_purchased($db_object, $path, $filecontent, $common->pfvar); $filecontent = $common->is_module_purchased($db_object, $path, $filecontent, $common->cavar); $filecontent = $common->is_module_purchased($db_object, $path, $filecontent, $common->covar); $filecontent = $common->direct_replace($db_object, $filecontent, $vals); echo $filecontent; } } } $ftobj = new Footer(); $ftobj->footer_display($common, $db_object, $user_id); ?>
</textarea> <p class="help-block" style="clear: both;">Optional notes and comments you wish to attach to the recipe. <a href="http://daringfireball.net/projects/markdown/">Markdown</a> is supported.</p> </div> </div> <div class="control-group"> <label class="control-label" for="recipe-editor">Recipe</label> <div class="controls"> <textarea id="recipe-editor" name="content"><?php echo $recipe->content; ?> </textarea> <p class="help-block" style="clear: both;"></p> </div> </div> <div class="control-group"> <div class="controls"> <a class="btn btn-primary" id="edit-recipe-submit" onclick="validate_edit_recipe();"><i class="icon-ok-sign icon-white"></i> Update Recipe</a> <a class="btn" href="<?php echo Links::render("view-recipe", array($recipe->id)); ?> ">Cancel</a> </div> </div> </fieldset> </form> </div> </div> </div> <?php Footer::render(array("chosen", "codemirror", "autosize", "edit-recipe"));
/** @var string primary_key the primary key of the table (must be AUTO_INCREMENT) */ $tabledit->primary_key = "id"; /** @var array fields_in_list_view the fields you want to see in "list view" */ $tabledit->fields_in_list_view = $output; /** @var int num_rows_list_view numbers of rows/records in "list view" */ $tabledit->num_rows_list_view = 10; /** @var array fields_required required fields in edit or add record */ //$tabledit->fields_required = array('name'); /** @var string url_base */ $tabledit->url_base = "Vendor/MySQL_table_edit/"; /** @var string url_script */ $tabledit->url_script = "/DataPoint"; /** @var array show_text */ $tabledit->show_text = $showt; ?> <div class="entries"> <div class="entries_inner"> <?php $tabledit->do_it(); ?> </div> </div> <?php /** * initiate page footer */ $footer = new Footer(); /** * display the footer */ $footer->display_footer();
function kitchenSink() { $mail = new Mail(); $email = new Email("DX", "*****@*****.**"); $mail->setFrom($email); $mail->setSubject("Hello World from the SendGrid PHP Library"); $personalization = new Personalization(); $email = new Email("Example User", "*****@*****.**"); $personalization->addTo($email); $email = new Email("Example User", "*****@*****.**"); $personalization->addTo($email); $email = new Email("Example User", "*****@*****.**"); $personalization->addCc($email); $email = new Email("Example User", "*****@*****.**"); $personalization->addCc($email); $email = new Email("Example User", "*****@*****.**"); $personalization->addBcc($email); $email = new Email("Example User", "*****@*****.**"); $personalization->addBcc($email); $personalization->setSubject("Hello World from the SendGrid PHP Library"); $personalization->addHeader("X-Test", "test"); $personalization->addHeader("X-Mock", "true"); $personalization->addSubstitution("%name%", "Example User"); $personalization->addSubstitution("%city%", "Denver"); $personalization->addCustomArg("user_id", "343"); $personalization->addCustomArg("type", "marketing"); $personalization->setSendAt(1443636843); $mail->addPersonalization($personalization); $personalization2 = new Personalization(); $email = new Email("Example User", "*****@*****.**"); $personalization2->addTo($email); $email = new Email("Example User", "*****@*****.**"); $personalization2->addTo($email); $email = new Email("Example User", "*****@*****.**"); $personalization2->addCc($email); $email = new Email("Example User", "*****@*****.**"); $personalization2->addCc($email); $email = new Email("Example User", "*****@*****.**"); $personalization2->addBcc($email); $email = new Email("Example User", "*****@*****.**"); $personalization2->addBcc($email); $personalization2->setSubject("Hello World from the SendGrid PHP Library"); $personalization2->addHeader("X-Test", "test"); $personalization2->addHeader("X-Mock", "true"); $personalization2->addSubstitution("%name%", "Example User"); $personalization2->addSubstitution("%city%", "Denver"); $personalization2->addCustomArg("user_id", "343"); $personalization2->addCustomArg("type", "marketing"); $personalization2->setSendAt(1443636843); $mail->addPersonalization($personalization2); $content = new Content("text/plain", "some text here"); $mail->addContent($content); $content = new Content("text/html", "<html><body>some text here</body></html>"); $mail->addContent($content); $attachment = new Attachment(); $attachment->setContent("TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gQ3JhcyBwdW12"); $attachment->setType("application/pdf"); $attachment->setFilename("balance_001.pdf"); $attachment->setDisposition("attachment"); $attachment->setContentId("Balance Sheet"); $mail->addAttachment($attachment); $attachment2 = new Attachment(); $attachment2->setContent("BwdW"); $attachment2->setType("image/png"); $attachment2->setFilename("banner.png"); $attachment2->setDisposition("inline"); $attachment2->setContentId("Banner"); $mail->addAttachment($attachment2); $mail->setTemplateId("439b6d66-4408-4ead-83de-5c83c2ee313a"); # This must be a valid [batch ID](https://sendgrid.com/docs/API_Reference/SMTP_API/scheduling_parameters.html) to work # $mail->setBatchID("sengrid_batch_id"); $mail->addSection("%section1%", "Substitution Text for Section 1"); $mail->addSection("%section2%", "Substitution Text for Section 2"); $mail->addHeader("X-Test1", "1"); $mail->addHeader("X-Test2", "2"); $mail->addCategory("May"); $mail->addCategory("2016"); $mail->addCustomArg("campaign", "welcome"); $mail->addCustomArg("weekday", "morning"); $mail->setSendAt(1443636842); $asm = new ASM(); $asm->setGroupId(99); $asm->setGroupsToDisplay([4, 5, 6, 7, 8]); $mail->setASM($asm); $mail->setIpPoolName("23"); $mail_settings = new MailSettings(); $bcc_settings = new BccSettings(); $bcc_settings->setEnable(true); $bcc_settings->setEmail("*****@*****.**"); $mail_settings->setBccSettings($bcc_settings); $sandbox_mode = new SandBoxMode(); $sandbox_mode->setEnable(true); $mail_settings->setSandboxMode($sandbox_mode); $bypass_list_management = new BypassListManagement(); $bypass_list_management->setEnable(true); $mail_settings->setBypassListManagement($bypass_list_management); $footer = new Footer(); $footer->setEnable(true); $footer->setText("Footer Text"); $footer->setHtml("<html><body>Footer Text</body></html>"); $mail_settings->setFooter($footer); $spam_check = new SpamCheck(); $spam_check->setEnable(true); $spam_check->setThreshold(1); $spam_check->setPostToUrl("https://spamcatcher.sendgrid.com"); $mail_settings->setSpamCheck($spam_check); $mail->setMailSettings($mail_settings); $tracking_settings = new TrackingSettings(); $click_tracking = new ClickTracking(); $click_tracking->setEnable(true); $click_tracking->setEnableText(true); $tracking_settings->setClickTracking($click_tracking); $open_tracking = new OpenTracking(); $open_tracking->setEnable(true); $open_tracking->setSubstitutionTag("Optional tag to replace with the open image in the body of the message"); $tracking_settings->setOpenTracking($open_tracking); $subscription_tracking = new SubscriptionTracking(); $subscription_tracking->setEnable(true); $subscription_tracking->setText("text to insert into the text/plain portion of the message"); $subscription_tracking->setHtml("<html><body>html to insert into the text/html portion of the message</body></html>"); $subscription_tracking->setSubstitutionTag("Optional tag to replace with the open image in the body of the message"); $tracking_settings->setSubscriptionTracking($subscription_tracking); $ganalytics = new Ganalytics(); $ganalytics->setEnable(true); $ganalytics->setCampaignSource("some source"); $ganalytics->setCampaignTerm("some term"); $ganalytics->setCampaignContent("some content"); $ganalytics->setCampaignName("some name"); $ganalytics->setCampaignMedium("some medium"); $tracking_settings->setGanalytics($ganalytics); $mail->setTrackingSettings($tracking_settings); $reply_to = new ReplyTo("*****@*****.**"); $mail->setReplyTo($reply_to); //echo json_encode($mail, JSON_PRETTY_PRINT), "\n"; return $mail; }
<?php require_once 'includes/common.php'; // do your controller calls include $globs[1] . "application_controller.php"; // calls navigation in //include $globs[1]."homepage_controller.php"; //echo $_SESSION['last_upload']; $title = "Upload Finished"; $meta_keys = ""; $meta_description = ""; $header = Header::compose("Everyone Needs a Blog", $title, $meta_keys, $meta_description, "uploaded"); echo $header; $contents['page_contents'] = '<img src="../blog/media/' . $_SESSION['last_upload'] . '"/>'; //render out your view include 'views/regular_header_view.php'; include 'views/simple_page_view.php'; //hear comes the footer $footer = Footer::foundation("main"); echo $footer;
?> ><?php echo substr($recipe_version->version, 0, 10); if ($recipe_version->id === $head->recipe_version) { ?> (HEAD)<?php } ?> </option> <?php } ?> </select> </li> </ul> </div> </div> </div> <pre class="prettyprint <?php echo $code_pretty_lang; ?> linenums"><?php echo $recipe->content; ?> </pre> </div> </div> </div> <?php Footer::render(array("chosen", "code-pretty", "bootbox", "view-recipe"));
public function renderHome() { require_once "/Classes/databaseHandler.class.php"; $Database = new Database(); $Database->query('SELECT COUNT(wedstrijdID) FROM wedstrijden'); $countWedstrijden = $Database->single(); $Database->query('SELECT COUNT(ID) FROM tijden'); $countTijden = $Database->single(); print ' <div class="container"> <img src="img/logo.png" alt="logo" style="width:400px;height:60px;"> <p> <br> Running Promotion Gelderland heeft sinds januari 2011 een eigen tijdregistratiesysteem, het IPICO Sports-tijdregistratiesysteem.<br> Het voordeel van dit systeem is de accurate tijdwaarneming en de mogelijkheid razendsnel tijden te verwerken. Het systeem is succesvol<br> toegepast bij de London Marathon en is gebruikt bij de Olympische Spelen van 2012. </p> <p><br><a class="btn btn-primary btn-lg" href="?wedstrijden" role="button"><i class="fa fa-search"></i> Bekijk alle wedstrijden</a></p> <p>Wat heeft hardloopuitslagen.nl tot nu toe gedaan?</p> <div class="row"> <div class="col-lg-3 col-md-6"> <div class="panel panel"> <div class="panel-heading"> <div class="row"> <div class="col-xs-3"> <i class="fa fa-calendar fa-5x"></i></i> </div> <div class="col-xs-9 text-right"> <div class="huge">' . $countWedstrijden['COUNT(wedstrijdID)'] . '</div> <div>Evenementen</div> </div> </div> </div> <a href="?wedstrijden"> <div class="panel-footer"> <span class="pull-left">Bekijk alle wedstrijden</span> <span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span> <div class="clearfix"></div> </div> </a> </div> </div> <div class="col-lg-3 col-md-6"> <div class="panel panel"> <div class="panel-heading"> <div class="row"> <div class="col-xs-3"> <i class="fa fa-smile-o fa-5x"></i> </div> <div class="col-xs-9 text-right"> <div class="huge">' . $countTijden['COUNT(ID)'] . '</div> <div>Geregistreerde tijden</div> </div> </div> </div> <a href="?wedstrijden"> <div class="panel-footer"> <span class="pull-left">Bekijk alle wedstrijden</span> <span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span> <div class="clearfix"></div> </div> </a> </div> </div> </div> <p>Klopt er een uitslag niet, heeft u een opmerking of mist u een uitslag? <br> Neem dan contact op met: <a href="mailto:info@hardloopuitslagen.nl">info@hardloopuitslagen.nl</a> </p> </div>'; require_once "/Classes/footer.php"; $Footer = new Footer(); $Footer->renderFooter(); }
/** * Set/get relation Id */ public function testRelationID() { $oFooter = new Footer(0); $iVal = rand(1, 1000); $oFooter->setRelationId($iVal); $this->assertEquals($iVal, $oFooter->getRelationId()); $this->assertEquals(Footer::AUTO, $oFooter->getType()); }
function update($resno = 0, $rebuild = 0) { global $path, $mysql; require_once CORE_DIR . "/postform.php"; require_once CORE_DIR . "/page/head.php"; $postform = new PostForm(); $head = new Head(); $this->update_cache(); //Muh speed increase (for when the function calls itself). Otherwise call Log->update_cache() manually. $find = false; $resno = (int) $resno; $log = $this->cache; if ($resno) { if (!isset($log[$resno])) { $this->update(0, $rebuild); // the post didn't exist, just rebuild the indexes return; } else { if ($log[$resno]['resto']) { $this->update($log[$resno]['resto'], $rebuild); // $resno is a reply, try rebuilding the parent return; } } } if ($resno) { $treeline = array($resno); //if(!$treeline=$mysql->query("select * from ".SQLLOG." where root>0 and no=".$resno." order by root desc")){echo S_SQLFAIL;} } else { $treeline = $log['THREADS']; //if(!$treeline=$mysql->query("select * from ".SQLLOG." where root>0 order by root desc")){echo S_SQLFAIL;} } //Finding the last entry number if (!($result = $mysql->query("select max(no) from " . SQLLOG))) { echo S_SQLFAIL; } $row = $mysql->fetch_array($result); $lastno = (int) $row[0]; $mysql->free_result($result); $counttree = count($treeline); //$counttree=mysql_num_rows($treeline); if (!$counttree) { $logfilename = PHP_SELF2; $dat = $head->generate() . $postform->format($resno); $this->print_page($logfilename, $dat); } if (UPDATE_THROTTLING >= 1) { $update_start = time(); touch("updatelog.stamp", $update_start); $low_priority = false; clearstatcache(); if (@filemtime(PHP_SELF) > $update_start - UPDATE_THROTTLING) { $low_priority = true; //touch($update_start . ".lowprio"); } else { touch(PHP_SELF, $update_start); } // $mt = @filemtime(PHP_SELF); // touch($update_start . ".$mt.highprio"); } //using CACHE_TTL method if (CACHE_TTL >= 1) { if ($resno) { $logfilename = RES_DIR . $resno . PHP_EXT; } else { $logfilename = PHP_SELF2; } //if(USE_GZIP == 1) $logfilename .= '.html'; // if the file has been made and it's younger than CACHE_TTL seconds ago clearstatcache(); if (file_exists($logfilename) && filemtime($logfilename) > time() - CACHE_TTL) { // save the post to be rebuilt later rebuildqueue_add($resno); // if it's a thread, try again on the indexes if ($resno && !$rebuild) { $this->update(); } // and we don't do any more rebuilding on this request return true; } else { // we're gonna update it now, so take it out of the queue rebuildqueue_remove($resno); // and make sure nobody else starts trying to update it because it's too old touch($logfilename); } } for ($page = 0; $page < $counttree; $page += PAGE_DEF) { $head->info['page']['title'] = "/" . BOARD_DIR . "/" . ($resno && !empty($log[$resno]['sub']) ? " - " . $log[$resno]['sub'] : '') . " - " . TITLE; $dat = $head->generate(); $dat .= $postform->format($resno); if (!$resno) { $st = $page; } $dat .= '<form name= "delform" action="' . PHP_SELF_ABS . '" method="post">'; for ($i = $st; $i < $st + PAGE_DEF; $i++) { list($_unused, $no) = each($treeline); if (!$no) { break; } //This won't need needed once the extra fluff is dealt with as we can just use the Index class. require_once CORE_DIR . "/thread/thread.php"; $thread = new Thread(); $thread->inIndex = $resno ? false : true; $dat .= $thread->format($no); // Deletion pending (We'll disable this for now as it currently serves no purpose) /*if (isset($log[$no]['old'])) $dat .= "<span class=\"oldpost\">" . S_OLD . "</span><br>\n"; */ $resline = $log[$no]['children']; ksort($resline); $countres = count($log[$no]['children']); $t = 0; if ($sticky == 1) { $disam = 1; } elseif (defined('REPLIES_SHOWN')) { $disam = REPLIES_SHOWN; } else { $disam = 5; } $s = $countres - $disam; $cur = 1; while ($s >= $cur) { list($row) = each($resline); if ($log[$row]["fsize"] != 0) { $t++; } $cur++; } if ($countres != 0) { reset($resline); } /*possibility for ads after each post*/ $dat .= "</span><br clear=\"left\" /><hr />\n"; if (USE_ADS3) { $dat .= ADS3 . '<hr>'; } if ($resno) { $dat .= "[<a href='" . PHP_SELF2_ABS . "'>" . S_RETURN . "</a>] [<a href='{$resno}" . PHP_EXT . "#top'>Top</a>]<hr>"; } clearstatcache(); //clear stat cache of a file //mysql_free_result($resline); $p++; if ($resno) { break; } //only one tree line at time of res } //afterPosts div is closed in general/foot.php $dat .= '<div class="afterPosts" /><table align="right"><tr><td class="delsettings" nowrap="nowrap" align="center"> <input type="hidden" name="mode" value="usrdel" />' . S_REPDEL . '[<input type="checkbox" name="onlyimgdel" value="on" />' . S_DELPICONLY . '] ' . S_DELKEY . '<input type="password" name="pwd" size="8" maxlength="8" value="" /> <input type="submit" value="' . S_DELETE . '" /><input type="button" value="Report" onclick="var o=document.getElementsByTagName(\'INPUT\');for(var i=0;i<o.length;i++)if(o[i].type==\'checkbox\' && o[i].checked && o[i].value==\'delete\') return reppop(\'' . PHP_SELF_ABS . '?mode=report&no=\'+o[i].name+\'\');"></tr></td></form><script>document.delform.pwd.value=l("saguaro_delpass");</script></td></tr></table>'; /*<script language="JavaScript" type="script"><!-- l(); //--></script>';*/ //Delete this after implementing Index class. if (!$resno) { // if not in reply to mode $prev = $st - PAGE_DEF; $next = $st + PAGE_DEF; // Page processing $dat .= "<table align=left border=1 class=pages><tr>"; if ($prev >= 0) { if ($prev == 0) { $dat .= "<form action=\"" . PHP_SELF2 . "\" method=\"get\" /><td>"; } else { $dat .= "<form action=\"" . $prev / PAGE_DEF . PHP_EXT . "\" method=\"get\"><td>"; } $dat .= "<input type=\"submit\" value=\"" . S_PREV . "\" />"; $dat .= "</td></form>"; } else { $dat .= "<td>" . S_FIRSTPG . "</td>"; } $dat .= "<td>"; for ($i = 0; $i < $counttree; $i += PAGE_DEF) { if ($i && !($i % (PAGE_DEF * 2))) { $dat .= " "; } if ($st == $i) { $dat .= "[" . $i / PAGE_DEF . "] "; } else { if ($i == 0) { $dat .= "[<a href=\"" . PHP_SELF2 . "\">0</a>] "; } else { $dat .= "[<a href=\"" . $i / PAGE_DEF . PHP_EXT . "\">" . $i / PAGE_DEF . "</a>] "; } } } $dat .= "</td>"; if ($p >= PAGE_DEF && $counttree > $next) { $dat .= "<td><form action=\"" . $next / PAGE_DEF . PHP_EXT . "\" method=\"get\">"; $dat .= "<input type=\"submit\" value=\"" . S_NEXT . "\" />"; $dat .= "</form></td>"; } else { $dat .= "<td>" . S_LASTPG . "</td>"; } $dat .= "</tr></table><br clear=\"all\" />\n"; } else { $dat .= "<br />"; } //end delete require_once CORE_DIR . "/page/foot.php"; $foot = new Footer(); $dat .= $foot->format(); if ($resno) { $logfilename = RES_DIR . $resno . PHP_EXT; $this->print_page($logfilename, $dat); $dat = ''; if (!$rebuild) { $deferred = $this->update(0); } break; } if ($page == 0) { $logfilename = PHP_SELF2; } else { $logfilename = $page / PAGE_DEF . PHP_EXT; } $this->print_page($logfilename, $dat); //chmod($logfilename,0666); } //mysql_free_result($treeline); if (isset($deferred)) { return $deferred; } return false; }
public function RenderPage() { print ' <link href="css/bootstrap.css" rel="stylesheet"> <link href="css/half-slider.css" rel="stylesheet"> <title>Wedstrijden - Hardloopuitslagen.nl</title>'; require_once "/Classes/header.php"; $Header = new Header(); $Header->renderHeader(); print ' <div id="clickTable" class="container"> <h1> Wedstrijden </h1> <table id = "myTable"class="table"> <thead> <tr> <th>Naam <i class="fa fa-sort" ></i></th> <th>Datum <i class="fa fa-sort" ></i></th> <th>Locatie <i class="fa fa-sort" ></i></th> <th>Media</th> <th>Open</th> </tr></thead>'; require_once "/Classes/databaseHandler.class.php"; $Database = new Database(); foreach ($this->wedstrijden as $key) { $Database->query('SELECT video, foto, cert, stats FROM wedstrijden WHERE wedstrijdID=?'); $Database->bind(1, $key['wedstrijdID']); $media = $Database->single(); print '<tr><td><img src="img/runner.png" height="25" width="30"> ' . $key['name'] . ' </td>'; print '<td>' . $key['date'] . ' </td>'; print '<td>' . $key['location'] . ' </td><td>'; if (!empty($media['stats'])) { print " <i class='fa fa-line-chart'></i>"; } if (!empty($media['video'])) { print " <i class='fa fa-video-camera'></i>"; } if (!empty($media['foto'])) { print " <i class='fa fa-camera'</a>"; } if (!empty($media['cert'])) { print " <i class='fa fa-certificate''></a></td>"; } print ' <td><a class="fa fa-folder-open-o" href="?wedstrijd&show=' . $key['wedstrijdID'] . '"</td></tr>'; } print ' </table> </div> <script> $(".carousel").carousel({ interval: 5000 //changes the speed }) $(document).ready(function() { $("#clickTable tr").click(function() { var href = $(this).find("a").attr("href"); if(href) { window.location = href; } }); }); </script> <script language="JavaScript" type="text/javascript"> $(document).ready(function() { $("#myTable").tablesorter(); } ); </script> '; require_once "/Classes/footer.php"; $Footer = new Footer(); $Footer->renderFooter(); }
?> </option> <?php } ?> </select> <p class="help-block">The recipe to execute.</p> </div> </div> <div class="control-group"> <label class="control-label" for="execute-notes">Notes</label> <div class="controls"> <textarea id="execute-notes" name="notes"></textarea> <p class="help-block" style="clear: both;">Optional notes and comments you wish to attach to this execution. <a href="http://daringfireball.net/projects/markdown/">Markdown</a> is supported.</p> </div> </div> <div class="control-group"> <div class="controls"> <a class="btn btn-primary" onclick="validate_execute();" id="execute-btn"><i class="icon-ok-sign icon-white"></i> Execute</a> </div> </div> </form> </div> </div> </div> <div class="row" id="execute-results-container"></div> <?php Footer::render(array("chosen", "codemirror", "highlight", "autosize", "execute"));
/** * Sends a JSON response to the browser * * @return void */ private function _ajaxResponse() { if (!isset($this->_JSON['message'])) { $this->_JSON['message'] = $this->_getDisplay(); } else { if ($this->_JSON['message'] instanceof Message) { $this->_JSON['message'] = $this->_JSON['message']->getDisplay(); } } if ($this->_isSuccess) { $this->_JSON['success'] = true; } else { $this->_JSON['success'] = false; $this->_JSON['error'] = $this->_JSON['message']; unset($this->_JSON['message']); } if ($this->_isSuccess) { // Note: the old judge sentence is: // $this->_isAjaxPage && $this->_isSuccess // Removal the first, because console need log all queries $this->addJSON('_title', $this->getHeader()->getTitleTag()); if (isset($GLOBALS['dbi'])) { $menuHash = $this->getHeader()->getMenu()->getHash(); $this->addJSON('_menuHash', $menuHash); $hashes = array(); if (isset($_REQUEST['menuHashes'])) { $hashes = explode('-', $_REQUEST['menuHashes']); } if (!in_array($menuHash, $hashes)) { $this->addJSON('_menu', $this->getHeader()->getMenu()->getDisplay()); } } $this->addJSON('_scripts', $this->getHeader()->getScripts()->getFiles()); $this->addJSON('_selflink', $this->getFooter()->getSelfUrl('unencoded')); $this->addJSON('_displayMessage', $this->getHeader()->getMessage()); $debug = $this->_footer->getDebugMessage(); if (empty($_REQUEST['no_debug']) && mb_strlen($debug)) { $this->addJSON('_debug', $debug); } $errors = $this->_footer->getErrorMessages(); if (mb_strlen($errors)) { $this->addJSON('_errors', $errors); } $promptPhpErrors = $GLOBALS['error_handler']->hasErrorsForPrompt(); $this->addJSON('_promptPhpErrors', $promptPhpErrors); if (empty($GLOBALS['error_message'])) { // set current db, table and sql query in the querywindow // (this is for the bottom console) $query = ''; $maxChars = $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']; if (isset($GLOBALS['sql_query']) && mb_strlen($GLOBALS['sql_query']) < $maxChars) { $query = $GLOBALS['sql_query']; } $this->addJSON('_reloadQuerywindow', array('db' => PMA_ifSetOr($GLOBALS['db'], ''), 'table' => PMA_ifSetOr($GLOBALS['table'], ''), 'sql_query' => $query)); if (!empty($GLOBALS['focus_querywindow'])) { $this->addJSON('_focusQuerywindow', $query); } if (!empty($GLOBALS['reload'])) { $this->addJSON('_reloadNavigation', 1); } $this->addJSON('_params', $this->getHeader()->getJsParams()); } } // Set the Content-Type header to JSON so that jQuery parses the // response correctly. if (!defined('TESTSUITE')) { header('Cache-Control: no-cache'); header('Content-Type: application/json'); } echo json_encode($this->_JSON); }
/** * Display the HTML footer file * @final */ protected final function DisplayFooter() { $footer = new Footer(); $footer->Display($this->footer_images); }
//inicializácia aplikácie require_once "request/init.php"; /* * Základné moduly potrebné pre správny chod aplikácie */ include_once dirname(__FILE__) . "/classes/utils/Menu.php"; //načíta zdrojový kód menu include_once dirname(__FILE__) . "/classes/utils/Header.php"; //načíta modul hlavičky include_once dirname(__FILE__) . "/classes/utils/Footer.php"; //načíta modul päty $menu = new Menu(); //vytvorí hlavné menu programu $header = new Header(); //vytvorí hlavičku programu $footer = new Footer(); //vytvorí pätu programu ?> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <base href="../"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Redakcia internetového časopisu Sedemnástka</title> <link rel="stylesheet" type="text/css" href="redakcia/styles/redakcia.css"> <link rel="stylesheet" type="text/css" href="styles/widgets.css"> <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/themes/humanity/jquery-ui.css"> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/jquery-ui.min.js"></script> <script type="text/javascript" src="redakcia/scripts/redakcia.js"></script> <script type="text/javascript" src="redakcia/scripts/validateForm.js"></script>
?> </a> </li> </ul> </div> </div> </div> <div id="contents-loading" class="progress progress-striped active"> <div class="bar" style="width: 100%;"></div> </div> <div id="execution-history-contents" style="display: none;"> <div style="float: right; position: relative; top: 0px; right: 0px;"> <a href="<?php echo Links::render("download-execution-history", array($execution_history['_id']->__toString())); ?> " class="btn btn-medium"><i class="icon-download-alt"></i> Download JSON</a> <a href="<?php echo Links::render("view-execution-history-raw", array($execution_history['_id']->__toString())); ?> " class="btn btn-medium"><i class="icon-align-left"></i> Raw</a> </div> <pre class="prettyprint linenums"><?php echo htmlentities(@json_encode($execution_history, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)); ?> </pre> </div> </div> </div> </div> <?php Footer::render(array("code-pretty", "zclip", "view-execution-history"));
<div class="btn-group" id="timezone-daylight-savings"> <?php if (isset($settings->data->timezone_daylight_savings) && $settings->data->timezone_daylight_savings === "true") { echo '<a class="btn btn-primary" data-value="true">Yes</a> <a class="btn" data-value="false">No</a>'; } else { echo '<a class="btn" data-value="true">Yes</a> <a class="btn btn-primary" data-value="false">No</a>'; } ?> </div> <p class="help-block">Add one hour to the timezone offset in observance of daylight savings.</p> </div> </div> <div class="control-group"> <div class="controls"> <a class="btn btn-primary" onclick="validate_edit_settings();"><i class="icon-ok-sign icon-white"></i> Save Settings</a> </div> </div> </fieldset> </form> <div class="aes-key"> <i class="icon-lock"></i> Settings are stored <a href="http://en.wikipedia.org/wiki/Advanced_Encryption_Standard" target="_blank">AES</a> encrypted. </div> <div class="clear"></div> </div> </div> </div> <?php Footer::render(array("chosen", "code-pretty", "settings"));
/** * Sends a JSON response to the browser * * @return void */ private function _ajaxResponse() { /* Avoid wrapping in case we're disabled */ if ($this->_isDisabled) { echo $this->_getDisplay(); return; } if (!isset($this->_JSON['message'])) { $this->_JSON['message'] = $this->_getDisplay(); } else { if ($this->_JSON['message'] instanceof Message) { $this->_JSON['message'] = $this->_JSON['message']->getDisplay(); } } if ($this->_isSuccess) { $this->_JSON['success'] = true; } else { $this->_JSON['success'] = false; $this->_JSON['error'] = $this->_JSON['message']; unset($this->_JSON['message']); } if ($this->_isSuccess) { // Note: the old judge sentence is: // $this->_isAjaxPage && $this->_isSuccess // Removal the first, because console need log all queries $this->addJSON('_title', $this->getHeader()->getTitleTag()); if (isset($GLOBALS['dbi'])) { $menuHash = $this->getHeader()->getMenu()->getHash(); $this->addJSON('_menuHash', $menuHash); $hashes = array(); if (isset($_REQUEST['menuHashes'])) { $hashes = explode('-', $_REQUEST['menuHashes']); } if (!in_array($menuHash, $hashes)) { $this->addJSON('_menu', $this->getHeader()->getMenu()->getDisplay()); } } $this->addJSON('_scripts', $this->getHeader()->getScripts()->getFiles()); $this->addJSON('_selflink', $this->getFooter()->getSelfUrl('unencoded')); $this->addJSON('_displayMessage', $this->getHeader()->getMessage()); $debug = $this->_footer->getDebugMessage(); if (empty($_REQUEST['no_debug']) && mb_strlen($debug)) { $this->addJSON('_debug', $debug); } $errors = $this->_footer->getErrorMessages(); if (mb_strlen($errors)) { $this->addJSON('_errors', $errors); } $promptPhpErrors = $GLOBALS['error_handler']->hasErrorsForPrompt(); $this->addJSON('_promptPhpErrors', $promptPhpErrors); if (empty($GLOBALS['error_message'])) { // set current db, table and sql query in the querywindow // (this is for the bottom console) $query = ''; $maxChars = $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']; if (isset($GLOBALS['sql_query']) && mb_strlen($GLOBALS['sql_query']) < $maxChars) { $query = $GLOBALS['sql_query']; } $this->addJSON('_reloadQuerywindow', array('db' => PMA_ifSetOr($GLOBALS['db'], ''), 'table' => PMA_ifSetOr($GLOBALS['table'], ''), 'sql_query' => $query)); if (!empty($GLOBALS['focus_querywindow'])) { $this->addJSON('_focusQuerywindow', $query); } if (!empty($GLOBALS['reload'])) { $this->addJSON('_reloadNavigation', 1); } $this->addJSON('_params', $this->getHeader()->getJsParams()); } } // Set the Content-Type header to JSON so that jQuery parses the // response correctly. PMA_headerJSON(); $result = json_encode($this->_JSON); if ($result === false) { switch (json_last_error()) { case JSON_ERROR_NONE: $error = 'No errors'; break; case JSON_ERROR_DEPTH: $error = 'Maximum stack depth exceeded'; break; case JSON_ERROR_STATE_MISMATCH: $error = 'Underflow or the modes mismatch'; break; case JSON_ERROR_CTRL_CHAR: $error = 'Unexpected control character found'; break; case JSON_ERROR_SYNTAX: $error = 'Syntax error, malformed JSON'; break; case JSON_ERROR_UTF8: $error = 'Malformed UTF-8 characters, possibly incorrectly encoded'; break; case JSON_ERROR_RECURSION: $error = 'One or more recursive references in the value to be encoded'; break; case JSON_ERROR_INF_OR_NAN: $error = 'One or more NAN or INF values in the value to be encoded'; break; case JSON_ERROR_UNSUPPORTED_TYPE: $error = 'A value of a type that cannot be encoded was given'; default: $error = 'Unknown error'; break; } echo json_encode(array('success' => false, 'error' => 'JSON encoding failed: ' . $error)); } else { echo $result; } }
</div> <div class="span3"> <div class="well"> <h1 style="margin-bottom: 10px;"><a href="<?php echo Links::render("recipes"); ?> ">Recipes</a></h1> <p>Recipes are containers of commands that are fully versioned. Recipes can be written in pure shell, bash, perl, python, or node.js.</p> <p><a class="btn btn-primary btn-large" href="<?php echo Links::render("recipes"); ?> ">Recipes »</a></p> </div> </div> <div class="span3"> <div class="well"> <h1 style="margin-bottom: 10px;"><a href="<?php echo Links::render("files"); ?> ">Files</a></h1> <p>Files is a centralized place to store text or binary files and then SCP transfer them to groups of servers via recipes.</p> <p><a class="btn btn-primary btn-large" href="<?php echo Links::render("files"); ?> ">Files »</a></p> </div> </div> </div> <?php Footer::render(array("index"));
<div class="well"> <div class="input-prepend" style="float: right"> <span class="add-on"> <i class="icon-search"></i> </span><input id="filter-files" type="text" class="span3 tip" rel="tooltip" data-placement="top" data-original-title="By id, name or type." maxlength="100" placeholder="Filter Files…" value="" disabled /> </div> <div class="clear"></div> </div> </div> </div> <div class="row"> <div class="span12"> <div class="well"> <div id="files-did-you-know" class="alert alert-info fade in" style="display: none;"> <a class="close" data-dismiss="alert">×</a> <h4>Did you know?</h4> You may upload either <i><strong>text</strong></i> or <i><strong>binary</strong></i> files. Store <strong>configuration</strong> files here. </div> <div id="progress-container"> <div class="progress progress-striped active"> <div class="bar" style="width: 100%;"></div> </div> </div> <div id="table-container" style="display: none;"></div> </div> </div> </div> <?php Footer::render(array("filedrop", "bootbox", "files"));
public function testKitchenSinkExample() { $mail = new Mail(); $email = new Email("DX", "*****@*****.**"); $mail->setFrom($email); $mail->setSubject("Hello World from the SendGrid PHP Library"); $personalization = new Personalization(); $email = new Email("Example User", "*****@*****.**"); $personalization->addTo($email); $email = new Email("Example User", "*****@*****.**"); $personalization->addTo($email); $email = new Email("Example User", "*****@*****.**"); $personalization->addCc($email); $email = new Email("Example User", "*****@*****.**"); $personalization->addCc($email); $email = new Email("Example User", "*****@*****.**"); $personalization->addBcc($email); $email = new Email("Example User", "*****@*****.**"); $personalization->addBcc($email); $personalization->setSubject("Hello World from the SendGrid PHP Library"); $personalization->addHeader("X-Test", "test"); $personalization->addHeader("X-Mock", "true"); $personalization->addSubstitution("%name%", "Example User"); $personalization->addSubstitution("%city%", "Denver"); $personalization->addCustomArg("user_id", "343"); $personalization->addCustomArg("type", "marketing"); $personalization->setSendAt(1443636843); $mail->addPersonalization($personalization); $personalization2 = new Personalization(); $email = new Email("Example User", "*****@*****.**"); $personalization2->addTo($email); $email = new Email("Example User", "*****@*****.**"); $personalization2->addTo($email); $email = new Email("Example User", "*****@*****.**"); $personalization2->addCc($email); $email = new Email("Example User", "*****@*****.**"); $personalization2->addCc($email); $email = new Email("Example User", "*****@*****.**"); $personalization2->addBcc($email); $email = new Email("Example User", "*****@*****.**"); $personalization2->addBcc($email); $personalization2->setSubject("Hello World from the SendGrid PHP Library"); $personalization2->addHeader("X-Test", "test"); $personalization2->addHeader("X-Mock", "true"); $personalization2->addSubstitution("%name%", "Example User"); $personalization2->addSubstitution("%city%", "Denver"); $personalization2->addCustomArg("user_id", "343"); $personalization2->addCustomArg("type", "marketing"); $personalization2->setSendAt(1443636843); $mail->addPersonalization($personalization2); $content = new Content("text/plain", "some text here"); $mail->addContent($content); $content = new Content("text/html", "<html><body>some text here</body></html>"); $mail->addContent($content); $attachment = new Attachment(); $attachment->setContent("TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gQ3JhcyBwdW12"); $attachment->setType("application/pdf"); $attachment->setFilename("balance_001.pdf"); $attachment->setDisposition("attachment"); $attachment->setContentId("Balance Sheet"); $mail->addAttachment($attachment); $attachment2 = new Attachment(); $attachment2->setContent("BwdW"); $attachment2->setType("image/png"); $attachment2->setFilename("banner.png"); $attachment2->setDisposition("inline"); $attachment2->setContentId("Banner"); $mail->addAttachment($attachment2); $mail->setTemplateId("439b6d66-4408-4ead-83de-5c83c2ee313a"); $mail->addSection("%section1%", "Substitution Text for Section 1"); $mail->addSection("%section2%", "Substitution Text for Section 2"); $mail->addHeader("X-Test1", "1"); $mail->addHeader("X-Test2", "2"); $mail->addCategory("May"); $mail->addCategory("2016"); $mail->addCustomArg("campaign", "welcome"); $mail->addCustomArg("weekday", "morning"); $mail->setSendAt(1443636842); $asm = new ASM(); $asm->setGroupId(99); $asm->setGroupsToDisplay([4, 5, 6, 7, 8]); $mail->setASM($asm); $mail->setIpPoolName("23"); $mail_settings = new MailSettings(); $bcc_settings = new BccSettings(); $bcc_settings->setEnable(True); $bcc_settings->setEmail("*****@*****.**"); $mail_settings->setBccSettings($bcc_settings); $sandbox_mode = new SandBoxMode(); $sandbox_mode->setEnable(True); $mail_settings->setSandboxMode($sandbox_mode); $bypass_list_management = new BypassListManagement(); $bypass_list_management->setEnable(True); $mail_settings->setBypassListManagement($bypass_list_management); $footer = new Footer(); $footer->setEnable(true); $footer->setText("Footer Text"); $footer->setHtml("<html><body>Footer Text</body></html>"); $mail_settings->setFooter($footer); $spam_check = new SpamCheck(); $spam_check->setEnable(True); $spam_check->setThreshold(1); $spam_check->setPostToUrl("https://spamcatcher.sendgrid.com"); $mail_settings->setSpamCheck($spam_check); $mail->setMailSettings($mail_settings); $tracking_settings = new TrackingSettings(); $click_tracking = new ClickTracking(); $click_tracking->setEnable(true); $click_tracking->setEnableText(True); $tracking_settings->setClickTracking($click_tracking); $open_tracking = new OpenTracking(); $open_tracking->setEnable(True); $open_tracking->setSubstitutionTag("Optional tag to replace with the open image in the body of the message"); $tracking_settings->setOpenTracking($open_tracking); $subscription_tracking = new SubscriptionTracking(); $subscription_tracking->setEnable(True); $subscription_tracking->setText("text to insert into the text/plain portion of the message"); $subscription_tracking->setHtml("<html><body>html to insert into the text/html portion of the message</body></html>"); $subscription_tracking->setSubstitutionTag("Optional tag to replace with the open image in the body of the message"); $tracking_settings->setSubscriptionTracking($subscription_tracking); $ganalytics = new Ganalytics(); $ganalytics->setEnable(True); $ganalytics->setCampaignSource("some source"); $ganalytics->setCampaignTerm("some term"); $ganalytics->setCampaignContent("some content"); $ganalytics->setCampaignName("some name"); $ganalytics->setCampaignMedium("some medium"); $tracking_settings->setGanalytics($ganalytics); $mail->setTrackingSettings($tracking_settings); $reply_to = new ReplyTo("*****@*****.**"); $mail->setReplyTo($reply_to); $json = json_encode($mail); $this->assertEquals($json, '{"from":{"name":"DX","email":"*****@*****.**"},"personalizations":[{"to":[{"name":"Example User","email":"*****@*****.**"},{"name":"Example User","email":"*****@*****.**"}],"cc":[{"name":"Example User","email":"*****@*****.**"},{"name":"Example User","email":"*****@*****.**"}],"bcc":[{"name":"Example User","email":"*****@*****.**"},{"name":"Example User","email":"*****@*****.**"}],"subject":"Hello World from the SendGrid PHP Library","headers":{"X-Test":"test","X-Mock":"true"},"substitutions":{"%name%":"Example User","%city%":"Denver"},"custom_args":{"user_id":"343","type":"marketing"},"send_at":1443636843},{"to":[{"name":"Example User","email":"*****@*****.**"},{"name":"Example User","email":"*****@*****.**"}],"cc":[{"name":"Example User","email":"*****@*****.**"},{"name":"Example User","email":"*****@*****.**"}],"bcc":[{"name":"Example User","email":"*****@*****.**"},{"name":"Example User","email":"*****@*****.**"}],"subject":"Hello World from the SendGrid PHP Library","headers":{"X-Test":"test","X-Mock":"true"},"substitutions":{"%name%":"Example User","%city%":"Denver"},"custom_args":{"user_id":"343","type":"marketing"},"send_at":1443636843}],"subject":"Hello World from the SendGrid PHP Library","content":[{"type":"text\\/plain","value":"some text here"},{"type":"text\\/html","value":"<html><body>some text here<\\/body><\\/html>"}],"attachments":[{"content":"TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gQ3JhcyBwdW12","type":"application\\/pdf","filename":"balance_001.pdf","disposition":"attachment","content_id":"Balance Sheet"},{"content":"BwdW","type":"image\\/png","filename":"banner.png","disposition":"inline","content_id":"Banner"}],"template_id":"439b6d66-4408-4ead-83de-5c83c2ee313a","sections":{"%section1%":"Substitution Text for Section 1","%section2%":"Substitution Text for Section 2"},"headers":{"X-Test1":"1","X-Test2":"2"},"categories":["May","2016"],"custom_args":{"campaign":"welcome","weekday":"morning"},"send_at":1443636842,"asm":{"group_id":99,"groups_to_display":[4,5,6,7,8]},"ip_pool_name":"23","mail_settings":{"bcc":{"enable":true,"email":"*****@*****.**"},"bypass_list_management":{"enable":true},"footer":{"enable":true,"text":"Footer Text","html":"<html><body>Footer Text<\\/body><\\/html>"},"sandbox_mode":{"enable":true},"spam_check":{"enable":true,"threshold":1,"post_to_url":"https:\\/\\/spamcatcher.sendgrid.com"}},"tracking_settings":{"click_tracking":{"enable":true,"enable_text":true},"open_tracking":{"enable":true,"substitution_tag":"Optional tag to replace with the open image in the body of the message"},"subscription_tracking":{"enable":true,"text":"text to insert into the text\\/plain portion of the message","html":"<html><body>html to insert into the text\\/html portion of the message<\\/body><\\/html>","substitution_tag":"Optional tag to replace with the open image in the body of the message"},"ganalytics":{"enable":true,"utm_source":"some source","utm_medium":"some medium","utm_term":"some term","utm_content":"some content","utm_campaign":"some name"}},"reply_to":{"email":"*****@*****.**"}}'); }