<?php $filename = filename(__FILE__); $github = \shgysk8zer0\Core\resources\Parser::parseFile('github.json'); $PDO = new \shgysk8zer0\Core\PDO($github); $parser = new \Parsedown\Parsedown(); $start = (array_key_exists('commit_start', $_REQUEST) and is_numeric($_REQUEST['commit_start'])) ? abs((int) $_REQUEST['commit_start']) : 0; $end = $start + 10; $commits = $PDO("SELECT\n\t\t\t`SHA`,\n\t\t\t`Branch`,\n\t\t\t`Commit_URL` AS `URL`,\n\t\t\t`Commit_Message` AS `Message`,\n\t\t\t`Author_Username` AS `Author`,\n\t\t\t`Author_Email` AS `Email`,\n\t\t\t`Time` AS `Timestamp`\n\t\tFROM `Commits`\n\t\tWHERE `Branch` = 'refs/heads/master'\n\t\tORDER BY `Timestamp`\n\t\tDESC\n\t\tLIMIT {$start}, 10;"); array_walk($commits, function (\stdClass &$commit) { $commit->Message = mb_convert_encoding($commit->Message, 'utf-8'); $commit->Message = explode(PHP_EOL, $commit->Message); }); ?> <dialog id="<?php echo $filename; ?> _dialog"> <button type="button" data-delete="#<?php echo $filename; ?> _dialog"></button> <br /> <table border="1"> <caption> Recent commits to <a href="<?php echo $github->repository->html_url; ?> "> <?php
<?php $connect = \shgysk8zer0\Core\resources\Parser::parseFile('connect.json'); ?> <form name="setup_database" action="<?php echo URL; ?> " method="post"> <fieldset form="setup_database"> <legend>Root MySQL user</legend> <label for="username">User: </label> <input type="text" name="username" id="username" value="root" placeholder="Default MySQL user" required/><br /> <label for="password">Password</label> <input type="password" name="password" id="password" placeholder="Default user's password"/> <button type="submit" title="Submit Form" data-icon="."></button> <button type="reset" data-icon="V" title="Clear Form"></button> <details> <summary><b>Options</b></summary> <label for="server">Server Address</label> <input type="text" name="server" id="server" value="localhost" required/> </details> </fieldset> </form>
break; case 'recent_commits': $resp->remove('#recent_commits_dialog, .backdrop')->append('body', load_results('recent_commits'))->showModal('#recent_commits_dialog'); break; case 'github_issues': $resp->append('body', load_results('github_issues'))->showModal('#github_issues_dialog'); break; case 'README': $readme = new \shgysk8zer0\Core\File('README.md'); $parser = new \Parsedown\Parsedown(); $dialog = new \shgysk8zer0\Core\Elements\Dialog('README', $parser->text($readme)); $resp->append('body', $dialog)->showModal($dialog->id); break; case 'update_icons': require_login('admin'); $icons = \shgysk8zer0\Core\resources\Parser::parseFile('icons.json'); $found = array_filter(array_unique($icons->icons), 'file_exists'); if (count($found) === count($icons->icons)) { if (SVG_symbols($icons->icons, $icons->output)) { $resp->notify('Success!', "Icons have been saved to {$icons->output}"); } else { $resp->notify('We have a problem :(', 'Was unable to update combined SVG due to an error parsing or saving the file', 'images/octicons/svg/bug.svg'); } } else { $resp->notify('We have a problem :(', 'Some icons are missing. Check your browser\'s log', 'images/octicons/svg/bug.svg')->log(['Icons' => $icons, 'Found' => $found, 'Missing' => array_diff($icons->icons, $found)]); } break; case 'concatenate_js': require_login('admin'); $scripts = array_map('current', get_dev_scripts()); if (concatenate_scripts($scripts)) {
<?php $settings = \shgysk8zer0\Core\resources\Parser::parseFile('settings.json'); if (isset($settings->module_test) and $settings->module_test) { $missing = module_test($settings); } if ($DB->connected) { $pages = \shgysk8zer0\Pages::load(); } else { $pages = new \stdClass(); $pages->content = null; } ?> <main role="main" itemprop="mainContentofPage" itemscope itemtype="http://schema.org/WebPageElement" <?php echo ($login->logged_in and $login->role === 'admin') ? ' contextmenu="admin_menu"' : ''; ?> > <?php if (isset($missing)) { echo '<div data-error="Missing Modules"><strong>Missing PHP Modules</strong><ul>'; foreach ($missing->php as $php) { echo "<li>{$php}</li>"; } echo '</ul><strong>Missing Apache Modules</strong><ul>'; foreach ($missing->apache as $apache) { echo "<li>{$apache}</li>"; } echo "</ul></div>"; } elseif ($DB->connected) { echo $pages->content; }