Beispiel #1
0
 public static function load()
 {
     //treat url erasing extra parts
     $current_uri = $_SERVER['REQUEST_URI'];
     //keeping a local copy
     ERewriter::$oldurl = $current_uri;
     $matches = array();
     foreach (EConfig::$data['rewrite'] as $key => $value) {
         if (!is_array($value)) {
             ELog::warning("You need to specify a second value as a rewrite rule in rewrite.conf.php");
             return;
         }
         //handle with normal rewrite that
         //permits to have parameters
         if ($value[1] == "normal") {
             $pos = strpos($current_uri, $key);
             //if we found a rewrite rule that can be applied
             if ($pos !== false) {
                 //rewrite only at the very start of the string
                 if ($pos == 0) {
                     //record the allowed key
                     $matches[strlen($key)] = array($key, $value[0]);
                 }
             }
         } else {
             if ($value[1] == "exact") {
                 $current_uri_t = explode("?", $current_uri)[0];
                 if ($current_uri_t == $key) {
                     if (ERewriter::$rewritable) {
                         $rewritten = str_replace($key, $value[0], $current_uri);
                         //TODO FIX HERE
                         //$rewritten = preg_replace("$key", $value, $current_uri, 1);
                         $_SERVER['REQUEST_URI'] = $rewritten;
                         //setting rewritable to false
                         ERewriter::$rewritable = false;
                         break;
                     }
                 }
             }
         }
     }
     if (ERewriter::$rewritable) {
         ksort($matches);
         $matches = array_reverse(array_values($matches));
         if (isset($matches[0])) {
             $rule = $matches[0];
             $rewritten = str_replace($rule[0], $rule[1], $current_uri);
             //TODO FIX HERE FIRST OCCURRENCE
             //$rewritten = preg_replace("$key", $value, $current_uri, 1);
             $_SERVER['REQUEST_URI'] = $rewritten;
         }
     }
 }
Beispiel #2
0
<?php

include "gfx3/lib.php";
$prevpage = EPageProperties::get_previous_page();
$name = EHeaderDataParser::db_post("name");
$type = EHeaderDataParser::db_post("type");
$downloadname1 = EHeaderDataParser::db_post("downloadname1");
$downloadlink1 = EHeaderDataParser::db_post("downloadlink1");
$description = EHeaderDataParser::db_post("description");
$summary = EHeaderDataParser::db_post("summary");
$version = EHeaderDataParser::db_post("version");
$changelog = EHeaderDataParser::db_post("changelog");
$personid = EUser::nick();
$postdata = array("name" => $name, "type" => $type, "downloadname1" => $downloadname1, "downloadlink1" => $downloadlink1, "description" => $description, "summary" => $summary, "version" => $version, "changelog" => $changelog, "personid" => $personid);
$client = new OCSClient(EConfig::$data["ocs"]["host"]);
$client->set_auth_info(EUser::nick(), EUser::password());
$check = $client->post("v1/content/add", $postdata);
if ($check["ocs"]["meta"]["statuscode"] == "100") {
    $id = $check["ocs"]["data"]["content"]["id"];
    //nothing hard insert into gamingfreedom database
    $pname = ERewriter::prettify($name);
    header("Location: game.php/title/{$pname}/id/{$id}");
} else {
    echo $client->get_last_raw_result();
    // redirecting to main page
    $message = $check["ocs"]["meta"]["message"];
    $message = str_replace(" ", "%20", $message);
    //header("Location: $prevpage?e=".$message);
}
Beispiel #3
0
<?php

