-
Notifications
You must be signed in to change notification settings - Fork 0
/
deliverable.php
33 lines (25 loc) · 1010 Bytes
/
deliverable.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
namespace wpdeliverable;
require_once __DIR__."/src/utils/WpUtil.php";
require_once WpUtil::getWpLoadPath();
require_once __DIR__."/src/controller/DeliverableShortcodeController.php";
require_once __DIR__."/src/model/Deliverable.php";
require_once __DIR__."/src/utils/Template.php";
use \Exception;
$slug=str_replace($_SERVER["SCRIPT_NAME"],"",$_SERVER["REQUEST_URI"]);
$slug=str_replace("/","",$slug);
if (!$slug)
exit("Expected slug");
$deliverable=Deliverable::findOneBy("slug",$slug);
if (!$deliverable)
exit("Not found");
$controller=new DeliverableShortcodeController();
$deliverableContent=$controller->deliverable(array(
"slug"=>"submit-your-p5js-game"
));
$template=new Template(__DIR__."/src/template/deliverablestandalone.php");
$template->set("title",$deliverable->title);
$template->set("deliverable",$deliverableContent);
$template->set("base",plugins_url()."/wp-deliverable/");
$template->set("jquerylink",get_site_url()."/wp-includes/js/jquery/jquery.js");
$template->show();