Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #55 from flatCore/develop
Browse files Browse the repository at this point in the history
Merge Develop Branch
  • Loading branch information
patkon committed Aug 26, 2021
2 parents ad1a4f8 + c9fd27e commit dd2af3a
Show file tree
Hide file tree
Showing 16 changed files with 317 additions and 171 deletions.
17 changes: 12 additions & 5 deletions acp/core/inc.addons.php
Expand Up @@ -46,9 +46,12 @@

if($sub == 'list' OR $sub == 'p' OR $sub == 'm' OR $sub == 't' OR $sub == 'u') {
echo '<div class="subHeader">';
echo '<div class="btn-group float-end" role="group">';
echo '<a href="?tn=moduls&sub=u" class="btn btn-fc '.$active_upload.'">'.$icon['upload'].' '.$lang['btn_install'].'</a>';
echo '</div>';

if($_SESSION['drm_acp_sensitive_files'] == 'allowed') {
echo '<div class="btn-group float-end" role="group">';
echo '<a href="?tn=moduls&sub=u" class="btn btn-fc '.$active_upload.'">'.$icon['upload'].' '.$lang['btn_install'].'</a>';
echo '</div>';
}

echo '<div class="btn-group" role="group">';
echo '<a href="?tn=moduls&sub=m" class="btn btn-fc '.$active_modules.'">Module</a>';
Expand Down Expand Up @@ -84,9 +87,13 @@
}

/* upload/update addons */

if($addon_mode == 'upload') {
include 'upload_addons.php';
if($_SESSION['drm_acp_sensitive_files'] == 'allowed') {
include 'upload_addons.php';
} else {
echo '<div class="alert alert-danger">'.$lang['drm_no_access'].'</div>';
}

}


Expand Down
4 changes: 4 additions & 0 deletions acp/core/list.addons.php
Expand Up @@ -54,6 +54,10 @@
$bnt_check_in_out = '<a class="btn btn-sm btn-fc text-danger" href="acp.php?tn=moduls&disable='.$modFolder.'">'.$lang['btn_mod_disable'].'</a>';
}
}

if($_SESSION['drm_acp_sensitive_files'] !== 'allowed') {
$bnt_check_in_out = '';
}

include '../modules/'.$modFolder.'/info.inc.php';

Expand Down
6 changes: 3 additions & 3 deletions acp/core/pages.snippets.php
Expand Up @@ -510,9 +510,9 @@


echo '<div class="btn-group d-flex my-3">';
echo '<a class="btn btn-fc w-100 '.$active_all.'" href="?tn=pages&sub=snippets&type=1">Alle <span class="badge badge-fc position-absolute top-0 end-0">'.$cnt['cnt_snippets'].'</span></a>';
echo '<a class="btn btn-fc w-100 '.$active_system.'" href="?tn=pages&sub=snippets&type=2">System <span class="badge badge-fc position-absolute top-0 end-0">'.$cnt['cnt_system_snippets'].'</span></a>';
echo '<a class="btn btn-fc w-100 '.$active_own.'" href="?tn=pages&sub=snippets&type=3">Eigene <span class="badge badge-fc position-absolute top-0 end-0">'.$cnt['cnt_custom_snippets'].'</span></a>';
echo '<a class="btn btn-fc w-100 '.$active_all.'" href="?tn=pages&sub=snippets&type=1">'.$lang['btn_snippets_all'].' <span class="badge badge-fc position-absolute top-0 end-0">'.$cnt['cnt_snippets'].'</span></a>';
echo '<a class="btn btn-fc w-100 '.$active_system.'" href="?tn=pages&sub=snippets&type=2">'.$lang['btn_snippets_system'].' <span class="badge badge-fc position-absolute top-0 end-0">'.$cnt['cnt_system_snippets'].'</span></a>';
echo '<a class="btn btn-fc w-100 '.$active_own.'" href="?tn=pages&sub=snippets&type=3">'.$lang['btn_snippets_own'].' <span class="badge badge-fc position-absolute top-0 end-0">'.$cnt['cnt_custom_snippets'].'</span></a>';
echo '</div>';