if (isset($data[0]["ocs"]["data"])) {
    foreach ($data[0]["ocs"]["data"]["content"] as $content) {
        echo "\n\t\t<div class=\"row\">\n\t\t\t<div class=\"col-md-7\">\n\t\t\t\t<a href=\"#\">\n\t\t\t\t\t<img class=\"img-responsive\" src=\"" . $content["preview1"] . "\" alt=\"\">\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t\t<div class=\"col-md-5\">\n\t\t\t\t<h3>" . $content["name"] . "</h3>";
        if (OCSUser::is_logged()) {
            echo "<a href=/plasmastore/publicprofile/" . $content["personid"] . "><h4>" . $content["personid"] . "</h4></a>";
        } else {
            echo "<h4>" . $content["personid"] . "</h4>";
        }
        echo "\n\t\t\t\t<p>" . $content["summary"] . "</p>\n\t\t\t\t<a class=\"btn btn-primary\" href=\"/plasmastore/app_description/show/" . $content["id"] . "/" . ERewriter::prettify($content["name"]) . "\">View Project <span class=\"glyphicon glyphicon-chevron-right\"></span></a>\n\t\t\t\t";
        if (OCSUser::is_logged() && $_COOKIE["login"] == $content["personid"]) {
            echo "<a class=\"btn btn-danger\" href=\"/plasmastore/home/delData/" . $content["id"] . "\">Delete <span class=\"glyphicon glyphicon-trash\"></span></a>";
        }
        echo "\n\t\t\t</div>\n\t\t</div> <hr>";
    }
}
Beispiel #4
0
        EDatabase::unload();
    }
}
$unloader = new EUnloader();
//including all modules
ELoader::loadAllModules();
//loading current website configuration
EConfig::load();
//protecting whole website with auth and enabled
EProtect::load();
//rewrite url if needed
if (EConfig::$data['generic']['rewrite'] == "yes") {
    ERewriter::enable();
    ERewriter::load();
} else {
    ERewriter::disable();
}
//loading get/post
if (EConfig::$data['generic']['protectheaders'] == "yes") {
    EHeaderDataParser::load();
}
//loading database
if (EConfig::$data['generic']['database'] == "yes") {
    EDatabase::load();
}
//loading user system
if (EConfig::$data['generic']['users'] == "yes") {
    OCSUser::client_login();
}
//rendering the page
if (EConfig::$data['generic']['mvc'] == "yes") {
Beispiel #5
0
$page = EHeaderDataParser::db_get("page");
$user = EHeaderDataParser::db_get("user");
if (!$from) {
    $from = "new";
}
if (!$label) {
    $label = "";
}
if (!$page) {
    $page = 1;
}
if (!$user) {
    $user = "";
}
$client = new OCSClient();
$games = $client->get("v1/content/data?search={$label}&page={$page}&pagesize=50&sortmode={$from}&user={$user}");
EStructure::code();
if (isset($games["ocs"]["data"]["content"])) {
    if (isset($games["ocs"]["data"]["content"]["id"])) {
        $game = $games["ocs"]["data"]["content"];
        echo "\n\t\t\t\t<div class=\"span6\">\n\t\t\t\t<div class=\"row\">\n\t\t\t\t <div class=\"span2\"><img src=\"" . $game["preview1"] . "\"></div>\n\t\t\t\t <div class=\"span4\"><h3><a href=\"/game.php/id/" . stripslashes($game["id"]) . "/title/" . ERewriter::prettify(stripslashes($game["name"])) . "\">" . stripslashes($game["name"]) . "</a></h3>\n\t\t\t\t <div class=\"static-rating\" id=\"" . $game["score"] . "_" . $game["id"] . "\"></div>\n\t\t\t\t <p>" . stripslashes($game["summary"]) . "</p>\n\t\t\t\t from <a data-toggle=\"modal\" href=\"#viewSelfProfileModal\" class=\"modalButton\" target=\"/viewProfileModal.php?login="******"personid"] . "\">" . $game["personid"] . "</a>\n\t\t\t\t </div>\n\t\t\t\t </div>\n\t\t\t\t <hr>\n\t\t\t\t </div>";
    } else {
        foreach ($games["ocs"]["data"]["content"] as $game) {
            echo "\n\t\t\t\t<div class=\"span6\">\n\t\t\t\t<div class=\"row\">\n\t\t\t\t <div class=\"span2\"><img src=\"" . $game["preview1"] . "\"></div>\n\t\t\t\t <div class=\"span4\"><h3><a href=\"/game.php/id/" . stripslashes($game["id"]) . "/title/" . ERewriter::prettify(stripslashes($game["name"])) . "\">" . stripslashes($game["name"]) . "</a></h3>\n\t\t\t\t <div class=\"static-rating\" id=\"" . $game["score"] . "_" . $game["id"] . "\"></div>\n\t\t\t\t <p>" . stripslashes($game["summary"]) . "</p>\n\t\t\t\t from <a data-toggle=\"modal\" href=\"#viewSelfProfileModal\" class=\"modalButton\" target=\"/viewProfileModal.php?login="******"personid"] . "\">" . $game["personid"] . "</a>\n\t\t\t\t </div>\n\t\t\t\t </div>\n\t\t\t\t <hr>\n\t\t\t\t </div>";
        }
    }
} else {
    echo "Nothing found :(";
}
EStructure::insert("game_list");
EStructure::unload();
Beispiel #6
0
 public function handle()
 {
     /*
     // overwrite the 404 error page returncode
     header("HTTP/1.0 200 OK");
     */
     if ($_SERVER['REQUEST_METHOD'] == 'GET') {
         $method = 'get';
     } elseif ($_SERVER['REQUEST_METHOD'] == 'PUT') {
         $method = 'put';
         parse_str(file_get_contents("php://input"), $put_vars);
     } elseif ($_SERVER['REQUEST_METHOD'] == 'POST') {
         $method = 'post';
     } else {
         echo 'internal server error: method not supported';
         exit;
     }
     // preprocess url
     $url = ERewriter::oldurl();
     //erasing get params
     $url = explode('?', $url)[0];
     if (substr($url, strlen($url) - 1) != '/') {
         $url .= '/';
     }
     //$ex=str_replace('?', '/?', $url, $uno);
     $ex = explode('/', $url);
     //var_dump($ex);
     // eventhandler
     if (count($ex) == 2) {
         H01_GUI::showtemplate('apidoc');
         // CONFIG
         // apiconfig - GET - CONFIG
     } elseif ($method == 'get' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'config' and count($ex) == 4) {
         $format = $this->readdata('format', 'text');
         $this->config($format);
         // personsearch - GET - PERSON/DATA				parameter als url parameter
     } elseif ($method == 'get' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'person' and strtolower($ex[3]) == 'data' and count($ex) == 5) {
         $format = $this->readdata('format', 'text');
         $username = $this->readdata('name', 'text');
         $country = $this->readdata('country', 'text');
         $city = $this->readdata('city', 'text');
         $description = $this->readdata('description', 'text');
         $pc = $this->readdata('pc', 'text');
         $software = $this->readdata('software', 'text');
         $longitude = $this->readdata('longitude', 'float');
         $latitude = $this->readdata('latitude', 'float');
         $distance = $this->readdata('distance', 'float');
         $attributeapp = $this->readdata('attributeapp', 'text');
         $attributekey = $this->readdata('attributekey', 'text');
         $attributevalue = $this->readdata('attributevalue', 'text');
         $page = $this->readdata('page', 'int');
         $pagesize = $this->readdata('pagesize', 'int');
         if ($pagesize < 1 or $pagesize > 100) {
             $pagesize = 10;
         }
         $this->personsearch($format, $username, $country, $city, $description, $pc, $software, $longitude, $latitude, $distance, $attributeapp, $attributekey, $attributevalue, $page, $pagesize);
         // personget - GET - PERSON/DATA/frank
     } elseif ($method == 'get' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'person' and strtolower($ex[3]) == 'data' and count($ex) == 6) {
         $format = $this->readdata('format', 'text');
         $username = addslashes($ex[4]);
         $this->personget($format, $username);
         // personaccountbalance - GET - PERSON/BALANCE
     } elseif ($method == 'get' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'person' and strtolower($ex[3]) == 'balance' and count($ex) == 5) {
         $format = $this->readdata('format', 'text');
         $this->persongetbalance($format);
         // personget - GET - PERSON/SELF
     } elseif ($method == 'get' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'person' and strtolower($ex[3]) == 'self' and count($ex) == 5) {
         $format = $this->readdata('format', 'text');
         $this->personget($format);
         // personedit - POST - PERSON/EDIT
     } elseif ($method == 'post' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'person' and strtolower($ex[3]) == 'self' and count($ex) == 5) {
         $format = $this->readdata('format', 'text');
         $longitude = $this->readdata('longitude', 'float');
         $latitude = $this->readdata('latitude', 'float');
         $country = $this->readdata('country', 'text');
         $city = $this->readdata('city', 'text');
         $this->personedit($format, $longitude, $latitude, $country, $city);
         // personcheck - POST - PERSON/CHECK
     } elseif ($method == 'post' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'person' and strtolower($ex[3]) == 'check' and count($ex) == 5) {
         $format = $this->readdata('format', 'text');
         $login = $this->readdata('login', 'text');
         $passwd = $this->readdata('password', 'text');
         $this->personcheck($format, $login, $passwd);
         // personadd - POST - PERSON/ADD
     } elseif ($method == 'post' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'person' and strtolower($ex[3]) == 'add' and count($ex) == 5) {
         $format = $this->readdata('format', 'text');
         $login = $this->readdata('login', 'text');
         $passwd = $this->readdata('password', 'text');
         $firstname = $this->readdata('firstname', 'text');
         $lastname = $this->readdata('lastname', 'text');
         $email = $this->readdata('email', 'text');
         $this->personadd($format, $login, $passwd, $firstname, $lastname, $email);
         // persongetea - GET - PERSON/ATTRIBUTES/frank/parley/key
     } elseif ($method == 'get' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'person' and strtolower($ex[3]) == 'attributes' and count($ex) == 8) {
         $format = $this->readdata('format', 'text');
         $username = addslashes($ex[4]);
         $app = addslashes($ex[5]);
         $key = addslashes($ex[6]);
         $this->personattributeget($format, $username, $app, $key);
         // persongetea - GET - PERSON/ATTRIBUTES/frank/parley
     } elseif ($method == 'get' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'person' and strtolower($ex[3]) == 'attributes' and count($ex) == 7) {
         $format = $this->readdata('format', 'text');
         $username = addslashes($ex[4]);
         $app = addslashes($ex[5]);
         $key = '';
         $this->personattributeget($format, $username, $app, $key);
         // persongetea - GET - PERSON/ATTRIBUTES/frank
     } elseif ($method == 'get' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'person' and strtolower($ex[3]) == 'attributes' and count($ex) == 6) {
         $format = $this->readdata('format', 'text');
         $username = addslashes($ex[4]);
         $app = '';
         $key = '';
         $this->personattributeget($format, $username, $app, $key);
         // persondeleteea - POST - PERSON/DELETEATTRIBUTE/app/key
     } elseif ($method == 'post' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'person' and strtolower($ex[3]) == 'deleteattribute' and count($ex) == 7) {
         $format = $this->readdata('format', 'text');
         $app = addslashes($ex[4]);
         $key = addslashes($ex[5]);
         $this->personattributedelete($format, $app, $key);
         // personsetea - POST - PERSON/SETATTRIBUTE/app/key
     } elseif ($method == 'post' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'person' and strtolower($ex[3]) == 'setattribute' and count($ex) == 7) {
         $format = $this->readdata('format', 'text');
         $app = addslashes($ex[4]);
         $key = addslashes($ex[5]);
         $value = $this->readdata('value', 'text');
         $this->personattributeset($format, $app, $key, $value);
         // FAN
         //fanget - GET - FAN/DATA/"contentid" - page,pagesize als url parameter,
     } elseif ($method == 'get' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'fan' and strtolower($ex[3]) == 'data' and count($ex) == 6) {
         $format = $this->readdata('format', 'text');
         $content = addslashes($ex[4]);
         $page = $this->readdata('page', 'int');
         $pagesize = $this->readdata('pagesize', 'int');
         if ($pagesize < 1 or $pagesize > 100) {
             $pagesize = 10;
         }
         $this->fanget($format, $content, $page, $pagesize);
         //isfan - GET - FAN/STATUS/"contentid"
     } elseif ($method == 'get' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'fan' and strtolower($ex[3]) == 'status' and count($ex) == 6) {
         $format = $this->readdata('format', 'text');
         $content = addslashes($ex[4]);
         $this->isfan($format, $content);
         //addfan - POST - FAN/ADD/"contentid"
     } elseif ($method == 'post' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'fan' and strtolower($ex[3]) == 'add' and count($ex) == 6) {
         $format = $this->readdata('format', 'text');
         $content = addslashes($ex[4]);
         $this->addfan($format, $content);
         //removefan - POST - FAN/REMOVE/"contentid"
     } elseif ($method == 'post' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'fan' and strtolower($ex[3]) == 'remove' and count($ex) == 6) {
         $format = $this->readdata('format', 'text');
         $content = addslashes($ex[4]);
         $this->removefan($format, $content);
         // FRIEND
         //friendget - GET - FRIEND/DATA/"personid" - page,pagesize als url parameter,
     } elseif ($method == 'get' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'friend' and strtolower($ex[3]) == 'data' and count($ex) == 6) {
         $format = $this->readdata('format', 'text');
         $username = addslashes($ex[4]);
         $page = $this->readdata('page', 'int');
         $pagesize = $this->readdata('pagesize', 'int');
         if ($pagesize < 1 or $pagesize > 100) {
             $pagesize = 10;
         }
         $this->friendget($format, $username, $page, $pagesize);
         //friendinvite - POST - FRIEND/INVITE/"username"/	 message als url parameter
     } elseif ($method == 'post' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'friend' and strtolower($ex[3]) == 'invite' and count($ex) == 6) {
         $format = $this->readdata('format', 'text');
         $username = addslashes($ex[4]);
         $message = $this->readdata('message', 'text');
         $this->friendinvite($format, $username, $message);
         //friendapprove - POST - FRIEND/APPROVE/"username"/
     } elseif ($method == 'post' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'friend' and strtolower($ex[3]) == 'approve' and count($ex) == 6) {
         $format = $this->readdata('format', 'text');
         $username = addslashes($ex[4]);
         $this->friendapprove($format, $username);
         //frienddecline - POST - FRIEND/DECLINE/"username"/
     } elseif ($method == 'post' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'friend' and strtolower($ex[3]) == 'decline' and count($ex) == 6) {
         $format = $this->readdata('format', 'text');
         $username = addslashes($ex[4]);
         $this->frienddecline($format, $username);
         //friendcancel - POST - FRIEND/CANCEL/"username"/
     } elseif ($method == 'post' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'friend' and strtolower($ex[3]) == 'cancel' and count($ex) == 6) {
         $format = $this->readdata('format', 'text');
         $username = addslashes($ex[4]);
         $this->friendcancel($format, $username);
         //friendcancelinvitation - POST - FRIEND/CANCEL/"username"/
     } elseif ($method == 'post' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'friend' and strtolower($ex[3]) == 'cancelinvitation' and count($ex) == 6) {
         $format = $this->readdata('format', 'text');
         $username = addslashes($ex[4]);
         $this->friendcancelinvitation($format, $username);
         //friendsentinvitations - GET - FRIEND/SENTINVITATIONS/
     } elseif ($method == 'get' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'friend' and strtolower($ex[3]) == 'sentinvitations' and count($ex) == 5) {
         $format = $this->readdata('format', 'text');
         $page = $this->readdata('page', 'int');
         $pagesize = $this->readdata('pagesize', 'int');
         if ($pagesize < 1 or $pagesize > 100) {
             $pagesize = 10;
         }
         $this->friendsentinvitations($format, $page, $pagesize);
         //friendreceivedinvitations - GET - FRIEND/RECEIVEDINVITATIONS/
     } elseif ($method == 'get' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'friend' and strtolower($ex[3]) == 'receivedinvitations' and count($ex) == 5) {
         $format = $this->readdata('format', 'text');
         $page = $this->readdata('page', 'int');
         $pagesize = $this->readdata('pagesize', 'int');
         if ($pagesize < 1 or $pagesize > 100) {
             $pagesize = 10;
         }
         $this->friendreceivedinvitations($format, $page, $pagesize);
         // MESSAGE
         //messagefolders	- GET - MESSAGE/
     } elseif ($method == 'get' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'message' and count($ex) == 4) {
         $format = $this->readdata('format', 'text');
         $this->messagefolders($format);
         //messagelist - GET - MESSAGE/"folderid"/	 page,pagesize als url parameter
     } elseif ($method == 'get' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'message' and count($ex) == 5) {
         $format = $this->readdata('format', 'text');
         $folder = (int) addslashes($ex[3]);
         $filter = $this->readdata('status', 'text');
         $page = $this->readdata('page', 'int');
         $pagesize = $this->readdata('pagesize', 'int');
         if ($pagesize < 1 or $pagesize > 100) {
             $pagesize = 10;
         }
         $this->messagelist($format, $folder, $page, $pagesize, $filter);
         // messagesend	- POST - MESSAGE/"folderid"
     } elseif ($method == 'post' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'message' and strtolower($ex[3]) == '2' and count($ex) == 5) {
         $format = $this->readdata('format', 'text');
         $touser = $this->readdata('to', 'text');
         $subject = $this->readdata('subject', 'text');
         $message = $this->readdata('message', 'text');
         $this->messagesend($format, $touser, $subject, $message);
         // messageget - GET - MESSAGE/"folderid"/"messageid"
     } elseif ($method == 'get' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'message' and count($ex) == 6) {
         $format = $this->readdata('format', 'text');
         $folder = (int) addslashes($ex[3]);
         $message = (int) addslashes($ex[4]);
         $this->messageget($format, $folder, $message);
         // ACTIVITY
         // activityget - GET ACTIVITY	 page,pagesize als urlparameter
     } elseif ($method == 'get' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'activity' and count($ex) == 4) {
         $format = $this->readdata('format', 'text');
         $page = $this->readdata('page', 'int');
         $pagesize = $this->readdata('pagesize', 'int');
         if ($pagesize < 1 or $pagesize > 100) {
             $pagesize = 10;
         }
         $this->activityget($format, $page, $pagesize);
         // activityput - POST ACTIVITY
     } elseif ($method == 'post' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'activity' and count($ex) == 4) {
         $format = $this->readdata('format', 'text');
         $message = $this->readdata('message', 'text');
         $this->activityput($format, $message);
         // CONTENT
         // contentcategories - GET - CONTENT/CATEGORIES
     } elseif ($method == 'get' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'content' and strtolower($ex[3]) == 'categories' and count($ex) == 5) {
         $format = $this->readdata('format', 'text');
         $this->contentcategories($format);
         // contentlicense - GET - CONTENT/LICENSES
     } elseif ($method == 'get' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'content' and strtolower($ex[3]) == 'licenses' and count($ex) == 5) {
         $format = $this->readdata('format', 'text');
         $this->contentlicenses($format);
         // contentdistributions - GET - CONTENT/DISTRIBUTIONS
     } elseif ($method == 'get' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'content' and strtolower($ex[3]) == 'distributions' and count($ex) == 5) {
         $format = $this->readdata('format', 'text');
         $this->contentdistributions($format);
         // contentdependencies - GET - CONTENT/DISTRIBUTIONS
     } elseif ($method == 'get' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'content' and strtolower($ex[3]) == 'dependencies' and count($ex) == 5) {
         $format = $this->readdata('format', 'text');
         $this->contentdependencies($format);
         // contenthomepage - GET - CONTENT/HOMPAGES
     } elseif ($method == 'get' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'content' and strtolower($ex[3]) == 'homepages' and count($ex) == 5) {
         $format = $this->readdata('format', 'text');
         $this->contenthomepages($format);
         // contentlist - GET - CONTENT/DATA - category,search,sort,page,pagesize
     } elseif ($method == 'get' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'content' and strtolower($ex[3]) == 'data' and count($ex) == 5) {
         $format = $this->readdata('format', 'text');
         $contents = $this->readdata('categories', 'text');
         $searchstr = $this->readdata('search', 'text');
         $searchuser = $this->readdata('user', 'text');
         $external = $this->readdata('external', 'text');
         $distribution = $this->readdata('distribution', 'text');
         $license = $this->readdata('license', 'text');
         $sortmode = $this->readdata('sortmode', 'text');
         $page = $this->readdata('page', 'int');
         $pagesize = $this->readdata('pagesize', 'int');
         if ($pagesize < 1 or $pagesize > 100) {
             $pagesize = 10;
         }
         $this->contentlist($format, $contents, $searchstr, $searchuser, $external, $distribution, $license, $sortmode, $page, $pagesize);
         // contentget - GET - CONTENT/DATA/"id"
     } elseif ($method == 'get' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'content' and strtolower($ex[3]) == 'data' and count($ex) == 6) {
         $format = $this->readdata('format', 'text');
         $id = addslashes($ex[4]);
         $this->contentget($format, $id);
         // contentdownload - GET - CONTENT/DOWNLOAD/"id"/"item"
     } elseif ($method == 'get' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'content' and strtolower($ex[3]) == 'download' and count($ex) == 7) {
         $format = $this->readdata('format', 'text');
         $id = addslashes($ex[4]);
         $item = addslashes($ex[5]);
         $this->contentdownload($format, $id, $item);
         // getrecommendations - GET - CONTENT/RECOMMENDATIONS/"id"
     } elseif ($method == 'get' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'content' and strtolower($ex[3]) == 'recommendations' and count($ex) == 6) {
         $format = $this->readdata('format', 'text');
         $id = addslashes($ex[4]);
         $page = $this->readdata('page', 'int');
         $pagesize = $this->readdata('pagesize', 'int');
         $this->contentrecommendations($id, $format, $page, $pagesize);
         // contentvote - POST - CONTENT/VOTE/"id" - good/bad als url parameter
     } elseif ($method == 'post' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'content' and strtolower($ex[3]) == 'vote' and count($ex) == 6) {
         $format = $this->readdata('format', 'text');
         $id = addslashes($ex[4]);
         $vote = $this->readdata('vote', 'text');
         $this->contentvote($format, $id, $vote);
         // contentpreviewdelete - POST - CONTENT/DELETEPREVIEW/"contentid"/"previewid"
     } elseif ($method == 'post' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'content' and strtolower($ex[3]) == 'deletepreview' and count($ex) == 7) {
         $format = $this->readdata('format', 'text');
         $contentid = addslashes($ex[4]);
         $previewid = addslashes($ex[5]);
         $this->contentpreviewdelete($format, $contentid, $previewid);
         // contentpreviewupload - POST - CONTENT/UPLOADPREVIEW/"contentid"/"previewid"
     } elseif ($method == 'post' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'content' and strtolower($ex[3]) == 'uploadpreview' and count($ex) == 7) {
         $format = $this->readdata('format', 'text');
         $contentid = addslashes($ex[4]);
         $previewid = addslashes($ex[5]);
         $this->contentpreviewupload($format, $contentid, $previewid);
         // contentdownloaddelete - POST - CONTENT/DELETEDOWNLOAD/"contentid"
     } elseif ($method == 'post' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'content' and strtolower($ex[3]) == 'deletedownload' and count($ex) == 6) {
         $format = $this->readdata('format', 'text');
         $contentid = addslashes($ex[4]);
         $this->contentdownloaddelete($format, $contentid);
         // contentdownloadupload - POST - CONTENT/UPLOADDOWNLOAD/"contentid"
     } elseif ($method == 'post' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'content' and strtolower($ex[3]) == 'uploaddownload' and count($ex) == 6) {
         $format = $this->readdata('format', 'text');
         $contentid = addslashes($ex[4]);
         $this->contentdownloadupload($format, $contentid);
         // contentadd - POST - CONTENT/ADD
     } elseif ($method == 'post' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'content' and strtolower($ex[3]) == 'add' and count($ex) == 5) {
         $format = $this->readdata('format', 'text');
         $this->contentadd($format);
         // contentedit - POST - CONTENT/EDIT/"contentid"
     } elseif ($method == 'post' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'content' and strtolower($ex[3]) == 'edit' and count($ex) == 6) {
         $format = $this->readdata('format', 'text');
         $contentid = addslashes($ex[4]);
         $this->contentedit($format, $contentid);
         // contentdelete - POST - CONTENT/DELETE/"contentid"
     } elseif ($method == 'post' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'content' and strtolower($ex[3]) == 'delete' and count($ex) == 6) {
         $format = $this->readdata('format', 'text');
         $contentid = addslashes($ex[4]);
         $this->contentdelete($format, $contentid);
         // KNOWLEDGEBASE
         // knowledgebaseget - GET - KNOWLEDGEBASE/DATA/"id"
     } elseif ($method == 'get' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'knowledgebase' and strtolower($ex[3]) == 'data' and count($ex) == 6) {
         $format = $this->readdata('format', 'text');
         $id = addslashes($ex[4]);
         $this->knowledgebaseget($format, $id);
         // knowledgebaselist - GET - KNOWLEDGEBASE/DATA - category,search,sort,page,pagesize
     } elseif ($method == 'get' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'knowledgebase' and strtolower($ex[3]) == 'data' and count($ex) == 5) {
         $format = $this->readdata('format', 'text');
         $contents = $this->readdata('content', 'text');
         $searchstr = $this->readdata('search', 'text');
         $sortmode = $this->readdata('sortmode', 'text');
         $page = $this->readdata('page', 'int');
         $pagesize = $this->readdata('pagesize', 'int');
         if ($pagesize < 1 or $pagesize > 100) {
             $pagesize = 10;
         }
         $this->knowledgebaselist($format, $contents, $searchstr, $sortmode, $page, $pagesize);
         // EVENT
         // eventget - GET - EVENT/DATA/"id"
     } elseif ($method == 'get' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'event' and strtolower($ex[3]) == 'data' and count($ex) == 6) {
         $format = $this->readdata('format', 'text');
         $id = addslashes($ex[4]);
         $this->eventget($format, $id);
         // eventlist - GET - EVENT/DATA - type,country,startat,search,sort,page,pagesize
     } elseif ($method == 'get' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'event' and strtolower($ex[3]) == 'data' and count($ex) == 5) {
         $format = $this->readdata('format', 'text');
         $type = $this->readdata('type', 'int');
         $country = $this->readdata('country', 'text');
         $startat = $this->readdata('startat', 'text');
         $searchstr = $this->readdata('search', 'text');
         $sortmode = $this->readdata('sortmode', 'text');
         $page = $this->readdata('page', 'int');
         $pagesize = $this->readdata('pagesize', 'int');
         if ($pagesize < 1 or $pagesize > 100) {
             $pagesize = 10;
         }
         $this->eventlist($format, $type, $country, $startat, $searchstr, $sortmode, $page, $pagesize);
         // eventadd - POST - EVENT/ADD
     } elseif ($method == 'post' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'event' and strtolower($ex[3]) == 'add' and count($ex) == 5) {
         $format = $this->readdata('format', 'text');
         $this->eventadd($format);
         // eventedit - POST - EVENT/EDIT/"eventid"
     } elseif ($method == 'post' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'event' and strtolower($ex[3]) == 'edit' and count($ex) == 6) {
         $format = $this->readdata('format', 'text');
         $eventid = addslashes($ex[4]);
         $this->eventedit($format, $eventid);
         // eventdelete - POST - EVENT/DELETE/"eventid"
     } elseif ($method == 'post' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'event' and strtolower($ex[3]) == 'delete' and count($ex) == 6) {
         $format = $this->readdata('format', 'text');
         $eventid = addslashes($ex[4]);
         $this->eventdelete($format, $eventid);
         // COMMENTS
         // commentsget - GET - COMMENTS/GET
     } elseif ($method == 'get' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'comments' and strtolower($ex[3]) == 'data' and count($ex) == 8) {
         $type = addslashes($ex[4]);
         $content = addslashes($ex[5]);
         $content2 = addslashes($ex[6]);
         $format = $this->readdata('format', 'text');
         $page = $this->readdata('page', 'int');
         $pagesize = $this->readdata('pagesize', 'int');
         if ($pagesize < 1 or $pagesize > 2000) {
             $pagesize = 10;
         }
         $this->commentsget($format, $type, $content, $content2, $page, $pagesize);
         // commentsadd - POST - COMMENTS/ADD
     } elseif ($method == 'post' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'comments' and strtolower($ex[3]) == 'add' and count($ex) == 5) {
         $format = $this->readdata('format', 'text');
         $type = $this->readdata('type', 'int');
         $content = $this->readdata('content', 'int');
         $content2 = $this->readdata('content2', 'int');
         $parent = $this->readdata('parent', 'int');
         $subject = $this->readdata('subject', 'text');
         $message = $this->readdata('message', 'text');
         $this->commentsadd($format, $type, $content, $content2, $parent, $subject, $message);
         // commentvote - GET - COMMENTS/vote
     } elseif ($method == 'post' and strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'comments' and strtolower($ex[3]) == 'vote' and count($ex) == 6) {
         $id = addslashes($ex[4]);
         $score = $this->readdata('vote', 'int');
         $format = $this->readdata('format', 'text');
         $this->commentvote($format, $id, $score);
         // FORUM
     } elseif (strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'forum') {
         $functioncall = strtolower($ex[3]);
         $subcall = strtolower($ex[4]);
         $argumentcount = count($ex);
         // list - GET - FORUM/LIST
         if ($method == 'get' and $functioncall == 'list' and $argumentcount == 4) {
             $format = $this->readdata('format', 'text');
             $page = $this->readdata('page', 'int');
             $pagesize = $this->readdata('pagesize', 'int');
             // TOPIC section
         } elseif ($functioncall == 'topic') {
             // list - GET - FORUM/TOPIC/LIST
             if ($method == 'get' and $subcall == 'list' and $argumentcount == 10) {
                 $format = $this->readdata('format', 'text');
                 $forum = $this->readdata('forum', 'int');
                 $search = $this->readdata('search', 'text');
                 $description = $this->readdata('description', 'text');
                 $sortmode = $this->readdata('sortmode', 'text');
                 $page = $this->readdata('page', 'int');
                 $pagesize = $this->readdata('pagesize', 'int');
                 // add - POST - FORUM/TOPIC/ADD
             } elseif ($method == 'post' and $subcall == 'add' and $argumentcount == 5) {
                 $format = $this->readdata('format', 'text');
                 $subject = $this->readdata('subject', 'text');
                 $content = $this->readdata('content', 'text');
                 $forum = $this->readdata('forum', 'int');
             }
         }
         // BUILDSERVICE
     } elseif (strtolower($ex[1]) == 'v1' and strtolower($ex[2]) == 'buildservice' and count($ex) > 4) {
         $functioncall = strtolower($ex[4]);
         $argumentcount = count($ex);
         // PROJECT section
         if (strtolower($ex[3] == 'project')) {
             // create - POST - PROJECT/CREATE
             if ($method == 'post' and $functioncall == 'create' and $argumentcount == 6) {
                 $format = $this->readdata('format', 'text');
                 $name = $this->readdata('name', 'text');
                 $version = $this->readdata('version', 'text');
                 $license = $this->readdata('license', 'text');
                 $url = $this->readdata('url', 'text');
                 $developers = $this->readdata('developers', 'text');
                 $summary = $this->readdata('summary', 'text');
                 $description = $this->readdata('description', 'text');
                 $requirements = $this->readdata('requirements', 'text');
                 $specfile = $this->readdata('specfile', 'text');
                 $this->buildserviceprojectcreate($format, $name, $version, $license, $url, $developers, $summary, $description, $requirements, $specfile);
                 // get - GET - PROJECT/GET/"project"
             } elseif ($method == 'get' and $functioncall == 'get' and $argumentcount == 7) {
                 $format = $this->readdata('format', 'text');
                 $projectID = $ex[5];
                 $this->buildserviceprojectget($format, $projectID);
                 // delete - POST - PROJECT/DELETE/"project"
             } elseif ($method == 'post' and $functioncall == 'delete' and $argumentcount == 7) {
                 $format = $this->readdata('format', 'text');
                 $projectID = $ex[5];
                 $this->buildserviceprojectdelete($format, $projectID);
                 // edit - POST - ROJECT/EDIT/"project"
             } elseif ($method == 'post' and $functioncall == 'edit' and $argumentcount == 7) {
                 $format = $this->readdata('format', 'text');
                 $projectID = $ex[5];
                 $name = $this->readdata('name', 'text');
                 $version = $this->readdata('version', 'text');
                 $license = $this->readdata('license', 'text');
                 $url = $this->readdata('url', 'text');
                 $developers = $this->readdata('developers', 'text');
                 $summary = $this->readdata('summary', 'text');
                 $description = $this->readdata('description', 'text');
                 $requirements = $this->readdata('requirements', 'text');
                 $specfile = $this->readdata('specfile', 'text');
                 $this->buildserviceprojectedit($format, $projectID, $name, $version, $license, $url, $developers, $summary, $description, $requirements, $specfile);
                 // listall - GET - PROJECT/LIST
             } elseif ($method == 'get' and $functioncall == 'list' and $argumentcount == 6) {
                 $format = $this->readdata('format', 'text');
                 $page = $this->readdata('page', 'int');
                 $pagesize = $this->readdata('pagesize', 'int');
                 $this->buildserviceprojectlist($format, $page, $pagesize);
                 // generatespecfile - GET - PROJECT/UPLOADSOURCE
             } elseif ($method == 'post' and $functioncall == 'uploadsource' and $argumentcount == 7) {
                 $format = $this->readdata('format', 'text');
                 $projectID = $ex[5];
                 $this->buildserviceprojectuploadsource($format, $projectID);
             } else {
                 $this->reportapisyntaxerror('buildservice/project');
             }
             // REMOTEACCOUNTS section
         } elseif (strtolower($ex[3]) == 'remoteaccounts') {
             if ($method == 'get' and $functioncall == 'list' and $argumentcount == 6) {
                 $format = $this->readdata('format', 'text');
                 $page = $this->readdata('page', 'int');
                 $pagesize = $this->readdata('pagesize', 'int');
                 $this->buildserviceremoteaccountslist($format, $page, $pagesize);
             } elseif ($method == 'post' and $functioncall == 'add' and $argumentcount == 6) {
                 $format = $this->readdata('format', 'text');
                 $type = $this->readdata('type', 'int');
                 $typeid = $this->readdata('typeid', 'text');
                 $data = $this->readdata('data', 'text');
                 $login = $this->readdata('login', 'text');
                 $password = $this->readdata('password', 'text');
                 $this->buildserviceremoteaccountsadd($format, $type, $typeid, $data, $login, $password);
             } elseif ($method == 'post' and $functioncall == 'edit' and $argumentcount == 7) {
                 $format = $this->readdata('format', 'text');
                 $id = $ex[5];
                 $data = $this->readdata('data', 'text');
                 $login = $this->readdata('login', 'text');
                 $password = $this->readdata('password', 'text');
                 $this->buildserviceremoteaccountsedit($format, $id, $login, $password, $data);
             } elseif ($method == 'get' and $functioncall == 'get' and $argumentcount == 7) {
                 $format = $this->readdata('format', 'text');
                 $id = $ex[5];
                 $this->buildserviceremoteaccountsget($format, $id);
             } elseif ($method == 'post' and $functioncall == 'remove' and $argumentcount == 7) {
                 $format = $this->readdata('format', 'text');
                 $id = $ex[5];
                 $this->buildserviceremoteaccountsremove($format, $id);
             } else {
                 $this->reportapisyntaxerror('buildservice/remoteaccounts');
             }
             // BUILDSERVICES section
         } elseif (strtolower($ex[3] == 'buildservices')) {
             if ($method == 'get' and $functioncall == 'list' and $argumentcount == 6) {
                 $format = $this->readdata('format', 'text');
                 $page = $this->readdata('page', 'int');
                 $pagesize = $this->readdata('pagesize', 'int');
                 $this->buildservicebuildserviceslist($format, $page, $pagesize);
             } elseif ($method == 'get' and $functioncall == 'get' and $argumentcount == 7) {
                 $format = $this->readdata('format', 'text');
                 $buildserviceID = $ex[5];
                 $this->buildservicebuildservicesget($format, $buildserviceID);
             } else {
                 $this->reportapisyntaxerror('buildservice/buildservices');
             }
             // JOBS section
         } elseif (strtolower($ex[3] == 'jobs')) {
             // getbuildcapabilities - GET - JOBS/GETBUILDCAPABILITIES
             if ($method == 'get' and $functioncall == 'list' and $argumentcount == 7) {
                 $format = $this->readdata('format', 'text');
                 $projectID = $ex[5];
                 $page = $this->readdata('page', 'int');
                 $pagesize = $this->readdata('pagesize', 'int');
                 $this->buildservicejobslist($format, $projectID, $page, $pagesize);
                 // create - POST - JOBS/CREATE/"project"/"buildsevice"/"target"
             } elseif ($method == 'post' and $functioncall == 'create' and $argumentcount == 9) {
                 $format = $this->readdata('format', 'text');
                 $projectID = $ex[5];
                 $buildserviceID = $ex[6];
                 $target = $ex[7];
                 $this->buildservicejobscreate($format, $projectID, $buildserviceID, $target);
                 // cancel - POST - JOBS/CANCEL/"buildjob"
             } elseif ($method == 'post' and $functioncall == 'cancel' and $argumentcount == 7) {
                 $format = $this->readdata('format', 'text');
                 $buildjobID = $ex[5];
                 $this->buildservicejobscancel($format, $buildjobID);
                 // get - GET - JOBS/GET/"buildjob"
             } elseif ($method == 'get' and $functioncall == 'get' and $argumentcount == 7) {
                 $format = $this->readdata('format', 'text');
                 $buildjobID = $ex[5];
                 $this->buildservicejobsget($format, $buildjobID);
                 // getoutput - GET - JOBS/GETOUTPOT/"buildjob"
             } elseif ($method == 'get' and $functioncall == 'getoutput' and $argumentcount == 7) {
                 $format = $this->readdata('format', 'text');
                 $buildjobID = $ex[5];
                 $this->buildservicejobsgetoutput($format, $buildjobID);
             } else {
                 $this->reportapisyntaxerror('buildservice/jobs');
             }
             // PUBLISHING section
         } elseif (strtolower($ex[3] == 'publishing')) {
             // getpublishingcapabilities - GET - PUBLISHING/GETPUBLISHINGCAPABILITIES
             if ($method == 'get' and $functioncall == 'getpublishingcapabilities' and $argumentcount == 6) {
                 $format = $this->readdata('format', 'text');
                 $page = $this->readdata('page', 'int');
                 $pagesize = $this->readdata('pagesize', 'int');
                 $this->buildservicepublishinggetpublishingcapabilities($format, $page, $pagesize);
                 // getpublisher - GET - PUBLISHING/GETPUBLISHER
             } elseif ($method == 'get' and $functioncall == 'getpublisher' and $argumentcount == 7) {
                 $format = $this->readdata('format', 'text');
                 $publisherID = $ex[5];
                 $this->buildservicepublishinggetpublisher($format, $publisherID);
                 // publishtargetresult - POST - PUBLISHING/PUBLISHTARGETRESULT/"buildjob"/"publisher"
             } elseif ($method == 'post' and $functioncall == 'publishtargetresult' and $argumentcount == 8) {
                 $format = $this->readdata('format', 'text');
                 $buildjobID = $ex[5];
                 $publisherID = $ex[6];
                 $this->buildservicepublishingpublishtargetresult($format, $buildjobID, $publisherID);
                 // savefields - POST - PUBLISHING/SAVEFIELDS/"project"
             } elseif ($method == 'post' and $functioncall == 'savefields' and $argumentcount == 7) {
                 $format = $this->readdata('format', 'text');
                 $projectID = $ex[5];
                 $fields = $this->readdata('fields', 'array');
                 $this->buildservicepublishingsavefields($format, $projectID, $fields);
                 // getfields - GET - PUBLISHING/GETFIELDS/"project"
             } elseif ($method == 'get' and $functioncall == 'getfields' and $argumentcount == 7) {
                 $format = $this->readdata('format', 'text');
                 $projectID = $ex[5];
                 $this->buildservicepublishinggetfields($format, $projectID);
             } else {
                 $this->reportapisyntaxerror('buildservice/publishing');
             }
         } else {
             $this->reportapisyntaxerror('buildservice');
         }
     } else {
         $format = $this->readdata('format', 'text');
         $txt = 'please check the syntax. api specifications are here: http://www.freedesktop.org/wiki/Specifications/open-collaboration-services' . "\n";
         $txt .= $this->getdebugoutput();
         echo OCSXML::generatexml($format, 'failed', 999, $txt);
     }
     exit;
 }
                                <div class="col-sm-10">
                                    <textarea class="form-control" rows="3" name="inputChangelog" placeholder="list the new changes/fixes have you made"></textarea>
                                </div>
                            </div>
                            <button class="btn btn-success btn-sm" type="submit">Upload!</button>
                        </form>
                    </div>
                </div> <!-- .div class="row" id="post-uploadapp-box" style="display:none" -->
                <?php 
