widget multiple section

This commit is contained in:
iBNu Maksum 2025-02-18 14:28:55 +07:00
parent 5b9cdd6681
commit 693d7f4acf
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5
5 changed files with 62 additions and 26 deletions

View File

@ -105,6 +105,8 @@ if ($action == 'add') {
r2(getUrl('widgets'), 's', 'Widget order Saved Successfully');
} else {
$widgets = ORM::for_table('tbl_widgets')->selects("position", 1)->order_by_asc("orders")->find_many();
$max = ORM::for_table('tbl_widgets')->max('position');
$ui->assign('widgets', $widgets);
$ui->assign('max', $max);
$ui->display('admin/settings/widgets.tpl');
}

View File

@ -1040,5 +1040,14 @@
"Not_all_widgets_require_content__HTML_widgets_require_content__either_text_or_PHP_code__Please_be_careful_when_writing_this_content_": "Not all widgets require content. HTML widgets require content, either text or PHP code. Please be careful when writing this content.",
"Area_Fields": "Area Fields",
"Add_new_widget": "Add new widget",
"Tambah": "Tambah"
"Tambah": "Tambah",
"All": "All",
"Enter_your_message_here___": "Enter your message here...",
"Close": "Close",
"Please_select_at_least_one_customer_to_send_a_message_": "Please select at least one customer to send a message.",
"Please_enter_a_message_to_send_": "Please enter a message to send.",
"Sending___": "Sending...",
"Message_sent_successfully_": "Message sent successfully.",
"Error_sending_message__": "Error sending message: ",
"Failed_to_send_the_message__Please_try_again_": "Failed to send the message. Please try again."
}

View File

@ -10,6 +10,34 @@
{if $_c['dashboard'] == '1.55.1'}
{showWidget widgets=$widgets pos=1}
<div class="row">
<div class="col-md-6">
{showWidget widgets=$widgets pos=2}
</div>
<div class="col-md-6">
{showWidget widgets=$widgets pos=3}
</div>
</div>
{showWidget widgets=$widgets pos=4}
{elseif $_c['dashboard'] == '1.57.1'}
{showWidget widgets=$widgets pos=1}
<div class="row">
<div class="col-md-5">
{showWidget widgets=$widgets pos=2}
</div>
<div class="col-md-7">
{showWidget widgets=$widgets pos=3}
</div>
</div>
{showWidget widgets=$widgets pos=4}
{elseif $_c['dashboard'] == '1.1.1.1'}
{showWidget widgets=$widgets pos=1}
{showWidget widgets=$widgets pos=2}
{showWidget widgets=$widgets pos=3}
{showWidget widgets=$widgets pos=4}
{else}
{showWidget widgets=$widgets pos=1}
<div class="row">
<div class="col-md-7">
@ -20,7 +48,7 @@
</div>
</div>
{showWidget widgets=$widgets pos=4}
{/if}
{if $_c['new_version_notify'] != 'disable'}
<script>

View File

@ -22,11 +22,12 @@
</td>
<td width="130">
<div class="btn-group btn-group-justified" role="group">
<a href="{Text::url('widgets/edit/', $w['id'])}" class="btn btn-sm btn-success">{Lang::T("Edit")}</a>
<a href="{Text::url('widgets/delete/', $w['id'])}"
onclick="return ask(this, 'Delete this widget?')" class="btn btn-sm btn-danger">
<i class="glyphicon glyphicon-trash"></i>
</a>
<a href="{Text::url('widgets/edit/', $w['id'])}"
class="btn btn-sm btn-success">{Lang::T("Edit")}</a>
</div>
</td>
</tr>
@ -48,18 +49,11 @@
{/function}
<div class="row">
{for $pos=1 to $max}
<div class="col-md-6 col-lg-4">
{showWidget widgets=$widgets pos=1}
</div>
<div class="col-md-6 col-lg-4">
{showWidget widgets=$widgets pos=2}
</div>
<div class="col-md-6 col-lg-4">
{showWidget widgets=$widgets pos=3}
</div>
<div class="col-md-6 col-lg-4">
{showWidget widgets=$widgets pos=4}
{showWidget widgets=$widgets pos=$pos}
</div>
{/for}
</div>
{include file="sections/footer.tpl"}

View File

@ -2,7 +2,7 @@
<form method="post" action="{Text::url('widgets/', $do)}">
<div class="row">
<div class="col-md-6 col-md-offset-3">
<div class="col-md-12">
<div class="panel panel-info">
<div class="panel-heading">{if $do == 'add'}{Lang::T('Tambah')}{else}{Lang::T('Edit')}{/if} Widget</div>
<div class="panel-body">
@ -40,7 +40,7 @@
<label class="col-md-3 control-label">{Lang::T('Position')}</label>
<div class="col-md-5">
<select name="position" id="position" class="form-control">
{for $pos=1 to 4}
{for $pos=1 to 12}
<option value="{$pos}" {if $widget['position'] eq $pos}selected="selected" {/if}>
Area {$pos}
</option>
@ -66,7 +66,7 @@
<div class="form-group">
<label class="col-md-3 control-label">{Lang::T('Content')}</label>
<div class="col-md-9">
<textarea name="content" rows="5" id="content" class="form-control">{$widget['content']}</textarea>
<textarea name="content" rows="15" id="summernote" class="form-control">{$widget['content']}</textarea>
<p class="help-block">{Lang::T("Not all widgets require content. HTML widgets require content, either text or PHP code. Please be careful when writing this content.")}</p>
</div>
</div>
@ -93,6 +93,9 @@
var name = sel.options[sel.selectedIndex].text;
document.getElementById('title').value = name;
}
document.addEventListener("DOMContentLoaded", function() {
$('#summernote').summernote();
});
</script>
{include file="sections/footer.tpl"}