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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
|
$content_module = array();
$result = array();
$github_url = 'https://api.github.com/repos/MyRepoName/MyRepoModules/';
$context = stream_context_create(array('http' => array(
'header' => 'User-Agent: ClicShopping',
)
)
);
$json = file_get_contents($github_url . 'contents/', true, $context );
$result = json_decode($json);
$result = json_decode($json);
//echo '<pre>'.print_r($result,true) .'</pre>';
?>
<!DOCTYPE html>
<html dir="ltr" lang="fr">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="https://cdn.rawgit.com/twbs/bootstrap/v4-dev/dist/css/bootstrap.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<script src="https://code.jquery.com/jquery-2.2.2.min.js" integrity="sha256-36cp2Co+/62rEAAYHLmRCPIych47CvdM+uTBJwSzWjI=" crossorigin="anonymous"></script>
<script src="https://cdn.rawgit.com/twbs/bootstrap/v4-dev/dist/js/bootstrap.js"></script>
</head>
<body>
<table width="100%">
<tr>
<td with="5%" class="text-md-center"></td>
<td with="33%" class="text-md-center">Module Name</td>
<td with="33%" class="text-md-center">Module Description</td>
<td with="33%" class="text-md-center">Installation</td>
</tr>
<?php
// content of repository ClicShopping_v3_official_modules
for ($i=0, $n=sizeof($result); $i<$n; $i++) {
echo '<tr>';
if ($result[$i]->name != 'LICENSE' && $result[$i]->name != 'README.md') {
$module_name = $result[$i]->name;
$module_sha = $result[$i]->sha;
echo '<td>image</td>';
echo '<td>' . $module_name . '</td>';
}
// list information repo
$json1 = file_get_contents($github_url . 'contents/' . $module_name, true, $context);
$result1 = json_decode($json1);
foreach ($result1 as $content) {
$content_module_name = $content->name;
if ($content_module_name == $module_name . '.json') {
$content_module = file_get_contents($content->download_url, true); //content of readme.
$result_content_module = json_decode($content_module);
// echo '<pre>' . print_r($result_content_module, true) . '</pre>';
echo '<td>';
echo '<br />' . $result_content_module->description;
echo '<br />Concepteur : ' . $result_content_module->vendor;
echo '<br />Licence : ' . $result_content_module->license;
echo '<br />version : ' . $result_content_module->version;
echo '<br />tag : ' . $result_content_module->tag;
echo '</td>';
echo '<td><button type="button" class="btn btn-default" git-name="' . $content_module_name . '"> <a href="' . $github_url . 'git/trees/' . $module_sha . '" git-type="cell" onclick="zipItButtonClick(this); >"><span class="glyphicon glyphicon-download-alt" aria-hidden="true"></span> Module Install</a></button></td>';
}
}
echo '</tr>';
}
?>
</tr>
</table>
</body>
</html> |
Partager