if (isset($data[1]["ocs"]["data"]["content"])) {
    $number = "0";
    echo "<table class=\"table table-striped\">\n                        <thead>\n                            <tr>\n                                <th>#</th>\n                                <th>Name</th>\n                                <th>Delete</th>\n                                <th>Edit</th>\n                            </tr>\n                        </thead>\n                        <tbody>";
    foreach ($data[1]["ocs"]["data"]["content"] as $content) {
        //if(OCSUser::login()==$content["personid"]){
        $number = $number + 1;
        echo "\n                            <tr>\n                              <td>{$number}</td>\n                              <td><a href=\"/plasmastore/app_description/show/" . $content["id"] . "/" . ERewriter::prettify($content["name"]) . "\">" . $content["name"] . "</td>\n                              <td><a class=\"btn-sm btn-danger\" href=\"/plasmastore/home/delData/" . $content["id"] . "\">Delete <span class=\"glyphicon glyphicon-trash\"></span></a></td>\n                              <td><a class=\"btn-sm btn-success open-editapp-box" . $content["id"] . "\" onclick=\"\$(this).openEditBox(" . $content["id"] . ");\" href=\"#\">Edit</a>\n\n                                <div class=\"row post-editapp-box" . $content["id"] . "\" style=\"display:none\">\n                                    <div class=\"col-md-12\">\n                                        <form class=\"form-horizontal\" enctype=\"multipart/form-data\" action=\"/plasmastore/userpanel/edit/" . $content["id"] . "\" method=\"post\">\n                                            <div class=\"form-group\">\n                                                <label for=\"inputTitle\" class=\"col-sm-2 control-label\">Title</label>\n                                                <div class=\"col-sm-10\">\n                                                    <input type=\"text\" class=\"form-control\" name=\"inputTitle\" value=\"" . $content["name"] . "\">\n                                                </div>\n                                            </div>\n                                            <div class=\"form-group\">\n                                                <label for=\"type\" class=\"col-sm-2 control-label\">Category</label>\n                                                <div class=\"col-sm-10\">\n                                                    <select name=\"type\">";
        foreach ($data[2]["ocs"]["data"]["category"] as $category) {
            if ($category["id"] == $content["id"]) {
                echo "<option value=" . $category["id"] . " selected>" . $category["name"] . "</option>";
            } else {
                echo "<option value=" . $category["id"] . ">" . $category["name"] . "</option>";
            }
        }
        echo "\n                                                    </select>\n                                                </div>\n                                            </div>\n                                            <div class=\"form-group\">\n                                                <label for=\"inputDownloadName\" class=\"col-sm-2 control-label\">Download name</label>\n                                                <div class=\"col-sm-10\">\n                                                    <input type=\"text\" class=\"form-control\" name=\"inputDownloadName\" value=\"" . $content["downloadname1"] . "\">\n                                                </div>\n                                            </div>\n                                            <div class=\"form-group\">\n                                                <label for=\"inputDownloadLink\" class=\"col-sm-2 control-label\">Download link</label>\n                                                <div class=\"col-sm-10\">\n                                                    <input type=\"text\" class=\"form-control\" name=\"inputDownloadLink\" value=\"" . $content["downloadlink1"] . "\">\n                                                </div>\n                                            </div>\n                                            <div class=\"form-group\">\n                                                <label for=\"inputDownloadFile\" class=\"col-sm-2 control-label\">Download File</label>\n                                                <div class=\"col-sm-10\">\n                                                    <input type=\"file\" class=\"form-control\" name=\"inputDownloadFile\" id=\"inputDownloadFile\">\n                                                </div>\n                                            </div>\n                                            <div class=\"form-group\">\n                                                <label for=\"inputScreenshot1\" class=\"col-sm-2 control-label\">Screenshot 1</label>\n                                                <div class=\"col-sm-10\">\n                                                    <input type=\"file\" class=\"form-control\" name=\"inputScreenshot1\" id=\"inputScreenshot1\">\n                                                </div>\n                                            </div>\n                                            <div class=\"form-group\">\n                                                <label for=\"inputScreenshot2\" class=\"col-sm-2 control-label\">Screenshot 2</label>\n                                                <div class=\"col-sm-10\">\n                                                    <input type=\"file\" class=\"form-control\" name=\"inputScreenshot2\" id=\"inputScreenshot2\">\n                                                </div>\n                                            </div>\n                                            <div class=\"form-group\">\n                                                <label for=\"inputScreenshot1\" class=\"col-sm-2 control-label\">Screenshot 3</label>\n                                                <div class=\"col-sm-10\">\n                                                    <input type=\"file\" class=\"form-control\" name=\"inputScreenshot3\" id=\"inputScreenshot1\">\n                                                </div>\n                                            </div>\n                                            <div class=\"form-group\">\n                                                <label for=\"inputSummary\" class=\"col-sm-2 control-label\">Summary</label>\n                                                <div class=\"col-sm-10\">\n                                                    <input type=\"text\" class=\"form-control\" name=\"inputSummary\" value=\"" . $content["summary"] . "\">\n                                                </div>\n                                            </div>\n                                            <div class=\"form-group\">\n                                                <label for=\"inputDescription\" class=\"col-sm-2 control-label\">Description</label>\n                                                <div class=\"col-sm-10\">\n                                                    <textarea rows=\"5\" class=\"form-control\" name=\"inputDescription\">" . $content["description"] . "</textarea>\n                                                </div>\n                                            </div>\n                                            <div class=\"form-group\">\n                                                <label for=\"inputVersion\" class=\"col-sm-2 control-label\">Version</label>\n                                                <div class=\"col-sm-10\">\n                                                    <input type=\"text\" class=\"form-control\" name=\"inputVersion\" value=\"" . $content["version"] . "\">\n                                                </div>\n                                            </div>\n                                            <div class=\"form-group\">\n                                                <label for=\"inputChangelog\" class=\"col-sm-2 control-label\">Changelog</label>\n                                                <div class=\"col-sm-10\">\n                                                    <textarea class=\"form-control\" rows=\"3\" name=\"inputChangelog\">" . $content["changelog"] . "</textarea>\n                                                </div>\n                                            </div>\n                                            <a class=\"btn btn-danger btn-sm close-editapp-box" . $content["id"] . "\" onclick=\"\$(this).closeEditBox(" . $content["id"] . ");\" href=\"#\" style=\"display:none; margin-right: 10px;\">Cancel</a>\n                                            <button class=\"btn btn-success btn-sm\" type=\"submit\">Save changes</button>\n                                        </form>\n                                    </div>\n                                </div> \n                                </td>\n                        </tr>";
    }
}
//}
echo "</tbody>";
?>
                </table>
            </div>