| @ -0,0 +1,47 @@ | |||
| <h2>Your Custom Settings</h2> | |||
| <br> | |||
| <p><u>hint:</u> Use <code>Ctrl</code>/<code>CMD</code> + <code>F</code> to search for your config key or value.</p> | |||
| <p><u>pro tips:</u> You can creating custom config key and print out your config key value anywhere in your template.</p> | |||
| <p><code><?php echo config('your.key'); ?></code></p> | |||
| <form method="POST"> | |||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf(); ?>"> | |||
| <table class="table" id="config"> | |||
| <tr> | |||
| <td><input type="text" class="form-control" name="newKey" placeholder="Your New Config Key"></td> | |||
| <td><input type="text" class="form-control" name="newValue" placeholder="Your New Value"></td> | |||
| </tr> | |||
| <?php | |||
| global $config_file; | |||
| $array = array( | |||
| "google.wmt" => "hallo", | |||
| ); | |||
| if (file_exists($config_file)) { | |||
| $array = parse_ini_file($config_file, true); | |||
| } | |||
| function valueMaker($value) | |||
| { | |||
| if (is_string($value)) | |||
| return htmlspecialchars($value); | |||
| if ($value === true) | |||
| return "true"; | |||
| if ($value === false) | |||
| return "false"; | |||
| if ($value == false) | |||
| return "0"; | |||
| return (string)$value; | |||
| } | |||
| $configList = json_decode(file_get_contents('content/data/configList.json', true)); | |||
| foreach ($array as $key => $value) { | |||
| if (!in_array($key, $configList)) { | |||
| echo '<tr>'; | |||
| echo '<td><label for="' . $key . '">' . $key . '</label></td>'; | |||
| echo '<td><input class="form-control" type="text" id="' . $key . '" name="-config-' . $key . '" value="' . valueMaker($value) . '"></td>'; | |||
| echo '</tr>'; | |||
| } | |||
| } | |||
| ?> | |||
| </table> | |||
| <input type="submit" class="form-control btn-primary btn-sm" style="width:100px;"> | |||
| </form> | |||
| @ -0,0 +1,56 @@ | |||
| <?php | |||
| global $config_file; | |||
| $array = array(); | |||
| if (file_exists($config_file)) { | |||
| $array = parse_ini_file($config_file, true); | |||
| } | |||
| ?> | |||
| <h2>Metatags</h2> | |||
| <br><br> | |||
| <form method="POST"> | |||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf(); ?>"> | |||
| <div class="form-group row"> | |||
| <label class="col-sm-2 col-form-label">Permalink</label> | |||
| <div class="col-sm-10"> | |||
| <div class="col-sm-10"> | |||
| <div class="form-check"> | |||
| <input class="form-check-input" type="radio" name="-config-permalink.type" id="permalink.type1" value="default" <?php if (config('permalink.type') === 'default'):?>checked<?php endif;?>> | |||
| <label class="form-check-label" for="permalink.type1"> | |||
| /year/month/your-post-slug | |||
| </label> | |||
| </div> | |||
| <div class="form-check"> | |||
| <input class="form-check-input" type="radio" name="-config-permalink.type" id="permalink.type1" value="post" <?php if (config('permalink.type') === 'post'):?>checked<?php endif;?>> | |||
| <label class="form-check-label" for="permalink.type2"> | |||
| /post/your-post-slug | |||
| </label> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| <label for="description.char" class="col-sm-2 col-form-label">Meta description character</label> | |||
| <div class="col-sm-10"> | |||
| <input type="number" name="-config-description.char" class="form-control" id="description.char" value="<?php echo config('description.char');?>"> | |||
| </div> | |||
| </div> | |||
| <br> | |||
| <h4>Sitemap</h4> | |||
| <hr> | |||
| <p>Valid values range from 0.0 to 1.0. See <a target="_blank" href="https://www.sitemaps.org/protocol.html">https://www.sitemaps.org/protocol.html</a></p> | |||
| <?php foreach($array as $key => $value) {?> | |||
| <?php if (stripos($key, 'sitemap.priority') !== false):?> | |||
| <div class="form-group row"> | |||
| <label for="<?php echo $key;?>" class="col-sm-2 col-form-label"><?php echo $key;?></label> | |||
| <div class="col-sm-10"> | |||
| <input step="any" type="number" name="-config-<?php echo $key;?>" class="form-control" id="<?php echo $key;?>" value="<?php echo $value;?>"> | |||
| </div> | |||
| </div> | |||
| <?php endif; ?> | |||
| <?php } ?> | |||
| <div class="form-group row"> | |||
| <div class="col-sm-10"> | |||
| <button type="submit" class="btn btn-primary">Save config</button> | |||
| </div> | |||
| </div> | |||
| </form> | |||
| @ -0,0 +1,95 @@ | |||
| <h2>Performance</h2> | |||
| <br><br> | |||
| <form method="POST"> | |||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf(); ?>"> | |||
| <div class="form-group row"> | |||
| <label for="cache.expiration" class="col-sm-2 col-form-label">Cache expiration</label> | |||
| <div class="col-sm-10"> | |||
| <input type="number" name="-config-cache.expiration" class="form-control" id="cache.expiration" value="<?php echo config('cache.expiration');?>"> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| <label class="col-sm-2 col-form-label">Cache off</label> | |||
| <div class="col-sm-10"> | |||
| <div class="col-sm-10"> | |||
| <div class="form-check"> | |||
| <input class="form-check-input" type="radio" name="-config-cache.off" id="cache.off1" value="true" <?php if (config('cache.off') === 'true'):?>checked<?php endif;?>> | |||
| <label class="form-check-label" for="cache.off1"> | |||
| Yes (not recommended) | |||
| </label> | |||
| </div> | |||
| <div class="form-check"> | |||
| <input class="form-check-input" type="radio" name="-config-cache.off" id="cache.off2" value="false" <?php if (config('cache.off') === 'false'):?>checked<?php endif;?>> | |||
| <label class="form-check-label" for="cache.off2"> | |||
| No | |||
| </label> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| <label class="col-sm-2 col-form-label">Cache timestamp</label> | |||
| <div class="col-sm-10"> | |||
| <div class="col-sm-10"> | |||
| <div class="form-check"> | |||
| <input class="form-check-input" type="radio" name="-config-cache.timestamp" id="cache.timestamp1" value="true" <?php if (config('cache.timestamp') === 'true'):?>checked<?php endif;?>> | |||
| <label class="form-check-label" for="cache.timestamp1"> | |||
| Enable | |||
| </label> | |||
| </div> | |||
| <div class="form-check"> | |||
| <input class="form-check-input" type="radio" name="-config-cache.timestamp" id="cache.timestamp2" value="false" <?php if (config('cache.timestamp') === 'false'):?>checked<?php endif;?>> | |||
| <label class="form-check-label" for="generation.time2"> | |||
| Disable | |||
| </label> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| <label class="col-sm-2 col-form-label">Page generation time</label> | |||
| <div class="col-sm-10"> | |||
| <div class="col-sm-10"> | |||
| <div class="form-check"> | |||
| <input class="form-check-input" type="radio" name="-config-generation.time" id="generation.time1" value="true" <?php if (config('generation.time') === 'true'):?>checked<?php endif;?>> | |||
| <label class="form-check-label" for="generation.time1"> | |||
| Enable | |||
| </label> | |||
| </div> | |||
| <div class="form-check"> | |||
| <input class="form-check-input" type="radio" name="-config-generation.time" id="generation.time2" value="false" <?php if (config('generation.time') === 'false'):?>checked<?php endif;?>> | |||
| <label class="form-check-label" for="generation.time2"> | |||
| Disable | |||
| </label> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <br> | |||
| <h4>Github pre-release</h4> | |||
| <hr> | |||
| <div class="form-group row"> | |||
| <label class="col-sm-2 col-form-label">Pre-release</label> | |||
| <div class="col-sm-10"> | |||
| <div class="col-sm-10"> | |||
| <div class="form-check"> | |||
| <input class="form-check-input" type="radio" name="-config-prerelease" id="prerelease1" value="true" <?php if (config('prerelease') === 'true'):?>checked<?php endif;?>> | |||
| <label class="form-check-label" for="prerelease1"> | |||
| Yes I'm in | |||
| </label> | |||
| </div> | |||
| <div class="form-check"> | |||
| <input class="form-check-input" type="radio" name="-config-prerelease" id="prerelease2" value="false" <?php if (config('prerelease') === 'false'):?>checked<?php endif;?>> | |||
| <label class="form-check-label" for="prerelease2"> | |||
| Nope | |||
| </label> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| <div class="col-sm-10"> | |||
| <button type="submit" class="btn btn-primary">Save config</button> | |||
| </div> | |||
| </div> | |||
| </form> | |||
| @ -0,0 +1,120 @@ | |||
| <h2>Reading Settings</h2> | |||
| <br><br> | |||
| <form method="POST"> | |||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf(); ?>"> | |||
| <div class="form-group row"> | |||
| <label class="col-sm-2 col-form-label">Front page displays</label> | |||
| <div class="col-sm-10"> | |||
| <div class="col-sm-10"> | |||
| <div class="form-check"> | |||
| <input class="form-check-input" type="radio" name="-config-static.frontpage" id="static.frontpage1" value="false" <?php if (config('static.frontpage') === 'false'):?>checked<?php endif;?>> | |||
| <label class="form-check-label" for="static.frontpage1"> | |||
| Your latest blog posts | |||
| </label> | |||
| </div> | |||
| <div class="form-check"> | |||
| <input class="form-check-input" type="radio" name="-config-static.frontpage" id="static.frontpage1" value="true" <?php if (config('static.frontpage') === 'true'):?>checked<?php endif;?>> | |||
| <label class="form-check-label" for="static.frontpage2"> | |||
| Static page | |||
| </label> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| <label for="posts.perpage" class="col-sm-2 col-form-label">Posts in front page show at most</label> | |||
| <div class="col-sm-10"> | |||
| <input type="number" name="-config-posts.perpage" class="form-control" id="posts.perpage" value="<?php echo config('posts.perpage');?>"> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| <label class="col-sm-2 col-form-label">Blog posts displayed as</label> | |||
| <div class="col-sm-10"> | |||
| <div class="col-sm-10"> | |||
| <div class="form-check"> | |||
| <input class="form-check-input" type="radio" name="-config-teaser.type" id="teaser.type1" value="full" <?php if (config('teaser.type') === 'full'):?>checked<?php endif;?>> | |||
| <label class="form-check-label" for="teaser.type1"> | |||
| Full post | |||
| </label> | |||
| </div> | |||
| <div class="form-check"> | |||
| <input class="form-check-input" type="radio" name="-config-teaser.type" id="teaser.type2" value="trimmed" <?php if (config('teaser.type') === 'trimmed'):?>checked<?php endif;?>> | |||
| <label class="form-check-label" for="teaser.type2"> | |||
| Summary | |||
| </label> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| <label for="teaser.char" class="col-sm-2 col-form-label">Summary character</label> | |||
| <div class="col-sm-10"> | |||
| <input type="number" name="-config-teaser.char" class="form-control" id="teaser.char" value="<?php echo config('teaser.char');?>"> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| <label for="read.more" class="col-sm-2 col-form-label">Read more text</label> | |||
| <div class="col-sm-10"> | |||
| <input type="text" name="-config-read.more" class="form-control" id="read.more" value="<?php echo config('read.more');?>" placeholder="Read more"> | |||
| </div> | |||
| </div> | |||
| <br> | |||
| <h4>Posts index settings</h4> | |||
| <hr> | |||
| <div class="form-group row"> | |||
| <label for="category.perpage" class="col-sm-2 col-form-label">Posts in category page at most</label> | |||
| <div class="col-sm-10"> | |||
| <input type="number" name="-config-category.perpage" class="form-control" id="category.perpage" value="<?php echo config('category.perpage');?>"> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| <label for="archive.perpage" class="col-sm-2 col-form-label">Posts in archive page at most</label> | |||
| <div class="col-sm-10"> | |||
| <input type="number" name="-config-archive.perpage" class="form-control" id="archive.perpage" value="<?php echo config('archive.perpage');?>"> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| <label for="tag.perpage" class="col-sm-2 col-form-label">Posts in tag page at most</label> | |||
| <div class="col-sm-10"> | |||
| <input type="number" name="-config-tag.perpage" class="form-control" id="tag.perpage" value="<?php echo config('tag.perpage');?>"> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| <label for="search.perpage" class="col-sm-2 col-form-label">Posts in search result at most</label> | |||
| <div class="col-sm-10"> | |||
| <input type="number" name="-config-search.perpage" class="form-control" id="search.perpage" value="<?php echo config('search.perpage');?>"> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| <label for="type.perpage" class="col-sm-2 col-form-label">Posts in type page at most</label> | |||
| <div class="col-sm-10"> | |||
| <input type="number" name="-config-type.perpage" class="form-control" id="type.perpage" value="<?php echo config('type.perpage');?>"> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| <label for="profile.perpage" class="col-sm-2 col-form-label">Posts in profile page at most</label> | |||
| <div class="col-sm-10"> | |||
| <input type="number" name="-config-profile.perpage" class="form-control" id="profile.perpage" value="<?php echo config('profile.perpage');?>"> | |||
| </div> | |||
| </div> | |||
| <br> | |||
| <h4>RSS settings</h4> | |||
| <hr> | |||
| <div class="form-group row"> | |||
| <label for="rss.count" class="col-sm-2 col-form-label">RSS feeds show the most recent</label> | |||
| <div class="col-sm-10"> | |||
| <input type="number" name="-config-rss.count" class="form-control" id="rss.count" value="<?php echo config('rss.count');?>"> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| <label for="rss.char" class="col-sm-2 col-form-label">RSS character</label> | |||
| <div class="col-sm-10"> | |||
| <input type="number" name="-config-rss.char" class="form-control" id="rss.char" value="<?php echo config('rss.char');?>"> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| <div class="col-sm-10"> | |||
| <button type="submit" class="btn btn-primary">Save config</button> | |||
| </div> | |||
| </div> | |||
| </form> | |||
| @ -0,0 +1,146 @@ | |||
| <h2>Widget Settings</h2> | |||
| <br><br> | |||
| <form method="POST"> | |||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf(); ?>"> | |||
| <div class="form-group row"> | |||
| <label for="related.count" class="col-sm-2 col-form-label">Related widget posts at most</label> | |||
| <div class="col-sm-10"> | |||
| <input type="number" name="-config-related.count" class="form-control" id="related.count" value="<?php echo config('related.count');?>"> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| <label for="recent.count" class="col-sm-2 col-form-label">Recent posts widget at most</label> | |||
| <div class="col-sm-10"> | |||
| <input type="number" name="-config-recent.count" class="form-control" id="recent.count" value="<?php echo config('recent.count');?>"> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| <label class="col-sm-2 col-form-label">Popular posts widget</label> | |||
| <div class="col-sm-10"> | |||
| <div class="col-sm-10"> | |||
| <div class="form-check"> | |||
| <input class="form-check-input" type="radio" name="-config-views.counter" id="views.counter1" value="true" <?php if (config('views.counter') === 'true'):?>checked<?php endif;?>> | |||
| <label class="form-check-label" for="views.counter1"> | |||
| Enable popular posts widget | |||
| </label> | |||
| </div> | |||
| <div class="form-check"> | |||
| <input class="form-check-input" type="radio" name="-config-views.counter" id="views.counter2" value="false" <?php if (config('views.counter') === 'false'):?>checked<?php endif;?>> | |||
| <label class="form-check-label" for="views.counter2"> | |||
| Disable popular posts widget | |||
| </label> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| <label for="popular.count" class="col-sm-2 col-form-label">Popular posts widget at most</label> | |||
| <div class="col-sm-10"> | |||
| <input type="number" name="-config-popular.count" class="form-control" id="popular.count" value="<?php echo config('popular.count');?>"> | |||
| </div> | |||
| </div> | |||
| <br> | |||
| <h4>Comments</h4> | |||
| <hr> | |||
| <p>To using Disqus or Facebook comment you need to provide Disqus shortname or Facebook App ID.</p> | |||
| <div class="form-group row"> | |||
| <label class="col-sm-2 col-form-label">Comment system</label> | |||
| <div class="col-sm-10"> | |||
| <div class="col-sm-10"> | |||
| <div class="form-check"> | |||
| <input class="form-check-input" type="radio" name="-config-comment.system" id="comment.system1" value="disable" <?php if (config('comment.system') === 'disable'):?>checked<?php endif;?>> | |||
| <label class="form-check-label" for="comment.system1"> | |||
| Disabled | |||
| </label> | |||
| </div> | |||
| <div class="form-check"> | |||
| <input class="form-check-input" type="radio" name="-config-comment.system" id="comment.system2" value="disqus" <?php if (config('comment.system') === 'disqus'):?>checked<?php endif;?>> | |||
| <label class="form-check-label" for="comment.system2"> | |||
| Disqus | |||
| </label> | |||
| </div> | |||
| <div class="form-check"> | |||
| <input class="form-check-input" type="radio" name="-config-comment.system" id="comment.system3" value="facebook" <?php if (config('comment.system') === 'facebook'):?>checked<?php endif;?>> | |||
| <label class="form-check-label" for="comment.system3"> | |||
| </label> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| <label for="disqus.shortname" class="col-sm-2 col-form-label">Disqus shortname</label> | |||
| <div class="col-sm-10"> | |||
| <input type="text" name="-config-disqus.shortname" class="form-control" id="disqus.shortname" value="<?php echo config('disqus.shortname');?>" placeholder="htmly"> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| <label for="fb.appid" class="col-sm-2 col-form-label">Facebook App ID</label> | |||
| <div class="col-sm-10"> | |||
| <input type="text" name="-config-fb.appid" class="form-control" id="fb.appid" value="<?php echo config('fb.appid');?>" placeholder="12345abcde"> | |||
| </div> | |||
| </div> | |||
| <br> | |||
| <h4>Recaptcha</h4> | |||
| <hr> | |||
| <p>Get one here <a target="_blank" href="https://www.google.com/recaptcha/admin">https://www.google.com/recaptcha/admin</a> | |||
| <div class="form-group row"> | |||
| <label class="col-sm-2 col-form-label">Recaptcha</label> | |||
| <div class="col-sm-10"> | |||
| <div class="col-sm-10"> | |||
| <div class="form-check"> | |||
| <input class="form-check-input" type="radio" name="-config-google.reCaptcha" id="google.reCaptcha1" value="true" <?php if (config('google.reCaptcha') === 'true'):?>checked<?php endif;?>> | |||
| <label class="form-check-label" for="google.reCaptcha1"> | |||
| Enable recaptcha | |||
| </label> | |||
| </div> | |||
| <div class="form-check"> | |||
| <input class="form-check-input" type="radio" name="-config-google.reCaptcha" id="google.reCaptcha2" value="false" <?php if (config('google.reCaptcha') === 'false'):?>checked<?php endif;?>> | |||
| <label class="form-check-label" for="google.reCaptcha2"> | |||
| Disable recaptcha | |||
| </label> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| <label for="google.reCaptcha.public" class="col-sm-2 col-form-label">Site Key</label> | |||
| <div class="col-sm-10"> | |||
| <input type="text" name="-config-google.reCaptcha.public" class="form-control" id="google.reCaptcha.public" value="<?php echo config('google.reCaptcha.public');?>" placeholder="12345abcde"> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| <label for="google.reCaptcha.private" class="col-sm-2 col-form-label">Secret Key</label> | |||
| <div class="col-sm-10"> | |||
| <input type="text" name="-config-google.reCaptcha.private" class="form-control" id="google.reCaptcha.private" value="<?php echo config('google.reCaptcha.private');?>" placeholder="12345abcde"> | |||
| </div> | |||
| </div> | |||
| <br> | |||
| <h4>Google Analytics</h4> | |||
| <hr> | |||
| <div class="form-group row"> | |||
| <label for="google.gtag.id" class="col-sm-2 col-form-label">Universal Analytics (gtag.js)</label> | |||
| <div class="col-sm-10"> | |||
| <input type="text" name="-config-google.gtag.id" class="form-control" id="google.gtag.id" value="<?php echo config('google.gtag.id');?>" placeholder="12345abcde"> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| <label for="google.analytics.id" class="col-sm-2 col-form-label">Google Analytics (legacy)</label> | |||
| <div class="col-sm-10"> | |||
| <input type="text" name="-config-google.analytics.id" class="form-control" id="google.analytics.id" value="<?php echo config('google.analytics.id');?>" placeholder="12345abcde"> | |||
| <small><em>This is legacy code. Usually new created analyics using gtag.js</em></small> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| <label for="google.wmt.id" class="col-sm-2 col-form-label">Google Search Console</label> | |||
| <div class="col-sm-10"> | |||
| <input type="text" name="-config-google.wmt.id" class="form-control" id="google.wmt.id" value="<?php echo config('google.wmt.id');?>" placeholder="12345abcde"> | |||
| <small><em>For google-site-verification meta</em></small> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| <div class="col-sm-10"> | |||
| <button type="submit" class="btn btn-primary">Save config</button> | |||
| </div> | |||
| </div> | |||
| </form> | |||
| @ -1,48 +1,117 @@ | |||
| <h2>Your Settings</h2> | |||
| <br> | |||
| <p><u>hint:</u> Use <code>Ctrl</code>/<code>CMD⌘</code> + <code>F</code> to search for your config key or value.</p> | |||
| <p><u>pro tips:</u> You can creating custom config key and print out your config key value anywhere in your template.</p> | |||
| <p><code><?php echo config('your.key'); ?></code></p> | |||
| <br> | |||
| <h2>General Settings</h2> | |||
| <br><br> | |||
| <form method="POST"> | |||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf(); ?>"> | |||
| <input class="form-control btn btn-primary btn-sm" type="submit" style="width:100px;"> | |||
| <br><br> | |||
| <table class="table" id="config"> | |||
| <tr> | |||
| <td><input type="text" class="form-control" name="newKey" placeholder="Your New Config Key"></td> | |||
| <td><input type="text" class="form-control" name="newValue" placeholder="Your New Value"></td> | |||
| </tr> | |||
| <?php | |||
| global $config_file; | |||
| $array = array( | |||
| "google.wmt" => "hallo", | |||
| ); | |||
| if (file_exists($config_file)) { | |||
| $array = parse_ini_file($config_file, true); | |||
| } | |||
| function valueMaker($value) | |||
| { | |||
| if (is_string($value)) | |||
| return htmlspecialchars($value); | |||
| if ($value === true) | |||
| return "true"; | |||
| if ($value === false) | |||
| return "false"; | |||
| if ($value == false) | |||
| return "0"; | |||
| return (string)$value; | |||
| } | |||
| foreach ($array as $key => $value) { | |||
| echo '<tr>'; | |||
| echo '<td><label for="' . $key . '">' . $key . '</label></td>'; | |||
| echo '<td><input class="form-control" type="text" id="' . $key . '" name="-config-' . $key . '" value="' . valueMaker($value) . '"></td>'; | |||
| echo '</tr>'; | |||
| } | |||
| ?> | |||
| </table> | |||
| <input type="submit" class="form-control btn-primary btn-sm" style="width:100px;"> | |||
| </form> | |||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf(); ?>"> | |||
| <div class="form-group row"> | |||
| <label for="site.url" class="col-sm-2 col-form-label">Address (URL)</label> | |||
| <div class="col-sm-10"> | |||
| <input type="text" name="-config-site.url" class="form-control" id="site.url" value="<?php echo config('site.url');?>" placeholder="https://www.htmly.com"> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| <label for="blog.title" class="col-sm-2 col-form-label">Blog title</label> | |||
| <div class="col-sm-10"> | |||
| <input type="text" name="-config-blog.title" class="form-control" id="blog.title" value="<?php echo config('blog.title');?>" placeholder="My HTMLy Blog"> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| <label for="blog.tagline" class="col-sm-2 col-form-label">Tagline</label> | |||
| <div class="col-sm-10"> | |||
| <input type="text" name="-config-blog.tagline" class="form-control" id="blog.tagline" value="<?php echo config('blog.tagline');?>" placeholder="Databaseless PHP Blogging Platform"> | |||
| <small><em>In a few words, explain what this blog is about.</em></small> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| <label for="blog.description" class="col-sm-2 col-form-label">Description</label> | |||
| <div class="col-sm-10"> | |||
| <textarea id="blog.description" name="-config-blog.description" class="form-control"><?php echo config('blog.description');?></textarea> | |||
| <small><em>In one paragraph, tell us more about your blog.</em></small> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| <label for="blog.copyright" class="col-sm-2 col-form-label">Copyright</label> | |||
| <div class="col-sm-10"> | |||
| <input type="text" name="-config-blog.copyright" class="form-control" id="blog.copyright" value="<?php echo config('blog.copyright');?>" placeholder="(c) Your name."> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| <label for=language" class="col-sm-2 col-form-label">Language</label> | |||
| <div class="col-sm-10"> | |||
| <select class="form-control" id="language" name="-config-language"> | |||
| <?php foreach (glob('lang/*.ini') as $file) { ?> | |||
| <option value="<?php echo pathinfo($file)['filename'];?>" <?php if (config('language') === pathinfo($file)['filename']):?>selected<?php endif;?>><?php echo pathinfo($file)['filename'];?></option> | |||
| <?php } ?> | |||
| </select> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| <label for=language" class="col-sm-2 col-form-label">Timezone</label> | |||
| <div class="col-sm-10"> | |||
| <select class="form-control" id="timezone" name="-config-timezone"> | |||
| <?php foreach (timezone_identifiers_list() as $zone) { ?> | |||
| <option value="<?php echo $zone;?>" <?php if (config('timezone') === $zone):?>selected<?php endif;?>><?php echo $zone;?></option> | |||
| <?php } ?> | |||
| </select> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| <?php $time = new DateTime('NOW'); $date = $time->format("Y-m-d H:i:s");?> | |||
| <label class="col-sm-2 col-form-label">Date Format</label> | |||
| <div class="col-sm-10"> | |||
| <div class="col-sm-10"> | |||
| <div class="form-check"> | |||
| <input class="form-check-input" type="radio" name="-config-date.format" id="date.format1" value="%d %B %Y" <?php if (config('date.format') === '%d %B %Y'):?>checked<?php endif;?>> | |||
| <label class="form-check-label" for="date.format1"> | |||
| <?php echo strftime('%d %B %Y', strtotime($date)); ?> | |||
| </label> | |||
| </div> | |||
| <div class="form-check"> | |||
| <input class="form-check-input" type="radio" name="-config-date.format" id="date.format2" value="%B %d, %Y" <?php if (config('date.format') === '%B %d, %Y'):?>checked<?php endif;?>> | |||
| <label class="form-check-label" for="date.format2"> | |||
| <?php echo strftime('%B %d, %Y', strtotime($date)); ?> | |||
| </label> | |||
| </div> | |||
| <div class="form-check"> | |||
| <input class="form-check-input" type="radio" name="-config-date.format" id="date.format3" value="%d %b %Y" <?php if (config('date.format') === '%d %b %Y'):?>checked<?php endif;?>> | |||
| <label class="form-check-label" for="date.format3"> | |||
| <?php echo strftime('%d %b %Y', strtotime($date)); ?> | |||
| </label> | |||
| </div> | |||
| <div class="form-check"> | |||
| <input class="form-check-input" type="radio" name="-config-date.format" id="date.format4" value="%b %d, %Y" <?php if (config('date.format') === '%b %d, %Y'):?>checked<?php endif;?>> | |||
| <label class="form-check-label" for="date.format4"> | |||
| <?php echo strftime('%b %d, %Y', strtotime($date)); ?> | |||
| </label> | |||
| </div> | |||
| <div class="form-check"> | |||
| <input class="form-check-input" type="radio" name="-config-date.format" id="date.format5" value="%d/%m/%Y" <?php if (config('date.format') === '%d/%m/%Y'):?>checked<?php endif;?>> | |||
| <label class="form-check-label" for="date.format5"> | |||
| <?php echo strftime('%d/%m/%Y', strtotime($date)); ?> | |||
| </label> | |||
| </div> | |||
| <div class="form-check"> | |||
| <input class="form-check-input" type="radio" name="-config-date.format" id="date.format6" value="%m/%d/%Y" <?php if (config('date.format') === '%m/%d/%Y'):?>checked<?php endif;?>> | |||
| <label class="form-check-label" for="date.format6"> | |||
| <?php echo strftime('%m/%d/%Y', strtotime($date)); ?> | |||
| </label> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| <label for=views.root" class="col-sm-2 col-form-label">Blog Theme</label> | |||
| <div class="col-sm-10"> | |||
| <select class="form-control" id="views.root" name="-config-views.root"> | |||
| <?php foreach (glob('themes/*/layout.html.php') as $folder) { ?> | |||
| <?php $theme = explode('/',pathinfo($folder)['dirname']); global $config_file; $this_config = parse_ini_file($config_file, true);?> | |||
| <option value="<?php echo pathinfo($folder)['dirname'];?>" <?php if ($this_config['views.root'] === pathinfo($folder)['dirname']):?>selected<?php endif;?>><?php echo $theme['1'];?></option> | |||
| <?php } ?> | |||
| </select> | |||
| </div> | |||
| </div> | |||
| <div class="form-group row"> | |||
| <div class="col-sm-10"> | |||
| <button type="submit" class="btn btn-primary">Save config</button> | |||
| </div> | |||
| </div> | |||
| </form> | |||