Files
.github
Sample
admin
docs
install
pages_template
qrcode
system
autoload
cache
controllers
accounts.php
admin.php
autoload.php
bandwidth.php
callback.php
community.php
customers.php
dashboard.php
default.php
export.php
home.php
index.html
login.php
logout.php
order.php
page.php
pages.php
paymentgateway.php
plugin.php
pluginmanager.php
pool.php
prepaid.php
register.php
reports.php
routers.php
services.php
settings.php
voucher.php
lan
paymentgateway
plugin
uploads
vendors
boot.php
cron.php
index.html
orm.php
radius.php
ui
.gitignore
LICENSE
README.md
config.sample.php
index.php
version.json
mitrobill/system/controllers/pages.php

39 lines
1.3 KiB
PHP
Raw Normal View History

<?php
/**
2022-10-16 14:50:24 +07:00
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
_admin();
2022-10-13 14:00:54 +07:00
$ui->assign('_title', 'Pages');
$ui->assign('_system_menu', 'pages');
$action = $routes['1'];
$admin = Admin::_info();
$ui->assign('_admin', $admin);
if(strpos($action,"-post")===false){
$path = __DIR__."/../../pages/".str_replace(".","",$action).".html";
//echo $path;
2022-09-18 00:00:40 +07:00
run_hook('view_edit_pages'); #HOOK
if(file_exists($path)){
$html = file_get_contents($path);
$ui->assign("htmls",str_replace(["<div","</div>"],"",$html));
$ui->assign("writeable",is_writable($path));
$ui->assign("pageHeader",$action);
$ui->assign("PageFile",$action);
$ui->display('page-edit.tpl');
}else
$ui->display('a404.tpl');
}else{
$action = str_replace("-post","",$action);
$path = __DIR__."/../../pages/".str_replace(".","",$action).".html";
if(file_exists($path)){
$html = _post("html");
2022-09-18 00:00:40 +07:00
run_hook('save_pages'); #HOOK
if(file_put_contents($path, str_replace(["<div","</div>"],"",$html))){
r2(U . 'pages/'.$action, 's', $_L['Success_Save_Page']);
}else{
r2(U . 'pages/'.$action, 'e', $_L['Failed_Save_Page']);
}
}else
$ui->display('a404.tpl');
}