echo $lang_filter_box;
Expand Down
77 changes: 61 additions & 16 deletions acp/core/system.syspref.php
Expand Up @@ -135,6 +135,24 @@
$prefs_xml_sitemap = 'off';
}

$data = $db_content->update("fc_preferences", [
"prefs_rss_time_offset" => $_POST['prefs_rss_time_offset'],
"prefs_acp_session_lifetime" => $_POST['prefs_acp_session_lifetime'],
"prefs_logfile" => $prefs_logfile,
"prefs_anonymize_ip" => $prefs_anonymize_ip,
"prefs_xml_sitemap" => $prefs_xml_sitemap,
"prefs_nbr_page_versions" => $prefs_nbr_page_versions,
"prefs_pagesort_minlength" => $prefs_pagesort_minlength
], [
"prefs_id" => 1
]);

}

/* save theme and template preferences */
if(isset($_POST['save_prefs_themes'])) {


if(isset($_POST['prefs_smarty_cache'])) {
$prefs_smarty_cache = 1;
} else {
Expand All @@ -148,20 +166,14 @@
}

$data = $db_content->update("fc_preferences", [
"prefs_rss_time_offset" => $_POST['prefs_rss_time_offset'],
"prefs_acp_session_lifetime" => $_POST['prefs_acp_session_lifetime'],
"prefs_logfile" => $prefs_logfile,
"prefs_anonymize_ip" => $prefs_anonymize_ip,
"prefs_xml_sitemap" => $prefs_xml_sitemap,
"prefs_nbr_page_versions" => $prefs_nbr_page_versions,
"prefs_pagesort_minlength" => $prefs_pagesort_minlength,
"prefs_usertemplate" => $_POST['prefs_usertemplate'],
"prefs_smarty_cache" => $prefs_smarty_cache,
"prefs_smarty_cache_lifetime" => $_POST['prefs_smarty_cache_lifetime'],
"prefs_smarty_compile_check" => $prefs_smarty_compile_check
], [
"prefs_id" => 1
]);

}

/* delete smarty cache files */
Expand Down Expand Up @@ -447,16 +459,48 @@

echo tpl_form_control_group('',$lang['prefs_pagesort_minlength'],"<input class='form-control' type='text' name='prefs_pagesort_minlength' value='$prefs_pagesort_minlength'>");

echo '<hr>';




echo '<input type="submit" class="btn btn-save" name="save_prefs_misc" value="'.$lang['save'].'">';
echo '<input type="hidden" name="csrf_token" value="'.$_SESSION['token'].'">';

echo '</form>';
echo '</fieldset>';

/* themes and template */
echo '<div id="themes" class="pt-2"></div>';

echo '<fieldset>';
echo '<legend>'.$lang['themes_templates'].'</legend>';
echo '<form action="acp.php?tn=system&sub=sys_pref#themes" method="POST" class="form-horizontal">';

if($prefs_usertemplate == '') {
$prefs_usertemplate = 'off';
}
echo '<div class="form-check">';
echo '<input type="radio" class="form-check-input" id="usertpl_off" name="prefs_usertemplate" value="off" '.($prefs_usertemplate == "off" ? 'checked' :'').'>';
echo '<label class="form-check-label" for="usertpl_off">'.$lang['f_prefs_userstyles_off'].'</label>';
echo '</div>';
echo '<div class="form-check">';
echo '<input type="radio" class="form-check-input" id="usertpl_on" name="prefs_usertemplate" value="on" '.($prefs_usertemplate == "on" ? 'checked' :'').'>';
echo '<label class="form-check-label" for="usertpl_on">'.$lang['f_prefs_userstyles_on'].'</label>';
echo '</div>';
echo '<div class="form-check">';
echo '<input type="radio" class="form-check-input" id="usertpl_overwrite" name="prefs_usertemplate" value="overwrite" '.($prefs_usertemplate == "overwrite" ? 'checked' :'').'>';
echo '<label class="form-check-label" for="usertpl_overwrite">'.$lang['f_prefs_userstyles_overwrite'].'</label>';
echo '</div>';

echo '<hr>';

echo '<div class="form-group form-check mt-3">';
echo '<input type="checkbox" class="form-check-input" id="cache" name="prefs_smarty_cache" '.($prefs_smarty_cache == "1" ? 'checked' :'').'>';
echo '<label class="form-check-label" for="cache">'.$lang['cache'].'</label>';
echo '</div>';


echo '<div class="form-group form-check mt-3">';
echo '<div class="form-group form-check">';
echo '<input type="checkbox" class="form-check-input" id="compile" name="prefs_smarty_compile_check" '.($prefs_smarty_compile_check == "1" ? 'checked' :'').'>';
echo '<label class="form-check-label" for="compile">'.$lang['compile_check'].'</label>';
echo '</div>';
Expand All @@ -467,18 +511,18 @@
$complete_size = readable_filesize($cache_size+$compile_size);

echo '<div class="input-group mb-3">';
echo '<input class="form-control" type="text" name="prefs_smarty_cache_lifetime" value="'.$prefs_smarty_cache_lifetime.'">';
echo '<div class="input-group-append">';
echo '<label class="form-label" for="cache_lifetime">'.$lang['cache_lifetime'].'</label>';
echo '<div class="input-group mb-3">';
echo '<input class="form-control" type="text" id="cache_lifetime" name="prefs_smarty_cache_lifetime" value="'.$prefs_smarty_cache_lifetime.'">';
echo '<button class="btn btn-fc" type="submit" name="delete_smarty_cache">('.$complete_size.') '.$lang['delete_cache'].'</button>';
echo '</div>';
echo '</div>';

echo '<input type="submit" class="btn btn-save" name="save_prefs_misc" value="'.$lang['save'].'">';

echo '<input type="submit" class="btn btn-save" name="save_prefs_themes" value="'.$lang['save'].'">';
echo '<input type="hidden" name="csrf_token" value="'.$_SESSION['token'].'">';

echo '</form>';
echo '</fieldset>';

echo '</fieldset>';


echo '</div>';
Expand All @@ -493,6 +537,7 @@
echo '<a href="#globalheader" class="list-group-item list-group-item-ghost">'.$lang['f_prefs_global_header'].'</a>';
echo '<a href="#deletedresources" class="list-group-item list-group-item-ghost">'.$lang['label_deleted_resources'].'</a>';
echo '<a href="#misc" class="list-group-item list-group-item-ghost">'.$lang['system_misc'].'</a>';
echo '<a href="#themes" class="list-group-item list-group-item-ghost">'.$lang['themes_templates'].'</a>';
echo '</div>';
echo '</div>';

Expand Down
2 changes: 1 addition & 1 deletion acp/core/system.update.php
Expand Up @@ -263,7 +263,7 @@ function compare_versions() {
echo '<tr>';
echo "<td>$fc_version_name (Build $fc_version_build)</td>";
echo "<td>$remote_versions[1] (Build $remote_versions[2])</td>";
echo '<td><span class="badge bg-danger">Attention!</span> You should not perform this function in a real environment. Load latest from <a href="?tn=system&sub=update&github=main">branch main</a> or load latest from <a href="?tn=system&sub=update&github=develop">develop develop</a></td>';
echo '<td><span class="badge bg-danger">Attention!</span> You should not perform this function in a real environment. Load latest from <a href="?tn=system&sub=update&github=main">branch main</a> or load latest from <a href="?tn=system&sub=update&github=develop">branch develop</a></td>';
echo '</tr>';
echo '</table>';

Expand Down

0 comments on commit dd2af3a

Please sign in to comment.